yx 4 years ago
parent
commit
c6aef5c27c

+ 55 - 16
src/views/equipment/table/eqDetaileDialog1.vue

@@ -55,8 +55,7 @@
                 v-model='wzjc'
             ></el-input>
             <!-- 多余的筛选 -->
-            <!-- 注释 -->
-            <!-- <input-dialog :type='1' @confirm='confirm'></input-dialog> -->
+            <input-dialog :type='1' @confirm='confirm'></input-dialog>
         </div>
         <div class='table1'>
             <el-table
@@ -65,7 +64,7 @@
                 :key='key'
                 :border='true'
                 style='width: 100%;'
-                :height='160'
+                :height='145'
                 :max-height='250'
                 :row-style='{height: "30px"}'
             >
@@ -76,6 +75,7 @@
                 <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>-->
@@ -127,16 +127,26 @@
         <div class='table-bottom'>
             <div class='title'>
                 <div class='text'>维保:</div>
-                <div class='d-tab d-tab-left' :class='{active:currentTab === 1}' @click='()=> currentTab = 1'>重要维保</div>
-                <div class='d-tab d-tab-right' :class='{active:currentTab === 2}' @click='()=> currentTab = 2'>日常维保</div>
+                <div class='d-tab d-tab-left' :class='{active:currentTab === 0}' @click='changeTab(0)'>重要维保</div>
+                <div class='d-tab d-tab-right' :class='{active:currentTab === 1}' @click='changeTab(1)'>日常维保</div>
                 <div class='text text-r'>维修:</div>
-                <div class='d-tab d-tab-left' :class='{active:currentTab === 3}' @click='()=> currentTab = 3'>重要维修</div>
-                <div class='d-tab d-tab-right' :class='{active:currentTab === 4}' @click='()=> currentTab = 4'>日常维修</div>
+                <div class='d-tab d-tab-left' :class='{active:currentTab === 2}' @click='changeTab(2)'>重要维修</div>
+                <div class='d-tab d-tab-right' :class='{active:currentTab === 3}' @click='changeTab(3)'>日常维修</div>
                 <!-- <el-tabs v-model='activeName' class='tab2' @tab-click='changeTable'> -->
             </div>
             <!-- TODO: 显示各个表格 -->
             <div class='table2-container'>
-                <wbTable ref='wb1' :smsxt='1004' tabLabel='重要维保' diff :assetnum='11266' :size='3' />
+                <component
+                    :is='currentComponent'
+                    :ref='currentComponent'
+                    :smsxt='rowData.system_code'
+                    :tabLabel='tabLabel[currentComponent]'
+                    :diff='diff'
+                    :assetnum='rowData.assetnum'
+                    :size='3'
+                ></component>
+                <!-- :max-height='220' -->
+                <!-- <wbTable ref='wb1' :smsxt='1004' tabLabel='重要维保' diff :assetnum='11266' :size='3' /> -->
             </div>
         </div>
     </div>
@@ -148,6 +158,10 @@ import { queryAsset } from '@/api/equipmentList.js'
 import { querySelect } from '@/api/public.js'
 import inputDialog from './inputDIalog'
 import wbTable from './wbTable'
