haojianlong %!s(int64=5) %!d(string=hai) anos
pai
achega
213e0dc192

+ 6 - 11
src/components/ledger/handsontables/device.vue

@@ -39,7 +39,7 @@
         <div
         style="width:100px;cursor: pointer;float:right; font-size:14px;margin-right:10px"
       >
-      <el-select v-model="onlyRead" @click="changeRead" size="small">
+      <el-select v-model="onlyRead" @change="changeRead" size="small">
         <el-option
           v-for="item in options"
           :key="item.value"
@@ -316,8 +316,7 @@ export default {
       })
     },
     changeRead() {
-      this.onlyRead = !this.onlyRead
-      this.getMain()
+      this.getHeaderData(this.mess)
     },
     getEquipmentFamilyList() {
       getEquipmentFamily(res => {
@@ -604,7 +603,7 @@ export default {
           renderer: text.systemList,
           readOnly: true
         }, {
-          data: "linkName",
+          data: "Count",
           readOnly: true
         }
       );
@@ -1070,16 +1069,12 @@ export default {
         this.dialog.systemType = true
       }
       //列表少包含的部件字段目前用当前关联的资产
-      if (val == "linkName") {
+      if (val == "Count") {
         let partsVal = this.hot.getDataAtCell(row.row,row.col);//获取被点击的单元格的数据
         if(this.onlyRead){
-          this.$router.push({ name: 'partsLedger', params: { facilityId: infos.id }});
+          this.$router.push({ name: 'partsLedger', params: { deviceId: infos.infos.EquipID }});
         }else{
-          if(partsVal > 0){
-            this.$router.push({ name: 'partsmanageLedger', params: { facilityId: infos.id }});
-          }else{
-            this.$router.push({ name: 'addparts', params: { facilityId: infos.id }});
-          }
+          this.$router.push({ name: 'partsmanageLedger', params: { deviceId: infos.infos.EquipID,typeId: this.mess.deviceId }});
         }
       }
 

+ 4 - 2
src/views/ledger/facility/parts/index.vue

@@ -134,8 +134,10 @@ export default {
       };
       await getEquipPartsType(params).then(res => {
         this.partsTypeList = res.data.Content;
-        this.tabVal = this.partsTypeList[0].Category;
-        this.getTableHeader();
+        if(this.partsTypeList.length){
+          this.tabVal = this.partsTypeList[0].Category;
+          this.getTableHeader();
+        }
       });
     },
     // 获取表头数据(初始化表格)