From 6e151129c595e103f0687a00ac0d43423069ebd4 Mon Sep 17 00:00:00 2001 From: songwenxuan <1924103812@qq.com> Date: Wed, 31 Jan 2024 14:56:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B9=E5=A6=83=E7=94=B8=E5=AE=9E=E4=B8=9A?= =?UTF-8?q?=E3=80=81=E6=9B=B9=E7=85=A4=E7=82=AD=E3=80=81=E6=B2=A7=E5=B7=9E?= =?UTF-8?q?=E7=9F=BF=E7=9F=B3=E5=AE=89=E5=85=A8=E7=8E=AF=E4=BF=9D=E6=A3=80?= =?UTF-8?q?=E6=9F=A5=E5=8F=91=E8=B5=B7=E5=A2=9E=E5=8A=A0=E6=A3=80=E6=9F=A5?= =?UTF-8?q?=E4=BA=BA=E5=91=98=E6=A0=A1=E9=AA=8C=EF=BC=8C=E5=8F=AA=E6=9C=89?= =?UTF-8?q?=E5=AF=B9=E5=BA=94=E5=85=AC=E5=8F=B8=E5=92=8C=E7=A7=A6=E6=B8=AF?= =?UTF-8?q?=E4=BA=BA=E5=91=98=E5=8F=AF=E4=BB=A5=E6=98=AF=E6=A3=80=E6=9F=A5?= =?UTF-8?q?=E4=BA=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inspection/components/add.vue | 60 ++++++++++++++++--- 1 file changed, 53 insertions(+), 7 deletions(-) diff --git a/src/views/safetyenvironmental/inspection/components/add.vue b/src/views/safetyenvironmental/inspection/components/add.vue index 76bede6..2f76f94 100644 --- a/src/views/safetyenvironmental/inspection/components/add.vue +++ b/src/views/safetyenvironmental/inspection/components/add.vue @@ -22,6 +22,7 @@ :options="treeData" :props="defaultProps" v-model="form.INSPECTED_DEPARTMENT_ID" + @change="changeCurrentDeptId(form.INSPECTED_DEPARTMENT_ID)" placeholder="请选择被检查单位" style="width: 300px" /> @@ -68,8 +69,8 @@ - 检查人员 添加 - + 检查人员 添加 +
@@ -82,7 +83,8 @@ v-model="item.INSPECTION_DEPARTMENT_ID" placeholder="请选择检查人员部门" style="width: 300px" - @change="updateInspecteDept(item.INSPECTION_DEPARTMENT_ID,index)"/> + @visible-change="" + @change="updateInspecteDept(item.INSPECTION_DEPARTMENT_ID,index,item)"/> @@ -348,6 +350,7 @@ export default { }, pd: [], switchInspectionType: 'select', + CURRENT_INSPECTED_DEPARTMENT_ID: '', //当前被检查单位 form: { INSPECTION_SUBJECT: '', // 检查标题 INSPECTION_SOURCE: '4', // 检查来源(4-监管端 5-企业端) @@ -480,6 +483,12 @@ export default { handleAdd() { this.dialogType = 'add' }, + changeCurrentDeptId(id) { + this.form.inspectorList = [] + this.form.inspectorList.push({ INSPECTION_INSPECTOR_ID: '', INSPECTION_DEPARTMENT_ID: '', INSPECTION_USER_ID: '', USER_SIDE: '' }) + this.INSPECTOR_List.push([]) + this.CURRENT_INSPECTED_DEPARTMENT_ID = id + }, changeSwitch(type) { if (type === 'InspectionType') { this.form.INSPECTION_TYPE = '' @@ -498,10 +507,46 @@ export default { this.form.inspectorList.push({ INSPECTION_INSPECTOR_ID: '', INSPECTION_DEPARTMENT_ID: '', INSPECTION_USER_ID: '', USER_SIDE: '' }) this.INSPECTOR_List.push([]) }, - updateInspecteDept(DEPARTMENT_ID, i) { - this.form.inspectorList[i].INSPECTION_USER_ID = '' - this.form.inspectorList[i].USER_SIDE = '' - this.getInspectorList(DEPARTMENT_ID, i) + updateInspecteDept(id,i,item) { + // 获取人员列表 + if (id) { + requestFN( + '/corpDepartment/checkDept', + { + DEPARTMENT_ID: this.CURRENT_INSPECTED_DEPARTMENT_ID, + id: id + } + ).then((data) => { + if (data.message!=null) { + this.INSPECTION_DEPARTMENT_ID = '' + this.INSPECTOR_List = [] + this.INSPECTION_USER_ID = '' + this.$message.error(data.message) + }else { + // 获取人员列表 + if (id) { + requestFN( + '/user/listAllManageAndCorp', + { + DEPARTMENT_ID: id + } + ).then((data) => { + this.INSPECTOR_List[i] = data.userList + this.$forceUpdate() + }).catch((e) => { + }) + } + this.form.inspectorList[i].INSPECTION_USER_ID = '' + this.form.inspectorList[i].USER_SIDE = '' + this.$message.success('检查人员部门选择成功') + this.getInspectorList(DEPARTMENT_ID, i) + } + }).catch((e) => { + }) + } + this.form.inspectorList = [] + this.form.inspectorList.push({ INSPECTION_INSPECTOR_ID: item.INSPECTION_INSPECTOR_ID, INSPECTION_DEPARTMENT_ID: item.INSPECTION_DEPARTMENT_ID, INSPECTION_USER_ID: '', USER_SIDE: item.USER_SIDE }) + this.INSPECTOR_List.push([]) }, // 获取人员列表 getInspectorList(DEPARTMENT_ID, i) { @@ -509,6 +554,7 @@ export default { requestFN( '/user/listAllManageAndCorp', { + CURRENT_INSPECTED_DEPARTMENT_ID: this.CURRENT_INSPECTED_DEPARTMENT_ID, DEPARTMENT_ID: DEPARTMENT_ID, NOMAIN: '1' }