This commit is contained in:
shijingjing
2022-05-05 15:14:28 +08:00
parent 04f788f0ad
commit a40ec9a147
2 changed files with 7 additions and 14 deletions

View File

@@ -184,7 +184,6 @@
</div>
</div>
<div class="upload">
<!-- :disabled="isEdit" -->
<AiUploader :def.sync="photo" multiple placeholder="上传图片" :limit="1" action="/admin/file/add2"/>
</div>
</div>
@@ -517,14 +516,17 @@ export default {
...mapState(['user']),
isEdit() {
return !!this.$route.query.id
}
},
},
watch: {
userList: {
handler: function (v) {
let {name, idNumber, currentAreaId, currentAreaName} = v?.[0] || {}
this.form = {...this.form, name, idNumber, currentAreaId, currentAreaName}
this.form.sex = this.$idCardNoUtil.getIdCardInfo(idNumber)?.sex
this.form.birthday = this.$idCardNoUtil.getIdCardInfo(idNumber)?.birthday
this.form.age = this.$calcAge(this.form.idNumber)
},
deep: true,
},
@@ -636,8 +638,6 @@ export default {
},
submit() {
if(!this.isEdit) {
if (!this.form.riskType) {
return this.$u.toast('请选择风险因素')
@@ -700,10 +700,6 @@ export default {
})
},
onChange(e) {
this.form.placeAreaId = e
},
getInfo(id) {
this.$http.post(`/app/apppreventionreturntopoverty/queryDetailById?id=${id}`).then(res => {
if (res?.data) {
@@ -720,15 +716,10 @@ export default {
this.helthList.map(items => {
items.checked = res.data.healthyStatusList.includes(items.dictValue)
})
this.form = {
...this.form,
...res.data
}
// this.photo = [{url: this.form.photo}]
this.form = { ...this.form, ...res.data }
if (this.form.photo) {
this.photo = [{url: this.form.photo}] || []
// this.form.files = [{url: this.form.photo}]
}
}

View File

@@ -661,6 +661,8 @@ export default {
let {name, idNumber, currentAreaId, currentAreaName} = v?.[0] || {}
this.form = {...this.form, name, idNumber, currentAreaId, currentAreaName}
this.form.sex = this.$idCardNoUtil.getIdCardInfo(idNumber)?.sex
this.form.birthday = this.$idCardNoUtil.getIdCardInfo(idNumber)?.birthday
this.form.age = this.$calcAge(this.form.idNumber)
},
deep: true,
},