From 49b46688641b7a4ba074dedccbcc5547f879ec0a Mon Sep 17 00:00:00 2001
From: 祖安之光 <11848914+light-of-zuan@user.noreply.gitee.com>
Date: Tue, 02 Jun 2026 14:50:14 +0800
Subject: [PATCH] 修改专业对应部门处室

---
 src/views/safetyReview/expertManage/fillForm/index.vue |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/src/views/safetyReview/expertManage/fillForm/index.vue b/src/views/safetyReview/expertManage/fillForm/index.vue
index 17f0edb..fbcb06c 100644
--- a/src/views/safetyReview/expertManage/fillForm/index.vue
+++ b/src/views/safetyReview/expertManage/fillForm/index.vue
@@ -23,6 +23,7 @@
                       <el-cascader
                           style="width: 100%"
                           clearable
+                          :disabled="state.findDept"
                           v-model="state.form.deptId"
                           :options="state.deptList"
                           :props="{ expandTrigger: 'hover', value: 'deptId',label: 'deptName',emitPath: false}"></el-cascader>
@@ -431,6 +432,7 @@
     remark: '',
     source: 1
   },
+  findDept: true,
   expertsType: [],
   deptList: [],
   directionList: [
@@ -510,12 +512,21 @@
     state.form.bigClassify = null
     state.form.smallClassify = null
   }
+  const foundType = findNodeById(state.expertsType,value[1])
+  if(foundType.deptId){
+    state.form.deptId = foundType.deptId
+    state.findDept = true
+  }else{
+    ElMessage.warning('该专业未找到对应的业务处室,请手动选择')
+    state.form.deptId = null
+    state.findDept = false
+  }
 }
 
 const findNodeById = (data,value)=> {
   for (const node of data) {
     if (node.id === value) {
-      return node.classifyName;
+      return node;
     }
     if (node.children) {
       const foundNode = findNodeById(node.children, value);
@@ -611,7 +622,7 @@
       let data = JSON.parse(JSON.stringify(state.form))
       data.bigClassify = data.profession[0]
       data.smallClassify = data.profession[1]
-      data.domain = findNodeById(state.expertsType,data.smallClassify)
+      data.domain = findNodeById(state.expertsType,data.smallClassify)?.classifyName
       data.supportDirectionSafety = Array.isArray(data.supportDirectionSafety)?data.supportDirectionSafety.join(','):''
       data.supportDirectionPrevention = Array.isArray(data.supportDirectionPrevention)?data.supportDirectionPrevention.join(','):''
       data.supportDirectionEmergency = Array.isArray(data.supportDirectionEmergency)?data.supportDirectionEmergency.join(','):''

--
Gitblit v1.9.2