Fixiaobai
2023-09-05 437b40045ce48b28e2817b0f9f9998d3a881ebe1
src/components/experiment/template_testReport/index.vue
@@ -174,57 +174,73 @@
                           <span>检验类型</span><br>
                           <span>Type of test</span>
                        </td>
                        <td colspan="2"></td>
                        <td colspan="2">
                           {{reportData.type === 0 ? "原材料检验" : (reportData.type === 1 ? "委托检验" : "成品检验")}}
                        </td>
                     </tr>
                     <tr>
                        <td>
                           <span>样品状态</span><br>
                           <span>Sample discription</span>
                        </td>
                        <td colspan="2"></td>
                        <td colspan="2">/</td>
                        <td>
                           <span>生产单位</span><br>
                           <span>Producer</span>
                        </td>
                        <td colspan="2"></td>
                        <td colspan="2">
                           {{reportData.supplier}}
                        </td>
                     </tr>
                     <tr>
                        <td>
                           <span>收样时间</span><br>
                           <span>送样时间</span><br>
                           <span>Received date</span>
                        </td>
                        <td colspan="2"></td>
                        <td colspan="2">
                        </td>
                        <td>
                           <span>检验日期</span><br>
                           <span>Test date</span>
                        </td>
                        <td colspan="2"></td>
                        <td colspan="2">
                           {{reportData.createTime}}
                        </td>
                     </tr>
                     <tr>
                        <td>
                           <span>委托人</span><br>
                           <span>Consignor</span>
                        </td>
                        <td colspan="2"></td>
                        <td colspan="2">
                           {{enterprise.linkName}}
                        </td>
                        <td>
                           <span>电话</span><br>
                           <span>Tel</span>
                        </td>
                        <td colspan="2"></td>
                        <td colspan="2">
                           {{enterprise.linkPhone}}
                        </td>
                     </tr>
                     <tr>
                        <td>
                           <span>委托单位</span><br>
                           <span>Client</span>
                        </td>
                        <td colspan="5"></td>
                        <td colspan="5">
                           {{enterprise.name}}
                        </td>
                     </tr>
                     <tr>
                        <td>
                           <span>委托单位地址</span><br>
                           <span>Address</span>
                        </td>
                        <td colspan="5"></td>
                        <td colspan="5">
                           {{enterprise.address}}
                        </td>
                     </tr>
                     <tr>
                        <td>
@@ -246,12 +262,12 @@
                           <span>Conclusion </span>
                        </td>
                        <td colspan="5">
                           <div style="height: 120px;"></div>
                           <div style="padding-left: 20px;width:100%;text-align:left; font-size:18px;height: 120px;line-height: 120px;">{{reportData.inspectionStatus === 1 ? "合格" : "不合格"}}</div>
                           <div style="height: 60px;margin-left: 250px;">
                              <span>(检测报告专用章)</span><br>
                              <span>( SPECIFIC STAMP FOR TEST RTORT) </span><br>
                              <span>签发日期: 年 月 日</span><br>
                              <span>Date of issue: August 23, 2023</span>
                              <span>签发日期: {{formattedDate('yyyy年MM月DD日','zh-cn') }}</span><br>
                              <span>Date of issue: {{formattedDate('LL','en-ca') }}</span>
                           </div>
                        </td>
                     </tr>
@@ -260,19 +276,19 @@
                           <span>备注</span><br>
                           <span>Remark </span>
                        </td>
                        <td colspan="5"></td>
                        <td colspan="5">{{reportData.notes  }}</td>
                     </tr>
                     <tr>
                        <td>
                           <span>编制</span><br>
                           <span>Preparer</span>
                        </td>
                        <td colspan="2"></td>
                        <td colspan="2">{{reportData.preparerName}}</td>
                        <td>
                           <span>检验</span><br>
                           <span>Tester</span>
                        </td>
                        <td colspan="2"></td>
                        <td colspan="2">{{ reportData.iUserName }}</td>
                     </tr>
                     <tr>
                        <td>
@@ -308,8 +324,8 @@
            <div class="table">
               <div class="table-header">
                  <div>
                     <span>报告编号:</span><br>
                     <span>Reference No:</span>
                     <span>报告编号:{{reportData.rcode}}</span><br>
                     <span>Reference No:{{reportData.rcode}}</span>
                  </div>
                  <div>
                     <span>第2页共2页</span><br>
@@ -323,12 +339,12 @@
                           <span>样品编号</span><br>
                           <span>Sample No</span>
                        </td>
                        <td colspan="3"></td>
                        <td colspan="3">{{reportData.imCode}}</td>
                        <td colspan="4">
                           <span>规格型号</span><br>
                           <span>Type</span>
                        </td>
                        <td colspan="3"></td>
                        <td colspan="3">{{reportData.specifications}}</td>
                     </tr>
                     <tr>
                        <td>
