diff --git a/src/apps/AppMonitoringObject/Add.vue b/src/apps/AppMonitoringObject/Add.vue index 1d48e263..31cca946 100644 --- a/src/apps/AppMonitoringObject/Add.vue +++ b/src/apps/AppMonitoringObject/Add.vue @@ -213,7 +213,7 @@
-
{{ e.dictName }}
+
{{ e.dictName }}
@@ -289,7 +289,7 @@ 劳动技能
- +
@@ -493,7 +493,6 @@ export default { userList: [], flag: false, helthList: [], - namelist: [], basicsCheckList: [ {dictName: '城乡居民基本医疗保险', checked: false}, {dictName: '城镇职工基本医疗保险', checked: false}, @@ -546,21 +545,15 @@ export default { this.form.objectType = query.objectType this.houseIdNumber = query.houseIdNumber - - if (query.id) { - this.flag = true - this.id = query.id - - - this.getInfo(this.id) - - - } }) }, onShow() { - document.title = this.id ? '编辑监测对象' : '添加监测对象' + document.title = this.$route.query.id ? '编辑监测对象' : '添加监测对象' + if (this.$route.query.id) { + this.flag = true + this.getInfo(this.$route.query.id) + } }, methods: { rules() { @@ -579,20 +572,9 @@ export default { }) }, - userClick(row, i) { - if (!this.helthList[i].checked) { - this.helthList[i].checked = true // 确定 - this.namelist.push({dictValue: row.dictValue, dictName: row.dictName}) // 赋值 - } else { - this.helthList[i].checked = false // 取消 - this.namelist.map((item, index) => { - if (item.dictValue == row.dictValue) { - this.namelist.splice(index, 1) - } - }) - - } - this.form.healthyStatus = this.namelist.map(v => v.dictValue).join(',') + userClick(row) { + row.checked = !row.checked + this.form.healthyStatus = this.helthList.filter(e => e.checked)?.map(e => e.dictValue)?.toString() }, // 医疗保险 @@ -704,11 +686,10 @@ export default { this.$http.post('/app/apppreventionreturntopoverty/addByEwechat', { ...this.form, - id: this.id || '', girdId: this.user.girdId, }).then(res => { if (res.code == 0) { - this.$u.toast(this.id ? '保存成功' : '提交成功') + this.$u.toast(this.$route.query.id ? '保存成功' : '提交成功') uni.$emit('reload') uni.navigateTo({url: './serviceResult'}) } @@ -737,9 +718,7 @@ export default { res.data.healthyStatusList.map((item) => { this.helthList.map(items => { - if (item == items.dictValue) { - items.checked = true - } + items.checked = item == items.dictValue }) })