Browse Source

资产台账和系统台账添加详情页

zhangyu 5 years ago
parent
commit
957a5172f9

+ 16 - 1
src/components/ledger/handsontables/assets.vue

@@ -751,7 +751,22 @@
           //操作
           case 'caozuo':
             // window.open(`http://adm.sagacloud.cn:8058/spread?id=${infos.EquipID}&pid=${this.projectId}&secret=${this.secret}`,"_blank")
-            this.$message("开发中...")
+            // this.$message("开发中...")
+            this.$router.push({
+              path: "propertyDetails",
+              query: {
+                type: this.mess.deviceId,
+                equipId: infos.EquipID,
+                equipName: infos.EquipLocalName?infos.EquipLocalName:infos.EquipName?infos.EquipName:'',
+                equipCode: infos.EquipLocalID?infos.EquipLocalID:'',
+                data: this.tableData.map(item => {
+                  return {
+                    id: item.EquipID,
+                    name: item.EquipLocalName?item.EquipLocalName:item.EquipName?item.EquipName:''
+                  }
+                })
+              }
+            })
             return false
           //资产二维码图片
           case 'EquipQRCode':

+ 22 - 9
src/router/system.js

@@ -47,6 +47,7 @@ import systemadd from '@/views/ledger/system/addsystem'
 import systemDetail from '@/views/ledger/system/systemDetail'
 import facilityLedger from '@/views/ledger/facility'
 import deviceDetails from "@/views/ledger/facility/details";
+import propertyDetails from "@/views/ledger/property/details";
 import partsLedger from '@/views/ledger/facility/parts'
 import partsmanageLedger from '@/views/ledger/facility/partsmanage'
 import partsadd from '@/views/ledger/facility/partsmanage/addparts'
@@ -341,15 +342,14 @@ export default [{
             name: 'deviceDetails', 
             component: deviceDetails,
             meta: {
-                keepAlive: false, 
-                breadcrumbs: [
-                    {label: '台账管理', path: '/ledger/facility'},
-                    {label: '设备台账', path: '/ledger/facility'}, 
-                    {label: '台账详情'}
-                ]
+							keepAlive: false, 
+							breadcrumbs: [
+								{label: '台账管理', path: '/ledger/facility'},
+								{label: '设备台账', path: '/ledger/facility'}, 
+								{label: '台账详情'}
+							]
             }
-        },
-
+          },
           {
             path: 'parts',
             name: 'partsLedger',
@@ -401,7 +401,20 @@ export default [{
                 name: 'propertyLedger',
                 component: propertyLedger,
                 meta: { keepAlive: false, breadcrumbs: [{ label: '台账管理', path: '/ledger/facility' }, { label: '资产台账' }] }
-            },
+						},
+						{
+							path: 'propertyDetails', 
+							name: 'propertyDetails', 
+							component: propertyDetails,
+							meta: {
+								keepAlive: false, 
+								breadcrumbs: [
+									{label: '台账管理', path: '/ledger/facility'},
+									{label: '资产台账', path: '/ledger/property'}, 
+									{label: '资产详情'}
+								]
+							}
+						},
             {
                 path: 'propertyadd',
                 name: 'propertyadd',

+ 2 - 0
src/views/ledger/facility/details/index.vue

@@ -244,10 +244,12 @@
           height: 50px;
           margin-bottom: 10px;
           border: 1px solid #ccc;
+          box-sizing: border-box;
         }
         .content-media {
           height: calc(100% - 60px);
           border: 1px solid #ccc;
+          box-sizing: border-box;
         }
       }
     }

+ 214 - 0
src/views/ledger/property/details/index.vue

