库管员配置 维修员配置 优化
This commit is contained in:
parent
1295d87dd9
commit
4fe534d843
|
|
@ -229,3 +229,12 @@ export function delConfigDetails(data) {
|
||||||
data
|
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() {
|
data() {
|
||||||
return {
|
return {
|
||||||
// 遮罩层
|
// 遮罩层
|
||||||
loading: true,
|
loading: false,
|
||||||
// 选中数组
|
// 选中数组
|
||||||
ids: [],
|
ids: [],
|
||||||
// 非单个禁用
|
// 非单个禁用
|
||||||
|
|
@ -458,11 +458,11 @@ export default {
|
||||||
this.treeOptionsTwo = response.data;
|
this.treeOptionsTwo = response.data;
|
||||||
if (
|
if (
|
||||||
this.treeOptionsTwo.length > 0 &&
|
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];
|
const firstNode = this.treeOptionsTwo[0].children[0];
|
||||||
this.queryParams.typeId = firstNode.id;
|
this.queryParams.typeId = firstNode.id;
|
||||||
this.queryParams.level = 1;
|
this.queryParams.level = firstNode.level
|
||||||
this.queryParams.houseId = firstNode.houseId;
|
this.queryParams.houseId = firstNode.houseId;
|
||||||
this.getList();
|
this.getList();
|
||||||
}
|
}
|
||||||
|
|
@ -473,11 +473,20 @@ export default {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
this.queryParams.displayBindRelationship = "true";
|
this.queryParams.displayBindRelationship = "true";
|
||||||
console.log("queryParams1", this.queryParams);
|
console.log("queryParams1", this.queryParams);
|
||||||
await getListByMaType(this.queryParams).then((response) => {
|
try {
|
||||||
this.typeList = response.data.rows;
|
const res = await getListByMaType(this.queryParams)
|
||||||
this.total = response.data.total;
|
this.loading = false
|
||||||
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) {
|
filterNode(value, data) {
|
||||||
|
|
@ -500,15 +509,9 @@ export default {
|
||||||
},
|
},
|
||||||
// 节点单击事件 - 左侧树
|
// 节点单击事件 - 左侧树
|
||||||
async handleNodeClickTwo(data, node) {
|
async handleNodeClickTwo(data, node) {
|
||||||
if (data.level == 0) {
|
this.queryParams.typeId = data.id;
|
||||||
this.queryParams.typeId = data.id;
|
this.queryParams.level = data.level;
|
||||||
this.queryParams.level = data.level;
|
this.queryParams.houseId = data.houseId;
|
||||||
this.queryParams.houseId = data.id;
|
|
||||||
} else {
|
|
||||||
this.queryParams.typeId = data.id;
|
|
||||||
this.queryParams.level = data.level;
|
|
||||||
this.queryParams.houseId = data.houseId;
|
|
||||||
}
|
|
||||||
this.handleQuery();
|
this.handleQuery();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -255,7 +255,7 @@ export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
// 遮罩层
|
// 遮罩层
|
||||||
loading: true,
|
loading: false,
|
||||||
// 选中数组
|
// 选中数组
|
||||||
ids: [],
|
ids: [],
|
||||||
// 非单个禁用
|
// 非单个禁用
|
||||||
|
|
@ -408,11 +408,12 @@ export default {
|
||||||
this.treeOptionsTwo = response.data;
|
this.treeOptionsTwo = response.data;
|
||||||
if (
|
if (
|
||||||
this.treeOptionsTwo.length > 0 &&
|
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];
|
const firstNode = this.treeOptionsTwo[0].children[0];
|
||||||
|
// console.log('🚀 ~ getMaTypeList ~ firstNode:', firstNode)
|
||||||
this.queryParams.typeId = firstNode.id;
|
this.queryParams.typeId = firstNode.id;
|
||||||
this.queryParams.level = 1;
|
this.queryParams.level = firstNode.level
|
||||||
this.queryParams.houseId = firstNode.houseId;
|
this.queryParams.houseId = firstNode.houseId;
|
||||||
this.getList();
|
this.getList();
|
||||||
}
|
}
|
||||||
|
|
@ -422,11 +423,20 @@ export default {
|
||||||
async getList() {
|
async getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
this.queryParams.displayBindRelationship = "true";
|
this.queryParams.displayBindRelationship = "true";
|
||||||
await getListByMaType(this.queryParams).then((response) => {
|
try {
|
||||||
this.typeList = response.data.rows;
|
const res = await getListByMaType(this.queryParams)
|
||||||
this.total = response.data.total;
|
this.loading = false
|
||||||
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) {
|
filterNode(value, data) {
|
||||||
|
|
@ -449,15 +459,10 @@ export default {
|
||||||
},
|
},
|
||||||
// 节点单击事件 - 左侧树
|
// 节点单击事件 - 左侧树
|
||||||
async handleNodeClickTwo(data, node) {
|
async handleNodeClickTwo(data, node) {
|
||||||
if (data.level == 0) {
|
// console.log('🚀 ~ handleNodeClickTwo ~ data:', data)
|
||||||
this.queryParams.typeId = data.id;
|
this.queryParams.typeId = data.id;
|
||||||
this.queryParams.level = data.level;
|
this.queryParams.level = data.level;
|
||||||
this.queryParams.houseId = data.id;
|
this.queryParams.houseId = data.houseId;
|
||||||
} else {
|
|
||||||
this.queryParams.typeId = data.id;
|
|
||||||
this.queryParams.level = data.level;
|
|
||||||
this.queryParams.houseId = data.houseId;
|
|
||||||
}
|
|
||||||
this.handleQuery();
|
this.handleQuery();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue