From c0842439ff844bef6b13d4015a43f36dfa31b770 Mon Sep 17 00:00:00 2001 From: lrw <18279117177@163.com> Date: Sun, 16 Feb 2020 19:02:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=95=E4=BD=8D=E5=90=8D=E7=A7=B0=E8=A1=A5?= =?UTF-8?q?=E5=85=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/fillIn/fillIn.vue | 38 +++++++++++++++++++---------------- pages/fillInDay/fillInDay.vue | 7 ------- 2 files changed, 21 insertions(+), 24 deletions(-) diff --git a/pages/fillIn/fillIn.vue b/pages/fillIn/fillIn.vue index 574b38b..dbee7b3 100644 --- a/pages/fillIn/fillIn.vue +++ b/pages/fillIn/fillIn.vue @@ -1655,7 +1655,7 @@ residenceAddress: '', planReturnDate: '' }, - formMat:{} + formMat: {} } }, @@ -1685,8 +1685,9 @@ let list = [] d.object.list.forEach(item => { list.push({ - label: item.orgName, - value: item.id + label: `${item.orgName} (${item.city} ${item.district} ${item.address} ${item.park})`, + value: item.id, + desc: item.orgName }) }) this.list[0].opts = list @@ -1703,8 +1704,10 @@ this.isRead = true const data = d.object.reportContent || {} this.form = data - this.form['householdValues'] = data['householdProvince'] + "," +data['householdCity'] + "," +data['householdDistrict'] - this.form['residenceValue'] = data['residenceProvince'] + "," + data['residenceCity'] + "," +data['residenceDistrict'] + this.form['householdValues'] = data['householdProvince'] + "," + data['householdCity'] + "," + data[ + 'householdDistrict'] + this.form['residenceValue'] = data['residenceProvince'] + "," + data['residenceCity'] + "," + data[ + 'residenceDistrict'] // 赋值 for (let k in data) { const val = data[k] @@ -1726,19 +1729,15 @@ } if (item.type == "picker") { item.opts.forEach(opt => { - if(opt.value == val) { - this.formMat[k] = opt.label - } - }) - - } - if (item.type == "pickerAddress") { - item.opts.forEach(opt => { - if(opt.value == val) { - this.formMat[k] = opt.label + if (opt.value == val) { + if (opt.desc) { + this.formMat[k] = opt.desc + } else { + this.formMat[k] = opt.label + } } }) - + } } } @@ -1875,8 +1874,13 @@ this.$set(this.form, prop, val) return } - this.$set(this.form, prop, opts[val].value) + this.$set(this.form, prop, opts[val].value) + if (opts[val].desc) { + this.$set(this.formMat, prop, opts[val].desc) + } else { this.$set(this.formMat, prop, opts[val].label) + } + if (item.show) { this.showChange(event, item) diff --git a/pages/fillInDay/fillInDay.vue b/pages/fillInDay/fillInDay.vue index 1557518..8aa58f8 100644 --- a/pages/fillInDay/fillInDay.vue +++ b/pages/fillInDay/fillInDay.vue @@ -702,14 +702,7 @@ }) } - if (item.type == "pickerAddress") { - item.opts.forEach(opt => { - if (opt.value == val) { - this.formMat[k] = opt.label - } - }) - } } } } -- 2.22.0