This commit is contained in:
yanran200730
2022-03-15 09:45:28 +08:00
parent 0af394b0ed
commit 7879070993

View File

@@ -37,7 +37,7 @@
<template v-else-if="item.type === 'gird'"> <template v-else-if="item.type === 'gird'">
<el-input disabled :value="girdName" size="small" placeholder="请选择网格"> <el-input disabled :value="girdName" size="small" placeholder="请选择网格">
<template slot="append"> <template slot="append">
<el-button size="small" @click="showGrid = true" :disabled="!!(formData.resident_id && item.isInit)">选择网格</el-button> <el-button size="small" @click="showGrid = true, treeObj.checkedKeys = formData[item.fieldDbName] ? [formData[item.fieldDbName]] : [], gridFieldName = item.fieldDbName" :disabled="!!(formData.resident_id && item.isInit)">选择网格</el-button>
</template> </template>
</el-input> </el-input>
</template> </template>
@@ -120,9 +120,9 @@
title="选择网格" title="选择网格"
:visible.sync="showGrid" :visible.sync="showGrid"
:destroyOnClose="true" :destroyOnClose="true"
@close="showGrid = false" @close="showGrid = false"
@onConfirm="getCheckedTree" @onConfirm="getCheckedTree"
width="720px"> width="720px">
<div class="grid"> <div class="grid">
<el-tree <el-tree
:data="treeObj.treeList" :data="treeObj.treeList"
@@ -169,6 +169,7 @@ export default {
} }
}, },
girdName: '', girdName: '',
gridFieldName: '',
showGrid: false, showGrid: false,
formDataList: [], formDataList: [],
pageShow: true, pageShow: true,
@@ -217,6 +218,7 @@ export default {
}, },
onChange (e) { onChange (e) {
this.formData.resident_id = e.id
Object.keys(this.formData).forEach(item => { Object.keys(this.formData).forEach(item => {
for (var p in e){ for (var p in e){
if (item === p) { if (item === p) {
@@ -226,7 +228,6 @@ export default {
}) })
const idNumberInfo = this.idCardNoUtil.getIdCardInfo(e.idNumber) const idNumberInfo = this.idCardNoUtil.getIdCardInfo(e.idNumber)
this.formData.resident_id = e.id
this.$set(this.formData, 'birthDate', idNumberInfo.birthday) this.$set(this.formData, 'birthDate', idNumberInfo.birthday)
this.formData.photo = e.photo ? [{ this.formData.photo = e.photo ? [{
url: e.photo url: e.photo
@@ -237,10 +238,10 @@ export default {
if (gird.length) { if (gird.length) {
this.girdName = gird[0].girdName this.girdName = gird[0].girdName
this.formData.gird_id = gird[0].id this.formData[this.gridFieldName] = gird[0].id
} else { } else {
this.girdName = '' this.girdName = ''
this.formData.gird_id = '' this.formData[this.gridFieldName] = ''
} }
this.showGrid = false this.showGrid = false