feat: 门店档案接口
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user