Browse Source

日常维保

lizhuang 4 years ago
parent
commit
d72b95c9df

+ 7 - 3
src/api/room.js

@@ -38,9 +38,13 @@ export function queryWxjf({ getParams }) {
     return httputils.getJson(`/data/sms_wx/query`, getParams)
 }
 
-// 机房-维保记录
-export function queryWb({ data, postParams }) {
-    return httputils.fetchJson(`/data/sms_wbzy/query`, data, postParams)
+//机房-维保记录
+// export function queryWb2({ data, postParams }) {
+//     return httputils.fetchJson(`/data/sms_wbzy/query`, data, postParams)
+// }
+//设备设施-日常维保
+export function queryWb({ getParams }) {
+    return httputils.getJson(`/data/sms_wbzy/query`, getParams)
 }
 // 查询位置属于哪个系统
 export function querySystem({ getParams }) {

+ 1 - 1
src/views/equipment/table/inputDIalog.vue

@@ -111,7 +111,7 @@
                 ></el-date-picker>
                 <p style='margin:16px 0 8px 0'>异常工单编号</p>
                 <p>
-                    <el-input clearable placeholder='异常工单编号' size='small' prefix-icon='el-icon-search' v-model='inputForm.bill' style='width:200px;'></el-input>
+                    <el-input clearable placeholder='异常工单编号' size='small' prefix-icon='el-icon-search' v-model='inputForm.bill' style='width:232px;'></el-input>
                 </p>
                 <p style='margin:16px 0 8px 0'>异常工单填报日期</p>
                 <el-date-picker

+ 1 - 1
src/views/equipment/table/otherTable.vue

@@ -190,7 +190,7 @@ export default {
             }
             querySelect({ data, postParams }).then(res => {
                 //console.log(res)
-                let handleresults = res.data.data.sms_qtsx.handleresults
+                let handleresults = res.data.data?res.data.data.sms_qtsx.handleresults:[]
                 this.handleOption = []
                 this.handleOption.push({
                     id: '1',

+ 95 - 43
src/views/equipment/table/rcwbTable.vue

@@ -55,7 +55,7 @@
             <div class='picker-box'>
                 <span class='picker-span'>任务开始日期:</span>
                 <el-date-picker
-                    style='width:180px'
+                    style='width:222px'
                     v-model='reportdate'
                     value-format='yyyyMMdd'
                     type='daterange'
@@ -71,13 +71,13 @@
         <div ref='tableBox' style='height: calc(100% - 115px);'>
             <el-table :data='tableData' :max-height='tableMaxHeight' :border='true' style='width: 100%' @row-click='innerTable'>
                 <el-table-column type='index' label='序号' width='60' :index='indexMethod'></el-table-column>
-                <el-table-column prop label='设备名称' show-overflow-tooltip resizable min-width='150'>
+                <el-table-column prop label='设备名称' show-overflow-tooltip resizable min-width='434'>
                     <template slot-scope='{row}'>{{row.sbmc||'--'}}</template>
                 </el-table-column>
                 <el-table-column prop label='设备内码' :show-overflow-tooltip='true' width='80'>
                     <template slot-scope='{row}'>{{row.assetnum||'--'}}</template>
                 </el-table-column>
-                <el-table-column prop label='核心维保事项记录' :show-overflow-tooltip='true' min-width='150'>
+                <el-table-column prop label='核心维保事项记录' :show-overflow-tooltip='true' min-width='225'>
                     <template slot-scope='{row}'>{{row.matters||'--'}}</template>
                 </el-table-column>
                 <el-table-column prop label='现场照片' :show-overflow-tooltip='true' width='80'>
@@ -96,17 +96,17 @@
                             <div style='cursor:pointer;color: #0091ff;'>{{row.wb_gzglid||'--'}}</div>
                         </template>
                     </el-table-column>
-                    <el-table-column prop label='维保任务名称' :show-overflow-tooltip='true' min-width='340'>
+                    <el-table-column prop label='维保任务名称' :show-overflow-tooltip='true' min-width='360'>
                         <template slot-scope='{row}'>{{row.wbrwmc || '--'}}</template>
                     </el-table-column>
                     <el-table-column prop label='任务状态' :show-overflow-tooltip='true'>
                         <template slot-scope='{row}'>{{row.status||'--'}}</template>
                     </el-table-column>
                     <el-table-column prop label='开始时间' :show-overflow-tooltip='true' width='130'>
-                        <template slot-scope='{row}'>{{row.sjkssj?formatter(row.sjkssj):'--'}}</template>
+                        <template slot-scope='{row}'>{{row.sjkssj?formatterTime(row.sjkssj):'--'}}</template>
                     </el-table-column>
                     <el-table-column prop label='完成时间' :show-overflow-tooltip='true' width='130'>
-                        <template slot-scope='{row}'>{{row.sjwcsj?formatter(row.sjwcsj):'--'}}</template>
+                        <template slot-scope='{row}'>{{row.sjwcsj?formatterTime(row.sjwcsj):'--'}}</template>
                     </el-table-column>
                     <el-table-column prop label='执行耗时(天)' :show-overflow-tooltip='true' min-width='130' :sortable='true'>
                         <template slot-scope='{row}'>{{row.sjcxsjt||'--'}}</template>
@@ -125,10 +125,10 @@
                         <template slot-scope='{row}'>{{row.description||'--'}}</template>
                     </el-table-column>
                     <el-table-column prop label='填报时间' :show-overflow-tooltip='true' width='130'>
-                        <template slot-scope='{row}'>{{row.reportdate?formatter(row.reportdate):'--'}}</template>
+                        <template slot-scope='{row}'>{{row.reportdate?formatterTime(row.reportdate):'--'}}</template>
                     </el-table-column>
                     <el-table-column prop label='验收时间' :show-overflow-tooltip='true' width='130'>
-                        <template slot-scope='{row}'>{{row.sjjssj?formatter(row.sjjssj):'--'}}</template>
+                        <template slot-scope='{row}'>{{row.sjjssj?formatterTime(row.sjjssj):'--'}}</template>
                     </el-table-column>
                 </el-table-column>
             </el-table>
@@ -148,11 +148,12 @@
     </div>
 </template>
 <script>
-import { queryWbsms } from '@/api/equipmentList.js'
+import {queryWb} from '@/api/room.js'
 import { mapGetters } from 'vuex'
 import { Select } from 'meri-design'
 import inputDialog from './inputDIalog'
 import { formatterTime, number_format } from '@/utils/format.js'
+import { querySelect } from '@/api/public.js'
 export default {
     components: { Select, inputDialog },
     data() {
@@ -161,9 +162,8 @@ export default {
             total: 0,
             currentPage: 1,
             size: 10,
-            // sjjssj: '',
             reportdate: '',
-            ischange: '2',
+            ischange: '全部',
             sbjc: '',
             formatterTime,
             number_format,
@@ -182,9 +182,15 @@ export default {
                 },
             ],
             statusOption: [],
-            status: '',
+            status: '全部',
             rwbh: '',
             imgUrl: [],
+            allArr: [
+                {
+                    id: '全部',
+                    name: '全部',
+                },
+            ],
             matters: '',
             bill: '',
             ycgdtbsj: '',
@@ -195,7 +201,7 @@ export default {
     },
     props: ['smsxt', 'major', 'diff', 'tabLabel'],
     computed: {
-        ...mapGetters(['floorSelect']),
+        ...mapGetters(['floorSelect', 'plazaId']),
     },
     methods: {
         //序号的方法
@@ -204,7 +210,6 @@ export default {
         },
         //工单详情
         innerTable(row) {
-            console.log(row)
             if (row.apptype == '外委' || row.apptype == '自维') {
                 if (row.wb_gzglid) {
                     window.open(`http://gcgl.wanda.cn/maximo/ui/?event=loadapp&value=WB_GZGL&uniqueid=${row.wb_gzglid}`)
@@ -235,58 +240,104 @@ export default {
             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,
+         // 下拉框数据
+        changeSelect() {
+            this.department = []
+            let postParams = [
+                {
+                    columnName: { status: 'status', zt: 'zt' },
+                    tableName: 'sms_wbzy',
                 },
+            ]
+            let data = {
+                plazaId: this.plazaId,
+            }
+            querySelect({ data, postParams }).then((res) => {
+                let status = [],
+                    zt = [],
+                    arr = [],
+                    arr1 = []
+
+                status = res.data.data.sms_wbzy.status ? res.data.data.sms_wbzy.status : []
+                zt = res.data.data.sms_wbzy.zt ? res.data.data.sms_wbzy.zt : []
+                if (status.length > 0) {
+                    status.forEach((el) => {
+                        let obj = {
+                            id: el.key,
+                            name: el.value,
+                        }
+                        arr.push(obj)
+                    })
+                    this.statusOption = this.allArr.concat(arr)
+                }
+                if (zt.length > 0) {
+                    zt.forEach((el) => {
+                        let obj = {
+                            id: el.key,
+                            name: el.value == '正常' ? '是' : '否',
+                        }
+                        arr1.push(obj)
+                    })
+                    this.changeOption = this.allArr.concat(arr1)
+                }
+            })
+        },
+        getList() {
+           
+            let data = {
+                smsxt: this.smsxt,
+                plazaId: this.plazaId,
+                page: this.currentPage,
+                size: this.size,
+                //orderBy: 'wb_gzglid,0;assetnum,1;reportedby,0;',
             }
             //下拉
-            if (this.ischange && this.ischange != 2) {
-                // getParams.data.ischangepj = this.ischange
-                getParams.data.ismodel = this.ischange
+            if (this.ischange && this.ischange != '全部') {
+                data.zt = this.ischange
+            }
+            if (this.status && this.status != '全部') {
+                data.status = this.status
             }
             //工单填报时间
             if (this.ycgdtbsj) {
-                getParams.data.sjjssjStartDate = this.ycgdtbsj[0] + '000000'
-                getParams.data.sjjssjEndDate = this.ycgdtbsj[1] + '000000'
+                data.reportdateStartDate = this.ycgdtbsj[0] + '000000'
+                data.reportdateEndDate = this.ycgdtbsj[1] + '000000'
             }
             //工单验收时间
             if (this.ycgdyssj) {
-                getParams.data.reportdateStartDate = this.ycgdyssj[0] + '000000'
-                getParams.data.reportdateEndDate = this.ycgdyssj[1] + '000000'
+                data.sjjssjStartDate = this.ycgdyssj[0] + '000000'
+                data.sjjssjEndDate = this.ycgdyssj[1] + '000000'
             }
             //任务开始时间
             if (this.reportdate) {
-                getParams.data.reportdate = this.reportdate[0] + '000000'
-                getParams.data.reportdate = this.reportdate[1] + '000000'
+                data.sjkssjStartDate = this.reportdate[0] + '000000'
+                data.sjkssjEndDate = this.reportdate[1] + '000000'
             }
             //任务完成时间
             if (this.complete) {
-                getParams.data.reportdateStartDate = this.complete[0] + '000000'
-                getParams.data.reportdateEndDate = this.complete[1] + '000000'
+                data.sjwcsjStartDate = this.complete[0] + '000000'
+                data.sjwcsjEndDate = this.complete[1] + '000000'
             }
             //输入框
-            getParams.data.keyword = ''
+            data.keyword = ''
             if (this.sbjc) {
-                getParams.data.keyword += `${this.sbjc}:sbmc,assetnum;`
+                data.keyword += `${this.sbjc}:sbmc,assetnum;`
             }
             if (this.matters) {
-                getParams.data.keyword += `${this.matters}:description,matters;`
+                data.keyword += `${this.matters}:description,matters;`
+            }
+            if (this.rwbh) {
+                data.keyword += `${this.rwbh}:wb_gzglid;`
             }
-            if (this.gzglid) {
-                getParams.data.keyword += `${this.gzglid}:wb_gzglid;`
+            if(this.bill){
+                  data.keyword += `${this.bill}:wonum;`
             }
-            if (getParams.data.keyword == '') {
-                delete getParams.data.keyword
+            if (data.keyword == '') {
+                delete data.keyword
             }
-            queryWbsms(getParams).then((res) => {
-                this.tableData = res.data || []
+             queryWb({getParams:data}).then((res) => {
                 this.total = res.count
+                this.tableData = res.data ? res.data: []
             })
         },
         clickPic(row) {
@@ -311,7 +362,7 @@ export default {
         },
         tabLabel(newV, oldV) {
             if (newV !== oldV) {
-                // this.tabFind()
+                this.changeSelect()
                 this.getList()
                 this.$nextTick(() => {
                     // 页面渲染完成后的回调
@@ -324,6 +375,7 @@ export default {
         },
     },
     mounted() {
+        this.changeSelect()
         this.getList()
         this.$nextTick(() => {
             // 页面渲染完成后的回调

+ 3 - 4
src/views/room/index.vue

@@ -752,7 +752,6 @@ export default {
         },
         // 机房维保记录
         Index4() {
-            let postParams = {}
             let data = {
                 location: this.location,
                 plazaId: this.plazaId,
@@ -818,11 +817,11 @@ export default {
                     data.keyword = `${this.ycgdbhInput5}:wonum`
                 }
             }
-            queryWb({ data, postParams }).then((res) => {
+            queryWb({getParams:data}).then((res) => {
                 //console.log('维保', res)
                 this.loading4 = false
-                this.total4 = res.data.count
-                this.table5 = res.data.data ? res.data.data : []
+                this.total4 = res.count
+                this.table5 = res.data ? res.data : []
             })
         },
         confirm() {