库管员配置 维修员配置 优化

This commit is contained in:
bb_pan 2025-06-16 10:32:53 +08:00
parent 1295d87dd9
commit 4fe534d843
3 changed files with 51 additions and 34 deletions

View File

@ -228,4 +228,13 @@ export function delConfigDetails(data) {
method: 'post',
data
})
}
// 配件1-2级树
export function getPartTreeApi(data) {
return request({
url: '/material/ma_part_type/getPartTree',
method: 'get',
params: data
})
}

View File

@ -256,7 +256,7 @@ export default {
data() {
return {
//
loading: true,
loading: false,
//
ids: [],
//
@ -458,11 +458,11 @@ export default {
this.treeOptionsTwo = response.data;
if (
this.treeOptionsTwo.length > 0 &&
this.treeOptionsTwo[0].children.length > 0
this.treeOptionsTwo[0].children && this.treeOptionsTwo[0].children.length > 0
) {
const firstNode = this.treeOptionsTwo[0].children[0];
this.queryParams.typeId = firstNode.id;
this.queryParams.level = 1;
this.queryParams.level = firstNode.level
this.queryParams.houseId = firstNode.houseId;
this.getList();
}
@ -473,11 +473,20 @@ export default {
this.loading = true;
this.queryParams.displayBindRelationship = "true";
console.log("queryParams1", this.queryParams);
await getListByMaType(this.queryParams).then((response) => {
this.typeList = response.data.rows;
this.total = response.data.total;
this.loading = false;
});
try {
const res = await getListByMaType(this.queryParams)
this.loading = false
if (!res.data || !res.data.rows) {
this.typeList = []
this.total = 0
return
}
this.typeList = res.data.rows
this.total = res.data.total
} catch (error) {
console.log('🚀 ~ getList ~ error:', error)
this.loading = false
}
},
// -
filterNode(value, data) {
@ -500,15 +509,9 @@ export default {
},
// -
async handleNodeClickTwo(data, node) {
if (data.level == 0) {
this.queryParams.typeId = data.id;
this.queryParams.level = data.level;
this.queryParams.houseId = data.id;
} else {
this.queryParams.typeId = data.id;
this.queryParams.level = data.level;
this.queryParams.houseId = data.houseId;
}
this.queryParams.typeId = data.id;
this.queryParams.level = data.level;
this.queryParams.houseId = data.houseId;
this.handleQuery();
},

View File

@ -255,7 +255,7 @@ export default {
data() {
return {
//
loading: true,
loading: false,
//
ids: [],
//
@ -408,11 +408,12 @@ export default {
this.treeOptionsTwo = response.data;
if (
this.treeOptionsTwo.length > 0 &&
this.treeOptionsTwo[0].children.length > 0
this.treeOptionsTwo[0].children && this.treeOptionsTwo[0].children.length > 0
) {
const firstNode = this.treeOptionsTwo[0].children[0];
// console.log('🚀 ~ getMaTypeList ~ firstNode:', firstNode)
this.queryParams.typeId = firstNode.id;
this.queryParams.level = 1;
this.queryParams.level = firstNode.level
this.queryParams.houseId = firstNode.houseId;
this.getList();
}
@ -422,11 +423,20 @@ export default {
async getList() {
this.loading = true;
this.queryParams.displayBindRelationship = "true";
await getListByMaType(this.queryParams).then((response) => {
this.typeList = response.data.rows;
this.total = response.data.total;
this.loading = false;
});
try {
const res = await getListByMaType(this.queryParams)
this.loading = false
if (!res.data || !res.data.rows) {
this.typeList = []
this.total = 0
return
}
this.typeList = res.data.rows
this.total = res.data.total
} catch (error) {
console.log('🚀 ~ getList ~ error:', error)
this.loading = false
}
},
// -
filterNode(value, data) {
@ -449,15 +459,10 @@ export default {
},
// -
async handleNodeClickTwo(data, node) {
if (data.level == 0) {
this.queryParams.typeId = data.id;
this.queryParams.level = data.level;
this.queryParams.houseId = data.id;
} else {
this.queryParams.typeId = data.id;
this.queryParams.level = data.level;
this.queryParams.houseId = data.houseId;
}
// console.log('🚀 ~ handleNodeClickTwo ~ data:', data)
this.queryParams.typeId = data.id;
this.queryParams.level = data.level;
this.queryParams.houseId = data.houseId;
this.handleQuery();
},