YaolongHan 4 years ago
parent
commit
0710cdf42d
3 changed files with 270 additions and 73 deletions
  1. 4 1
      src/api/equipmentList.js
  2. 174 14
      src/views/equipment/table/rcwxTable.vue
  3. 92 58
      src/views/room/room4.vue

+ 4 - 1
src/api/equipmentList.js

@@ -33,7 +33,10 @@ export function queryWx({ data, getParams }) {
 export function queryWxzy({ data, getParams }) {
     return httputils.getJson(`/data/sms_wxzy/query`, data, getParams)
 }
-
+//设备设施-维修-查图片
+export function queryWxzyImg({ data, getParams }) {
+    return httputils.getJson(`/data/sms_wxzy/queryImg`, data, getParams)
+}
 // 设备设施-专维
 export function queryZw({ data, getParams }) {
     return httputils.getJson(`/data/sms_zw/query`, data, getParams)

+ 174 - 14
src/views/equipment/table/rcwxTable.vue

@@ -178,12 +178,12 @@
   </div>
 </template>
 <script>
-import { queryWxzy } from "@/api/equipmentList.js";
-import { mapGetters } from "vuex";
-import inputDialog from "./inputDIalog";
-import { Select } from "meri-design";
-import { querySelect } from "@/api/public.js";
-import { formatterTime, number_format } from "@/utils/format.js";
+import { queryWxzy, queryWxzyImg } from '@/api/equipmentList.js'
+import { mapGetters } from 'vuex'
+import inputDialog from './inputDIalog'
+import { Select } from 'meri-design'
+import { querySelect } from '@/api/public.js'
+import { formatterTime, number_format } from '@/utils/format.js'
 export default {
   components: { Select, inputDialog },
   data() {
@@ -225,14 +225,174 @@ export default {
         );
       }
     },
-    //跳转工单编号
-    staff(row) {
-      console.log(row);
-      if (row.wonum) {
-        window.open(
-          `http://gcgl.wanda.cn/maximo/ui/?event=loadapp&value=JXWO&uniqueid=${row.wonum}`
-        );
-      }
+    props: ['smsxt', 'diff', 'tabLabel', 'size', 'assetnum'],
+    methods: {
+        //序号的方法
+        indexMethod(index) {
+            return (this.currentPage - 1) * this.size + index + 1
+        },
+        innerTable(row) {
+            if (row.workorderid) {
+                window.open(`http://gcgl.wanda.cn/maximo/ui/?event=loadapp&value=JXWO&uniqueid=${row.workorderid}`)
+            }
+        },
+        //跳转工单编号
+        staff(row) {
+            console.log(row)
+            if (row.wonum) {
+                window.open(`http://gcgl.wanda.cn/maximo/ui/?event=loadapp&value=JXWO&uniqueid=${row.wonum}`)
+            }
+        },
+        //多余输入框监听
+        confirm(reportdate, real, locationName) {
+            this.reportdate = reportdate
+            this.sjjssj = real
+            this.locationName = locationName
+            this.getList()
+        },
+        pageChanged(page) {
+            this.currentPage = page
+            this.getList()
+        },
+        getList() {
+            let getParams = {
+                data: {
+                    smsxt: this.smsxt,
+                    // diff: this.diff,
+                    plazaId: this.$store.state.plazaId,
+                    page: this.currentPage,
+                    size: this.size,
+                },
+            }
+            //区分主要设备和全部设备
+            if (this.smsxt != '1008') {
+                getParams.data.onlyMainAsset = true
+            }
+            if (this.assetnum) {
+                getParams.data.assetnum = this.assetnum
+            }
+            //下拉
+            if (this.reportdate) {
+                getParams.data.schedfinishStartDate = this.reportdate[0] + '000000'
+                getParams.data.schedfinishEndDate = this.reportdate[1] + '000000'
+            }
+            if (this.real) {
+                getParams.data.wotjyssjStartDate = this.real[0] + '000000'
+                getParams.data.wotjyssjEndDate = this.real[1] + '000000'
+            }
+            if (this.source && this.source != '全部') {
+                getParams.data.bxfwlymc = this.source
+            }
+            //输入框搜索
+            getParams.data.keyword = ''
+            if (this.sbjc) {
+                getParams.data.keyword += `${this.sbjc}:sbmc,assetnum;`
+            }
+            if (this.matters) {
+                getParams.data.keyword += `${this.matters}:description;`
+            }
+            if (this.locationName) {
+                getParams.data.keyword += `${this.locationName}:location;`
+            }
+            if (this.wonum2) {
+                getParams.data.keyword += `${this.wonum2}:wonum;`
+            }
+            if (this.people) {
+                getParams.data.keyword += `${this.people}:lead;`
+            }
+            if (getParams.data.keyword == '') {
+                delete getParams.data.keyword
+            }
+            queryWxzy(getParams).then((res) => {
+                this.tableData = res.data || []
+                this.total = res.count
+            })
+        },
+        clickPicRepair(row) {
+            let getParams = {
+                data: {
+                    plazaId: this.$store.state.plazaId,
+                    ticketuid: row.ticketuid,
+                    type: 0,
+                    workorderid: row.workorderid,
+                },
+            }
+            queryWxzyImg(getParams).then((res) => {
+                let url = res.data
+                this.imgUrl = []
+                if (url) {
+                    url.forEach((el) => {
+                        let obj = {
+                            name: el.description,
+                            url: el.urlname,
+                        }
+                        this.imgUrl.push(obj)
+                    })
+                }
+                this.$refs.picLargeOpen.open(this.imgUrl)
+            })
+        },
+        clickPicFinish(row) {
+            let getParams = {
+                data: {
+                    plazaId: this.plazaId,
+                    ticketuid: row.ticketuid,
+                    type: 1,
+                    workorderid: row.workorderid,
+                },
+            }
+            queryWxzyImg(getParams).then((res) => {
+                let url = res.data
+                this.imgUrl = []
+                if (url) {
+                    url.forEach((el) => {
+                        let obj = {
+                            name: el.description,
+                            url: el.urlname,
+                        }
+                        this.imgUrl.push(obj)
+                    })
+                }
+                this.$refs.picLargeOpen.open(this.imgUrl)
+            })
+        },
+        startMethods() {
+            this.tabFind()
+            this.getList()
+        },
+        //下拉框查询
+        tabFind() {
+            let postParams = [
+                {
+                    columnName: { bxfwly: 'bxfwlymc' },
+                    params: {
+                        smsxt: this.smsxt,
+                    },
+                    tableName: 'sms_wxzy', //视图名称
+                },
+            ]
+            let data = {
+                plazaId: this.$store.state.plazaId,
+            }
+            if (this.smsxt != '1008') {
+                data.onlyMainAsset = true
+            }
+            querySelect({ data, postParams }).then((res) => {
+                //console.log(res)
+                let bxfwlymc = res.data && res.data.data && res.data.data.sms_wxzy ? res.data.data.sms_wxzy.bxfwly : []
+                this.sourceOption = []
+                this.sourceOption.push({
+                    name: '全部',
+                    id: '全部',
+                })
+                bxfwlymc.forEach((el) => {
+                    this.sourceOption.push({
+                        name: el.value,
+                        id: el.key,
+                    })
+                })
+            })
+        },
     },
     //多余输入框监听
     confirm(reportdate, real, locationName) {

+ 92 - 58
src/views/room/room4.vue

@@ -103,25 +103,26 @@
     </div>
     <pic-large ref="picLargeOpen"></pic-large>
 
-    <div class="foot">
-      <el-pagination
-        background
-        layout="prev, pager, next"
-        :total="total"
-        :page-size="size"
-        :current-page.sync="page"
-        @prev-click="pageChanged"
-        @next-click="pageChanged"
-        @current-change="pageChanged"
-      ></el-pagination>
+        <div class='foot'>
+            <el-pagination
+                background
+                layout='prev, pager, next'
+                :total='total'
+                :page-size='size'
+                :current-page.sync='page'
+                @prev-click='pageChanged'
+                @next-click='pageChanged'
+                @current-change='pageChanged'
+            ></el-pagination>
+        </div>
     </div>
-  </div>
 </template>
 <script>
 // import Select from '@/components/Select/Select.vue'
-import { Select } from "meri-design";
-import moment from "moment";
-import { formatterTime, number_format } from "@/utils/format.js";
+import { Select } from 'meri-design'
+import moment from 'moment'
+import { formatterTime, number_format } from '@/utils/format.js'
+import { queryWxzyImg } from '@/api/equipmentList.js'
 export default {
   props: ["table4", "sjjssj", "total", "page", "size", "loading"],
   data() {
@@ -138,67 +139,100 @@ export default {
   components: { Select },
   methods: {
     indexMethod(index) {
-      return (this.page - 1) * this.size + index + 1;
+        return (this.page - 1) * this.size + index + 1
     },
     formatter(date) {
-      return moment.unix(date / 1000).format("YYYY.MM.DD HH:mm");
+        return moment.unix(date / 1000).format('YYYY.MM.DD HH:mm')
     },
     pageChanged(page) {
-      this.$emit("Index3Emit", page);
+        this.$emit('Index3Emit', page)
     },
     //工单详情
     innerTable(row) {
-      if (row.workorderid) {
-        window.open(
-          `http://gcgl.wanda.cn/maximo/ui/?event=loadapp&value=JXWO&uniqueid=WB_GZGL&uniqueid=${row.wb_gzglid}`
-        );
-      }
+        if (row.workorderid) {
+            window.open(`http://gcgl.wanda.cn/maximo/ui/?event=loadapp&value=JXWO&uniqueid=WB_GZGL&uniqueid=${row.wb_gzglid}`)
+        }
     },
-    clickPic(row) {
-      this.imgUrl = [];
-      if (row) {
-        row.forEach(el => {
-          let obj = {
-            name: el.description,
-            url: el.url
-          };
-          this.imgUrl.push(obj);
-        });
-      }
-      this.$refs.picLargeOpen.open(this.imgUrl);
+    clickPicRepair(row) {
+        let getParams = {
+            data: {
+                plazaId: this.$store.state.plazaId,
+                ticketuid: row.ticketuid,
+                type: 0,
+                workorderid: row.workorderid,
+            },
+        }
+        queryWxzyImg(getParams).then((res) => {
+            let url = res.data
+            this.imgUrl = []
+            if (url) {
+                url.forEach((el) => {
+                    let obj = {
+                        name: el.description,
+                        url: el.urlname,
+                    }
+                    this.imgUrl.push(obj)
+                })
+            }
+            this.$refs.picLargeOpen.open(this.imgUrl)
+        })
+    },
+    clickPicFinish(row) {
+        let getParams = {
+            data: {
+                plazaId: this.$store.state.plazaId,
+                ticketuid: row.ticketuid,
+                type: 1,
+                workorderid: row.workorderid,
+            },
+        }
+        queryWxzyImg(getParams).then((res) => {
+            let url = res.data
+            this.imgUrl = []
+            if (url) {
+                url.forEach((el) => {
+                    let obj = {
+                        name: el.description,
+                        url: el.urlname,
+                    }
+                    this.imgUrl.push(obj)
+                })
+            }
+            this.$refs.picLargeOpen.open(this.imgUrl)
+        })
     },
     computedHeight() {
-      this.$nextTick(() => {
-        // 页面渲染完成后的回调
-        this.tableMaxHeight = this.$refs.tableBox4.offsetHeight;
-      });
+        this.$nextTick(() => {
+            // 页面渲染完成后的回调
+            this.tableMaxHeight = this.$refs.tableBox4.offsetHeight
+        })
     }
   },
   updated() {
-    this.$nextTick(() => {
-      // 页面渲染完成后的回调
-      this.tableMaxHeight = this.$refs.tableBox4.offsetHeight;
-    });
+        this.$nextTick(() => {
+            // 页面渲染完成后的回调
+            this.tableMaxHeight = this.$refs.tableBox4.offsetHeight
+        })
   }
-};
+}
 </script>
 <style lang="less" scoped>
 </style>
 <style lang="less">
 .compute-item {
-  .compute-center {
-    display: flex;
-    align-items: center;
-    margin-bottom: 12px;
-  }
-  .foot {
-    height: 32px;
-    display: flex;
-    justify-content: flex-end;
-    margin-top: 28px;
-  }
-  /deep/.el-table td {
-    cursor: pointer;
-  }
+    .compute-center {
+        display: flex;
+        align-items: center;
+        margin-bottom: 12px;
+    }
+    .foot {
+        height: 32px;
+        display: flex;
+        justify-content: flex-end;
+        margin-top: 28px;
+    }
+    /deep/.el-table td {
+        cursor: pointer;
+    }
 }
 </style>