+import rcwbTable from './rcwbTable'
+import wxTable from './wxTable'
+import rcwxTable from './rcwxTable'
+import { cloneDeep } from '../../../components/Select/utils'
 
 export default {
     data() {
@@ -175,14 +189,21 @@ export default {
             statusOption: [],
             floorAllSelect: [],
             key: 0,
-            currentTab: 1,
+            currentTab: 0, //选中页签,默认重要维保
+            currentComponent: 'wbTable', //选中的组件,默认 重要维保
+            componentArr: ['wbTable', 'rcwbTable', 'wxTable', 'rcwxTable'], //下部表格组件列表
+            tabLabel: {
+                //下部表格组件列表使用label
+                wbTable: '重要维保',
+                rcwbTable: '日常维保',
+                wxTable: '重要维修',
+                rcwxTable: '日常维保',
+            },
+            diff: '', //?
+            rowData: {}, //行数据,供下部表格使用参数
         }
     },
-    components: {
-        Select,
-        inputDialog,
-        wbTable,
-    },
+    components: { Select, inputDialog, wbTable, rcwbTable, wxTable, rcwxTable },
     computed: {
         ...mapGetters(['floorSelect']),
     },
@@ -193,8 +214,15 @@ export default {
         this.getFloorAllSelect()
     },
     methods: {
+        // 上部表格行点击
         innerTable(row) {
             console.log(row)
+            // 设置下部表格使用的行数据
+            this.rowData = cloneDeep(row)
+            // TODO:
+            this.$nextTick(() => {
+                this.$refs[this.currentComponent].startMethods()
+            })
             if (row.assetuid) {
                 window.open(`http://gcgl.wanda.cn/maximo/ui/?event=loadapp&value=assetdevic&uniqueid=${row.assetuid}`)
             }
@@ -343,6 +371,12 @@ export default {
                 this.tableData = res.data.data
                 this.total = res.data.count
                 this.key++
+                // 设置下部表格使用的行数据
+                if (this.tableData[0]) {
+                    this.rowData = cloneDeep(this.tableData[0])
+                } else {
+                    this.rowData = {}
+                }
             })
         },
         getFloorAllSelect() {
@@ -361,8 +395,13 @@ export default {
                 this.page = 1
             }
         },
-        handleClickWb() {},
-        changeTable() {},
+        // 更改tab页签
+        changeTab(index) {
+            this.currentTab = index
+            this.currentComponent = this.componentArr[index]
+            // TODO:
+            this.$refs[currentComponent].startMethods()
+        },
     },
     watch: {
         row: {

+ 17 - 1
src/views/equipment/table/eqListTable.vue

@@ -90,7 +90,7 @@
         >
             <eq-detail ref='qdDialog' :row='row' :major='major' :smsxt='smsxt' :diff='diff' :sign='sign'></eq-detail>
         </el-dialog>-->
-        <el-dialog width='100%' :title='`${InfoName}-${type_name}`' :visible.sync='innerVisible' append-to-body :fullscreen='true'>
+        <el-dialog width='100%' :title='`${type_name}设备清单`' :visible.sync='innerVisible' append-to-body :fullscreen='true'>
             <eq-detail ref='qdDialog' :row='row' :major='major' :smsxt='smsxt' :diff='diff' :sign='sign'></eq-detail>
         </el-dialog>
     </div>
@@ -256,4 +256,20 @@ export default {
         cursor: pointer;
     }
 }
+// 弹窗头部样式修改
+.el-dialog__header {
+    padding: 16px 24px;
+    background: linear-gradient(180deg, rgba(54, 156, 247, 1) 0%, rgba(2, 91, 170, 1) 100%);
+}
+.el-dialog__headerbtn .el-dialog__close {
+    color: #fff;
+}
+.el-dialog__title {
+    font-size: 16px;
+    padding-right: 6px;
+    padding-left: 24px;
+    font-weight: bold;
+    color: #fff;
+    font-weight: normal;
+}
 </style>

+ 22 - 1
src/views/equipment/table/standTable.vue

@@ -83,7 +83,7 @@
             <eq-detail ref='qdDialog' :row='row' :major='major' :smsxt='smsxt' :diff='diff' :sign='sign'></eq-detail>
         </el-dialog>-->
         <!-- 标准表格详情钻取表,使用全屏弹窗 -->
-        <el-dialog width='100%' :title='`${InfoName}-${type_name}`' :visible.sync='innerVisible' append-to-body :fullscreen='true'>
+        <el-dialog width='100%' :title='`${type_name}设备清单`' :visible.sync='innerVisible' append-to-body :fullscreen='true'>
             <eq-detail ref='qdDialog' :row='row' :major='major' :smsxt='smsxt' :diff='diff' :sign='sign'></eq-detail>
         </el-dialog>
     </div>
@@ -243,6 +243,10 @@ export default {
         margin-top: 28px;
     }
 }
+// /deep/.dialog-container .el-dialog__header {
+//     padding: 16px 24px;
+//     background: linear-gradient(180deg, #369cf7 0%, #025baa 100%);
+// }
 @media screen and (max-width: 1600px) {
     /deep/ .el-dialog__body {
         padding: 0;
@@ -262,4 +266,21 @@ export default {
         cursor: pointer;
     }
 }
+// 弹窗头部样式修改
+.el-dialog__header {
+    padding: 16px 24px;
+    background: linear-gradient(180deg, rgba(54, 156, 247, 1) 0%, rgba(2, 91, 170, 1) 100%);
+}
+.el-dialog__headerbtn .el-dialog__close {
+    color: #fff;
+}
+
+.el-dialog__title {
+    font-size: 16px;
+    padding-right: 6px;
+    padding-left: 24px;
+    font-weight: bold;
+    color: #fff;
+    font-weight: normal;
+}
 </style>