From b4aa13669f6e6da6f5c4cf34abf6b21720c1c6c5 Mon Sep 17 00:00:00 2001
From: Fixiaobai <fixiaobai@163.com>
Date: 星期一, 28 八月 2023 14:32:00 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.110.209:9001/r/lims-before

---
 src/components/experiment/checkTheReport/index.vue |   34 +++++++++++++++++++++++++++++-----
 1 files changed, 29 insertions(+), 5 deletions(-)

diff --git a/src/components/experiment/checkTheReport/index.vue b/src/components/experiment/checkTheReport/index.vue
index 3c005d9..7d22893 100644
--- a/src/components/experiment/checkTheReport/index.vue
+++ b/src/components/experiment/checkTheReport/index.vue
@@ -40,13 +40,15 @@
                     <td>妫�娴嬬粨鏋�</td>
                     <td>鍗曢」鍒ゆ柇</td>
                 </tr>
-                <tr v-for="(item,index) in reportData.products" :key="item">
+                <tr v-for="(item,index) in arr" :key="index">
                     <td>{{index+1}}</td>
                     <td>{{item.ipName}}</td>
                     <td>{{item.unit}}</td>
                     <td>{{item.required}}</td>
                     <td>{{item.testValue}}</td>
-                    <td>{{item.testState === 1 ? "鈭�" : "X"}}</td>
+                    <td >
+                        {{isIfState(item.testState) }}
+                    </td>
                 </tr>
                 <tr>
                     <td colspan="6">妫�楠岀粨璁猴細{{reportData.type == 1 ? "鍚堟牸" : "涓嶅悎鏍�"}}</td>
@@ -74,7 +76,24 @@
     data() {
         return {
             logoSrc : require("@/assets/404_images/logo.png"),    
-            now: new Date().toLocaleDateString()
+            now: new Date().toLocaleDateString(),
+            arr: []
+        }
+    },
+    mounted(){
+        this.arr = this.reportData.products;
+        if(this.reportData.products.length < 10){
+            let size = this.reportData.products.length; 
+            let num=10-size
+            for(let i=0;i< num;i++){
+                this.arr.push({
+                    code: null,
+                    ipName: "",
+                    required: "",
+                    testState: null,
+                    testValue: "",
+                    unit: ""})
+            }
         }
     },
     methods:{
@@ -84,6 +103,11 @@
             let month = (dt.getMonth() + 1).toString().padStart(2,'0');
             let date = dt.getDate().toString().padStart(2,'0');
             return `${year}-${month}-${date}`;
+        },
+        isIfState(val){
+            if(val===1)return "鈭�"
+            else if(val===null || val=== undefined) return null
+            else return "X"
         }
     },
     props:["reportData"]
@@ -117,7 +141,7 @@
                 border: 2px solid black;
             }
             tr,td,th{
-                padding: 10px 10px;
+                padding: 15px 10px;
             }
             .date-group{
                 width: 90%;
@@ -135,7 +159,7 @@
                 margin-left: 5%;
                 color: lightgray; 
                 text-align: center;
-                margin-top: 250px;
+                margin-top: 300px;
             }
         }
      }

--
Gitblit v1.9.3