From c819024e241b9f7c54cc3786373ad0d2998f2190 Mon Sep 17 00:00:00 2001
From: 马宇豪 <978517621@qq.com>
Date: 星期五, 05 五月 2023 08:55:46 +0800
Subject: [PATCH] 修改

---
 src/views/doublePreventAction/hiddenDanger/inspectionStatistics/index.vue |  228 +++++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 213 insertions(+), 15 deletions(-)

diff --git a/src/views/doublePreventAction/hiddenDanger/inspectionStatistics/index.vue b/src/views/doublePreventAction/hiddenDanger/inspectionStatistics/index.vue
index 8e7db67..13c4558 100644
--- a/src/views/doublePreventAction/hiddenDanger/inspectionStatistics/index.vue
+++ b/src/views/doublePreventAction/hiddenDanger/inspectionStatistics/index.vue
@@ -3,39 +3,130 @@
         <div class="inspectionStatistics_part">
             <div class="inspectionStatistics_part_person">
                 <div class="inspectionStatistics_part_title">{{"巡检人员统计"}}</div>
-                <el-divider></el-divider>
+                <div class="inspectionStatistics_part_time">
+                    <el-select v-model="personListQuery.depId" @change="changeInspectionPerson">
+                        <el-option
+                            v-for="item in departmentList"
+                            :key="item.id"
+                            :value="item.id"
+                            :label="item.department"
+                        >
+                        </el-option>
+                    </el-select>
+                </div>
+                <div class="inspectionStatistics_part_time">
+
+                    <el-date-picker
+                    v-model="value1"
+                    type="daterange"
+                    range-separator="至"
+                    start-placeholder="开始日期"
+                    value-format="yyyy-MM-dd HH:mm:ss"
+                    :default-time="['00:00:00','23:59:59']"
+                    @change="changeTimeInspectionPerson"
+                    end-placeholder="结束日期">
+                    </el-date-picker>
+                </div>
+                    <el-divider></el-divider>
                 <div class="inspectionStatistics_part_body">
-                    <inspection-person></inspection-person>
+                    <inspection-person ref="inspectionPerson"></inspection-person>
                 </div>
             </div>
         </div>
         <div class="inspectionStatistics_part">
             <div class="inspectionStatistics_part_complete">
                 <div class="inspectionStatistics_part_title">{{"巡检完成统计"}}</div>
+                <div class="inspectionStatistics_part_time" style="width:150px">
+                    <el-select v-model="completeListQuery.depId" @change="changeInspectionComplete">
+                        <el-option
+                            v-for="item in departmentList"
+                            :key="item.id"
+                            :value="item.id"
+                            :label="item.department"
+                        >
+                        </el-option>
+                    </el-select>
+                </div>
+                <div class="inspectionStatistics_part_time" style="width:100px">
+                    <el-select v-model="completeListQuery.status" @change="changeInspectionComplete">
+                        <el-option
+                            v-for="item in stateList"
+                            :key="item.id"
+                            :value="item.id"
+                            :label="item.name"
+                        >
+                        </el-option>
+                    </el-select>
+                </div>
+                <div class="inspectionStatistics_part_time">
+                    <el-date-picker
+                    v-model="value2"
+                    type="daterange"
+                    range-separator="至"
+                    value-format="yyyy-MM-dd HH:mm:ss"
+                    :default-time="['00:00:00','23:59:59']"
+                    @change="changeCompleteTimeInspectionPerson"
+                    start-placeholder="开始日期"
+                    end-placeholder="结束日期">
+                    </el-date-picker>
+                </div>
                 <el-divider></el-divider>
                 <div class="inspectionStatistics_part_body">
-                    <inspection-complete></inspection-complete>
+                    <inspection-complete ref="inspectionComplete"></inspection-complete>
                 </div>
             </div>
         </div>
         <div class="inspectionStatistics_part">
             <div class="inspectionStatistics_part_today">
