From 2e9ced35b468351168a524182729d606c9f7a25b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=8B=E4=BC=9F=E4=BD=B3?= <2797716443@qq.com> Date: Sat, 26 Mar 2022 17:57:10 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B4=A3=E4=BB=BB=E9=83=A8=E9=97=A8=E5=8E=BB?= =?UTF-8?q?=E9=87=8D=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../qbzxdjhgk/component/establish.vue | 37 ++++++++++++++-- .../qbzxdjhgk/component/merge.vue | 44 ++++++++++++++++--- 2 files changed, 72 insertions(+), 9 deletions(-) diff --git a/src/pages/processCenter/pages/creatProcess/qbzxdjhgk/component/establish.vue b/src/pages/processCenter/pages/creatProcess/qbzxdjhgk/component/establish.vue index a1a75b07e..7e29e5222 100644 --- a/src/pages/processCenter/pages/creatProcess/qbzxdjhgk/component/establish.vue +++ b/src/pages/processCenter/pages/creatProcess/qbzxdjhgk/component/establish.vue @@ -831,10 +831,13 @@ export default { this.modalshowflag2 = true; }, checkedRole2(data) { - console.log(data); + let unList = [] + let uidList = [] let idList = "", nameList = "" let unitList = "", unitNameList = "" data.forEach(item => { + unList.push(item.institutionName) + uidList.push(item.institutionId) if (nameList.length) { nameList += ","; idList += ","; @@ -846,11 +849,39 @@ export default { unitList += item.institutionId unitNameList += item.institutionName }); + let unNameList = [] + let unIdList = [] + unList.forEach(item => { + if(unNameList.length){ + unNameList.forEach(items => { + if(items !== item){ + unNameList.push(item) + }else{ + return + } + }) + }else{ + unNameList.push(item) + } + }) + uidList.forEach(item => { + if(unIdList.length){ + unIdList.forEach(items => { + if(items !== item){ + unIdList.push(item) + }else{ + return + } + }) + }else{ + unIdList.push(item) + } + }) if(this.roleType === '1'){ this.$set(this.qbfsForm, 'drafter', idList) this.$set(this.qbfsForm, 'drafterName', nameList) - this.$set(this.qbfsForm, 'unit', unitList) - this.$set(this.qbfsForm, 'unitName', unitNameList) + this.$set(this.qbfsForm, 'unit', unIdList.join(',')) + this.$set(this.qbfsForm, 'unitName', unNameList.join(',')) }else if(this.roleType === '2'){ this.$set(this.qbfsForm, 'resPerson', idList) this.$set(this.qbfsForm, 'resPersonName', nameList) diff --git a/src/pages/processCenter/pages/creatProcess/qbzxdjhgk/component/merge.vue b/src/pages/processCenter/pages/creatProcess/qbzxdjhgk/component/merge.vue index fb599e5ac..beb0960e6 100644 --- a/src/pages/processCenter/pages/creatProcess/qbzxdjhgk/component/merge.vue +++ b/src/pages/processCenter/pages/creatProcess/qbzxdjhgk/component/merge.vue @@ -942,30 +942,62 @@ export default { this.modalshowflag2 = true; }, checkedRole2(data) { + let unList = [] + let uidList = [] let idList = "", nameList = "" let unitList = "", unitNameList = "" data.forEach(item => { + unList.push(item.institutionName) + uidList.push(item.institutionId) if (nameList.length) { nameList += ","; idList += ","; - unitList += ","; + unitList += "," unitNameList += ","; } idList += item.id; nameList += item.name; unitList += item.institutionId unitNameList += item.institutionName - }); - if(this.type === '1'){ + let unNameList = [] + let unIdList = [] + unList.forEach(item => { + if(unNameList.length){ + unNameList.forEach(items => { + if(items !== item){ + unNameList.push(item) + }else{ + return + } + }) + }else{ + unNameList.push(item) + } + }) + uidList.forEach(item => { + if(unIdList.length){ + unIdList.forEach(items => { + if(items !== item){ + unIdList.push(item) + }else{ + return + } + }) + }else{ + unIdList.push(item) + } + }) + if(this.roleType === '1'){ this.$set(this.qbfsForm, 'drafter', idList) this.$set(this.qbfsForm, 'drafterName', nameList) - this.$set(this.qbfsForm, 'unit', unitList) - this.$set(this.qbfsForm, 'unitName', unitNameList) - }else if(this.type === '2'){ + this.$set(this.qbfsForm, 'unit', unIdList.join(',')) + this.$set(this.qbfsForm, 'unitName', unNameList.join(',')) + }else if(this.roleType === '2'){ this.$set(this.qbfsForm, 'resPerson', idList) this.$set(this.qbfsForm, 'resPersonName', nameList) } + // === '0' false null undefined都属于false类变量 如果里面有值可以直接判断 if(this.qbfsForm.drafterName){ this.$refs.qbfsForm.validateField('drafterName'); }