浏览代码

事件联动

彭宇 2 年之前
父节点
当前提交
91acdcbc2e
共有 2 个文件被更改,包括 167 次插入37 次删除
  1. 10 1
      src/api/system/dept.js
  2. 157 36
      src/views/eventdetailsdialog.vue

+ 10 - 1
src/api/system/dept.js

@@ -33,6 +33,15 @@ export function treeselect() {
   })
 }
 
+
+// 查询部门下拉树结构(全部)
+export function treeselectAll() {
+  return request({
+    url: '/system/dept/treeselectAll',
+    method: 'get'
+  })
+}
+
 // 根据角色ID查询部门树结构
 export function roleDeptTreeselect(roleId) {
   return request({
@@ -65,4 +74,4 @@ export function delDept(deptId) {
     url: '/system/dept/' + deptId,
     method: 'delete'
   })
-}
+}

+ 157 - 36
src/views/eventdetailsdialog.vue

@@ -204,10 +204,11 @@
     <el-dialog :title="eventConfirmTitle" :visible.sync="showEventConfirm" v-if="showEventConfirm" width="770px"
                style="height: 700px;" @close="cancelEventConfirm()">
       <el-form label-width="80px">
-        <el-form-item label="火灾半径"  v-if="eventStatusButton=='qs'">
+        <el-form-item label="火灾半径" v-if="eventStatusButton=='qs'">
           <el-input type="number" v-model="sendHuoZaiBanJing" placeholder="请输入火灾半径"/>
         </el-form-item>
-        <el-form-item label="签收部门" v-if="eventStatusButton=='qs'||eventStatusButton=='wb'||eventStatusButton=='cf'">
+        <el-form-item :label="deptNameitem"
+                      v-if="eventStatusButton=='qs'||eventStatusButton=='wb'||eventStatusButton=='cf'||eventStatusButton=='ld'">
           <!--          <treeselect v-model="deptId" :options="deptOptions" multiple :show-count="true"-->
           <!--                      placeholder="请选择签收部门"/>-->
           <el-select v-model="sendDeptName" clearable placeholder="请选择部门" class="m-r-1rem" @change="setValue">
@@ -229,6 +230,30 @@
             />
           </el-select>
         </el-form-item>
+        <el-form-item label="联动标题" v-if="eventStatusButton=='ld'">
+          <el-input v-model="sendTaskTitle" placeholder="请输入联动标题"/>
+        </el-form-item>
+        <el-form-item label="联动内容" v-if="eventStatusButton=='ld'">
+          <el-input type="textarea" v-model="sendTaskContent"
+                    :autosize="{ minRows: 7, maxRows: 7}" placeholder="请输入联动内容">
+          </el-input>
+        </el-form-item>
+        <el-form-item label="联动部门" v-if="eventStatusButton=='ld'">
+          <el-checkbox v-model="deptExpand" @change="handleCheckedTreeExpand($event, 'dept')">展开/折叠</el-checkbox>
+          <!--          <el-checkbox v-model="deptNodeAll" @change="handleCheckedTreeNodeAll($event, 'dept')">全选/全不选</el-checkbox>-->
+          <!--          <el-checkbox v-model="deptCheckStrictly" @change="handleCheckedTreeConnect($event, 'dept')">父子联动</el-checkbox>-->
+          <el-tree
+            class="tree-border"
+            :data="deptOptionsLiandong"
+            show-checkbox
+            default-expand-all
+            ref="LiandongDept"
+            node-key="id"
+            :check-strictly="!deptCheckStrictly"
+            empty-text="加载中,请稍候"
+            :props="defaultProps"
+          ></el-tree>
+        </el-form-item>
         <el-form-item label="关联预案" v-if="eventStatusButton=='qs'">
           <el-select v-model="sendGuanLianYuAn" placeholder="请选择关联预案!" clearable>
             <el-option
@@ -248,6 +273,9 @@
         <el-button size="mini" type="primary" v-if="eventStatusButton=='cf'"
                    @click="updateCentereventTEventcatalogueStatus('cf',true)">重复
         </el-button>
+        <el-button size="mini" type="primary" v-if="eventStatusButton=='ld'"
+                   @click="updateCentereventTEventcatalogueStatus('ld',true)">发起联动
+        </el-button>
       </el-form>
     </el-dialog>
   </div>
