feat: 门店档案接口

This commit is contained in:
wanglei
2024-06-26 11:19:28 +08:00
parent 2ff20d4fc5
commit 54880a9562
3 changed files with 42 additions and 24 deletions

View File

@@ -129,6 +129,7 @@
show-checkbox
:default-expanded-keys="currCheckedKeys"
:default-checked-keys="currCheckedKeys"
@check-change="handleCheckChange"
@check="onCheckChange">
</el-tree>
</div>
@@ -171,6 +172,7 @@ export default {
currCheckedKeys: [],
dialog: false,
treeList: [],
treeArray:[],
treeObj: {
checkedKeys: [],
},
@@ -209,6 +211,7 @@ export default {
this.treeObj.checkedKeys = [];
this.instance.post(`/app/appgirdinfo/listAll3`, null, null).then((res) => {
if (res.code == 0) {
this.treeArray = res.data
this.form.girdInfoList.map((e) => {
this.treeObj.checkedKeys.push(e.id);
});
@@ -238,7 +241,12 @@ export default {
}
})
if (code === 0) {
this.form = {...data}
this.form = {...data,girdInfoList:[]}
this.form.fileUrl = [{
url: data.fileUrl
}]
const target = this.treeArray?.find(v=>v.girdCode === data.girdCode)
this.currCheckedKeys = [target.id]
}
} catch (e) {
console.error(e)
@@ -251,18 +259,22 @@ export default {
return this.$message.error('请选择网格')
}
if (nodes.length > 1) {
return this.$message.error('不支持多选')
}
this.currCheckedKeys = [nodes[0]?.id]
this.form.girdCode = nodes[0]?.girdCode
this.form.girdName = nodes[0]?.girdName
this.dialog = false;
},
onCheckChange(e) {
handleCheckChange(data, checked){
if (checked) {
this.$refs.treeRef.setCheckedKeys([data.id])
}
},
onCheckChange(e) {
if(e.children && e.children.length>0){
this.$refs.treeRef.setCheckedKeys([]);
}
},
idChange(val) {