@@ -356,53 +372,35 @@
                           <span>Conclusion</span>
                        </td>
                     </tr>
                     <tr>
                        <td>
                           <span></span><br>
                           <span></span>
                        </td>
                        <td colspan="3">
                           <span>样品标识</span><br>
                           <span>Sample labeling</span>
                        </td>
                        <td>
                           <span></span><br>
                           <span>I</span>
                        </td>
                        <td colspan="3">
                           <span></span><br>
                           <span></span>
                        </td>
                        <td colspan="3">
                           <span></span><br>
                           <span></span>
                        </td>
                        <td>
                           <span></span><br>
                           <span></span>
                        </td>
                     </tr>
                     <tr v-for="(item, index) in resultTable" :key="index">
                        <td>
                           <span>{{ item.id }}</span><br>
                           <span>{{ index + 1 }}</span><br>
                        </td>
                        <td colspan="3">
                           <span>{{ item.testitem }}</span><br>
                           <span>{{ item.testitem_engName }}</span>
                           <span>{{ item.ipName }}</span>
                        </td>
                        <td>
                           <span>{{ item.unit }}</span>
                        </td>
                        <td colspan="3">
                           <span>{{ item.requirement }}</span><br>
                           <span>{{ item.requirement_eng }}</span>
                           <span>{{ item.required }}</span><br>
                        </td>
                        <td colspan="3">
                           <span>{{ item.testresult }}</span><br>
                           <span>{{ item.testresult_engName }}</span>
                           <span>{{ item.testValue }}</span><br>
                        </td>
                        <td>
                           <span>{{ item.conclusion }}</span>
                           <span>{{ isIfState(item.testState) }}</span>
                        </td>
                     </tr>
                     <tr>
                        <td>
                           <span>备注:</span><br/>
                           <span>remarks:</span>
                        </td>
                        <td colspan="13">
                           “√”表示项目合格,“×”表示项目不合格,“-”表示不要判定,“/”表示没有标准要求。
                           “√” indicates test Item is qualified,“×” indicates test Item is unqualified,
                           “-” indicates test Item  judgment is not required,“/” indicates test Item is no test requirement .
                        </td>
                     </tr>
                  </table>
@@ -412,8 +410,8 @@
         <div class="pageFour">
            <div class="page-header" style="display: flex;justify-content: space-between;font-size: 12px;">
               <div>
                  <span>报告编号:</span><br>
                  <span>Reference No:</span>
                  <span>报告编号:{{reportData.rcode}}</span><br>
                  <span>Reference No:{{reportData.rcode}}</span>
               </div>
               <div>
                  <span>附页</span><br>
@@ -456,24 +454,25 @@
                           </td>
                        </tr>
                     </thead>
                     <tr v-for="(item, index) in table" :key="index">
                     <tr v-for="(item, index) in reportData.equipment" :key="index">
                        <td>
                           <span>{{ item.id }}</span>
                           <span>{{ item.eId }}</span>
                        </td>
                        <td colspan="2">
                           <span>{{ item.equipment_name }}</span>
                           <span>{{ item.eName }}</span>
                        </td>
                        <td>
                           <span>{{ item.type }}</span><br>
                           <span>{{ item.eType }}</span><br>
                        </td>
                        <td colspan="2">
                           <span>{{ item.factory_number }}</span>
                           <span>{{ item.eCode }}</span>
                        </td>
                        <td colspan="2">
                           <span>{{ item.validity }}</span>
                           <span>{{ item.validty }}</span>
                        </td>
                     </tr>
                  </table>
                  <p style="width:100%;text-align: center;font-size: 15px;">------以下空白(Following Blank)------</p>
               </div>
            </div>
         </div>
@@ -482,6 +481,7 @@
</template>
<script>
   import moment from 'moment';
   import {
      get,
      post,
@@ -489,19 +489,9 @@
   } from "@/api/util/requestUtil.js"
   export default {
      name: 'TestReport',
      props: ["reportData"],
      data() {
         return {
            resultTable: [{
               id: '1',
               testitem: '原始拉伸',
               testitem_engName: 'Primitive strength',
               unit: 'MPa',
               requirement: '最小10.0',
               requirement_eng: 'Minimun 10.0',
               testresult: '',
               testitem_engName: ''
            }],
            resultTable: [],
            table: [{
               id: 1,
               equipment_name: '拖拉机',
@@ -516,7 +506,8 @@
         }
      },
      mounted() {
         this.getEnterprise()
         this.initResultData();
         this.getEnterprise();
         if (Object.keys(this.reportData).length > 0) {
            this.reData.productNames = ''
            this.reportData.products.forEach(a=>{
@@ -526,12 +517,39 @@
         }
      },
      methods: {
         initResultData(){
            this.resultTable = this.reportData.products;
            if (this.resultTable.length < 15) {
               let size = this.resultTable.length;
               let num = 15 - size;
               for (let i = 0; i < num; i++) {
                  this.resultTable.push({
                     code: null,
                     ipName: "",
                     required: "",
                     testState: null,
                     testValue: "",
                     unit: ""
                  })
               }
            }
         },
         isIfState(val) {
            if (val === 1) return "√"
            else if (val === null || val === undefined) return null
            else return "X"
         },
         formattedDate(fmt,local) {
            moment.locale(local);
            return moment().format(fmt);
         },
         getEnterprise() {
            get("/report/getEnterprise").then(res => {
               this.enterprise = res.data
            })
         }
      }
      },
      props: ["reportData"],
   }
</script>