Hwt 2 years ago
parent
commit
e5d369e742

+ 4 - 4
operationSupport/src/router/dynamicMuen.js

@@ -84,10 +84,10 @@ const staticMuen = [
     //     path: '/employeeServices',
     //     component: () => import(/* webpackChunkName: "404" */ '@views/workOrders/employeeServices/index.vue')
     // },
-    // {
-    //     path: '/PatrolStatistics',
-    //     component: () => import(/* webpackChunkName: "404" */ '@views/patrolManagement/PatrolStatistics.vue')
-    // },
+    {
+        path: '/patrolPointStatistics',
+        component: () => import(/* webpackChunkName: "404" */ '@views/patrolManagement/patrolPointStatistics.vue')
+    },
     {
         path: '*',
         redirect: '/404'

+ 91 - 42
operationSupport/src/views/patrolManagement/PatrolStatistics.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author:韩玮涛
  * @Date: 2022-08-08 09:38:04
- * @LastEditTime: 2022-08-08 15:50:51
+ * @LastEditTime: 2022-08-10 15:11:30
  * @LastEditors: D4THYL3
  * @Description: In User Settings Edit
  * @FilePath: \operationSupport\src\views\patrolManagement\PatrolStatistics.vue
@@ -78,22 +78,22 @@
         ></el-table-column>
 
         <el-table-column
-          prop="communityName"
+          prop="routeName"
           label="巡更路线"
         ></el-table-column>
 
         <el-table-column
-          prop="communityName"
+          prop="userName"
           label="巡更人员"
         ></el-table-column>
 
         <el-table-column
-          prop="communityName"
+          prop="patrolDate"
           label="巡更日期"
         ></el-table-column>
 
         <el-table-column
-          prop="communityName"
+          prop="patrolTime"
           label="巡更时间"
         ></el-table-column>
 
@@ -109,7 +109,11 @@
             :key="ine"
           >
             <template slot-scope="scope">
-              {{ it.optionValue[scope.$index]}}
+              <span
+                v-if="it.optionId[scope.$index] == 1 ? true : false"
+                style="color: red;"
+              >{{ it.optionValue[scope.$index]}}</span>
+              <span v-else>{{ it.optionValue[scope.$index]}}</span>
             </template>
           </el-table-column>
         </el-table-column>
@@ -132,36 +136,31 @@
 </template>
 
 <script>
+import { statSync } from 'fs';
 export default {
   data () {
     return {
-      tableData: [
-        {
-          communityName: '222222',
-          index: '1'
-        },
-        {
-          communityName: '555555',
-          index: '2'
-        },
-      ],
-      outermostTitle: [
-        {
-          oneTitle: '1111',
-          twoTitle: [
-            {
-              title: '55566',
-              optionValue: ['5555', '44444', '33333'],
-            },
-            {
-              title: '666644',
-              optionValue: ['7777', '147878']
-            }
-          ]
-        }, {
-          oneTitle: '2222'
-        }
-      ],
+      tableData: [],
+      outermostTitle: [],
+      // outermostTitle: [
+      //   {
+      //     oneTitle: '1111',
+      //     twoTitle: [
+      //       {
+      //         title: '55566',
+      //         optionValue: ['5555', '44444', '33333'],
+      //         optionId: [],
+      //       },
+      //       {
+      //         title: '666644',
+      //         optionValue: ['7777', '147878'],
+      //         optionId: [],
+      //       }
+      //     ]
+      //   }, {
+      //     oneTitle: '2222'
+      //   }
+      // ],
       pageset: {
         total: 0,
         pageSize: 1,
@@ -170,6 +169,8 @@ export default {
       },
       currentPage: 1,
       mixins_query: {
+        pageNum: '1',
+        pageSize: '15',
         communityId: '',
         patrolType: '',
         startTime: '',
@@ -179,23 +180,23 @@ export default {
       communityList: [],
       patrolTypeList: [{
         label: '市容市貌',
-        value: '1'
+        value: 1
       },
       {
         label: '环境卫生',
-        value: '2'
+        value: 2
       },
       {
         label: '公共秩序',
-        value: '3'
+        value: 3
       },
       {
         label: '设备设施',
-        value: '4'
+        value: 4
       },
       {
         label: '消防安全',
-        value: '5'
+        value: 5
       },]
 
     }
@@ -237,7 +238,8 @@ export default {
           // 默认选中第一个
           this.mixins_query.communityId = this.communityList[0].id;
           // 默认选择市容市貌
-          this.mixins_query.patrolType = '1';
+          this.mixins_query.patrolType = 1;
+          this.mixinsQuery();
         }
       })
     },
@@ -249,14 +251,61 @@ export default {
       }
       this.mixins_query.startTime = !!arr[0] ? arr[0] + ' 00:00:00' : '';
       this.mixins_query.endTime = !!arr[1] ? arr[1] + ' 23:59:59' : '';
-      console.log('5555', this.mixins_query);
     },
     mixins_search () {
-      console.log('11');
+      if (this.mixins_query.communityId == "" || this.mixins_query.patrolType == "") {
+        this.$message.error('请选择社区或巡更类型');
+      } else {
+        this.mixinsQuery();
+      }
+
     },
     exportExcel () {
-      // this.__exportExcel('/czc-community/assets/building/export/excel');
+      this.__exportExcel('/czc-community/patrol/record/standard/export/list');
     },
+    mixinsQuery () {
+      this.$http.post('/czc-community/patrol/record/standard/page', this.mixins_query).then(({ status, data, msg }) => {
+        if (status == 0) {
+          this.tableData = [];
+          this.outermostTitle = [];
+          data.list.forEach((item, index) => {
+            this.tableData.push({
+              communityName: item.communityName,
+              patrolDate: item.patrolDate,
+              patrolTime: item.patrolTime,
+              routeName: item.routeName,
+              userName: item.userName
+            })
+            item.details.forEach((items, indexs) => {
+              if (index == 0) {
+                this.outermostTitle.push({
+                  twoTitle: [],
+                  oneTitle: items.patrolType == 1 ? '市容市貌' : items.patrolType == 2 ? '环境卫生' : items.patrolType == 3 ? '公共秩序' : items.patrolType == 4 ? '设备设施' : items.patrolType == 5 ? '消防安全' : '-'
+                })
+                items.list.forEach((itd, ind) => {
+                  this.outermostTitle[indexs].twoTitle.push({
+                    title: itd.content,
+                    optionValue: [],
+                    optionId: []
+                  })
+                })
+                items.list.forEach((itds, inds) => {
+                  this.outermostTitle[indexs].twoTitle[inds].optionValue.push(itds.optionValue);
+                  this.outermostTitle[indexs].twoTitle[inds].optionId.push(itds.status);
+                })
+              } else {
+                items.list.forEach((itds, inds) => {
+                  this.outermostTitle[indexs].twoTitle[inds].optionValue.push(itds.optionValue);
+                  this.outermostTitle[indexs].twoTitle[inds].optionId.push(itds.status);
+                })
+              }
+            })
+          })
+        }
+      })
+    }
+
+
   },
   created () {
     this.communityNameList();

+ 254 - 0
operationSupport/src/views/patrolManagement/patrolPointStatistics.vue

@@ -0,0 +1,254 @@
+<!--
+ * @Author: 韩玮涛
+ * @Date: 2022-08-10 09:21:59
+ * @LastEditTime: 2022-08-10 15:16:08
+ * @LastEditors: D4THYL3
+ * @Description: In User Settings Edit
+ * @FilePath: \operationSupport\src\views\patrolManagement\patrolPointStatistics.vue
+-->
+<template>
+  <div class="main">
+    <div class="search">
+      <el-input
+        placeholder="请输入巡更点名称"
+        class="search-input"
+        clearable
+        v-model="mixins_query.pointName"
+      ></el-input>
+
+      <el-select
+        v-model="mixins_query.communityId"
+        placeholder="请选择所属社区"
+        clearable
+      >
+        <el-option
+          v-for="(item, index) in communityArr"
+          :key="index"
+          :label="item.communityName"
+          :value="item.id"
+        ></el-option>
+      </el-select>
+
+      <el-select
+        v-model="mixins_query.pointStatus"
+        placeholder="请选择状态"
+        clearable
+      >
+        <el-option
+          label="正常"
+          value="1"
+        ></el-option>
+        <el-option
+          label="异常"
+          value="2"
+        ></el-option>
+      </el-select>
+      <el-date-picker
+        v-model="times"
+        value-format="yyyy-MM-dd"
+        type="daterange"
+        range-separator="至"
+        start-placeholder="开始日期"
+        end-placeholder="结束日期"
+        @change="effectiveDateToggle"
+      ></el-date-picker>
+      <el-button
+        type="primary"
+        class="search-btn"
+        @click="mixins_search"
+        icon="el-icon-search"
+      >查询</el-button>
+      <div class="search-icon">
+        <el-tooltip
+          class="item"
+          effect="light"
+          placement="bottom"
+          content="导出"
+        >
+          <i
+            class="zoniot_font zoniot-icon-daochu2"
+            @click="exportExcel()"
+          ></i>
+        </el-tooltip>
+      </div>
+    </div>
+    <zz-table
+      :cols="cols"
+      :settings="{ showIndex: true, stripe: true }"
+      :loading="mixins_onQuery"
+      :data="mixins_list"
+      :pageset="mixins_pageset"
+      @page-change="pageChange"
+    >
+      <template
+        slot="picturePath"
+        slot-scope="scope"
+      >
+
+        <div v-if="!!scope.row.picturePath">
+          <div
+            class="imgVdio"
+            v-for="item in scope.row.picturePath.split(',')"
+            :key="item"
+          >
+            <video
+              v-if="typeVideo(item)"
+              :src="item"
+              @click="lookVideos(item)"
+            ></video>
+            <el-image
+              class="imgs"
+              v-else
+              :src="item"
+              :preview-src-list="[item]"
+            ></el-image>
+          </div>
+        </div>
+
+      </template>
+
+    </zz-table>
+  </div>
+</template>
+
+
+<script>
+import list from '@utils/list.js';
+
+export default {
+  mixins: [list],
+  data () {
+    return {
+      communityId: '',
+      mixins_query: {
+        communityId: ''
+      },
+      times: [],
+      communityArr: [],
+      mixins_post: 'post',
+      cols: [
+        {
+          label: '所属社区',
+          prop: 'communityName'
+        },
+        {
+          label: '巡更路线',
+          prop: 'routeName'
+        },
+        {
+          label: '巡更人员',
+          prop: 'partolName'
+        },
+        {
+          label: '巡更日期',
+          prop: 'patrolDate'
+        },
+        {
+          label: "巡更班次",
+          prop: 'patrolTime'
+        },
+        {
+          label: "巡更点",
+          prop: 'pointName'
+        },
+        {
+          label: "状态",
+          prop: 'pointStatus',
+          format (val) {
+            if (val == 1) {
+              return '正常'
+            } else if (val == 2) {
+              return '异常'
+            }
+          }
+        },
+        {
+          label: '巡更结果',
+          prop: 'result'
+        },
+        {
+          label: '图片/视频',
+          prop: 'picturePath',
+          slot: 'picturePath'
+        },
+        {
+          label: '签到时间',
+          prop: 'checkTime'
+        }
+      ]
+    }
+  },
+  methods: {
+    exportExcel () {
+      this.__exportExcel('/czc-community/patrol/point/getPointHistoryExcel');
+    },
+    effectiveDateToggle (va) {
+      let arr = va;
+      if (!arr) {
+        arr = ['', ''];
+      }
+      this.mixins_query.startTime = !!arr[0] ? arr[0] + ' 00:00:00' : '';
+      this.mixins_query.endTime = !!arr[1] ? arr[1] + ' 23:59:59' : '';
+    },
+    getorgTree () {
+      this.$http.get('/czc-community/assets/community/list').then(({ data, msg, status }) => {
+        if (status == 0) {
+          this.communityArr = [];
+          data.forEach((item) => {
+            this.communityArr.push({
+              communityName: item.communityName,
+              id: item.id
+            })
+          })
+          this.mixins_query.communityId = this.communityArr[0].id;
+          this.mixins_dataUrl = '/czc-community/patrol/point/list/pointHistory';
+          this.mixins_search();
+
+        }
+      })
+
+        .catch(function () { });
+    },
+
+    typeVideo (str) {
+      let type = str.slice(str.lastIndexOf('.') + 1, str.length);
+      let videoType = ['mp4'];
+      return videoType.includes(type);
+    },
+    lookVideos (src) {
+      new Promise((resolve) => {
+        this.$store.dispatch('addPopup', {
+          url: '/lookVideo.vue',
+          width: '600px',
+          height: '500px',
+          props: {
+            src: src,
+            callback: resolve
+          },
+          showConfirmButton: true,
+          showCancelButton: true,
+          hideStar: true,
+          title: '查看视频'
+        });
+      }).then(() => {
+        this.mixins_search();
+      });
+    },
+  },
+  created () {
+    this.getorgTree();
+  }
+}
+</script>
+
+<style scoped lang='scss'>
+.imgVdio {
+    display: inline-block;
+    margin-right: 10px;
+    .imgs,
+    video {
+        width: 64px;
+        cursor: pointer;
+    }
+}
+</style>