Browse Source

新版维修围标钻取表的添加

zhulizhen1111 4 years ago
parent
commit
eaaac6d414

+ 7 - 3
src/components/floorMap/index.vue

@@ -8,6 +8,7 @@
             <canvasFun @fit='fit' @savePng='savePng' @saveSvg='saveSvg' @saveJson='saveJson' @scale='scale' @showText='showText' ref='canvasFun'></canvasFun>
         </div>
         <room-box ref='boxRoom'></room-box>
+        <equip-detail ref="equipDetail"></equip-detail>
         <el-popover ref='popover' placement='right' trigger='manual' v-model='visible' width='380'>
             <!-- <div style="text-align: right;margin-bottom: 10px;">
                 <span style="float: left;">对应的工程信息化信息</span>
@@ -102,6 +103,7 @@ import { SColor } from '@saga-web/draw/lib'
 import bus from '@/utils/bus.js'
 import { TipelineItem } from '../../lib/items/TipelineItem'
 import { SImageLegendItem } from '../../lib/items/SImageLegendItem'
+import equipDetail from '../../views/equipment/table/equipDetail'
 
 // import { uuid } from "@/components/mapClass/until";
 
@@ -155,7 +157,7 @@ export default {
         loadName: null,
         type: null,
     },
-    components: { RoomBox, canvasFun },
+    components: { RoomBox, canvasFun, equipDetail },
     computed: {
         ...mapGetters(['plazaId', 'fmapID', 'haveFengMap', 'bunkObj']),
     },
