From 6a1c487a1a5e43e617bd4e6c08d618abbd08116c Mon Sep 17 00:00:00 2001 From: caoyizhong <1270296080@qq.com> Date: Wed, 2 Aug 2023 10:34:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AE=A2=E6=88=B7=E5=9B=9E?= =?UTF-8?q?=E6=98=BE=EF=BC=8C=E7=BC=96=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/basicdata/brand/basicClient.vue | 52 ++++++++++++++++++----- 1 file changed, 41 insertions(+), 11 deletions(-) diff --git a/src/views/basicdata/brand/basicClient.vue b/src/views/basicdata/brand/basicClient.vue index 62eac5b6..5c02165c 100644 --- a/src/views/basicdata/brand/basicClient.vue +++ b/src/views/basicdata/brand/basicClient.vue @@ -844,6 +844,9 @@ export default { this.viewEntd = false; getDetail(row.id).then(res => { this.form = res.data.data; + if(this.form.detailedly == "0" || this.form.detailedly == "-1"){ + this.form.detailedly = ""; + } let bus =[]; this.form.typeServiceBusiness.forEach(i =>{ bus.push(i.typeService); @@ -852,12 +855,21 @@ export default { this.form.businessType = i.mold; } }) - this.form.typeServiceList = bus; + if(!!bus){ + this.form.typeServiceList = bus; + } + let a = []; if (!!this.form.bladeRegionProvinceId) { - a.push(res.data.data.bladeRegionProvinceId); - a.push(res.data.data.bladeRegionCityId); - a.push(res.data.data.bladeRegionAreaId); + if(res.data.data?.bladeRegionProvinceId){ + a.push(res.data.data.bladeRegionProvinceId); + } + if(res.data.data?.bladeRegionCityId){ + a.push(res.data.data.bladeRegionCityId); + } + if(res.data.data?.bladeRegionAreaId){ + a.push(res.data.data.bladeRegionAreaId); + } } this.form.bladeRegionProvinceId = a; if (!!this.form.leaseAccessories) { @@ -891,27 +903,45 @@ export default { // res.data.data.typeService = res.data.data.typeService.toString(); console.log('>>>>>', res.data.data); this.form = res.data.data; + if(this.form.detailedly == "0" || this.form.detailedly == "-1"){ + this.form.detailedly = ""; + } + let bus =[]; + // console.log("????><><><",this.form.typeServiceBusiness); this.form.typeServiceBusiness.forEach(i =>{ bus.push(i.typeService); if(i.typeService == '3'){ this.distriType = true; - i.businessType = i.mold; + // i.businessType = i.mold; + this.form.businessType= i.mold; } }) - this.form.typeServiceList = bus; + + if(!!bus){ + this.form.typeServiceList = bus; + } + //处理第 let a = []; if (!!this.form.bladeRegionProvinceId) { - a.push(res.data.data.bladeRegionProvinceId); - a.push(res.data.data.bladeRegionCityId); - a.push(res.data.data.bladeRegionAreaId); + if(res.data.data?.bladeRegionProvinceId){ + a.push(res.data.data.bladeRegionProvinceId); + } + if(res.data.data?.bladeRegionCityId){ + a.push(res.data.data.bladeRegionCityId); + } + if(res.data.data?.bladeRegionAreaId){ + a.push(res.data.data.bladeRegionAreaId); + } } this.form.bladeRegionProvinceId = a; + //处理图片 if (!!this.form.leaseAccessories) { if (this.form.leaseAccessories.includes(',')) { let le = []; let d = this.form.leaseAccessories.splice(','); d.forEach(i => { + console.log(">>>>",i); let q = { name: '', url: i @@ -921,7 +951,7 @@ export default { this.fileList = le; } else { this.fileList = [{ - name: '', + name: this.form.fileName, url: this.form.leaseAccessories }]; } @@ -1112,7 +1142,7 @@ export default { return it.bladeRegionAreaId == i.value; }); // console.log("========",JSON.parse(JSON.stringify(arrsheng)) ); - dz = arrsheng[0].label + '/' + arrshi[0].label + '/' + arrqu[0].label; + dz = arrsheng[0].label + (arrshi[0].label?`/${arrshi[0].label}`:``) + (arrqu[0]?.label?`/${arrqu[0]?.label}`:''); it.bladeRegionProvinceId = dz; });