库管员配置 维修员配置 优化
This commit is contained in:
parent
1295d87dd9
commit
4fe534d843
|
|
@ -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
|
||||
})
|
||||
}
|
||||
|
|
@ -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();
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
},
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue