From 59693d9fba2455c58fb4c40f913a5c3f0c61658b Mon Sep 17 00:00:00 2001 From: TiaStars Date: Fri, 29 Sep 2023 15:45:14 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E8=AE=A1=E5=88=92=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/components/dialog/index.vue | 84 ++++++++++++++++++--------- src/views/yingji/planManage.vue | 84 ++++++++++++++++++--------- 2 files changed, 112 insertions(+), 56 deletions(-) diff --git a/src/views/components/dialog/index.vue b/src/views/components/dialog/index.vue index c22533c..b299f39 100644 --- a/src/views/components/dialog/index.vue +++ b/src/views/components/dialog/index.vue @@ -56,7 +56,7 @@ -->
经济类型:
- + { + this.district.map((item)=>{ if(item.subdistrict == district) { name = item.institutionName } else { @@ -471,18 +472,25 @@ export default { let obj // 如果是苏州市或者是某个区 if(!this.disabled) { - if(this.form.subdistrict.length > 0){ + // console.log('123') + if(Array.isArray(this.form.subdistrict)){ if(this.form.subdistrict.length == 2) { - this.form.subdistrict = this.form.subdistrict[1] - this.subdistrict = this.form.subdistrict.slice(1, 11); + this.subdistrict = this.form.subdistrict[2].slice(1, 11); obj = { ...this.pages, ...this.form,subdistrict:this.subdistrict }; } else if(this.form.subdistrict.length == 1) { - this.form.subdistrict = this.form.subdistrict[0] - this.subdistrict = this.form.subdistrict.slice(1, 8); + this.subdistrict = this.form.subdistrict[1].slice(1, 8); obj = { ...this.pages, ...this.form,subdistrict:this.subdistrict }; + } else { + obj = {...this.pages,...this.form} } } else { - obj = {...this.pages,...this.form} + if(this.county){ + let subdistrict = this.form.subdistrict.slice(1, 8); + obj = { ...this.pages, ...this.form,subdistrict }; + } else { + let subdistrict = this.form.subdistrict.slice(1, 8); + obj = { ...this.pages, ...this.form,subdistrict }; + } } } else { // 不是苏州市是乡镇 @@ -647,9 +655,17 @@ export default { this.pages = pages; console.log(this.form) if(this.dept.ancestors.split(',').length == 2){ - this.subdistrict = this.form.subdistrict.slice(1, 8); + if(Array.isArray(this.form.subdistrict)) { + this.subdistrict = this.form.subdistrict.slice(1, 8); + } else { + this.subdistrict = this.form.subdistrict; + } } else if(this.dept.ancestors.split(',').length == 3){ - this.subdistrict = this.form.subdistrict.slice(1, 11); + if(Array.isArray(this.form.subdistrict)) { + this.subdistrict = this.form.subdistrict.slice(1, 11); + } else { + this.subdistrict = this.form.subdistrict; + } } this.getTable({...pages,...this.form,subdistrict:this.subdistrict}); }, @@ -767,36 +783,46 @@ export default { return ""; }, commentData(item,dept) { + // item.map((item)=>{ + // if(item.children instanceof Array && item.children.length == 0){ + // item.county = item.subdistrict + // delete item.children; + // } else { + // // this.props.value = 'subdistrict' + // this.commentData(item.children,dept) + // } + // }) item.map((item)=>{ - if(item.children instanceof Array && item.children.length == 0){ - item.county = item.subdistrict - delete item.children; - } else { - // this.props.value = 'subdistrict' - this.commentData(item.children,dept) - } + item.children.map((itemTwo)=>{ + itemTwo.county = itemTwo.subdistrict + }) }) - this.myDistrict = item; + // this.myDistrict = item; this.listOne = item if(dept.ancestors.split(',').length == 2) { this.listOne = this.listOne.filter((item)=>{ return item.institutionName == dept.deptName }) - // this.listOne.map((item)=>{ - // if(item.institutionName == dept.deptName) { - // this.form.subdistrict = item.county - // this.workingArea = item.county - // delete item.children - // } - // }) - // this.disabled = true; - } else if(dept.ancestors.split(',').length == 3) { this.listOne.map((item)=>{ if(item.institutionName == dept.deptName) { - this.form.subdistrict = item.subdistrict + console.log(item.county) + this.form.subdistrict = item.county this.workingArea = item.county + this.county = true; + // delete item.children } }) + // this.disabled = true; + } else if(dept.ancestors.split(',').length == 3) { + this.listOne.map((item)=>{ + item.children.map((itemTwo)=>{ + if(itemTwo.institutionName == dept.deptName) { + this.form.subdistrict = itemTwo.subdistrict + this.workingArea = itemTwo.county + this.county = false; + } + }) + }) this.disabled = true; } }, diff --git a/src/views/yingji/planManage.vue b/src/views/yingji/planManage.vue index 4db800b..7b6a0f8 100644 --- a/src/views/yingji/planManage.vue +++ b/src/views/yingji/planManage.vue @@ -4,7 +4,7 @@ * @Author: JC9527 * @Date: 2023-09-04 10:20:06 * @LastEditors: JC9527 - * @LastEditTime: 2023-09-28 13:44:14 + * @LastEditTime: 2023-09-29 15:40:31 --> diff --git a/src/views/yingji/enterprise.vue b/src/views/yingji/enterprise.vue index d7c1e18..973c2e1 100644 --- a/src/views/yingji/enterprise.vue +++ b/src/views/yingji/enterprise.vue @@ -620,7 +620,7 @@ export default { for (let key in this.details) { this.listDes.forEach((value1, index1) => { if (key == value1.eng) { - this.listDes[index1].value = this.details[key]; + this.listDes[index1].value = this.details[key] == '无' ? '/' : this.details[key]; return; } }); diff --git a/src/views/yingji/planManage.vue b/src/views/yingji/planManage.vue index 7b6a0f8..0e31f62 100644 --- a/src/views/yingji/planManage.vue +++ b/src/views/yingji/planManage.vue @@ -4,7 +4,7 @@ * @Author: JC9527 * @Date: 2023-09-04 10:20:06 * @LastEditors: JC9527 - * @LastEditTime: 2023-09-29 15:40:31 + * @LastEditTime: 2023-09-29 16:20:31 -->