@@ -0,0 +1,214 @@
+<template>
+  <div class="tableDisplay">
+    <div class="header">
+      <el-button style="float:left;" size="small" type="default" icon="el-icon-back" @click="goBack"></el-button>
+      <span class="details-title"><b>{{name}} - {{code}}</b></span>
+    </div>
+    <div class="content">
+      <div class="content-left">
+        <div class="content-keyPoint"></div>
+        <div class="content-showType"></div>
+        <div class="content-point">
+          <div class="content-point-left">
+            <el-scrollbar style="height:100%;">
+              <div style="height:1000px"></div>
+            </el-scrollbar>
+          </div>
+        </div>
+      </div>
+      <div class="content-right">
+        <div class="content-media">
+          <el-scrollbar style="height:100%;">
+            <div style="height:1000px"></div>
+          </el-scrollbar>
+        </div>
+      </div>
+    </div>
+    <div class="footer"></div>
+  </div>
+</template>
+
+<script>
+  import exhibitionBaseInformation from "@/components/ledger/details/detail/exhibitionBaseInformation";
+  import exhibitionFile from "@/components/ledger/details/detail/exhibitionFile";
+  import exhibitionImage from "@/components/ledger/details/detail/exhibitionImage";
+  import selectRadio from "@/components/ledger/details/detail/selectRadio";
+
+  import { getDataDictionary, queryProperty } from "@/api/scan/request";
+  import { mapGetters, mapActions } from "vuex";
+
+  export default {
+    name: "propertyDetails",
+    components: {exhibitionBaseInformation, exhibitionFile, exhibitionImage, selectRadio},
+    created() {
+      this.id = this.$route.query.equipId;
+      this.name = this.$route.query.equipName;
+      this.code = this.$route.query.equipCode;
+      this.type = this.$route.query.type;
+      this.list = this.$route.query.data;
+      this.getData();
+      console.log(this.$route.query)
+    },
+    computed: {
+      ...mapGetters("layout", ["projectId", "secret", "userId"])
+    },
+    data() {
+      return {
+        id: '', //当前资产id
+        name: '', //当前资产本地名称
+        code: '', //当前资产的本地编码
+        type: '', //资产类型
+        list: [], //资产列表
+        pointData: [], //信息点数据
+        exampleData: {}, //实例数据
+        selectRadio: {
+          information: '资产信息点',
+          radioList: [
+            {
+              value: '显示需采集信息点',
+              label: '1'
+            },
+            {
+              value: '显示需采集信息点',
+              label: '2'
+            },
+            {
+              value: '显示需采集信息点',
+              label: '3'
+            }
+          ]
+        },
+        exhibitionBaseInformation: {
+          //产品说所有信息的key和value是动态生成的
+          base: {
+            baseInformation: '基本信息',
+            list: [
+              {
+                text: '资产本地编码:',
+                val: '123--22:'
+              },
+              {
+                text: '资产二维码图片:',
+                val: '2:'
+              },
+            ]
+          },
+          manufacture: {
+            manufacturerParameter: '台账参数 / 设备厂家',
+          },
+          supplier: {
+            supplierParameters: '台账参数 / 供应购买'
+          }
+        },
+        exhibitionFile: {},
+        exhibitionImage: {
+          title:'图片'
+        }
+      }
+    },
+    methods: {
+      // 获取表头和实例数据
+      getData () {
+        let params1 = {
+          data: {
+            Orders: "sort asc",
+            PageNumber: 1,
+            PageSize: 1000
+          },
+          type: this.type
+        }, params2 = {
+          Filters: `EquipID='${this.id}'`,
+        };
+        let promise1 = new Promise((resolve, reject) => {
+          getDataDictionary(params1, res => {
+            resolve(res)
+          })
+        })
+        let promise2 = new Promise((resolve, reject) => {
+          queryProperty(params2, res => {
+            resolve(res)
+          })
+        })
+        Promise.all([promise1, promise2]).then(values => {
+          this.pointData = values[0].Content;
+          this.exampleData = values[1].Content[0];
+        })
+      },
+      goBack () {
+        this.$router.push({path: "/ledger/property"})
+      },
+    },
+    watch: {
+      projectId() {
+        this.$router.push({path: "/ledger/property"})
+      }
+    }
+  }
+</script>
+
+<style scoped lang="less">
+  .tableDisplay {
+    .header {
+      padding-bottom: 10px;
+      .details-title {
+        color: #333;
+        font-size: 16px;
+        margin-left: 20px;
+        line-height: 32px;
+      }
+    }
+
+    .content {
+      display: flex;
+      flex-direction: row;
+      box-sizing: border-box;
+      height: calc(100% - 82px);
+      .content-left {
+        display: flex;
+        flex-direction: column;
+        flex: 1;
+        .content-keyPoint {
+          border: 1px solid #ccc;
+          box-sizing: border-box;
+          height: 100px;
+          margin-bottom: 10px;
+          overflow: hidden;
+        }
+        .content-showType {
+          height: 50px;
+          border: 1px solid #ccc;
+          border-bottom: none;
+          box-sizing: border-box;
+        }
+        .content-point {
+          display: flex;
+          flex-direction: row;
+          height: calc(100% - 160px);
+          border: 1px solid #ccc;
+          box-sizing: border-box;
+          .content-point-left {
+            flex: 1;
+          }
+        }
+      }
+      .content-right {
+        width: 400px;
+        margin-left: 10px;
+        .content-media {
+          height: 100%;
+          border: 1px solid #ccc;
+          box-sizing: border-box;
+        }
+      }
+    }
+
+    .footer {
+      height: 40px;
+    }
+  }
+
+  /deep/ .el-scrollbar__wrap {
+    overflow-x: hidden;
+  }
+
+</style>

