瀏覽代碼

巡检详情

Hwt 2 年之前
父節點
當前提交
2f0ed1a776

+ 175 - 134
operationSupport/src/views/facilityInspections/inspectionsRecords.vue

@@ -1,148 +1,189 @@
 <template>
-    <div class="main">
-        <div class="search">
-            <el-input placeholder="请输入巡检任务/人员" class="search-input" clearable v-model="mixins_query.currentUsers"></el-input>
-            <el-select class="width90" placeholder="请选择巡检状态" v-model="mixins_query.inspectionStatus" clearable>
-                <el-option label="待执行" :value="1"></el-option>
-                <el-option label="执行中" :value="2"></el-option>
-                <el-option label="已完成" :value="3"></el-option>
-                <el-option label="已完成(超时)" :value="4"></el-option>
-                <el-option label="已逾期" :value="5"></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>
-        <zz-table
-            :cols="cols"
-            :settings="{ showIndex: true, stripe: true }"
-            :loading="mixins_onQuery"
-            :data="mixins_list"
-            :pageset="mixins_pageset"
-            @page-change="pageChange"
-        >
-            <template slot-scope="scope" slot="opt">
-                <div class="opt">
-                    <el-tooltip effect="light" placement="bottom" content="详情">
-                        <i class="zoniot_font zoniot-icon-xiangqing" @click="lookDetails(scope.row)"></i>
-                    </el-tooltip>
-                </div>
-            </template>
-        </zz-table>
+  <div class="main">
+    <div class="search">
+      <el-input
+        placeholder="请输入巡检任务/人员"
+        class="search-input"
+        clearable
+        v-model="mixins_query.currentUsers"
+      ></el-input>
+      <el-select
+        class="width90"
+        placeholder="请选择巡检状态"
+        v-model="mixins_query.inspectionStatus"
+        clearable
+      >
+        <el-option
+          label="待执行"
+          :value="1"
+        ></el-option>
+        <el-option
+          label="执行中"
+          :value="2"
+        ></el-option>
+        <el-option
+          label="已完成"
+          :value="3"
+        ></el-option>
+        <el-option
+          label="已完成(超时)"
+          :value="4"
+        ></el-option>
+        <el-option
+          label="已逾期"
+          :value="5"
+        ></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>
+    <zz-table
+      :cols="cols"
+      :settings="{ showIndex: true, stripe: true }"
+      :loading="mixins_onQuery"
+      :data="mixins_list"
+      :pageset="mixins_pageset"
+      @page-change="pageChange"
+    >
+      <template
+        slot-scope="scope"
+        slot="opt"
+      >
+        <div class="opt">
+          <el-tooltip
+            effect="light"
+            placement="bottom"
+            content="详情"
+          >
+            <i
+              class="zoniot_font zoniot-icon-xiangqing"
+              @click="lookDetails(scope.row)"
+            ></i>
+          </el-tooltip>
+        </div>
+      </template>
+    </zz-table>
+  </div>
 </template>
 
 <script>
 import list from '@utils/list.js';
 export default {
-    mixins: [list],
-    name: 'workOrdersRecords',
-    data() {
-        return {
-            communityArr: [],
-            cols: [
-                {
-                    label: '所属社区',
-                    prop: 'communityName'
-                },
-                {
-                    label: '巡检任务',
-                    prop: 'inspectionName'
-                },
-                {
-                    label: '巡检人员',
-                    prop: 'peopleName'
-                },
-                {
-                    label: '设备/设施类型',
-                    prop: 'typeValue'
-                },
-                {
-                    label: '计划开始时间',
-                    prop: 'startDate'
-                },
-                {
-                    label: '计划结束时间',
-                    prop: 'endDate'
-                },
-                {
-                    label: '实际开始时间',
-                    prop: 'startTime'
-                },
-                {
-                    label: '实际结束时间',
-                    prop: 'endTime'
-                },
-                {
-                    label: '状态',
-                    prop: 'inspectionStatus',
-                    format(val) {
-                        if (val == 1) {
-                            return '待执行';
-                        } else if (val == 2) {
-                            return '执行中';
-                        } else if (val == 3) {
-                            return '已完成';
-                        } else if (val == 4) {
-                            return '已完成(超时)';
-                        } else if (val == 5) {
-                            return '已逾期';
-                        }
-                        return '--';
-                    }
-                },
-                {
-                    label: '操作',
-                    prop: 'id',
-                    slot: 'opt'
-                }
-            ],
-            times: [],
-            mixins_post: 'post'
-        };
-    },
-    created() {
-        this.mixins_dataUrl = '/sc-community/inspectionRecord/page';
-        this.mixins_query = {};
-        this.mixins_search();
-    },
-    mounted() {},
-    methods: {
-        effectiveDateToggle(va) {
-            let arr = va;
-            if (!arr) {
-                arr = ['', ''];
+  mixins: [list],
+  name: 'workOrdersRecords',
+  data () {
+    return {
+      communityArr: [],
+      cols: [
+        {
+          label: '所属社区',
+          prop: 'communityName'
+        },
+        {
+          label: '巡检任务',
+          prop: 'inspectionName'
+        },
+        {
+          label: '巡检人员',
+          prop: 'peopleName'
+        },
+        {
+          label: '设备/设施类型',
+          prop: 'typeValue'
+        },
+        {
+          label: '计划开始时间',
+          prop: 'startDate'
+        },
+        {
+          label: '计划结束时间',
+          prop: 'endDate'
+        },
+        {
+          label: '实际开始时间',
+          prop: 'startTime'
+        },
+        {
+          label: '实际结束时间',
+          prop: 'endTime'
+        },
+        {
+          label: '状态',
+          prop: 'inspectionStatus',
+          format (val) {
+            if (val == 1) {
+              return '待执行';
+            } else if (val == 2) {
+              return '执行中';
+            } else if (val == 3) {
+              return '已完成';
+            } else if (val == 4) {
+              return '已完成(超时)';
+            } else if (val == 5) {
+              return '已逾期';
             }
-            this.mixins_query.startTime = arr[0];
-            this.mixins_query.endTime = arr[1];
+            return '--';
+          }
         },
-        lookDetails(row) {
-            new Promise((resolve) => {
-                this.$store.dispatch('addPopup', {
-                    url: '/facilityInspections/popups/details.vue',
-                    width: '900px',
-                    height: '581px',
-                    props: {
-                        data: row,
-                        callback: resolve
-                    },
-                    showConfirmButton: true,
-                    showCancelButton: true,
-                    hideStar: true,
-                    title: '巡检详情'
-                });
-            }).then(() => {
-                this.mixins_search();
-            });
+        {
+          label: '操作',
+          prop: 'id',
+          slot: 'opt'
         }
+      ],
+      times: [],
+      mixins_post: 'post'
+    };
+  },
+  created () {
+    this.mixins_dataUrl = '/sc-community/inspectionRecord/page';
+    this.mixins_query = {};
+    this.mixins_search();
+  },
+  mounted () { },
+  methods: {
+    effectiveDateToggle (va) {
+      let arr = va;
+      if (!arr) {
+        arr = ['', ''];
+      }
+      this.mixins_query.startTime = arr[0];
+      this.mixins_query.endTime = arr[1];
+    },
+    lookDetails (row) {
+      debugger
+      new Promise((resolve) => {
+        this.$store.dispatch('addPopup', {
+          url: '/facilityInspections/popups/details.vue',
+          width: '900px',
+          height: '581px',
+          props: {
+            data: row,
+            callback: resolve
+          },
+          showConfirmButton: true,
+          showCancelButton: true,
+          hideStar: true,
+          title: '巡检详情'
+        });
+      }).then(() => {
+        this.mixins_search();
+      });
     }
+  }
 };
 </script>
 <style scoped lang='scss'>

+ 215 - 181
operationSupport/src/views/facilityInspections/popups/details.vue

@@ -1,198 +1,232 @@
 <template>
-    <div class="lookDetail">
-        <div class="list-item">
-            <div class="formContent-item_title">工单信息</div>
-            <el-form ref="form" label-width="110px">
-                <template v-for="(item, index) in formLook">
-                    <el-col :span="!!item.span ? item.span : 12" :key="index">
-                        <el-form-item :label="item.label">
-                            <template v-if="item.slot">
-                                <template v-if="item.slot === 'inspectionStatus'">
-                                    <span v-if="thisItem['inspectionStatus'] == 1">待执行</span>
-                                    <span v-else-if="thisItem['inspectionStatus'] == 2">执行中</span>
-                                    <span v-else-if="thisItem['inspectionStatus'] == 3">已完成</span>
-                                    <span v-else-if="thisItem['inspectionStatus'] == 4">已完成(超时)</span>
-                                    <span v-else-if="thisItem['inspectionStatus'] == 5">已逾期</span>
-                                    <span v-else>--</span>
-                                </template>
-                            </template>
-                            <template v-else>
-                                {{ thisItem[item.prop] || '--' }}
-                            </template>
-                        </el-form-item>
-                    </el-col>
+  <div class="lookDetail">
+    <div class="list-item">
+      <div class="formContent-item_title">工单信息</div>
+      <el-form
+        ref="form"
+        label-width="110px"
+      >
+        <template v-for="(item, index) in formLook">
+          <el-col
+            :span="!!item.span ? item.span : 12"
+            :key="index"
+          >
+            <el-form-item :label="item.label">
+              <template v-if="item.slot">
+                <template v-if="item.slot === 'inspectionStatus'">
+                  <span v-if="thisItem['inspectionStatus'] == 1">待执行</span>
+                  <span v-else-if="thisItem['inspectionStatus'] == 2">执行中</span>
+                  <span v-else-if="thisItem['inspectionStatus'] == 3">已完成</span>
+                  <span v-else-if="thisItem['inspectionStatus'] == 4">已完成(超时)</span>
+                  <span v-else-if="thisItem['inspectionStatus'] == 5">已逾期</span>
+                  <span v-else>--</span>
                 </template>
-            </el-form>
-        </div>
-        <div class="list-item">
-            <div class="formContent-item_title">设备巡检信息</div>
-            <zz-table
-                :cols="cols"
-                :settings="{ showIndex: true, stripe: true }"
-                :loading="mixins_onQuery"
-                :data="mixins_list"
-                :pageset="mixins_pageset"
-                @page-change="pageChange"
+              </template>
+              <template v-else>
+                {{ thisItem[item.prop] || '--' }}
+              </template>
+            </el-form-item>
+          </el-col>
+        </template>
+      </el-form>
+    </div>
+    <div class="list-item">
+      <div class="formContent-item_title">设备巡检信息</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"
             >
-                <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>
-                <template slot-scope="scope" slot="opt">
-                    <div class="opt">
-                        <el-tooltip effect="light" placement="bottom" content="详情" v-if="!!scope.row.id">
-                            <i class="zoniot_font zoniot-icon-xiangqing" @click="lookDetails(scope.row)"></i>
-                        </el-tooltip>
-                    </div>
-                </template>
-            </zz-table>
-        </div>
+              <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>
+        <template
+          slot-scope="scope"
+          slot="opt"
+        >
+          <div class="opt">
+            <el-tooltip
+              effect="light"
+              placement="bottom"
+              content="详情"
+              v-if="!!scope.row.id"
+            >
+              <i
+                class="zoniot_font zoniot-icon-xiangqing"
+                @click="lookDetails(scope.row)"
+              ></i>
+            </el-tooltip>
+          </div>
+        </template>
+      </zz-table>
     </div>
+  </div>
 </template>
 <script >
 import list from '@utils/list.js';
 export default {
-    props: ['params'],
-    mixins: [list],
-    data() {
-        return {
-            formLook: [
-                {
-                    label: '所属社区:',
-                    prop: 'communityName'
-                },
-                {
-                    label: '任务名称:',
-                    prop: 'inspectionName'
-                },
-                {
-                    label: '设备/设施类型:',
-                    prop: 'typeValue'
-                },
-                {
-                    label: '巡检人员:',
-                    prop: 'peopleName'
-                },
-                {
-                    label: '计划开始时间:',
-                    prop: 'startDate'
-                },
-                {
-                    label: '计划结束时间:',
-                    prop: 'endDate'
-                },
-                {
-                    label: '实际开始时间:',
-                    prop: 'startTime'
-                },
-                {
-                    label: '实际结束时间:',
-                    prop: 'endTime'
-                },
-                {
-                    label: '状态:',
-                    prop: 'inspectionStatus',
-                    slot: 'inspectionStatus'
-                }
-            ],
-            cols: [
-                {
-                    label: '设备编号',
-                    prop: 'no'
-                },
-                {
-                    label: '设备名称',
-                    prop: 'name'
-                },
-                {
-                    label: '地址',
-                    prop: 'address'
-                },
-                {
-                    label: '巡检时间',
-                    prop: 'checkTime'
-                },
-                {
-                    label: '巡检结果',
-                    prop: 'result'
-                },
-                {
-                    label: '图片/视频',
-                    prop: 'picturePath',
-                    slot: 'picturePath'
-                },
-                {
-                    label: '操作',
-                    prop: 'opt',
-                    slot: 'opt'
-                }
-            ],
-            thisItem: {},
-            mixins_post: 'post'
-        };
-    },
-
-    methods: {
-        lookDetails(row) {
-            new Promise((resolve) => {
-                this.$store.dispatch('addPopup', {
-                    url: '/facilityInspections/popups/itemDetails.vue',
-                    width: '500px',
-                    height: '500px',
-                    props: {
-                        data: row,
-                        callback: resolve
-                    },
-                    showConfirmButton: true,
-                    showCancelButton: true,
-                    hideStar: true,
-                    title: '巡检项详情'
-                });
-            }).then(() => {
-                this.mixins_search();
-            });
+  props: ['params'],
+  mixins: [list],
+  data () {
+    return {
+      formLook: [
+        {
+          label: '所属社区:',
+          prop: 'communityName'
+        },
+        {
+          label: '任务名称:',
+          prop: 'inspectionName'
+        },
+        {
+          label: '设备/设施类型:',
+          prop: 'typeValue'
+        },
+        {
+          label: '巡检人员:',
+          prop: 'peopleName'
+        },
+        {
+          label: '计划开始时间:',
+          prop: 'startDate'
+        },
+        {
+          label: '计划结束时间:',
+          prop: 'endDate'
         },
-        getDatali(id) {
-            this.mixins_dataUrl = '/sc-community/inspectionRecord/findDetail';
-            this.mixins_query = {
-                id: id,
-                type: this.params.data.type
-            };
-            this.mixins_search();
+        {
+          label: '实际开始时间:',
+          prop: 'startTime'
         },
-        typeVideo(str) {
-            let type = str.slice(str.lastIndexOf('.') + 1, str.length);
-            let videoType = ['mp4'];
-            return videoType.includes(type);
+        {
+          label: '实际结束时间:',
+          prop: 'endTime'
         },
-        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();
-            });
+        {
+          label: '状态:',
+          prop: 'inspectionStatus',
+          slot: 'inspectionStatus'
         }
+      ],
+      cols: [
+        {
+          label: '设备编号',
+          prop: 'no'
+        },
+        {
+          label: '设备名称',
+          prop: 'name'
+        },
+        {
+          label: '地址',
+          prop: 'address'
+        },
+        {
+          label: '巡检时间',
+          prop: 'checkTime'
+        },
+        {
+          label: '巡检结果',
+          prop: 'result'
+        },
+        {
+          label: '图片/视频',
+          prop: 'picturePath',
+          slot: 'picturePath'
+        },
+        {
+          label: '操作',
+          prop: 'opt',
+          slot: 'opt'
+        }
+      ],
+      thisItem: {},
+      mixins_post: 'post'
+    };
+  },
+
+  methods: {
+    lookDetails (row) {
+      debugger
+      new Promise((resolve) => {
+        this.$store.dispatch('addPopup', {
+          url: '/facilityInspections/popups/itemDetails.vue',
+          width: '500px',
+          height: '500px',
+          props: {
+            data: row,
+            callback: resolve
+          },
+          showConfirmButton: true,
+          showCancelButton: true,
+          hideStar: true,
+          title: '巡检项详情'
+        });
+      }).then(() => {
+        this.mixins_search();
+      });
+    },
+    getDatali (id) {
+      this.mixins_dataUrl = '/sc-community/inspectionRecord/findDetail';
+      this.mixins_query = {
+        id: id,
+        type: this.params.data.type
+      };
+      this.mixins_search();
+    },
+    typeVideo (str) {
+      let type = str.slice(str.lastIndexOf('.') + 1, str.length);
+      let videoType = ['mp4'];
+      return videoType.includes(type);
     },
-    created() {
-        this.thisItem = this.params.data;
-        this.getDatali(this.params.data.id);
+    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.thisItem = this.params.data;
+    this.getDatali(this.params.data.id);
+  }
 };
 </script>
 <style lang="scss" scoped>

+ 75 - 40
operationSupport/src/views/facilityInspections/popups/itemDetails.vue

@@ -1,50 +1,84 @@
+<!--
+ * @Author: your name
+ * @Date: 2022-08-24 11:40:11
+ * @LastEditTime: 2022-08-24 17:19:02
+ * @LastEditors: D4THYL3
+ * @Description: In User Settings Edit
+ * @FilePath: \operationSupport\src\views\facilityInspections\popups\itemDetails.vue
+-->
 <template>
-    <el-form label-position="top">
-        <div class="formContent-item_title" v-for="(item, index) in listData" :key="index">
-            {{ item.cotent }}
-            <template>
-                <el-radio-group v-model="item.chooseValue" v-if="item.type == 1">
-                    <el-radio :label="its" v-for="(its, inx) in item.value.split(',')" :key="inx" disabled></el-radio>
-                </el-radio-group>
+  <el-form label-position="top">
+    <div
+      class="formContent-item_title"
+      v-for="(item, index) in listData"
+      :key="index"
+    >
+      {{ item.cotent }}
+      <template>
+        <el-radio-group
+          v-model="item.chooseValue"
+          v-if="item.type == 1"
+        >
+          <el-radio
+            :label="its"
+            v-for="(its, inx) in item.value.split(',')"
+            :key="inx"
+            disabled
+          ></el-radio>
+        </el-radio-group>
 
-                <el-checkbox-group v-model="item.selectArr" v-else-if="item.type == 2">
-                    <el-checkbox :label="its" name="type" v-for="(its, inx) in item.value.split(',')" :key="inx" disabled></el-checkbox>
-                </el-checkbox-group>
+        <el-checkbox-group
+          v-model="item.selectArr"
+          v-else-if="item.type == 2"
+        >
+          <el-checkbox
+            :label="its"
+            name="type"
+            v-for="(its, inx) in item.value.split(',')"
+            :key="inx"
+            disabled
+          ></el-checkbox>
+        </el-checkbox-group>
 
-                <el-input v-model="item.chooseValue" v-else-if="item.type == 3" disabled></el-input>
-            </template>
-        </div>
-    </el-form>
+        <el-input
+          v-model="item.chooseValue"
+          v-else-if="item.type == 3"
+          disabled
+        ></el-input>
+      </template>
+    </div>
+  </el-form>
 </template>
 <script>
 export default {
-    props: ['params'],
-    data() {
-        return {
-            listData: []
-        };
-    },
-    methods: {
-        getDatali(item) {
-            this.$http
-                .postForm('/sc-community/inspectionRecord/findInspectionDetail', { detailId: item.id })
-                .then(({ status, data, msg }) => {
-                    if (status == 0) {
-                        data.map((item) => {
-                            if (item.type == 2) {
-                                item.selectArr = item.chooseValue.split(',');
-                            }
-                        });
-                        this.listData = data;
-                    }
-                })
-                .catch((err) => {});
-        }
-    },
-    mounted() {},
-    created() {
-        this.getDatali(this.params.data);
+  props: ['params'],
+  data () {
+    return {
+      listData: []
+    };
+  },
+  methods: {
+    getDatali (item) {
+      this.$http
+        .postForm('/sc-community/inspectionRecord/findInspectionDetail', { detailId: item.id })
+        .then(({ status, data, msg }) => {
+          if (status == 0) {
+            data.map((item) => {
+              if (item.type == 2) {
+                item.selectArr = item.chooseValue.split(',');
+              }
+            });
+            this.listData = data;
+          }
+        })
+        .catch((err) => { });
     }
+  },
+  mounted () { },
+  created () {
+    debugger
+    this.getDatali(this.params.data);
+  }
 };
 </script>
 <style lang="scss" scoped>
@@ -58,6 +92,7 @@ export default {
 /deep/ .el-radio-group,
 /deep/ .el-checkbox-group,
 /deep/ .el-input {
+    width: 100%;
     margin-top: 15px;
 }
 </style>