Browse Source

事件详情联动

qinhouyu 2 years ago
parent
commit
8d00f599ec
3 changed files with 52 additions and 24 deletions
  1. 1 0
      src/store/modules/user.js
  2. 27 15
      src/views/eventdetailsdialog.vue
  3. 24 9
      src/views/firespread.vue

+ 1 - 0
src/store/modules/user.js

@@ -77,6 +77,7 @@ const user = {
           commit('SET_USERID', user.id)
           commit('SET_AVATAR', avatar)
           Cookies.set('deptId',user.deptId)
+          Cookies.set('deptName',user.deptName)
           resolve(res)
         }).catch(error => {
           reject(error)

+ 27 - 15
src/views/eventdetailsdialog.vue

@@ -715,8 +715,7 @@
           v-if="
             eventStatusButton == 'wb' ||
             eventStatusButton == 'qs' ||
-            eventStatusButton == 'cf' ||
-            eventStatusButton == 'ld'
+            eventStatusButton == 'cf'
           "
           :label="deptNameitem"
         >
@@ -731,8 +730,7 @@
             v-if="
               eventStatusButton == 'wb' ||
               eventStatusButton == 'qs' ||
-              eventStatusButton == 'cf' ||
-              eventStatusButton == 'ld'
+              eventStatusButton == 'cf'
             "
           >
             <el-option
@@ -2357,6 +2355,18 @@ export default {
     /** ----------------------------------摄像头预览结束------------------------------------- */
   },
   methods: {
+    //设置联动部门不可选择本部门
+    recursiveChildren(arrayList,deptId) {
+      arrayList.forEach((item, index) => {
+        if(item.id==deptId){
+          item.disabled="true";
+          return
+        }
+        if(item.children){
+          this.recursiveChildren(item.children,deptId)
+        }
+      });
+    },
     closedEventDiaTool() {
       document.addEventListener("click", (e) => {
         let b = document.getElementById("eventMapToolOnly");
@@ -3238,6 +3248,8 @@ export default {
           that.eventConfirmTitle = "事件联动";
           /** 查询部门树结构 */
           await deptTreeselect().then((response) => {
+            let deptId=Cookies.get("deptId")
+            that.recursiveChildren(response.data,deptId)
             that.deptOptionsLiandong = response.data;
           });
           that.showEventConfirm = true;
@@ -3278,15 +3290,15 @@ export default {
             that.$message.error(`请选择任务联动部门!`);
             return;
           }
-          if (
-            that.sendDeptId == "" ||
-            that.sendDeptId == null ||
-            that.sendDeptName == "" ||
-            that.sendDeptName == null
-          ) {
-            that.$message.error(`请选择任务发起部门!`);
-            return;
-          }
+          // if (
+          //   that.sendDeptId == "" ||
+          //   that.sendDeptId == null ||
+          //   that.sendDeptName == "" ||
+          //   that.sendDeptName == null
+          // ) {
+          //   that.$message.error(`请选择任务发起部门!`);
+          //   return;
+          // }
           let eventState = "";
           listSJfl({
             parentId: that.eventType,
@@ -3298,8 +3310,8 @@ export default {
                 }
               }
               let param = {
-                sendDeptId: that.sendDeptId,
-                sendDept: that.sendDeptName,
+                sendDeptId: Cookies.get("deptId"),
+                sendDept: Cookies.get("deptName"),
                 eventCode: that.eventCode,
                 longitude: that.longitude,
                 latitude: that.latitude,

+ 24 - 9
src/views/firespread.vue

@@ -938,12 +938,12 @@
           <el-input type="number" v-model="sendHuoZaiBanJing" placeholder="请输入火灾半径" />
         </el-form-item>
         <el-form-item
-          v-if="eventStatusButton=='wb'||eventStatusButton=='qs'||eventStatusButton=='cf'||eventStatusButton=='ld'"
+          v-if="eventStatusButton=='wb'||eventStatusButton=='qs'||eventStatusButton=='cf'"
           :label="deptNameitem">
           <!--          <treeselect v-model="deptId" :options="deptOptions" multiple :show-count="true"-->
           <!--                      placeholder="请选择签收部门"/>-->
           <el-select v-model="sendDeptName" clearable placeholder="请选择部门" class="m-r-1rem" @change="setValue"
-                     v-if="eventStatusButton=='wb'||eventStatusButton=='qs'||eventStatusButton=='cf'||eventStatusButton=='ld'">
+                     v-if="eventStatusButton=='wb'||eventStatusButton=='qs'||eventStatusButton=='cf'">
             <el-option v-for="item in deptOptions" :key="item.deptId" :label="item.deptName"
                        :value="{value:item.deptId,label:item.deptName}">
             </el-option>
@@ -1735,6 +1735,7 @@ import {
 } from "@/api/meeting";
 import findUserByDept from '@/views/findUserByDept' //责任人选择弹框
 import request from "@/utils/request";
+import Cookies from "js-cookie"; //责任人选择弹框
 
 export default {
   dicts: ['task_source'],
@@ -2033,6 +2034,18 @@ export default {
     this.fireControlViewList();
   },
   methods: {
+    //设置联动部门不可选择本部门
+    recursiveChildren(arrayList,deptId) {
+      arrayList.forEach((item, index) => {
+        if(item.id==deptId){
+          item.disabled="true";
+          return
+        }
+        if(item.children){
+          this.recursiveChildren(item.children,deptId)
+        }
+      });
+    },
     /************************************责任制-开始****************************************/
     addLine: function() { //添加负责人行数
       var newValue = {
@@ -2725,6 +2738,8 @@ export default {
           that.eventConfirmTitle = '事件联动'
           /** 查询部门树结构 */
           await deptTreeselect().then(response => {
+            let deptId=Cookies.get("deptId")
+            that.recursiveChildren(response.data,deptId)
             that.deptOptionsLiandong = response.data
           })
           that.showEventConfirm = true
@@ -2762,11 +2777,11 @@ export default {
             that.$message.error(`请选择任务联动部门!`)
             return
           }
-          if (that.sendDeptId == '' || that.sendDeptId == null || that.sendDeptName == '' || that.sendDeptName ==
-            null) {
-            that.$message.error(`请选择任务发起部门!`)
-            return
-          }
+          // if (that.sendDeptId == '' || that.sendDeptId == null || that.sendDeptName == '' || that.sendDeptName ==
+          //   null) {
+          //   that.$message.error(`请选择任务发起部门!`)
+          //   return
+          // }
           let eventState = "";
           listSJfl({
             parentId: that.eventType
@@ -2778,8 +2793,8 @@ export default {
                 }
               }
               let param = {
-                sendDeptId: that.sendDeptId,
-                sendDept: that.sendDeptName,
+                sendDeptId: Cookies.get("deptId"),
+                sendDept: Cookies.get("deptName"),
                 eventCode: that.eventCode,
                 longitude: that.longitude,
                 latitude: that.latitude,