@@ -267,6 +295,9 @@ import {
   selectByeventCode,
   updateCentereventTEventcatalogueStatus
 } from '@/api/forest'
+import {
+  treeselectAll as deptTreeselect
+} from '@/api/system/dept'
 
 export default {
   components: {
@@ -278,16 +309,28 @@ export default {
   data() {
     return {
       /** *****************事件流程***************************/
-      sendDeptId: null,
-      sendDeptName: null,
-      sendEventType: null,
-      sendHuoZaiBanJing: null,
-      sendGuanLianYuAn: null,
+      deptNameitem: '签收部门',
+      sendDeptId: null,//签收部门/发起部门
+      sendDeptName: null,//签收部门/发起部门
+      sendEventType: null,//事件类型
+      sendHuoZaiBanJing: null,//火灾报告
+      sendGuanLianYuAn: null,//关联预案
+      sendTaskTitle: null,//联动标题
+      sendTaskContent: null,//联动内容
+      sendLianDongDept: [],//联动部门
       eventTypeList: [],//事件类型列表
       guanLianYuAnList: [],//关联预案列表
       deptOptions: [],//签收部门
-      eventStatusButton:null,//流程按钮标识
-      eventConfirmTitle:null,//弹窗标题  ---签收 误报  重复
+      deptOptionsLiandong: [],//联动部门
+      eventStatusButton: null,//流程按钮标识
+      eventConfirmTitle: null,//弹窗标题  ---签收 误报  重复
+      deptExpand: true,//展开/折叠
+      deptNodeAll: false,//全选/全不选
+      deptCheckStrictly: false,//父子联动
+      defaultProps: {
+        children: 'children',
+        label: 'label'
+      },
       /** *****************事件流程***************************/
       showEventConfirm: false,//事件签收弹窗
       eventStatusValue: null,//事件状态
@@ -360,6 +403,7 @@ export default {
       this.eventTypeList = []//事件类型列表
       this.guanLianYuAnList = []//关联预案列表
       this.deptOptions = []//签收部门
+      this.deptOptionsLiandong = []//联动部门
       this.eventStatusButton = null//流程按钮标识
       this.eventConfirmTitle = null//流程按钮标识
     },
@@ -368,10 +412,11 @@ export default {
      * isSend 是否办理
      * */
     async updateCentereventTEventcatalogueStatus(eventStatus, isSend) {
-      this.eventStatusButton=eventStatus
-      if (!isSend) {
+      this.eventStatusButton = eventStatus
+
+      if (!isSend) {//事件弹窗
         if (eventStatus == 'qs') {//签收
-          this.eventConfirmTitle='事件签收'
+          this.eventConfirmTitle = '事件签收'
           let param = { parentId: this.eventType }
           await listSJfl(param).then(res => {
             //事件类型
@@ -389,56 +434,132 @@ export default {
             //签收部门
             if (res.code == 200) {
               this.deptOptions = res.data
+              this.deptNameitem = '签收部门'
             }
           })
           this.showEventConfirm = true
-        }else if (eventStatus == 'wb') {//误报
-          this.eventConfirmTitle='事件误报'
+        } else if (eventStatus == 'wb') {//误报
+          this.eventConfirmTitle = '事件误报'
           await selectByeventCode(this.eventCode).then(res => {
             //签收部门
             if (res.code == 200) {
               this.deptOptions = res.data
+              this.deptNameitem = '签收部门'
             }
           })
           this.showEventConfirm = true
-        }else if (eventStatus == 'cf') {//重复
-          this.eventConfirmTitle='事件重复'
+        } else if (eventStatus == 'cf') {//重复
+          this.eventConfirmTitle = '事件重复'
           await selectByeventCode(this.eventCode).then(res => {
             //签收部门
             if (res.code == 200) {
               this.deptOptions = res.data
+              this.deptNameitem = '签收部门'
             }
           })
           this.showEventConfirm = true
-        }else if (eventStatus == 'ld') {//联动
-          this.eventConfirmTitle='事件联动'
+        } else if (eventStatus == 'ld') {//联动
           await selectByeventCode(this.eventCode).then(res => {
             //签收部门
             if (res.code == 200) {
               this.deptOptions = res.data
+              this.deptNameitem = '发起部门'
             }
           })
+          this.eventConfirmTitle = '事件联动'
+          /** 查询部门树结构 */
+          await deptTreeselect().then(response => {
+            this.deptOptionsLiandong = response.data
+          })
           this.showEventConfirm = true
         }
-      } else {
-        //事件处理流程
-        let param = {
-          eventCode: this.eventCode,
-          deptId: this.sendDeptId,
-          deptName: this.sendDeptName,
-          eventStatus: eventStatus,
-          eventType: this.sendEventType,
-          id: this.eventId,
-          czlx: '',
-          fireRadius: this.sendHuoZaiBanJing,
-          reserve: this.sendGuanLianYuAn,
-        }
-        updateCentereventTEventcatalogueStatus(param).then(res => {
-          if (res.code == 200) {
-            this.refreshEvent(this.eventCode)
-            this.showEventConfirm = false
+      } else {//事件提交后台
+        if (eventStatus == 'ld') {
+          let array = this.$refs.LiandongDept.getCheckedNodes()
+          if (array != null && array.length > 0) {
+            for (let i = 0; i < array.length; i++) {
+              this.sendLianDongDept.push({
+                'taskDeptId': array[i].id,
+                'taskDeptName': array[i].label
+              })
+            }
+          }
+          //事件处理流程
+          let param = {
+            sendDeptId: this.sendDeptId,
+            sendDept: this.sendDeptName,
+            eventCode: this.eventCode,
+            eventType: this.sendEventType,
+            longitude:"125.11111",
+            latitude:"48.22222",
+            taskTitle:this.sendTaskTitle,
+            taskContent:this.taskContent,
+            taskDept: this.sendLianDongDept
+          }
+          updateCentereventTEventcatalogueStatus(param).then(res => {
+            if (res.code == 200) {
+              this.refreshEvent(this.eventCode)
+              this.showEventConfirm = false
+            }
+          })
+
+        } else {
+          //事件处理流程
+          let param = {
+            eventCode: this.eventCode,
+            deptId: this.sendDeptId,
+            deptName: this.sendDeptName,
+            eventStatus: eventStatus,
+            eventType: this.sendEventType,
+            id: this.eventId,
+            czlx: '',
+            fireRadius: this.sendHuoZaiBanJing,
+            reserve: this.sendGuanLianYuAn
           }
-        })
+          updateCentereventTEventcatalogueStatus(param).then(res => {
+            if (res.code == 200) {
+              this.refreshEvent(this.eventCode)
+              this.showEventConfirm = false
+            }
+          })
+        }
+      }
+    },
+    // 树权限(展开/折叠)
+    handleCheckedTreeExpand(value, type) {
+      if (type == 'menu') {
+        let treeList = this.menuOptions
+        for (let i = 0; i < treeList.length; i++) {
+          this.$refs.menu.store.nodesMap[treeList[i].id].expanded = value
+        }
+      } else if (type == 'menuVisu') {
+        let treeList = this.menuVisuOptions
+        for (let i = 0; i < treeList.length; i++) {
+          this.$refs.menuVisu.store.nodesMap[treeList[i].id].expanded = value
+        }
+      } else if (type == 'dept') {
+        let treeList = this.deptOptions
+        for (let i = 0; i < treeList.length; i++) {
+          this.$refs.LiandongDept.store.nodesMap[treeList[i].id].expanded = value
+        }
+      }
+    },
+    // 树权限(全选/全不选)
+    handleCheckedTreeNodeAll(value, type) {
+      if (type == 'menu') {
+        this.$refs.menu.setCheckedNodes(value ? this.menuOptions : [])
+      } else if (type == 'menuVisu') {
+        this.$refs.menuVisu.setCheckedNodes(value ? this.menuVisuOptions : [])
+      } else if (type == 'dept') {
+        this.$refs.LiandongDept.setCheckedNodes(value ? this.deptOptions : [])
+      }
+    },
+    // 树权限(父子联动)
+    handleCheckedTreeConnect(value, type) {
+      if (type == 'menu') {
+        this.menuCheckStrictly = value ? true : false
+      } else if (type == 'dept') {
+        this.deptCheckStrictly = value ? true : false
       }
     },
     sendEventLog() {