value
2023-08-28 b1dd7463eebcd7e67f94244988ebbc3b9d29c1b7
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;
            }
        }
     }