From 79eab76ac1b4b77696c92d72cfbde1e122c4c28f Mon Sep 17 00:00:00 2001
From: jinlin <jinlin>
Date: 星期一, 28 十月 2024 17:58:44 +0800
Subject: [PATCH] 关于修改可靠性产品重复

---
 web/src/views/modules/baseReliability/ParamDataBasic.vue |   69 ++++++++++++++++++++++------------
 1 files changed, 45 insertions(+), 24 deletions(-)

diff --git a/web/src/views/modules/baseReliability/ParamDataBasic.vue b/web/src/views/modules/baseReliability/ParamDataBasic.vue
index cab88f5..5b497be 100644
--- a/web/src/views/modules/baseReliability/ParamDataBasic.vue
+++ b/web/src/views/modules/baseReliability/ParamDataBasic.vue
@@ -29,6 +29,7 @@
                       border @selection-change="table.selectionChangeHandle">
               <!--<el-table-column type="selection" width="40"/>-->
               <el-table-column prop="name" label="鍚嶇О"/>
+              <el-table-column prop="basicUnitNum" label="鍗曞厓鏁伴噺"/>
               <el-table-column prop="basicMtbfRegulate" label="MTBF" align="right">
                 <template slot-scope="scope">
                   <span>{{  keepNumber(scope.row.basicMtbfRegulate) }}</span>
@@ -37,6 +38,16 @@
               <el-table-column prop="repairMttcr" label="MTTR" align="right">
                 <template slot-scope="scope">
                   <span>{{  keepNumber(scope.row.repairMttcr) }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column prop="basicMtbfRegulSuccRate" label="鎴愬姛鐜�" align="right">
+                <template slot-scope="scope">
+                  <span>{{keepNumber(scope.row.basicMtbfRegulSuccRate) }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column prop="basicRunsNum" label="杩愯娆℃暟" align="right">
+                <template slot-scope="scope">
+                  <span>{{scope.row.basicRunsNum}}</span>
                 </template>
               </el-table-column>
               <el-table-column prop="basicMtbfOperatingRatio" label="杩愯姣�" align="right">
@@ -68,7 +79,9 @@
           basicMtbfRegulate: '',
           repairMttcr: '',
           basicMtbfOperatingRatio: '',
-          ai: ''
+          ai: '',
+          basicMtbfRegulSuccRate:'',
+          basicRunsNum:''
         },
         defultKey: []
       }
@@ -79,10 +92,17 @@
     computed: {
       keepNumber() { //杩囨护鍣ㄤ繚鐣�4涓哄皬鏁�
         return function (val) {		// 瀵硅绠楀睘鎬ц繘琛屼紶鍙�
-          const numM = Number(val).toFixed(5);
-          return numM.substring(0, numM.length - 1);
+          let numM = 0.0
+          if (val){
+            numM = Number(val).toFixed(4);
+            numM.substring(0, numM.length - 1)
+          }
+          return numM;
         }
       },
+    },
+    mounted() {
+      this.$refs.modelTree.getProductList()
     },
     methods: {
       onProductSelected(data) {
@@ -112,29 +132,30 @@
         })
       },
       cellStyle({row, column, rowIndex, columnIndex}) {
-        let warningColor = false;
-        //   console.log(row, column, rowIndex, columnIndex);
-        //console.log(row, "row");
-        Object.keys(row).forEach((key, index) => {
-          //閬嶅巻姣忚涓瘡涓暟鎹殑state
-          if (key === "repairMttcr" || key === "basicMtbfRegulate") {
-            //console.log(key, "row key");
-            let val = row[key]
-            const numM = Number(val).toFixed(5);
-            if (numM.substring(0, numM.length - 1) === '0.0000' && val > 0) {
-              //瀹氫綅璇ユ暟鎹殑鍧愭爣
-              if (columnIndex === 2) {
-                warningColor = true;
-              }
-            }
-          }
-        });
-
-        if (warningColor) {
-          // red涓烘兂鍙樻垚鐨勫崟鍏冩牸鏍峰紡
+        const numM1 = Number(row.repairMttcr).toFixed(5);
+        const numM2 = Number(row.basicMtbfRegulate).toFixed(5);
+        console.log(numM1,numM2,'234')
+        if (numM1.substring(0, numM1.length - 1) === '0.0000' && row.repairMttcr > 0 && column.property ==="repairMttcr") {
           return 'color : red'
+        } else if (numM2.substring(0, numM1.length - 1) === '0.0000' && row.basicMtbfRegulate > 0 && column.property ==="basicMtbfRegulate") {
+          return 'color : red'
+        }else {
+          return ''
         }
-        return "";
+        // Object.keys(row).forEach((key, index) => {
+        //   //閬嶅巻姣忚涓瘡涓暟鎹殑state
+        //   if (key === "repairMttcr" || key === "basicMtbfRegulate") {
+        //     //console.log(key, "row key");
+        //     let val = row[key]
+        //     const numM = Number(val).toFixed(5);
+        //     if (numM.substring(0, numM.length - 1) === '0.0000' && val > 0) {
+        //       //瀹氫綅璇ユ暟鎹殑鍧愭爣
+        //       if (columnIndex === 2) {
+        //         warningColor = true;
+        //       }
+        //     }
+        //   }
+        // });
       },
     }
   }

--
Gitblit v1.9.1