-                <div class="inspectionStatistics_part_title">{{"今日异常完成"}}</div>
+                <div class="inspectionStatistics_part_title">{{"巡检任务统计"}}</div>
+                <div class="inspectionStatistics_part_time">
+                    <el-select v-model="taskListQuery.depId" @change="changeInspectionTask">
+                        <el-option
+                            v-for="item in departmentList"
+                            :key="item.id"
+                            :value="item.id"
+                            :label="item.department"
+                        >
+                        </el-option>
+                    </el-select>
+                </div>
+                <div class="inspectionStatistics_part_time">
+
+                    <el-date-picker
+                        v-model="value3"
+                        type="daterange"
+                        range-separator="至"
+                        start-placeholder="开始日期"
+                        value-format="yyyy-MM-dd HH:mm:ss"
+                        :default-time="['00:00:00','23:59:59']"
+                        @change="changeTimeTask"
+                        end-placeholder="结束日期">
+                    </el-date-picker>
+                </div>
                 <el-divider></el-divider>
                 <div class="inspectionStatistics_part_body">
-                    <today-unusual></today-unusual>
+                    <today-unusual ref="todayUnusual"></today-unusual>
                 </div>
             </div>
         </div>
-        <div class="inspectionStatistics_part">
-            <div class="inspectionStatistics_part_unusual">
-                <div class="inspectionStatistics_part_title">{{"巡检异常统计"}}</div>
-                <el-divider></el-divider>
-                <div class="inspectionStatistics_part_body">
-                    <inspection-unusual></inspection-unusual>
-                </div>
-            </div>
-        </div>
+<!--        <div class="inspectionStatistics_part">-->
+<!--            <div class="inspectionStatistics_part_unusual">-->
+<!--                <div class="inspectionStatistics_part_title">{{"巡检异常统计"}}</div>-->
+<!--                <div class="inspectionStatistics_part_time">-->
+<!--                    <el-date-picker-->
+<!--                    v-model="value3"-->
+<!--                    type="daterange"-->
+<!--                    range-separator="至"-->
+<!--                    start-placeholder="开始日期"-->
+<!--                    end-placeholder="结束日期">-->
+<!--                    </el-date-picker>-->
+<!--                </div>-->
+<!--                <el-divider></el-divider>-->
+<!--                <div class="inspectionStatistics_part_body">-->
+<!--                    <inspection-unusual></inspection-unusual>-->
+<!--                </div>-->
+<!--            </div>-->
+<!--        </div>-->
     </div>
 </template>
 
@@ -44,20 +135,122 @@
     import inspectionComplete from './components/inspectionComplete/index'
     import inspectionUnusual from './components/inspectionUnusual/index'
     import todayUnusual from './components/todayUnusual/index'
