zhulizhen1111 4 years ago
parent
commit
3306501639

+ 7 - 1
src/utils/plugins/components.js

@@ -14,6 +14,7 @@ var system = [
                     label: "变配电室内部设备清单",
                     children: [],
                     id: "GDQD",
+                    param: { tab_code: "gd01" },
                 },
                 {
                     label: "楼层电井(间)控制商铺范围清单",
@@ -217,6 +218,7 @@ var system = [
                     label: "主要设备清单",
                     children: [],
                     id: "XFQD",
+                    param: { tab_code: "xf01" },
                 },
                 {
                     label: "维保事项",
@@ -307,7 +309,7 @@ var system = [
                         {
                             label: "BA楼宇智能化",
                             id: "RDQD1",
-                            param: { tab_code: "rd03" },
+                            param: { tab_code: "rd02" },
                         },
                         {
                             label: "门禁管理",
@@ -402,6 +404,7 @@ var system = [
                     label: "主要设备清单",
                     id: "GSQD",
                     children: [],
+                    param: { tab_code: "gps01" },
                 },
                 {
                     label: "维保事项",
@@ -489,6 +492,7 @@ var system = [
                     label: "主要设备清单",
                     id: "DTQD",
                     children: [],
+                    param: { tab_code: "dt01" },
                 },
                 {
                     label: "维修及维保事项",
@@ -540,6 +544,7 @@ var system = [
                     label: "主要设备清单",
                     children: [],
                     id: "RQQD",
+                    param: { tab_code: "rq01" },
                 },
                 {
                     label: "维修及维保事项",
@@ -608,6 +613,7 @@ var system = [
                     label: "主要材料清单",
                     id: "TJQD",
                     children: [],
+                    param: { tab_code: "tj01" },
                 },
                 {
                     label: "维修及维保事项",

+ 17 - 14
src/views/equipment/eqDialog.vue

@@ -3,12 +3,15 @@
     <div class='dialog-container'>
         <el-dialog :title='`${systemName}-${dialogInfo.label}`' :visible.sync='visible' :fullscreen='true'>
             <div class='top'></div>
-            <div v-if='Object.keys(dialogInfo).length>0 && dialogInfo.id.slice(2,4)=="YL"' style='width:100%;height:600px;overflow:hidden'>
-                <rotation :rotationImg='rotationImg'></rotation>
+            <div v-if='Object.keys(dialogInfo).length>0 && dialogInfo.children.length==0'>
+                <div v-if='dialogInfo.id.slice(2,4)=="YL"' style='width:100%;height:600px;overflow:hidden'>
+                    <rotation :rotationImg='rotationImg'></rotation>
+                </div>
+                <tj-table v-else-if='dialogInfo.id.slice(0,4)=="TJQD"' :param='param' major='土建'></tj-table>
+                <standTable v-else-if='dialogInfo.id.slice(2,4)=="QD"' :param='param' :major='dialogInfo.id'></standTable>
+                <!-- <GDQDTable v-else-if='Object.keys(dialogInfo).length>0 && dialogInfo.id.slice(0,4)=="GDQD"' major></GDQDTable> -->
+                <look-page v-else-if='dialogInfo.id.slice(2,4)=="TZ"' param major></look-page>
             </div>
-            <tj-table v-else-if='Object.keys(dialogInfo).length>0 && dialogInfo.id.slice(0,4)=="TJQD"' major='土建'></tj-table>
-            <GDQDTable v-else-if='Object.keys(dialogInfo).length>0 && dialogInfo.id.slice(0,4)=="GDQD"' major></GDQDTable>
-            <look-page v-else-if='Object.keys(dialogInfo).length>0 && dialogInfo.id.slice(2,4)=="TZ"' param major></look-page>
             <div v-else>
                 <el-tabs v-model='activeName' @tab-click='handleClick' v-if='Object.keys(dialogInfo).length>0 && dialogInfo.children.length>0'>
                     <el-tab-pane
@@ -20,8 +23,8 @@
                         <div v-if='value.id.slice(2,4)=="YL"' style='width:100%;height:600px;overflow:hidden'>
                             <rotation :rotationImg='rotationImg'></rotation>
                         </div>
-                        <tableList v-else-if='value.id.slice(0,4)=="RDQD"' ref='list1' :param='param' major='弱电'></tableList>
-                        <tableList v-else-if='value.id.slice(0,4)=="NTQD"' ref='list2' :param='param' major='暖通'></tableList>
+                        <tableList v-else-if='value.id.slice(0,4)=="RDQD"' :param='param' ref='list1' major='弱电'></tableList>
+                        <tableList v-else-if='value.id.slice(0,4)=="NTQD"' :param='param' ref='list2' major='暖通'></tableList>
                         <wb-table v-else-if='value.id.slice(2,4)=="WX"' param major='维修'></wb-table>
                         <zw-table v-else-if='value.id.slice(2,4)=="ZW"' param major='专维'></zw-table>
                         <wb-table v-else-if='value.id.slice(2,4)=="WB"' param major='维保'></wb-table>
@@ -38,6 +41,7 @@ import wbTable from './table/wbTable'
 import zwTable from './table/zwTable'
 import lookPage from './table/lookPageTable'
 import GDQDTable from './table/GDQDTable'
+import standTable from './table/standTable'
 export default {
     props: ['systemName'],
     data() {
@@ -49,23 +53,22 @@ export default {
             rotationImg: [require('@/assets/imgs/eq.jpg'), require('@/assets/imgs/survey_pop2.png'), require('@/assets/imgs/survey_pop1.png')]
         }
     },
-    mounted() {
-        // if (this.$refs.list1) {
-        //     this.$refs.list1.getList(this.activeName)
-        // }
-    },
-    components: { tableList, tjTable, wbTable, zwTable, lookPage, GDQDTable },
+    mounted() {},
+    components: { tableList, tjTable, wbTable, zwTable, lookPage, GDQDTable, standTable },
     methods: {
         showModal(item) {
             this.visible = true
             this.dialogInfo = item
             if (Object.keys(this.dialogInfo).length > 0 && this.dialogInfo.children.length > 0) {
                 this.activeName = this.dialogInfo.children[0].param.tab_code
+            } else {
+                this.activeName = this.dialogInfo.param.tab_code
             }
+            this.param = this.activeName
         },
         handleClick(tab) {
             this.param = tab.name
-            console.log(tab)
+            this.activeName = tab.name
         }
     }
 }

+ 2 - 2
src/views/equipment/index.vue

@@ -83,8 +83,8 @@ export default {
                 plazaId: '1001145'
             }
             querySelect({ data, postParams }).then(res => {
-                this.brand = res.data.data.glsms_asset.brand
-                this.manufacturer = res.data.data.glsms_asset.manufacturer
+                this.brand = res.data.data.glsms_asset ? res.data.data.glsms_asset.brand : []
+                this.manufacturer = res.data.data.glsms_asset ? res.data.data.glsms_asset.manufacturer : []
             })
         },
         tabFind() {

+ 5 - 8
src/views/equipment/table/eqListTable.vue

@@ -8,20 +8,20 @@
             <a-input-search placeholder style='width: 192px;margin-left:12px;height:32px;' @search='getList' />
         </div>
         <el-table :data='tableData' style='width: 100%'>
-            <el-table-column type='index' label='序号' width='80'></el-table-column>
+            <el-table-column prop='sbxh' label='序号' width='120'></el-table-column>
             <el-table-column prop='sbjbm' label='设备编号' width='160'></el-table-column>
             <el-table-column prop='sl' label='数量'></el-table-column>
             <el-table-column prop='brand' label='品牌'></el-table-column>
             <el-table-column prop='sbxh' label='型号'></el-table-column>
             <el-table-column prop='floor' label='楼层'></el-table-column>
             <el-table-column prop='wzjc' label='安装位置' width='240'></el-table-column>
-            <el-table-column prop='manufacturer' label='生产厂商'></el-table-column>
+            <el-table-column prop='manufacturer' label='生产厂商' width='240'></el-table-column>
         </el-table>
         <div class='foot'>
             <el-pagination
                 background
                 layout='prev, pager, next'
-                :total='total/pageSize'
+                :total='total'
                 :page-size='size'
                 @prev-click='pageChanged'
                 @next-click='pageChanged'
@@ -39,7 +39,6 @@ export default {
     components: { Select },
     data() {
         return {
-            pageSize: 10,
             dataSelect2: [
                 { id: 'test1', name: '选择项' },
                 { id: 'test2', name: '单平米' },
@@ -58,12 +57,10 @@ export default {
     },
     props: ['param', 'major'],
     methods: {
-        pageChanged(page, size) {
+        pageChanged(page) {
             this.currentPage = page
-            this.size = size
             this.getList()
         },
-
         init() {
             this.floorSelect = []
             if (this.floorsArr.length > 0) {
@@ -78,7 +75,7 @@ export default {
         },
         getList() {
             let postParams = {
-                CLASSSTRUCTUREID: this.param
+                tab_code: this.param
             }
             let data = {
                 page: this.currentPage,

+ 122 - 0
src/views/equipment/table/standTable.vue

@@ -0,0 +1,122 @@
+<!-- 设备清单的有select的表格 无tab的标准设备表格 -->
+<template>
+    <div class='stand-list'>
+        <div class='eq-list-top'>
+            <Select width='120' tipPlace='top' caption='楼层:' v-model='floor' :selectdata='floorSelect' style='margin:0 12px' @change='getList'></Select>
+            <a-input-search placeholder='请按照类别或品牌搜索' v-model='keyword' style='width: 192px;margin-left:12px;height:32px;' @search='getList' />
+        </div>
+        <el-table :data='tableData' style='width: 100%'>
+            <el-table-column type='index' label='序号' width='80'></el-table-column>
+            <el-table-column prop='sbjc' label='设备简称' width='160'></el-table-column>
+            <el-table-column prop='sl' label='数量'></el-table-column>
+            <el-table-column prop='brand' label='品牌'></el-table-column>
+            <el-table-column prop='sbxh' label='型号'></el-table-column>
+            <el-table-column prop='floor' label='楼层'></el-table-column>
+            <el-table-column prop='manufacturer' label='生产厂商'></el-table-column>
+        </el-table>
+        <div class='foot'>
+            <el-pagination
+                background
+                layout='prev, pager, next'
+                :total='total/pageSize'
+                :page-size='size'
+                @prev-click='pageChanged'
+                @next-click='pageChanged'
+                @current-change='pageChanged'
+            ></el-pagination>
+        </div>
+    </div>
+</template>
+<script>
+import { queryEquipmentList } from '@/api/equipmentList.js'
+export default {
+    data() {
+        return {
+            pageSize: 10,
+            tableData: [],
+            total: 0,
+            currentPage: 1,
+            size: 10,
+            keyword: '',
+            floorSelect: [],
+            floor: ''
+        }
+    },
+    props: ['major', 'param'],
+    methods: {
+        pageChanged(page, size) {
+            this.currentPage = page
+            this.getList()
+        },
+        init() {
+            this.floorSelect = []
+            if (this.floorsArr.length > 0) {
+                this.floorsArr.forEach(e => {
+                    let obj = {
+                        id: e,
+                        name: e
+                    }
+                    this.floorSelect.push(obj)
+                })
+            }
+        },
+        getList() {
+            let postParams = {
+                tab_code: this.param
+            }
+            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 = '燃气'
+            }
+            let data = {
+                page: this.currentPage,
+                size: this.size,
+                plazaId: this.$store.state.plazaId,
+                major: major,
+                keyword: this.keyword
+                // floor:this.floor
+            }
+            queryEquipmentList({ data, postParams }).then(res => {
+                this.tableData = res.data.data
+                this.total = res.data.count
+            })
+        }
+    },
+    watch: {
+        param(newV, oldV) {
+            if (newV !== oldV) {
+                this.getList()
+            }
+        }
+    },
+    mounted() {
+        // this.init()
+        this.getList()
+    }
+}
+</script>
+<style lang="less" scoped>
+.stand-list {
+    .eq-list-top {
+        display: flex;
+    }
+    .foot {
+        position: absolute;
+        height: 32px;
+        right: 26px;
+    }
+    td {
+        overflow: hidden;
+        text-overflow: ellipsis;
+        white-space: nowrap;
+    }
+}
+</style>

+ 14 - 8
src/views/equipment/table/tjTable.vue

@@ -1,15 +1,15 @@
-<!-- 设备清单的有select的表格 -->
+<!-- 设备清单的有select的表格 标准设备表格 -->
 <template>
     <div class='tj-list'>
         <div class='eq-list-top'>
-            <a-input-search placeholder='请按照类别或品牌搜索' v-model='keyword' style='width: 192px;margin-left:12px;height:32px;' @search='onSearch' />
+            <a-input-search placeholder='请按照类别或品牌搜索' v-model='keyword' style='width: 192px;margin-left:12px;height:32px;' @search='getList' />
         </div>
         <el-table :data='tableData' style='width: 100%'>
             <el-table-column type='index' label='序号' width='80'></el-table-column>
             <el-table-column prop='lb' label='类别' width='160'></el-table-column>
             <el-table-column prop='sl' label='数量'></el-table-column>
-            <el-table-column prop='unit' label='单位'></el-table-column>
             <el-table-column prop='brand' label='品牌'></el-table-column>
+            <el-table-column prop='unit' label='单位'></el-table-column>
         </el-table>
         <div class='foot'>
             <el-pagination
@@ -37,16 +37,16 @@ export default {
             keyword: ''
         }
     },
-    props: ['major'],
+    props: ['major', 'param'],
     methods: {
-        onSearch() {},
         pageChanged(page, size) {
             this.currentPage = page
-            this.size = size
             this.getList()
         },
         getList() {
-            let postParams = {}
+            let postParams = {
+                tab_code: this.param
+            }
             let data = {
                 page: this.currentPage,
                 size: this.size,
@@ -55,12 +55,18 @@ export default {
                 keyword: this.keyword
             }
             queryEquipmentList({ data, postParams }).then(res => {
-                console.log(res)
                 this.tableData = res.data.data
                 this.total = res.data.count
             })
         }
     },
+    watch: {
+        param(newV, oldV) {
+            if (newV !== oldV) {
+                this.getList()
+            }
+        }
+    },
     mounted() {
         this.getList()
     }