应急管理厅专家管理系统
祖安之光
13 hours ago 49b46688641b7a4ba074dedccbcc5547f879ec0a
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(','):''