+import { getInspectionCount } from '../../../../api/inspectionTask'
+    import {getDepartmentList} from "../../../../api/departmentManage";
     export default {
         name: "index",
+        data() {
+            return {
+                value1:['',''],
+                value2:['',''],
+                value3:['',''],
+                departmentList:[],
+                listQuery:{
+                "dateList": [
+                ],
+                "endDate": "",
+                "execUid": null,
+                "startDate": ""
+                },
+                personListQuery:{
+                    depId:41,
+                    startTime:'',
+                    endTime:'',
+                },
+                completeListQuery:{
+                    depId:41,
+                    startTime:'',
+                    endTime:'',
+                    status:1,
+                },
+                taskListQuery:{
+                    depId:41,
+                    startTime:'',
+                    endTime:'',
+                },
+                stateList:[
+                    {id:1,name:'正常'},
+                    {id:2,name:'存在隐患'},
+                    {id:3,name:'未处理'}
+                ]
+            }
+        },
         components : {
             inspectionPerson,
             inspectionComplete,
             inspectionUnusual,
             todayUnusual
+        },
+        created() {
+            this.getDepartment()
+        },
+        mounted() {
+            this.setTimeValue()
+        },
+        methods: {
+            setTimeValue() {
+                let newTime =  new Date()
+                this.value1 = [(newTime.getFullYear()+ '-' + ((newTime.getMonth() + 1) < 10 ? '0' + (newTime.getMonth() + 1) : (newTime.getMonth() + 1)) + '-' +  '01').toString() + ' '  + '00:00:00',(newTime.getFullYear()+ '-' + ((newTime.getMonth() + 1) < 10 ? '0' + (newTime.getMonth() + 1) : (newTime.getMonth() + 1)) + '-' + newTime.getDate()).toString() + ' ' + '23:59:59']
+                this.personListQuery.startTime = this.value1[0]
+                this.personListQuery.endTime = this.value1[1]
+                this.$refs.inspectionPerson.updateData(this.personListQuery)
+                this.value2 = [(newTime.getFullYear()+ '-' + ((newTime.getMonth() + 1) < 10 ? '0' + (newTime.getMonth() + 1) : (newTime.getMonth() + 1)) + '-' +  '01').toString() + ' '  + '00:00:00',(newTime.getFullYear()+ '-' + ((newTime.getMonth() + 1) < 10 ? '0' + (newTime.getMonth() + 1) : (newTime.getMonth() + 1)) + '-' + newTime.getDate()).toString() + ' ' + '23:59:59']
+                this.completeListQuery.startTime = this.value2[0]
+                this.completeListQuery.endTime = this.value2[1]
+                this.$refs.inspectionComplete.updateData(this.completeListQuery)
+                this.value3 = [(newTime.getFullYear()+ '-' + ((newTime.getMonth() + 1) < 10 ? '0' + (newTime.getMonth() + 1) : (newTime.getMonth() + 1)) + '-' +  '01').toString() + ' '  + '00:00:00',(newTime.getFullYear()+ '-' + ((newTime.getMonth() + 1) < 10 ? '0' + (newTime.getMonth() + 1) : (newTime.getMonth() + 1)) + '-' + newTime.getDate()).toString() + ' ' + '23:59:59']
+                this.taskListQuery.startTime = this.value3[0]
+                this.taskListQuery.endTime = this.value3[1]
+                this.$refs.todayUnusual.updateData(this.taskListQuery)
+            },
+            changeTimeInspectionPerson() {
+                if(this.value1 !== null){
+                    this.personListQuery.startTime = this.value1[0]
+                    this.personListQuery.endTime = this.value1[1]
+                }
+                this.$refs.inspectionPerson.updateData(this.personListQuery)
+            },
+            changeTimeTask(){
+                if(this.value3 !== null){
+                    this.taskListQuery.startTime = this.value3[0]
+                    this.taskListQuery.endTime = this.value3[1]
+                }
+                this.$refs.todayUnusual.updateData(this.taskListQuery)
+            },
+            changeCompleteTimeInspectionPerson() {
+                if(this.value2 !== null){
+                    this.completeListQuery.startTime = this.value2[0]
+                    this.completeListQuery.endTime = this.value2[1]
+                }
+                this.$refs.inspectionComplete.updateData(this.completeListQuery)
+            },
+            changeInspectionTask() {
+                this.$refs.todayUnusual.updateData(this.taskListQuery)
+            },
+            changeInspectionPerson() {
+                this.$refs.inspectionPerson.updateData(this.personListQuery)
+            },
+            changeInspectionComplete() {
+                this.$refs.inspectionComplete.updateData(this.completeListQuery)
+            },
+            async getDepartment(){
+                let res = await getDepartmentList({pageSize:1000,pageIndex:1})
+                if(res.data.code === '200'){
+                    this.departmentList = res.data.result.result
+                }else{
+                    this.$message({
+                        message:res.data.message,
+                        type:'warning'
+                    })
+                }
+            },
         }
     }
 </script>
 
 <style scoped>
     /deep/.el-divider--horizontal {
-        margin-top: 0px !important;
+        margin-top: 1px !important;
     }
     .inspectionStatistics{
         width:100%;
@@ -80,9 +273,14 @@
         height:60px;
         line-height: 60px;
         padding-left:20px;
+        display: inline-block;
+        width:20%;
     }
     .inspectionStatistics_part_body{
         width:100%;
         height:410px;
     }
+    .inspectionStatistics_part_time{
+        display: inline-block;
+    }
 </style>

--
Gitblit v1.9.2