@@ -213,8 +215,10 @@ export default {
         },
         // 查看浮层设备详情
         handleClickEquipDetail(row) {
-            if (row.assetuid) {
-                window.open(`http://gcgl.wanda.cn/maximo/ui/?event=loadapp&value=assetdevic&uniqueid=${row.assetuid}`)
+            console.log(row)
+            if (row.assetnum) {
+                this.$refs.equipDetail.open({ row: JSON.stringify(row) })
+                // window.open(`http://gcgl.wanda.cn/maximo/ui/?event=loadapp&value=assetdevic&uniqueid=${row.assetuid}`)
             }
         },
         // 查看浮层位置详情

+ 94 - 276
src/views/equipment/table/equipDetail.vue

@@ -2,131 +2,79 @@
 <template>
     <!-- 详情页面 -->
     <div class='gdqd-dialog1'>
-        <div class='top'></div>
-        <div class='qdxq-top'>
-            <div class='gdqd-dialog-top'>
-                <!-- <el-input
-                    placeholder='搜索设备简称编号'
-                    style='width:192px;margin-right:12px'
-                    size='small'
-                    prefix-icon='el-icon-search'
-                    v-model='sbjc'
-                    clearable
-                    @keyup.enter.native='queryTableList'
-                    @blur='queryTableList'
-                ></el-input>
-                <Select v-model='sbglgs' width='180' tipPlace='top' caption='管理归属:' size='small' :selectdata='sbglgsOption' @change='queryTableList'></Select>
-                <Select
-                    width='160'
-                    style='margin: 0 12px;'
-                    v-model='status'
-                    tipPlace='top'
-                    caption='设备状态:'
-                    size='small'
-                    :selectdata='statusOption'
-                    @change='queryTableList'
-                ></Select>
-                <el-input
-                    placeholder='搜索品牌、型号'
-                    style='width:180px;margin-right:12px'
-                    size='small'
-                    clearable
-                    prefix-icon='el-icon-search'
-                    v-model='brand'
-                    @keyup.enter.native='queryTableList'
-                    @blur='queryTableList'
-                ></el-input>
-                <Select
-                    width='150'
-                    style='margin-right:12px;'
-                    v-model='floor'
-                    tipPlace='top'
-                    caption='楼层:'
-                    size='small'
-                    :selectdata='floorAllSelect'
-                    @change='queryTableList'
-                ></Select>
-                <el-input
-                    placeholder='搜索安装位置'
-                    @keyup.enter.native='queryTableList'
-                    @blur='queryTableList'
-                    clearable
-                    style='width:180px;margin-right:12px'
-                    size='small'
-                    prefix-icon='el-icon-search'
-                    v-model='wzjc'
-                ></el-input>-->
-                <!-- 多余的筛选 -->
-                <!-- <input-dialog :type='1' @confirm='confirm'></input-dialog> -->
+        <el-dialog :title='`${row.sbjc}-设备详情`' :visible.sync='visible' :fullscreen='true'>
+            <div class='top'></div>
+            <div class='qdxq-top'>
+                <div class='gdqd-dialog-top'></div>
+                <div class='gdqd-dialog-bottom'>
+                    <el-table @row-click='innerTable' :data='tableData' :border='true' style='width: 100%;margin-bottom:30px'>
+                        <el-table-column type='index' label='序号' width='60'></el-table-column>
+                        <el-table-column prop='sbjc' label='设备名称' show-overflow-tooltip resizable min-width='338'>
+                            <template slot-scope='{row}'>{{row.sbjc || '--'}}</template>
+                        </el-table-column>
+                        <el-table-column prop='assetnum' label='设备内码' show-overflow-tooltip resizable width='80'>
+                            <template slot-scope='{row}'>{{row.assetnum || '--'}}</template>
+                        </el-table-column>
+                        <el-table-column prop='sl' label='数量' width='60'>
+                            <template slot-scope='{row}'>{{row.sl>=0?row.sl:'--'}}</template>
+                        </el-table-column>
+                        <el-table-column prop='sbglgs' label='管理归属' show-overflow-tooltip resizable>
+                            <template slot-scope='{row}'>{{row.sbglgs || '--'}}</template>
+                        </el-table-column>
+                        <el-table-column prop='sb_status' label='设备状态' width='80' show-overflow-tooltip resizable>
+                            <template slot-scope='{row}'>{{row.sb_status || '--'}}</template>
+                        </el-table-column>
+                        <el-table-column prop='brand' label='品牌' show-overflow-tooltip resizable width='80'>
+                            <template slot-scope='{row}'>{{row.brand || '--'}}</template>
+                        </el-table-column>
+                        <el-table-column prop='sbxh' label='型号' show-overflow-tooltip resizable width='100'>
+                            <template slot-scope='{row}'>{{row.sbxh || '--'}}</template>
+                        </el-table-column>
+                        <el-table-column prop='floor' sortable label='楼层' width='70' show-overflow-tooltip resizable>
+                            <template slot-scope='{row}'>{{row.floorcode || '--'}}</template>
+                        </el-table-column>
+                        <el-table-column prop='wzjc' label='安装位置' show-overflow-tooltip resizable min-width='250'>
+                            <template slot-scope='{row}'>{{row.wzjc || '--'}}</template>
+                        </el-table-column>
+                        <el-table-column prop='manufacturer' label='生产厂商' show-overflow-tooltip resizable min-width='300'>
+                            <template slot-scope='{row}'>{{row.manufacturer || '--'}}</template>
+                        </el-table-column>
+                        <el-table-column prop='fws' label='服务商' show-overflow-tooltip resizable min-width='300'>
+                            <template slot-scope='{row}'>{{row.fws || '--'}}</template>
+                        </el-table-column>
+                        <el-table-column prop label='相关资料' show-overflow-tooltip resizable min-width='150'>
+                            <template slot-scope='{row}'>{{'--'}}</template>
+                        </el-table-column>
+                    </el-table>
+                </div>
             </div>
-            <div class='gdqd-dialog-bottom'>
-                <el-table @row-click='innerTable' :data='tableData' :border='true' style='width: 100%;margin-bottom:30px'>
-                    <el-table-column type='index' label='序号' width='60'></el-table-column>
-                    <el-table-column prop='sbjc' label='设备名称' show-overflow-tooltip resizable min-width='338'>
-                        <template slot-scope='{row}'>{{row.sbjc || '--'}}</template>
-                    </el-table-column>
-                    <el-table-column prop='assetnum' label='设备内码' show-overflow-tooltip resizable width='80'>
-                        <template slot-scope='{row}'>{{row.assetnum || '--'}}</template>
-                    </el-table-column>
-                    <el-table-column prop='sl' label='数量' width='60'>
-                        <template slot-scope='{row}'>{{row.sl>=0?row.sl:'--'}}</template>
-                    </el-table-column>
-                    <el-table-column prop='sbglgs' label='管理归属' show-overflow-tooltip resizable>
-                        <template slot-scope='{row}'>{{row.sbglgs || '--'}}</template>
-                    </el-table-column>
-                    <el-table-column prop='sb_status' label='设备状态' width='80' show-overflow-tooltip resizable>
-                        <template slot-scope='{row}'>{{row.sb_status || '--'}}</template>
-                    </el-table-column>
-                    <el-table-column prop='brand' label='品牌' show-overflow-tooltip resizable width='80'>
-                        <template slot-scope='{row}'>{{row.brand || '--'}}</template>
-                    </el-table-column>
-                    <el-table-column prop='sbxh' label='型号' show-overflow-tooltip resizable width='100'>
-                        <template slot-scope='{row}'>{{row.sbxh || '--'}}</template>
-                    </el-table-column>
-                    <el-table-column prop='floor' sortable label='楼层' width='70' show-overflow-tooltip resizable>
-                        <template slot-scope='{row}'>{{row.floorcode || '--'}}</template>
-                    </el-table-column>
-                    <el-table-column prop='wzjc' label='安装位置' show-overflow-tooltip resizable min-width='150'>
-                        <template slot-scope='{row}'>{{row.wzjc || '--'}}</template>
-                    </el-table-column>
-                    <el-table-column prop='manufacturer' label='生产厂商' show-overflow-tooltip resizable min-width='220'>
-                        <template slot-scope='{row}'>{{row.manufacturer || '--'}}</template>
-                    </el-table-column>
-                    <el-table-column prop='fws' label='服务商' show-overflow-tooltip resizable min-width='220'>
-                        <template slot-scope='{row}'>{{row.fws || '--'}}</template>
-                    </el-table-column>
-                    <el-table-column prop label='相关资料' show-overflow-tooltip resizable min-width='150'>
-                        <template slot-scope='{row}'>{{'--'}}</template>
-                    </el-table-column>
-                </el-table>
+            <div class='qdxq-bottom'>
+                <div class='wb-title'>
+                    <div class='tab-title' id='1' :class='activeId==1?"active-is":""' @click='tabClick(1)'>维保</div>
+                    <div class='tab-title' id='2' :class='activeId==2?"active-is":""' @click='tabClick(2)'>维修</div>
+                </div>
+                <div v-if='activeId==1'>
+                    <el-tabs v-model='activeName1' @tab-click='handleClickWb'>
+                        <el-tab-pane label='重要维保' name='wb1' v-if='Object.keys(this.row).length>0'>
+                            <wbTable ref='wb1' :smsxt='smsxt' tabLabel='重要维保' :diff='diff' :assetnum='row.assetnum' :size='3'></wbTable>
+                        </el-tab-pane>
+                        <el-tab-pane label='日常维保' name='wb2' v-if='Object.keys(this.row).length>0'>
+                            <rcwbTable ref='wb2' :smsxt='smsxt' tabLabel='日常维保' :diff='diff' :assetnum='row.assetnum' :size='3'></rcwbTable>
+                        </el-tab-pane>
+                    </el-tabs>
+                </div>
+                <div v-if='activeId==2'>
+                    <el-tabs v-model='activeName2' @tab-click='handleClickWx'>
+                        <el-tab-pane label='重要维修' name='wx1' v-if='Object.keys(this.row).length>0'>
+                            <wxTable ref='wx1' :smsxt='smsxt' tabLabel='重要维修' :diff='diff' :assetnum='row.assetnum' :size='3'></wxTable>
+                        </el-tab-pane>
+                        <el-tab-pane label='日常维修' name='wx2' v-if='Object.keys(this.row).length>0'>
+                            <rcwxTable ref='wx2' :smsxt='smsxt' tabLabel='日常维修' :diff='diff' :assetnum='row.assetnum' :size='3'></rcwxTable>
+                        </el-tab-pane>
+                    </el-tabs>
+                </div>
             </div>
-        </div>
-        <div class='qdxq-bottom'>
-            <div class='wb-title'>
-                <div class='tab-title' id='1' :class='activeId==1?"active-is":""' @click='tabClick(1)'>维保</div>
-                <div class='tab-title' id='2' :class='activeId==2?"active-is":""' @click='tabClick(2)'>维修</div>
-            </div>
-            <div v-if='activeId==1'>
-                <el-tabs v-model='activeName1' @tab-click='handleClickWb'>
-                    <el-tab-pane label='重要维保' name='wb1' v-if='Object.keys(this.detailData).length>0'>
-                        <wbTable ref='wb1' :smsxt='smsxt' tabLabel='重要维保' :diff='diff' :assetnum='row.assetnum' :size='3'></wbTable>
-                    </el-tab-pane>
-                    <el-tab-pane label='日常维保' name='wb2' v-if='Object.keys(this.detailData).length>0'>
-                        <rcwbTable ref='wb2' :smsxt='smsxt' tabLabel='日常维保' :diff='diff' :assetnum='detailData.assetnum' :size='3'></rcwbTable>
-                    </el-tab-pane>
-                </el-tabs>
-            </div>
-            <div v-if='activeId==2'>
-                <el-tabs v-model='activeName2' @tab-click='handleClickWx'>
-                    <el-tab-pane label='重要维修' name='wx1' v-if='Object.keys(this.detailData).length>0'>
-                        <wxTable ref='wx1' :smsxt='smsxt' tabLabel='重要维修' :diff='diff' :assetnum='detailData.assetnum' :size='3'></wxTable>
-                    </el-tab-pane>
-                    <el-tab-pane label='日常维修' name='wx2' v-if='Object.keys(this.detailData).length>0'>
-                        <rcwxTable ref='wx2' :smsxt='smsxt' tabLabel='日常维修' :diff='diff' :assetnum='detailData.assetnum' :size='3'></rcwxTable>
-                    </el-tab-pane>
-                </el-tabs>
-            </div>
-        </div>
+        </el-dialog>
     </div>
 </template>
 <script>
@@ -166,7 +114,10 @@ export default {
             activeId: '1',
             activeName1: 'wb1',
             activeName2: 'wx1',
-            detailData: {},
+            row: {},
+            visible: false,
+            smsxt: '',
+            diff: '',
         }
     },
     components: {
@@ -180,186 +131,53 @@ export default {
     computed: {
         ...mapGetters(['floorSelect']),
     },
-    props: ['row', 'major', 'smsxt', 'diff'],
-    mounted() {
-        this.queryTableList()
-        this.tabFind()
-        this.getFloorAllSelect()
-    },
     methods: {
         tabClick(item) {
             this.activeId = item
         },
         handleClickWb(label) {
-            console.log(label)
-            console.log(this.$refs[`${label.name}`])
-            this.$refs[`${label.name}`].startMethods()
+            if (this.$refs[`${label.name}`]) {
+                this.$refs[`${label.name}`].startMethods()
+            }
         },
         handleClickWx(label) {
-            this.$refs[`${label.name}`].startMethods()
+            if (this.$refs[`${label.name}`]) {
+                this.$refs[`${label.name}`].startMethods()
+            }
         },
         innerTable(row) {
-            console.log(row)
             if (row.assetuid) {
                 window.open(`http://gcgl.wanda.cn/maximo/ui/?event=loadapp&value=assetdevic&uniqueid=${row.assetuid}`)
             }
         },
-        //多余输入框监听
-        confirm(fws, manufacturer) {
-            //console.log(fws, manufacturer, '------')
-            this.fws = fws
-            this.manufacturer = manufacturer
-            this.queryTableList()
-        },
-        //下拉框查询
-        tabFind() {
-            let postParams = [
-                {
-                    columnName: { sbglgs: 'sbglgs', sb_status: 'sb_status' },
-                    params: {
-                        type_code: this.row.type_code,
-                    },
-                    tableName: 'sms_asset', //视图名称
-                },
-            ]
-            let major
-            if (this.major.slice(0, 2) == 'GD') {
-                major = '供电'
-            } else if (this.major.slice(0, 2) == 'XF') {
-                major = '消防'
-            } else if (this.major.slice(0, 2) == 'GPS') {
-                major = '给排水'
-            } else if (this.major.slice(0, 2) == 'DT') {
-                major = '电梯'
-            } else if (this.major.slice(0, 2) == 'RQ') {
-                major = '燃气'
-            } else {
-                major = this.major
-            }
-            let data = {
-                major: major,
-                plazaId: this.$store.state.plazaId,
-            }
-            querySelect({ data, postParams }).then((res) => {
-                //console.log(res)
-                let sb_status = res.data.data.sms_asset.sb_status
-                let sbglgs = res.data.data.sms_asset.sbglgs
-                this.sbglgsOption = []
-                this.sbglgsOption.push({
-                    name: '全部',
-                    id: '1',
-                })
-                this.statusOption = []
-                this.statusOption.push({
-                    name: '全部',
-                    id: '1',
-                })
-                sb_status.forEach((el) => {
-                    this.statusOption.push({
-                        name: el.value,
-                        id: el.key,
-                    })
-                })
-                sbglgs.forEach((el) => {
-                    this.sbglgsOption.push({
-                        name: el.value,
-                        id: el.key,
-                    })
-                })
-            })
-        },
         queryTableList() {
-            let major
-            if (this.major.slice(0, 2) == 'GD') {
-                major = '供电'
-            } else if (this.major.slice(0, 2) == 'XF') {
-                major = '消防'
-            } else if (this.major.slice(0, 2) == 'GPS') {
-                major = '给排水'
-            } else if (this.major.slice(0, 2) == 'DT') {
-                major = '电梯'
-            } else if (this.major.slice(0, 2) == 'RQ') {
-                major = '燃气'
-            } else {
-                major = this.major
-            }
             let data = {
-                major: major,
                 plazaId: this.$store.state.plazaId,
             }
-            //输入框搜索
-            data.keyword = ''
-            if (this.sbjc) {
-                data.keyword += `${this.sbjc}:sbjc,assetnum;`
-            }
-            if (this.brand) {
-                data.keyword += `${this.brand}:brand,sbxh;`
-            }
-            if (this.wzjc) {
-                data.keyword += `${this.wzjc}:wzjc;`
-            }
-            if (this.manufacturer) {
-                data.keyword += `${this.manufacturer}:manufacturer;`
-            }
-            if (this.fws) {
-                data.keyword += `${this.fws}:fws;`
-            }
-            if (data.keyword == '') {
-                delete data.keyword
-            }
             let postParams = {
                 classstructureid: this.row.classstructureid,
                 type_code: this.row.type_code,
                 manufacturer: this.row.manufacturer || '--',
                 sbxh: this.row.sbxh || '--',
                 brand: this.row.brand || '--',
-            }
-            //下拉筛选
-            if (this.floor && this.floor != 1) {
-                postParams.gname = this.floor
-            }
-            if (this.sbglgs && this.sbglgs != 1) {
-                postParams.sbglgs = this.sbglgs
-            }
-            if (this.status && this.status != 1) {
-                postParams.status = this.status
+                assetnum: this.assetnum,
             }
             queryAsset({ data, postParams }).then((res) => {
                 //console.log(res)
                 this.tableData = res.data.data
-                this.detailData = this.tableData[0]
-                console.log(this.detailData)
+                if (this.tableData.length > 0) {
+                    this.row = this.tableData[0]
+                    this.$refs.wb1.startMethods()
+                }
                 this.total = res.data.count
             })
         },
-        getFloorAllSelect() {
-            this.floorAllSelect = []
-            this.floorAllSelect.push({
-                id: '1',
-                name: '全部',
-            })
-            this.floorSelect.forEach((el) => {
-                this.floorAllSelect.push(el)
-            })
-        },
-    },
-    watch: {
-        row: {
-            handler(newV, oldV) {
-                this.queryTableList()
-                this.getFloorAllSelect()
-                this.tabFind()
-                this.handleClickWb()
-            },
-            deep: true,
-        },
-        sbglgs() {
-            this.queryTableList()
-        },
-        status() {
-            this.queryTableList()
-        },
-        floor() {
+        //弹框出现
+        open(row) {
+            this.visible = true
+            this.row = JSON.parse(row.row)
+            this.assetnum = this.row.assetnum
+            this.smsxt = this.row.system_code
             this.queryTableList()
         },
     },
@@ -367,7 +185,7 @@ export default {
 </script>
 <style lang="less" scoped>
 .gdqd-dialog1 {
-    height: 100vh;
+    //height: 100vh;
     display: flex;
     flex-direction: column;
     .qdxq-top {
@@ -376,7 +194,7 @@ export default {
         }
         .gdqd-dialog-bottom {
             overflow: hidden;
-            max-height: 9vh;
+            max-height: 12vh;
         }
     }
     .qdxq-bottom {

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

@@ -195,7 +195,7 @@ export default {
                 },
             }
             if (this.assetnum) {
-                getParamsdata.assetnum = this.assetnum
+                getParams.data.assetnum = this.assetnum
             }
             //下拉
             if (this.reportdate) {

+ 4 - 2
src/views/equipment/table/wbTable.vue

@@ -170,7 +170,7 @@ export default {
             imgUrl: [],
             shjc: '',
             gzglid: '',
-            matters: ''
+            matters: '',
         }
     },
     props: ['smsxt', 'diff', 'tabLabel', 'size', 'assetnum'],
@@ -216,12 +216,14 @@ export default {
             let getParams = {
                 data: {
                     smsxt: this.smsxt,
-                    diff: this.diff,
                     plazaId: this.$store.state.plazaId,
                     page: this.currentPage,
                     size: this.size,
                 },
             }
+            if (this.diff) {
+                getParams.data.diff = this.diff
+            }
             if (this.assetnum) {
                 getParams.data.assetnum = this.assetnum
             }

+ 3 - 1
src/views/equipment/table/wxTable.vue

@@ -206,12 +206,14 @@ export default {
             let getParams = {
                 data: {
                     smsxt: this.smsxt,
-                    diff: this.diff,
                     plazaId: this.$store.state.plazaId,
                     page: this.currentPage,
                     size: this.size,
                 },
             }
+            if (this.diff) {
+                getParams.data.diff = this.diff
+            }
             if (this.assetnum) {
                 getParams.data.assetnum = this.assetnum
             }

+ 2 - 1
vue.config.js

@@ -5,7 +5,7 @@ module.exports = {
         proxy: {
             "/data": {
                 target: "http://60.205.177.43",
-                //target: 'http://10.199.143.126',
+                //target: "http://10.199.143.126",
                 // target: 'http://192.168.200.11:9003', //yll
                 // target: 'http://localhost:6040/data/',
                 changeOrigin: true,
@@ -35,6 +35,7 @@ module.exports = {
             "/serve": {
                 // target: 'http://192.168.200.87:8088',
                 target: "http://60.205.177.43:8080",
+                //target: "http://10.199.143.129:8080",
                 changeOrigin: true,
                 pathRewrite: {
                     "^/serve": "",