From 48750d465d5679efe9e847fdd298590b4daebe5a Mon Sep 17 00:00:00 2001 From: lideqin <694785430@qq.com> Date: Wed, 13 Dec 2023 11:46:59 +0800 Subject: [PATCH] =?UTF-8?q?[update]=20=E4=BC=81=E6=A0=87=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E6=A0=87=E5=87=86=E7=AD=89=E7=BA=A7=E5=88=86?= =?UTF-8?q?=E7=B1=BB=E4=B8=BA1,2,3=E7=BA=A7=EF=BC=8C=E6=8E=88=E6=9D=83?= =?UTF-8?q?=E9=83=A8=E9=97=A8=E5=B8=A6=E5=87=BA=E7=9A=84=E6=98=AF=E5=BD=93?= =?UTF-8?q?=E5=89=8D=E6=A0=87=E5=87=86=E7=9A=84=E4=B8=BB=E8=B5=B7=E8=8D=89?= =?UTF-8?q?=E5=8D=95=E4=BD=8D=EF=BC=8C=E4=B8=BB=E8=B5=B7=E8=8D=89=E5=8D=95?= =?UTF-8?q?=E4=BD=8D=E4=BF=AE=E6=94=B9=E5=90=8E=E4=BC=9A=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=8E=88=E6=9D=83=E9=83=A8=E9=97=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/customField/AddForm.vue | 33 +++++++++++++++++++++----- 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/src/components/customField/AddForm.vue b/src/components/customField/AddForm.vue index 0700e61b..39a92414 100644 --- a/src/components/customField/AddForm.vue +++ b/src/components/customField/AddForm.vue @@ -332,8 +332,10 @@ export default { } } else if (val === StandardGradeClassify.ONE_LEVEL.value) { // 选的是1级 - // 带出3级的部门:起草部门 - this.formInline.auth_dept = this.standardGradeClassification.find(item => item.level + '' === '3').deptIds + // // 带出3级的部门:起草部门 + // this.formInline.auth_dept = this.standardGradeClassification.find(item => item.level + '' === '3').deptIds + // 带出主起草单位 + this.formInline.auth_dept = this.formInline.main_drafting_unit // 设置可选择项 this.departSelectRange = this.standardGradeClassification.find(item => item.level + '' === '1').deptIds.split(',') this.formInline = JSON.parse(JSON.stringify(this.formInline)) @@ -343,8 +345,10 @@ export default { } } else if (val === StandardGradeClassify.TWO_LEVEL.value) { // 选的是2级 - // 带出3级的部门:起草部门 - this.formInline.auth_dept = this.standardGradeClassification.find(item => item.level + '' === '3').deptIds + // // 带出3级的部门:起草部门 + // this.formInline.auth_dept = this.standardGradeClassification.find(item => item.level + '' === '3').deptIds + // 带出主起草单位 + this.formInline.auth_dept = this.formInline.main_drafting_unit // 设置可选择项 this.departSelectRange = this.standardGradeClassification.find(item => item.level + '' === '2').deptIds.split(',') this.formInline = JSON.parse(JSON.stringify(this.formInline)) @@ -353,8 +357,10 @@ export default { this.innerDisabledField = this.innerDisabledField.filter(item => item !== 'auth_dept') } } else if (val === StandardGradeClassify.THREE_LEVEL.value) { - // 选的是3级,授权部门带出不可编辑 - this.formInline.auth_dept = this.standardGradeClassification.find(item => item.level + '' === '3').deptIds + // // 选的是3级,授权部门带出不可编辑 + // this.formInline.auth_dept = this.standardGradeClassification.find(item => item.level + '' === '3').deptIds + // 选的是3级,带出主起草单位 + this.formInline.auth_dept = this.formInline.main_drafting_unit if (!this.innerDisabledField.includes('auth_dept')) { this.innerDisabledField.push('auth_dept') } @@ -389,6 +395,21 @@ export default { } } }, + // 主起草单位改变后,需要将选中的主起草单位增加到授权部门 + 'formInline.main_drafting_unit' (val) { + if (val) { + if (this.formInline.grade_classification === StandardGradeClassify.ONE_LEVEL.value || + this.formInline.grade_classification === StandardGradeClassify.TWO_LEVEL.value) { + // 标准等级分类是1级或者2级需要,把主起草单位追加到授权部门 + const authDeptArr = (this.formInline.auth_dept || '').split(',') + authDeptArr.push(val) + this.formInline.auth_dept = authDeptArr.join(',') + } else if (this.formInline.grade_classification === StandardGradeClassify.THREE_LEVEL.value) { + // 标准等级分类是3级,把授权部门替换成主起草单位 + this.formInline.auth_dept = val + } + } + }, // 企标是否试行改变,标准状态需要跟着变,试行周期必填校验也跟着变 'formInline.try_flag' (val) { if (val && this.flag === StandardSource.ENTERPRISE.value) {