+ 115 - 20
src/views/ledger/system/systemDetail/index.vue

@@ -17,8 +17,30 @@
           <el-button size="small" @click="deleteSystem">删除系统</el-button>
         </div>
       </el-row>
-      <div v-if="activeTab=='detail'" style="height:calc(100% - 110px)">
-        <div>开发中...</div>
+      <div v-if="activeTab=='detail'" class="content">
+        <div class="content-left">
+          <div class="content-showType"></div>
+          <div class="content-point">
+            <div class="content-point-left">
+              <el-scrollbar style="height:100%;">
+                <div style="height:1000px"></div>
+              </el-scrollbar>
+            </div>
+            <div class="content-point-right">
+              <el-scrollbar style="height:100%;">
+                <div style="height:1000px"></div>
+              </el-scrollbar>
+            </div>
+          </div>
+        </div>
+        <div class="content-right">
+          <div class="content-repair"></div>
+          <div class="content-media">
+            <el-scrollbar style="height:100%;">
+              <div style="height:1000px"></div>
+            </el-scrollbar>
+          </div>
+        </div>
       </div>
       <!-- 系统内设备 -->
       <deviceTable v-if="activeTab=='Equipment'" :params="params" :type="activeTab"></deviceTable>
@@ -31,11 +53,16 @@
 </template>
 
 <script>
