Browse Source

modify css of parts

haojianlong 5 years ago
parent
commit
4aa89e104e

+ 12 - 5
src/components/ledger/handsontables/device.vue

@@ -1069,11 +1069,18 @@ export default {
       if (val == "linkSystem") {
         this.dialog.systemType = true
       }
-
-      if (val == "linkName" && this.onlyRead) {
-        this.$router.push({ name: 'partsLedger', params: { facilityId: infos.id }});
-      } else if (val == "linkName" && !this.onlyRead) {
-        this.$router.push({ name: 'partsmanageLedger', params: { facilityId: infos.id }});
+      //列表少包含的部件字段目前用当前关联的资产
+      if (val == "linkName") {
+        let partsVal = this.hot.getDataAtCell(row.row,row.col);//获取被点击的单元格的数据
+        if(this.onlyRead){
+          this.$router.push({ name: 'partsLedger', params: { facilityId: infos.id }});
+        }else{
+          if(partsVal > 0){
+            this.$router.push({ name: 'partsmanageLedger', params: { facilityId: infos.id }});
+          }else{
+            this.$router.push({ name: 'addparts', params: { facilityId: infos.id }});
+          }
+        }
       }
 
       if (val == "infos.Pic") {

+ 1 - 21
src/views/ledger/facility/partsmanage/addparts/index.vue

@@ -261,25 +261,6 @@ export default {
           info3: "王靖",
           info4: "文强",
           info5: "小白"
-        },{
-          operation: "查看详情",
-          demo1: "小龙",
-          demo2: "三娘",
-          info1: "阿党",
-          info2: "阿腾",
-          info3: "王靖",
-          info4: "文强",
-          info5: "小白"
-        },
-        {
-          operation: "查看详情",
-          demo1: "小龙",
-          demo2: "三娘",
-          info1: "阿党",
-          info2: "阿腾",
-          info3: "王靖",
-          info4: "文强",
-          info5: "小白"
         }
       ],
       tableHeader: ["信息1", "信息2", "信息3", "信息4", "信息5"],
@@ -637,7 +618,6 @@ export default {
 </script>
 <style lang="scss" scoped>
 .container {
-  border: 1px solid #333333;
   padding: 15px;
   position: relative;
   .table-top {
@@ -671,7 +651,7 @@ export default {
     margin: 20px 0;
     overflow: hidden;
     .tableBox {
-      height: calc(100% - 130px);
+      // height: calc(100% - 130px);
     }
     .el-button{
       display: block;

+ 134 - 90
src/views/ledger/facility/partsmanage/index.vue

@@ -12,31 +12,33 @@
     </div>
     <el-row class="right">
       <el-checkbox v-model="checked">隐藏自动填充的信息</el-checkbox>
-      <el-button @click="addparts">添加部件</el-button>
+      <el-button @click="addparts">添加3部件</el-button>
       <el-button>刷新</el-button>
       <el-button>撤销</el-button>
     </el-row>
     <div class="tableBox">
       <handson-table ref="table"></handson-table>
     </div>
-    <el-pagination
-      class="center"
-      @size-change="handleSizeChange"
-      @current-change="handleCurrentChange"
-      :current-page="page.pageNumber"
-      :page-sizes="page.pageSizes"
-      :page-size="page.pageSize"
-      layout="total, sizes, prev, pager, next, jumper"
-      :total="page.total">
-    </el-pagination>
+    <div class="table-bottom">
+      <el-pagination
+        class="fr"
+        @size-change="handleSizeChange"
+        @current-change="handleCurrentChange"
+        :current-page="page.pageNumber"
+        :page-sizes="page.pageSizes"
+        :page-size="page.pageSize"
+        layout="total, sizes, prev, pager, next, jumper"
+        :total="page.total"
+      ></el-pagination>
+    </div>
   </div>
 </template>
 
 <script>
 import tools from "@/utils/scan/tools";
-import handsonUtils from "@/utils/hasontableUtils"
-import showTools from "@/utils/handsontable/notShow"
-import text from "@/utils/handsontable/mainText"
+import handsonUtils from "@/utils/hasontableUtils";
+import showTools from "@/utils/handsontable/notShow";
+import text from "@/utils/handsontable/mainText";
 
 import handsonTable from "@/components/common/handsontable";
 import { mapGetters, mapActions } from "vuex";
@@ -45,9 +47,7 @@ export default {
   components: {
     handsonTable
   },
-  props: {
-
-  },
+  props: {},
   data() {
     return {
       partsId: "",
@@ -68,7 +68,8 @@ export default {
           info3: "王靖",
           info4: "文强",
           info5: "小白"
-        }, {
+        },
+        {
           operation: "查看详情",
           demo1: "小龙",
           demo2: "三娘",
@@ -77,7 +78,8 @@ export default {
           info3: "王靖",
           info4: "文强",
           info5: "小白"
-        },{
+        },
+        {
           operation: "查看详情",
           demo1: "小龙",
           demo2: "三娘",
@@ -86,7 +88,8 @@ export default {
           info3: "王靖",
           info4: "文强",
           info5: "小白"
-        },{
+        },
+        {
           operation: "查看详情",
           demo1: "小龙",
           demo2: "三娘",
@@ -95,7 +98,8 @@ export default {
           info3: "王靖",
           info4: "文强",
           info5: "小白"
-        },{
+        },
+        {
           operation: "查看详情",
           demo1: "小龙",
           demo2: "三娘",
@@ -104,7 +108,8 @@ export default {
           info3: "王靖",
           info4: "文强",
           info5: "小白"
-        },{
+        },
+        {
           operation: "查看详情",
           demo1: "小龙",
           demo2: "三娘",
@@ -113,7 +118,8 @@ export default {
           info3: "王靖",
           info4: "文强",
           info5: "小白"
-        },{
+        },
+        {
           operation: "查看详情",
           demo1: "小龙",
           demo2: "三娘",
@@ -122,7 +128,8 @@ export default {
           info3: "王靖",
           info4: "文强",
           info5: "小白"
-        },{
+        },
+        {
           operation: "查看详情",
           demo1: "小龙",
           demo2: "三娘",
@@ -131,7 +138,8 @@ export default {
           info3: "王靖",
           info4: "文强",
           info5: "小白"
-        },{
+        },
+        {
           operation: "查看详情",
           demo1: "小龙",
           demo2: "三娘",
@@ -140,7 +148,8 @@ export default {
           info3: "王靖",
           info4: "文强",
           info5: "小白"
-        },{
+        },
+        {
           operation: "查看详情",
           demo1: "小龙",
           demo2: "三娘",
@@ -159,7 +168,8 @@ export default {
           info3: "王靖",
           info4: "文强",
           info5: "小白"
-        }, {
+        },
+        {
           operation: "查看详情",
           demo1: "小龙",
           demo2: "三娘",
@@ -168,7 +178,8 @@ export default {
           info3: "王靖",
           info4: "文强",
           info5: "小白"
-        },{
+        },
+        {
           operation: "查看详情",
           demo1: "小龙",
           demo2: "三娘",
@@ -177,7 +188,8 @@ export default {
           info3: "王靖",
           info4: "文强",
           info5: "小白"
-        },{
+        },
+        {
           operation: "查看详情",
           demo1: "小龙",
           demo2: "三娘",
@@ -186,7 +198,8 @@ export default {
           info3: "王靖",
           info4: "文强",
           info5: "小白"
-        },{
+        },
+        {
           operation: "查看详情",
           demo1: "小龙",
           demo2: "三娘",
@@ -195,7 +208,8 @@ export default {
           info3: "王靖",
           info4: "文强",
           info5: "小白"
-        },{
+        },
+        {
           operation: "查看详情",
           demo1: "小龙",
           demo2: "三娘",
@@ -204,7 +218,8 @@ export default {
           info3: "王靖",
           info4: "文强",
           info5: "小白"
-        },{
+        },
+        {
           operation: "查看详情",
           demo1: "小龙",
           demo2: "三娘",
@@ -213,7 +228,8 @@ export default {
           info3: "王靖",
           info4: "文强",
           info5: "小白"
-        },{
+        },
+        {
           operation: "查看详情",
           demo1: "小龙",
           demo2: "三娘",
@@ -222,7 +238,8 @@ export default {
           info3: "王靖",
           info4: "文强",
           info5: "小白"
-        },{
+        },
+        {
           operation: "查看详情",
           demo1: "小龙",
           demo2: "三娘",
@@ -231,7 +248,8 @@ export default {
           info3: "王靖",
           info4: "文强",
           info5: "小白"
-        },{
+        },
+        {
           operation: "查看详情",
           demo1: "小龙",
           demo2: "三娘",
@@ -292,21 +310,20 @@ export default {
   methods: {
     //获取表头
     getHeaderData() {
-      this.changeCader()
-      if(this.mess.deviceId){
-          getTableHeader({
-            code: this.mess.deviceId,
-            ProjId: this.projectId
+      this.changeCader();
+      if (this.mess.deviceId) {
+        getTableHeader({
+          code: this.mess.deviceId,
+          ProjId: this.projectId
         }).then(res => {
-            this.headers = res.data.Content;
-            this.getMain()
+          this.headers = res.data.Content;
+          this.getMain();
         });
       }
-      
     },
-    addparts(){
-       this.$router.push({ name: 'addparts', params: { facilityId: 1 }});
-       console.log("dianjile")
+    addparts() {
+      this.$router.push({ name: "addparts", params: { facilityId: 1 } });
+      console.log("dianjile");
     },
     createTable() {
       const params = {
@@ -315,7 +332,7 @@ export default {
         PageNumber: this.page.pageNumber,
         PageSize: this.page.pageSize,
         Projection: []
-      }
+      };
       let settings = {
         data: this.tableData,
         colHeaders: this.header,
@@ -342,7 +359,8 @@ export default {
         this.tableExample = this.$refs.table.init(settings);
       });
     },
-    handleTdClick(el, rowArr) { //点击表格的操作
+    handleTdClick(el, rowArr) {
+      //点击表格的操作
       //点击的是表头
       if (rowArr.row < 0) {
         return;
@@ -358,7 +376,8 @@ export default {
         this.getInfors(infos, { row: sortArr[rowArr.row], col: rowArr.col });
       } else if (isSort) {
         //排序后的数组
-        let sortArr = this.tableExample.getPlugin("columnSorting").rowsMapper.__arrayMap;
+        let sortArr = this.tableExample.getPlugin("columnSorting").rowsMapper
+          .__arrayMap;
         let infos = this.tableData[sortArr[rowArr.row]];
         this.getInfors(infos, { row: sortArr[rowArr.row], col: rowArr.col });
       } else if (trimmedArr.length) {
@@ -373,12 +392,17 @@ export default {
     getInfors(infos, row) {
       //其他的开始判断
       let val = this.tableExample.colToProp(row.col);
-      this.row = row.row
-      this.messKey = val
-      this.systemId = infos.id
+      this.row = row.row;
+      this.messKey = val;
+      this.systemId = infos.id;
       debugger;
       if (val == "operation") {
-         window.open(`http://47.94.89.44:8058/spread?id=${infos.id}&pid=${this.projectId}&secret=${this.secret}`,"_blank")
+        window.open(
+          `http://47.94.89.44:8058/spread?id=${infos.id}&pid=${
+            this.projectId
+          }&secret=${this.secret}`,
+          "_blank"
+        );
         // this.iframeSrc =
         //   process.env.BASE_URL +
         //   ":8889/#/details?perjectId=" +
@@ -400,51 +424,71 @@ export default {
         val == "infos.Drawing"
       ) {
         if (this.onlyRead) {
-          this.dialog.lookPic = true
-          this.picsArr = this.tableData[row.row].infos ? (this.tableData[row.row].infos[val.split(".")[1]] ? this.tableData[row.row].infos[val.split(".")[1]] : []) : []
+          this.dialog.lookPic = true;
+          this.picsArr = this.tableData[row.row].infos
+            ? this.tableData[row.row].infos[val.split(".")[1]]
+              ? this.tableData[row.row].infos[val.split(".")[1]]
+              : []
+            : [];
         } else {
-          this.imgsArr = this.tableData[row.row].infos ? (this.tableData[row.row].infos[val.split(".")[1]] ? this.tableData[row.row].infos[val.split(".")[1]] : []) : []
-          this.dialog.uploadImgs = true
+          this.imgsArr = this.tableData[row.row].infos
+            ? this.tableData[row.row].infos[val.split(".")[1]]
+              ? this.tableData[row.row].infos[val.split(".")[1]]
+              : []
+            : [];
+          this.dialog.uploadImgs = true;
         }
       }
 
       if (val == "linkSystem") {
-        this.dialog.systemType = true
+        this.dialog.systemType = true;
       }
 
       if (val == "linkName" && this.onlyRead) {
-        this.$router.push({ name: 'partsLedger'});
+        this.$router.push({ name: "partsLedger" });
       } else if (val == "linkName" && !this.onlyRead) {
-        this.$router.push({ name: 'partsLedger'});
+        this.$router.push({ name: "partsLedger" });
       }
 
       if (val == "infos.Pic") {
-        this.picsArr = this.tableData[row.row].infos ? (this.tableData[row.row].infos[val.split(".")[1]] ? this.tableData[row.row].infos[val.split(".")[1]] : []) : []
+        this.picsArr = this.tableData[row.row].infos
+          ? this.tableData[row.row].infos[val.split(".")[1]]
+            ? this.tableData[row.row].infos[val.split(".")[1]]
+            : []
+          : [];
         if (this.onlyRead) {
-          this.dialog.lookPic = true
+          this.dialog.lookPic = true;
         } else {
-          this.dialog.pic = true
+          this.dialog.pic = true;
         }
       }
-      if (val == "infos.InsuranceFile" || val == "infos.Archive" || val == "infos.CheckReport") {
-        this.filesArr = this.tableData[row.row].infos ? (this.tableData[row.row].infos[val.split(".")[1]] ? this.tableData[row.row].infos[val.split(".")[1]] : []) : []
-        this.dialog.uploadFiles = true
+      if (
+        val == "infos.InsuranceFile" ||
+        val == "infos.Archive" ||
+        val == "infos.CheckReport"
+      ) {
+        this.filesArr = this.tableData[row.row].infos
+          ? this.tableData[row.row].infos[val.split(".")[1]]
+            ? this.tableData[row.row].infos[val.split(".")[1]]
+            : []
+          : [];
+        this.dialog.uploadFiles = true;
       }
       if (val == "linkName" && this.linkNameFalg) {
-        this.category = this.tableData[row.row]
-        this.dialog.changeRea = true
+        this.category = this.tableData[row.row];
+        this.dialog.changeRea = true;
       }
       if (val == "infos.EquipQRCode") {
-        this.qrcodeUrl = this.tableData[row.row].infos.EquipQRCode
+        this.qrcodeUrl = this.tableData[row.row].infos.EquipQRCode;
         if (!!this.qrcodeUrl) {
           this.dialog.qrcode = true;
         } else {
-          this.$message("此设备没有设备二维码")
+          this.$message("此设备没有设备二维码");
         }
       }
 
       if (this.onlyRead) {
-        return
+        return;
       }
 
       if (val == "infos.DPManufacturerID") {
@@ -452,43 +496,41 @@ export default {
       }
 
       if (val == "infos.SupplierContractID") {
-        let falg = null
+        let falg = null;
         if (!!this.tableData[row.row].infos) {
           if (!!this.tableData[row.row].infos.DPSupplierID) {
-            falg = this.tableData[row.row].infos.DPSupplierID.split("-")[0]
+            falg = this.tableData[row.row].infos.DPSupplierID.split("-")[0];
           }
         }
         if (!!falg) {
-          this.id = falg
+          this.id = falg;
           this.dialog.supply = true;
         } else {
-          this.$message("请先选择供应商")
+          this.$message("请先选择供应商");
         }
       }
 
       if (val == "infos.InsuranceNum") {
         //选择保单
-        let falg = null
+        let falg = null;
         if (!!this.tableData[row.row].infos) {
           if (!!this.tableData[row.row].infos.DPInsurerID) {
-            falg = this.tableData[row.row].infos.DPInsurerID.split("-")[0]
+            falg = this.tableData[row.row].infos.DPInsurerID.split("-")[0];
           }
         }
         if (!!falg) {
-          this.id = falg
+          this.id = falg;
           this.dialog.guarantee = true;
         } else {
-          this.$message("请先选择保险商")
+          this.$message("请先选择保险商");
         }
       }
 
-      if (
-        val == "infos.DPSupplierID"
-      ) {
+      if (val == "infos.DPSupplierID") {
         if (!!infos.linkId) {
           this.dialog.supplier = true;
         } else {
-          this.$message("该设备无关联资产")
+          this.$message("该设备无关联资产");
         }
       }
 
@@ -496,16 +538,15 @@ export default {
         if (!!infos.linkId) {
           this.dialog.maintainer = true;
         } else {
-          this.$message("该设备无关联资产")
+          this.$message("该设备无关联资产");
         }
       }
 
-      if (
-        val == "infos.DPInsurerID") {
+      if (val == "infos.DPInsurerID") {
         if (!!infos.linkId) {
           this.dialog.insurer = true;
         } else {
-          this.$message("该设备无关联资产")
+          this.$message("该设备无关联资产");
         }
       }
     },
@@ -543,8 +584,8 @@ export default {
       }
       return a;
     },
-    handleTabClick() { //切换部件时回调
-
+    handleTabClick() {
+      //切换部件时回调
     },
     handleSizeChange(val) {
       console.log(`每页 ${val} 条`);
@@ -581,7 +622,7 @@ export default {
 };
 </script>
 
-<style lang="scss">
+<style lang="scss" scoped>
 .tableBox {
   height: calc(100% - 150px);
 }
@@ -590,4 +631,7 @@ export default {
     margin-bottom: 0;
   }
 }
+.fr {
+  float: right;
+}
 </style>