Browse Source

设备和资产台账添加分页

zhangyu 5 years ago
parent
commit
d918925def

+ 2 - 2
src/components/ledger/handsontables/assets.vue

@@ -761,8 +761,8 @@
                 equipCode: infos.EquipLocalID?infos.EquipLocalID:'',
                 data: this.tableData.map(item => {
                   return {
-                    id: item.EquipID,
-                    name: item.EquipLocalName?item.EquipLocalName:item.EquipName?item.EquipName:''
+                    value: item.EquipID,
+                    label: item.EquipLocalName?item.EquipLocalName:item.EquipName?item.EquipName:''
                   }
                 })
               }

+ 2 - 2
src/components/ledger/handsontables/device.vue

@@ -954,8 +954,8 @@
                         equipCode: infos.EquipLocalID?infos.EquipLocalID:'',
                         data: this.tableData.map(item => {
                           return {
-                            id: item.EquipID,
-                            name: item.EquipLocalName?item.EquipLocalName:item.EquipName?item.EquipName:''
+                            value: item.EquipID,
+                            label: item.EquipLocalName?item.EquipLocalName:item.EquipName?item.EquipName:''
                           }
                         })
                       }

+ 14 - 14
src/router/system.js

@@ -401,20 +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: 'propertyDetails', 
+                name: 'propertyDetails', 
+                component: propertyDetails,
+                meta: {
+                    keepAlive: false, 
+                    breadcrumbs: [
+                        {label: '台账管理', path: '/ledger/facility'},
+                        {label: '资产台账', path: '/ledger/property'}, 
+                        {label: '资产详情'}
+                    ]
+                }
+            },
             {
                 path: 'propertyadd',
                 name: 'propertyadd',

+ 28 - 5
src/views/ledger/facility/details/index.vue

@@ -47,7 +47,16 @@
         </div>
       </div>
     </div>
-    <div class="footer"></div>
+    <div class="footer">
+      <el-select size="mini" style="float:right;margin:7px 30px 0 0" v-model="id" @change="handleChangeExample" placeholder="请选择">
+        <el-option
+          v-for="item in list"
+          :key="item.value"
+          :label="item.label"
+          :value="item.value">
+        </el-option>
+      </el-select>
+    </div>
   </div>
 </template>
 
@@ -199,6 +208,8 @@
         Promise.all([promise1, promise2]).then(values => {
           this.pointData = values[0].Content;
           this.exampleData = values[1].Content[0];
+          this.name = this.exampleData.EquipLocalName?this.exampleData.EquipLocalName:this.exampleData.EquipName?this.exampleData.EquipName:'';
+          this.code = this.exampleData.EquipLocalID?this.exampleData.EquipLocalID:'';
           let obj = this.deepCopy(values[1].Content[0]);
           obj = flattenKeys(obj);
           this.instance = obj;
@@ -385,9 +396,17 @@
         this.exhibitionCrux.allMessage = result
       },
       goBack() {
-        this.$router.push({path: "/ledger/facility"})
+        this.$router.push({
+          name: "facilityLedger",
+          params: {
+            deviceId: this.type
+          }
+        })
+      },
+      // 切换实例
+      handleChangeExample() {
+        this.getData();
       },
-
     },
     watch: {
       projectId() {
@@ -414,7 +433,7 @@
       display: flex;
       flex-direction: row;
       box-sizing: border-box;
-      height: calc(100% - 82px);
+      height: calc(100% - 95px);
       .content-left {
         display: flex;
         flex-direction: column;
@@ -472,7 +491,11 @@
     }
 
     .footer {
-      height: 40px;
+      margin-top: 5px;
+      height: 45px;
+      background-color: #fff;
+      box-sizing: border-box;
+      border: 1px solid #ccc;
     }
   }
 

+ 28 - 4
src/views/ledger/property/details/index.vue

@@ -38,7 +38,16 @@
         </div>
       </div>
     </div>
-    <div class="footer"></div>
+    <div class="footer">
+      <el-select size="mini" style="float:right;margin:7px 30px 0 0" v-model="id" @change="handleChangeExample" placeholder="请选择">
+        <el-option
+          v-for="item in list"
+          :key="item.value"
+          :label="item.label"
+          :value="item.value">
+        </el-option>
+      </el-select>
+    </div>
   </div>
 </template>
 
@@ -176,6 +185,8 @@
         Promise.all([promise1, promise2]).then(values => {
           this.pointData = values[0].Content;
           this.exampleData = values[1].Content[0];
+          this.name = this.exampleData.EquipLocalName?this.exampleData.EquipLocalName:this.exampleData.EquipName?this.exampleData.EquipName:'';
+          this.code = this.exampleData.EquipLocalID?this.exampleData.EquipLocalID:'';
           let obj = this.deepCopy(values[1].Content[0]);
           obj = flattenKeys(obj);
           this.instance = obj;
@@ -320,7 +331,16 @@
         this.exhibitionCrux.allMessage = result
       },
       goBack () {
-        this.$router.push({path: "/ledger/property"})
+        this.$router.push({
+          name: 'propertyLedger',
+          params: {
+            Family: this.type
+          }
+        })
+      },
+      // 切换实例
+      handleChangeExample() {
+        this.getData();
       },
     },
     watch: {
@@ -347,7 +367,7 @@
       display: flex;
       flex-direction: row;
       box-sizing: border-box;
-      height: calc(100% - 82px);
+      height: calc(100% - 95px);
       .content-left {
         display: flex;
         flex-direction: column;
@@ -391,7 +411,11 @@
     }
 
     .footer {
-      height: 40px;
+      margin-top: 5px;
+      height: 45px;
+      background-color: #fff;
+      box-sizing: border-box;
+      border: 1px solid #ccc;
     }
   }