浏览代码

任务联动 发起部门默认当前部门

王通 1 年之前
父节点
当前提交
5bd170808b
共有 3 个文件被更改,包括 71 次插入48 次删除
  1. 1 0
      src/store/modules/user.js
  2. 29 20
      src/views/eventdetailsdialog.vue
  3. 41 28
      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.deptNames)
           resolve(res)
         }).catch(error => {
           reject(error)

+ 29 - 20
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
@@ -801,8 +799,8 @@
             :filter-node-method="filterNode"
             :accordion="true"
             empty-text="加载中,请稍候"
-            :props="defaultProps"
-          ></el-tree>
+            :props="defaultProps">
+          </el-tree>
           <!--            default-expand-all-->
         </el-form-item>
         <el-form-item label="关联预案" v-if="eventStatusButton == 'qs'">
@@ -2827,7 +2825,7 @@ export default {
                 lat: 43.02,
                 icon: "marker",
                 bindPopupHtml: "",
-                click: "preview",
+                click: "",
                 parameter: "",
                 keepBindPopup: false,
                 isAggregation: true,
@@ -2902,8 +2900,8 @@ export default {
                     markersMap.click = ''
                   }
                 }
-
-                  if (res.data[i].cameraCode != null) {
+                if (res.data[i].cameraCode != null) {
+                  markersMap.click = "preview";
                   // markersMap.parameter = res.data[i].cameraCode
                   markersMap.parameter = {
                     code: res.data[i].cameraCode,
@@ -3123,6 +3121,19 @@ export default {
         this.attachExamine.push(attachPath);
       });
     },
+
+//设置联动部门不可选择本部门
+    recursiveChildren(arrayList,deptId) {
+      arrayList.forEach((item, index) => {
+        if(item.id==deptId){
+          item.disabled="true";
+          return
+        }
+        if(item.children){
+          this.recursiveChildren(item.children,deptId)
+        }
+      });
+    },
     /**
      * eventStatusValue 事件状态
      * isSend 是否办理
@@ -3200,6 +3211,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;
@@ -3240,15 +3253,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,
@@ -3260,8 +3269,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,

+ 41 - 28
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>
@@ -1733,7 +1733,8 @@ import DHWs from '@/dahua/lib/DHWs'
 import {
   joinConferences
 } from "@/api/meeting";
-import findUserByDept from '@/views/findUserByDept' //责任人选择弹框
+import findUserByDept from '@/views/findUserByDept'
+import Cookies from "js-cookie"; //责任人选择弹框
 export default {
   dicts: ['task_source'],
   watch: {
@@ -2076,12 +2077,12 @@ export default {
           obj.type = data.type;
           obj.count = data.num;
           obj.icon = icon;
-          _this.resourcesList1.push(obj);
+          _this.resourcesList.push(obj);
           console.log("icon_" + (index + 1) + "=", icon);
           //每个图标对应固定颜色
-          _this.$set(_this.resourcesList1[index], "bg", getIconBg(icon));
+          _this.$set(_this.resourcesList[index], "bg", getIconBg(icon));
         });
-        _this.resourcesList1.push({
+        _this.resourcesList.push({
           resourceName: "摄像头",
           type: "sxt",
           count: "1",
@@ -2401,7 +2402,7 @@ export default {
                 lat: 43.02,
                 icon: 'marker',
                 bindPopupHtml: '',
-                click: 'preview',
+                click: '',
                 parameter: '',
                 keepBindPopup: false,
                 isAggregation: true
@@ -2454,9 +2455,8 @@ export default {
                     markersMap.click=''
                   }
 
-
-              }
-              else if (res.data[i].cameraUse == 4) {
+                }
+                else if (res.data[i].cameraUse == 4) {
                   if(res.data[i].workingStatus==0)
                   {
                     markersMap.icon = 'sj-icon-map-centerdata-sand-quarry-camera'
@@ -2467,21 +2467,18 @@ export default {
                     markersMap.click=''
                   }
 
-              }
-              else if (res.data[i].cameraUse == 5) {
-                  if(res.data[i].workingStatus==0)
-                  {
+                }
+                else if (res.data[i].cameraUse == 5) {
+                  if (res.data[i].workingStatus == 0) {
                     markersMap.icon = 'sj-icon-map-centerdata-t-hydraulic-reservoir-camera'
-                    markersMap.click='preview'
-                  }else if (res.data[i].workingStatus==1)
-                  {
+                    markersMap.click = 'preview'
+                  } else if (res.data[i].workingStatus == 1) {
                     markersMap.icon = 'sj-icon-map-not-centerdata-t-hydraulic-reservoir-camera'
-                    markersMap.click=''
+                    markersMap.click = ''
                   }
-
-              }
+                }
                 if (res.data[i].cameraCode != null) {
-
+                  markersMap.click = 'preview'
                   // markersMap.parameter = res.data[i].cameraCode
                   markersMap.parameter = {code:res.data[i].cameraCode,
                     type:res.data[i].cameraFactory?res.data[i].cameraFactory:1,name:res.data[i].cameraName}
@@ -2694,6 +2691,19 @@ export default {
         this.attachExamine.push(attachPath)
       });
     },
+
+//设置联动部门不可选择本部门
+    recursiveChildren(arrayList,deptId) {
+      arrayList.forEach((item, index) => {
+        if(item.id==deptId){
+          item.disabled="true";
+          return
+        }
+        if(item.children){
+          this.recursiveChildren(item.children,deptId)
+        }
+      });
+    },
     /**
      * eventStatusValue 事件状态
      * isSend 是否办理
@@ -2760,6 +2770,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
@@ -2797,11 +2809,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
@@ -2813,8 +2825,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,
@@ -2826,6 +2838,7 @@ export default {
                 eventState: eventState,
                 eventName: that.eventName
               }
+              debugger
               sendTask(param).then(res => {
                 if (res.code == 200) {
                   that.$message.success(`联动发起成功!`)