-import { mapGetters } from "vuex"
-import { queryLinkSys, deleteGeneralSys, queryDictionaryHead, buildingQuery } from '@/api/scan/request'
-import cenoteTable from '@/components/ledger/system/table/cenoteTable'
-import deviceTable from '@/components/ledger/system/table/deviceTable'
-import spaceTable from '@/components/ledger/system/table/spaceTable'
+import { mapGetters } from "vuex";
+import { getDataDictionary, queryLinkSys, deleteGeneralSys, queryDictionaryHead, buildingQuery } from '@/api/scan/request';
+
+import cenoteTable from '@/components/ledger/system/table/cenoteTable';
+import deviceTable from '@/components/ledger/system/table/deviceTable';
+import spaceTable from '@/components/ledger/system/table/spaceTable';
+import exhibitionBaseInformation from "@/components/ledger/details/detail/exhibitionBaseInformation";
+import exhibitionFile from "@/components/ledger/details/detail/exhibitionFile";
+import exhibitionImage from "@/components/ledger/details/detail/exhibitionImage";
+import selectRadio from "@/components/ledger/details/detail/selectRadio";
 export default {
   data() {
     return {
@@ -47,7 +74,8 @@ export default {
         { Code: 'space', Name: '系统所在业务空间' },
       ], //tab页
       activeTab: 'detail', //当前选中的tab
-      systemDetails: {}, //系统信息,
+      pointData: [], //信息点数据
+      exampleData: {}, //实例数据
       spaceType: {},//空间种类
       floorType: {}
     }
@@ -58,11 +86,15 @@ export default {
   components: {
     cenoteTable,
     deviceTable,
-    spaceTable
+    spaceTable,
+    exhibitionBaseInformation,
+    exhibitionFile,
+    exhibitionImage,
+    selectRadio
   },
   created() {
     this.params = this.$route.query;
-    this.getSystemDetails();
+    this.getData();
 
     let pa = {
       Filters: `parentId='Space'`
@@ -107,14 +139,32 @@ export default {
         params: this.params
       })
     },
-    // 查询系统详情
-    getSystemDetails() {
-      let pa = {
-        Filters: `SysID="${this.params.SysID}"`
-      }
-      queryLinkSys(pa, res => {
-        this.systemDetails = res.Content[0];
-      })
+    // 获取表头和实例数据
+    getData () {
+      let params1 = {
+          data: {
+            Orders: "sort asc",
+            PageNumber: 1,
+            PageSize: 1000
+          },
+          type: this.params.SysType
+        }, params2 = {
+          Filters: `SysID='${this.params.SysID}'`,
+        };
+        let promise1 = new Promise((resolve, reject) => {
+          getDataDictionary(params1, res => {
+            resolve(res)
+          })
+        })
+        let promise2 = new Promise((resolve, reject) => {
+          queryLinkSys(params2, res => {
+            resolve(res)
+          })
+        })
+        Promise.all([promise1, promise2]).then(values => {
+          this.pointData = values[0].Content;
+          this.exampleData = values[1].Content[0];
+        })
     },
     // 删除系统
     deleteSystem() {
@@ -124,7 +174,7 @@ export default {
         type: 'warning'
       }).then(() => {
         let pa = [{
-          SysID: this.systemDetails.SysID
+          SysID: this.exampleData.SysID
         }]
         this.removeSys(pa)
       }).catch(() => {
@@ -150,7 +200,7 @@ export default {
     flex-direction: column;
     border: 1px solid #dfe6ec;
     background: #fff;
-    margin-bottom: 10px;
+    box-sizing: border-box;
     .header {
       padding-bottom: 10px;
       span {
@@ -177,6 +227,48 @@ export default {
         border-bottom: 1px solid #e4e7ed;
       }
     }
+    .content {
+      display: flex;
+      flex-direction: row;
+      box-sizing: border-box;
+      height: calc(100% - 99px);
+      .content-left {
+        display: flex;
+        flex-direction: column;
+        flex: 1;
+        .content-showType {
+          height: 50px;
+          border: 1px solid #ccc;
+          border-bottom: none;
+          box-sizing: border-box;
+        }
+        .content-point {
+          display: flex;
+          flex-direction: row;
+          height: calc(100% - 50px);
+          border: 1px solid #ccc;
+          box-sizing: border-box;
+          .content-point-left {
+            flex: 1;
+          }
+        }
+      }
+      .content-right {
+        width: 400px;
+        margin-left: 10px;
+        .content-repair {
+          height: 50px;
+          margin-bottom: 10px;
+          border: 1px solid #ccc;
+          box-sizing: border-box;
+        }
+        .content-media {
+          height: calc(100% - 60px);
+          border: 1px solid #ccc;
+          box-sizing: border-box;
+        }
+      }
+    }
     .main {
       margin-top: 10px;
       height: calc(100% - 96px);
@@ -184,6 +276,9 @@ export default {
     .footer {
       margin-bottom: 10px;
     }
+    /deep/ .el-scrollbar__wrap {
+      overflow-x: hidden;
+    }
   }
 }
 </style>