Pārlūkot izejas kodu

哨兵事件页面提交

wang_xy 1 nedēļu atpakaļ
vecāks
revīzija
cff0056edd
3 mainītis faili ar 320 papildinājumiem un 51 dzēšanām
  1. 120 2
      src/api/event.js
  2. 24 28
      src/views/SenEventCenter.vue
  3. 176 21
      src/views/SentryPage.vue

+ 120 - 2
src/api/event.js

@@ -1,12 +1,36 @@
+//哨兵事件中心
 import request from '@/utils/request'
 
-//哨兵事件中心
-export function getStatisticByEventType() {
+
+/**
+ * 事件统计接口
+ * @param param
+ * @returns {AxiosPromise}
+ */
+export function getStatisticByEventType(param) {
   return request({
     url: '/sooka-digital-construction/eventSubject/getStatisticByEventType',
     method: 'get',
+    params: param
   })
 }
+
+/**
+ * 查询事件类型
+ * @returns {*}
+ */
+export function eventTypesListAll() {
+  return request({
+    url: '/sooka-digital-construction/eventTypes/listAll',
+    method: 'get',
+  })
+}
+
+/**
+ * 事件列表接口
+ * @param param
+ * @returns {AxiosPromise}
+ */
 export function getEventList(param) {
   return request({
     url: '/sooka-digital-construction/eventSubject/getEventList',
@@ -14,9 +38,103 @@ export function getEventList(param) {
     params: param
   })
 }
+
+/**
+ * 根据id获取事件详情
+ * @param param
+ * @returns {AxiosPromise}
+ */
+export function getDescriptionById(eventId) {
+  return request({
+    url: '/sooka-digital-construction/eventSubject/getDescription/'+eventId,
+    method: 'get',
+  })
+}
+
+/**
+ * 事件日志接口
+ * @param eventId
+ * @returns {AxiosPromise}
+ */
 export function getEventLog(eventId) {
   return request({
     url: '/sooka-digital-construction/eventSubject/log/'+eventId,
     method: 'get',
   })
 }
+
+/**
+ * 事件签收接口
+ * @param {"deptList":[{"mapDeptId":"370","mapDeptName":"双辽市"},{"mapDeptId":"371","mapDeptName":"梨树县"}],"eventId":"edd820f5737f4cfa8c02f24bea86d4ce"}
+ * @returns {AxiosPromise}
+ */
+export function eventSignature(param) {
+  return request({
+    url: '/sooka-digital-construction/eventSubject/eventSignature',
+    method: 'post',
+    data:param
+  })
+}
+
+/**
+ * 事件办结接口
+ * @param eventId
+ * @returns {AxiosPromise}
+ */
+export function eventCompletion(eventId) {
+  return request({
+    url: '/sooka-digital-construction/eventSubject/eventCompletion/'+eventId,
+    method: 'get',
+  })
+}
+
+/**
+ * 事件审核接口
+ * @param param
+ * @returns {AxiosPromise}
+ */
+export function eventReview(param) {
+  return request({
+    url: '/sooka-digital-construction/eventSubject/eventReview',
+    method: 'get',
+    params:param
+  })
+}
+
+/**
+ * 事件归档接口
+ * @param eventId
+ * @returns {AxiosPromise}
+ */
+export function eventArchiving(eventId) {
+  return request({
+    url: '/sooka-digital-construction/eventSubject/eventArchiving/'+eventId,
+    method: 'get',
+  })
+}
+
+/**
+ * 设定指挥中心 / 新增协同部门
+ * @param eventId
+ * @returns {AxiosPromise}
+ */
+export function configDept(params) {
+  return request({
+    url: '/sooka-digital-construction/eventSubject/configDept',
+    method: 'post',
+    data: params
+  })
+}
+
+/**
+ * 事件添加反馈日志接口
+ * @param {"eventId":"xxxxx","reviewDescription":"日志内容xxxxxxxxxxxxxxxxxxx"}
+ * @returns {AxiosPromise}
+ */
+export function addEventLogDescription(param) {
+  return request({
+    url: '/sooka-digital-construction/eventSubject/addEventLogDescription',
+    method: 'post',
+    data:param
+  })
+}

+ 24 - 28
src/views/SenEventCenter.vue

@@ -26,12 +26,12 @@
 				</div>
 			</div>
 			<div class="list_tit">事件列表</div>
-			<el-select v-model="value" placeholder="请选择">
+			<el-select v-model="eventType" placeholder="请选择" @change="getEventLeft(1)">
 				<el-option
-						v-for="item in options"
-						:key="item.value"
-						:label="item.label"
-						:value="item.value">
+						v-for="item in eventTypes"
+						:key="item.eventTypeCode"
+						:label="item.eventTypeName"
+						:value="item.eventTypeCode">
 				</el-option>
 			</el-select>
 			<el-input
@@ -90,7 +90,7 @@
 <script>
 	import Cookies from 'js-cookie'
 	import {getUserProfile} from "@/api/system/user";
-	import {getEventList,getStatisticByEventType} from "@/api/event";
+  import {eventTypesListAll, getEventList, getStatisticByEventType} from "@/api/event";
 
 	import '../assets/styles/sb_body.css';
 
@@ -120,6 +120,7 @@
       this.getEventRight(1);
       this.getSupermapEvent();
       this.getStatisticByEventType();
+      this.eventTypesListAll();
 		},
 		mounted() {
 			// 初始化地图数据
@@ -171,34 +172,26 @@
         rightTotal:0,
         rightCurrentPage:1,
 
-				options: [{
-					value: '选项1',
-					label: '华生1'
-				}, {
-					value: '选项2',
-					label: '华生2'
-				}, {
-					value: '选项3',
-					label: '华生3'
-				}, {
-					value: '选项4',
-					label: '华生4'
-				}, {
-					value: '选项5',
-					label: '华生5'
-				}],
+        eventTypes: [],
+        eventType: ''
 
 			}
 		},
 		methods: {
       getStatisticByEventType(){
-        getStatisticByEventType().then(req => {
+        getStatisticByEventType({createTimeRange:this.dataValue+","+this.dataValue}).then(req => {
           this.eventNumberList = req.data;
+          this.eventTotal = 0;
           for(let item of req.data){
             this.eventTotal += item.countSum
           }
         })
       },
+      eventTypesListAll(){
+        eventTypesListAll().then(req => {
+          this.eventTypes = req.data;
+        })
+      },
       getCurrentDataStr(date) {
         let y = date.getFullYear()
         let m = date.getMonth() + 1
@@ -211,13 +204,16 @@
         this.dataValue = this.getCurrentDataStr(value);
         this.getEventLeft(1);
         this.getEventRight(1);
+        this.getStatisticByEventType();
+        this.getSupermapEvent();
       },
       getEventLeft(pageNum){
         let param = {
-          pageNum:pageNum,
-          pageSize:10,
-          eventTitle:this.searchLeft,
-          createTimeRange:this.dataValue+","+this.dataValue,
+          pageNum: pageNum,
+          pageSize: 10,
+          eventTypeCode: this.eventType,
+          eventTitle: this.searchLeft,
+          createTimeRange: this.dataValue+","+this.dataValue,
         };
         getEventList(param).then(req => {
           this.eventLeftList = req.rows;
@@ -244,7 +240,7 @@
         let that = this;
         let param = {
           createTimeRange:this.dataValue+","+this.dataValue,
-          selectClient:"ALL"
+          eventTypeCode:"all"
         };
         getEventList(param).then(res => {
           const markersList = []

+ 176 - 21
src/views/SentryPage.vue

@@ -9,23 +9,24 @@
 
  <template>
     <div class="visual-con hz_body">
+    <router-view ref="senEventCenter"></router-view>
 		<div class="s_header">
 			<div class="head_btn">
-                <div @click="jumpTo('/SentryCockpit',0)" :class="routerIdx == 0 ? 'on' : ''">
-                    <i>驾驶舱</i>
-                </div>
-                <div @click="jumpTo('/SenEquipmentCenter',1)" :class="routerIdx == 1 ? 'on' : ''">
-                    <i>设备中心</i>
-                </div>
-            </div>
-            <div class="header_tit"><i>{{title}}</i></div>
-            <div class="head_btn">
-                <div @click="jumpTo('/SenEventCenter',2)" :class="routerIdx == 2 ? 'on' : ''">
-                    <i>事件中心</i>
-                </div>
-                <div @click="jumpTo('/useCenter',3)" :class="routerIdx == 3 ? 'on' : ''">
-                    <i>用户中心</i>
-                </div>
+          <div @click="jumpTo('/SentryCockpit',0)" :class="routerIdx == 0 ? 'on' : ''">
+              <i>驾驶舱</i>
+          </div>
+          <div @click="jumpTo('/SenEquipmentCenter',1)" :class="routerIdx == 1 ? 'on' : ''">
+              <i>设备中心</i>
+          </div>
+      </div>
+      <div class="header_tit"><i>{{title}}</i></div>
+      <div class="head_btn">
+          <div @click="jumpTo('/SenEventCenter',2)" :class="routerIdx == 2 ? 'on' : ''">
+              <i>事件中心</i>
+          </div>
+          <div @click="jumpTo('/useCenter',3)" :class="routerIdx == 3 ? 'on' : ''">
+              <i>用户中心</i>
+          </div>
 			</div>
 			<div class="head_tx">
 				<span><img src="../assets/images/sentinel/hz_tx.png" /></span>
@@ -72,7 +73,23 @@
             <p>所在街道:无</p>
             <p>事件坐标:{{eventDetails.longitude}};{{eventDetails.latitude}}</p>
             <p>所属部门:无</p>
-            <p>处理流程:<a  @click="dialogVisible = true">详情</a></p>
+<!--            <p>处理流程:<a  @click="dialogVisible = true">详情</a></p>-->
+            <p>处理流程:<a  @click="ceshi">详情</a></p>
+            <button v-if="eventDetails.eventStatus=='event_confirmation'" @click="eventSignature(eventDetails)">签收</button>
+            <button v-if="eventDetails.eventStatus=='event_signature'" @click="configDept(eventDetails)">联动</button>
+            <button v-if="eventDetails.eventStatus=='event_signature'" @click="eventCompletion(eventDetails)">办结</button>
+            <button v-if="eventDetails.eventStatus=='event_completion'" @click="eventReview(eventDetails)">审核</button>
+            <button v-if="eventDetails.eventStatus=='event_archiving'" @click="eventArchiving(eventDetails)">归档</button>
+            <el-tree class="tree-border tree_scroll" style="height: 20vh; overflow-y:scroll" :data="deptOptionsLiandong" v-if="eventDetails.eventStatus=='event_confirmation'||eventDetails.eventStatus=='event_signature'"
+                     show-checkbox ref="LiandongDept" node-key="id" :check-strictly="true"
+                     :accordion="true" empty-text="加载中,请稍候" :props="defaultProps"></el-tree>
+            <div v-if="eventDetails.eventStatus=='event_completion'">
+              <el-radio-group v-model="reviewStatus" v-for="(item,idx) in reviewStatusList">
+                <el-radio :label="item.value" :name="item.value">{{ item.name }}</el-radio>
+              </el-radio-group>
+            </div>
+            <textarea v-model="reviewDescription"> </textarea>
+            <button @click="addEventLogDescription(eventDetails)">发送</button>
           </div>
         </div>
         <!--弹框 开始-->
@@ -174,11 +191,28 @@
 		selectByDeviceId,selectDailyThreshold
 	} from "@/api/sentinel"
     let echarts = require("echarts");
-    import {getEventList, getEventLog} from "@/api/event";
+    import {
+      addEventLogDescription,
+      getDescriptionById,
+      getEventLog,
+      eventSignature,
+      eventCompletion,
+      eventReview,
+      eventArchiving,
+      configDept
+    } from "@/api/event";
+    import {
+      treeselectAll
+    } from '@/api/system/dept'
   export default {
     name: 'MyChart',
     components: {
-        supermap
+      supermap,
+    },
+    watch: {
+      filterText(val) {
+        this.$refs.LiandongDept.filter(val)
+      }
     },
     metaInfo() {
       return {
@@ -205,14 +239,27 @@
         eventDetails:{},                // 事件详情信息
         dialogVisible: false,           // 事件日志显隐框
         activities:[],                  // 事件日志信息
+
+        deptOptionsLiandong: [],        //联动部门
+        defaultProps: {
+          children: "children",
+          label: "label",
+        },
+
+        reviewStatus:true,
+        reviewStatusList:[
+          {name:'通过',value:true},
+          {name:'不通过',value:false},
+        ],
+        reviewDescription:'',
       }
 		},
     created() {
-
+      this.getDeptTreeselect();
     },
     mounted() {
-        // 初始定向到驾驶舱
-        this.$router.push({
+      // 初始定向到驾驶舱
+      this.$router.push({
             path:'/SentryCockpit'
         })
 			// 初始化地图数据
@@ -447,6 +494,114 @@
       handleClose(done) {
         done();
       },
+      getDescriptionById(eventId){
+        getDescriptionById(eventId).then(req => {
+          this.eventDetails = req.data;
+        })
+      },
+      // 添加日志信息
+      addEventLogDescription(params){
+        addEventLogDescription({eventId:params.eventId,reviewDescription:this.reviewDescription}).then(req => {
+          if(req.code == 200){
+            this.$modal.msgSuccess('保存成功');
+          }
+        })
+      },
+
+      // 获取部门列表树
+      getDeptTreeselect(){
+        treeselectAll().then((response) => {
+          let deptId=Cookies.get("deptId")
+          this.recursiveChildren(response.data,deptId)
+          this.deptOptionsLiandong = response.data;
+        });
+      },
+      //设置联动部门不可选择本部门
+      recursiveChildren(arrayList,deptId) {
+        arrayList.forEach((item, index) => {
+          if(item.id==deptId){
+            item.disabled="true";
+            return
+          }
+          if(item.children){
+            this.recursiveChildren(item.children,deptId)
+          }
+        });
+      },
+
+      // 签收
+      eventSignature(params){
+        const qsParams = {};
+        const deptList = [];
+        let array = this.$refs.LiandongDept.getCheckedNodes();
+        if(array!=null && array.length!=0){
+          for(let item of array){
+            deptList.push({mapDeptId:item.id,mapDeptName:item.label});
+          }
+          qsParams.deptList = deptList;
+        }
+        qsParams.eventId = params.eventId;
+        eventSignature(qsParams).then(req => {
+          if(req.code == 200){
+            this.$modal.msgSuccess( '签收成功')
+            this.getDescriptionById(params.eventId);
+            this.$refs.senEventCenter.getSupermapEvent();
+          }
+        })
+      },
+      // 联动
+      configDept(params){
+        const qsParams = {};
+        const deptList = [];
+        let array = this.$refs.LiandongDept.getCheckedNodes();
+        if(array!=null && array.length!=0){
+          for(let item of array){
+            deptList.push({mapDeptId:item.id,mapDeptName:item.label});
+          }
+          qsParams.deptList = deptList;
+        }
+        qsParams.eventId = params.eventId;
+        configDept(qsParams).then(req => {
+          if(req.code == 200){
+            this.$modal.msgSuccess( '签收成功')
+            this.getDescriptionById(params.eventId);
+          }
+        })
+      },
+      // 办结
+      eventCompletion(eventDetails){
+        eventCompletion(eventDetails.eventId).then(req => {
+          if(req.code == 200){
+            this.$modal.msgSuccess( '办结成功')
+            this.getDescriptionById(eventDetails.eventId);
+            this.$refs.senEventCenter.getSupermapEvent();
+          }
+        })
+      },
+      // 审核
+      eventReview(eventDetails){
+        if(!this.reviewStatus&&this.reviewDescription==''){
+          this.$modal.loading( '请填写不通过审核意见!!!')
+        }
+        const param = {eventId:eventDetails.eventId,reviewStatus:this.reviewStatus,reviewDescription:this.reviewDescription}
+        eventReview(param).then(req => {
+          if(req.code == 200){
+            this.$modal.msgSuccess( '审核操作成功')
+            this.getDescriptionById(eventDetails.eventId);
+            this.$refs.senEventCenter.getSupermapEvent();
+          }
+        })
+      },
+      // 归档
+      eventArchiving(params){
+        eventArchiving(params.eventId).then(req => {
+          if(req.code == 200){
+            this.$modal.msgSuccess( '归档成功')
+            this.getDescriptionById(params.eventId);
+            this.$refs.senEventCenter.getSupermapEvent();
+          }
+        })
+      },
     }
 }
 </script>