From 5918627d2ef3988915d8601755b558f46702991f Mon Sep 17 00:00:00 2001
From: yuyu <1981343953@qq.com>
Date: 星期二, 29 八月 2023 15:18:50 +0800
Subject: [PATCH] 8.29提交成品检验报告

---
 .env.development                                        |    2 +-
 src/components/experiment/checkTheReport/index.vue      |    1 +
 src/components/experiment/template_testReport/index.vue |   21 +++++++++------------
 src/views/experiment/checkTheReport/index.vue           |   34 ++++++++++++++++++++++++++++------
 4 files changed, 39 insertions(+), 19 deletions(-)

diff --git a/.env.development b/.env.development
index ab9be2d..92026e1 100644
--- a/.env.development
+++ b/.env.development
@@ -2,4 +2,4 @@
 ENV = 'development'
 
 # base api
-VUE_APP_BASE_API =  'http://localhost:1234/'
+VUE_APP_BASE_API =  'http://192.168.137.138:1234/'
diff --git a/src/components/experiment/checkTheReport/index.vue b/src/components/experiment/checkTheReport/index.vue
index 7d22893..3f4d022 100644
--- a/src/components/experiment/checkTheReport/index.vue
+++ b/src/components/experiment/checkTheReport/index.vue
@@ -73,6 +73,7 @@
 </template>
 <script>
 export default({
+    name: 'Preview',
     data() {
         return {
             logoSrc : require("@/assets/404_images/logo.png"),    
diff --git a/src/views/template_testReport/index.vue b/src/components/experiment/template_testReport/index.vue
similarity index 98%
rename from src/views/template_testReport/index.vue
rename to src/components/experiment/template_testReport/index.vue
index 575e579..ecc76e1 100644
--- a/src/views/template_testReport/index.vue
+++ b/src/components/experiment/template_testReport/index.vue
@@ -30,7 +30,7 @@
           <div class="name">
             <div style="width:140px; text-align-last: justify;">
             <div>濮旀墭鍗曚綅</div>
-            <span style="font-size: 14px;display: block;margin: 10px 50px 0px;">Client</span>
+            <span style="font-size: 14px;display: block;margin: 10px 45px 0px;">Client</span>
           </div>
             <div class="line"> 娴嬭瘯鍚嶇О</div>
           </div>
@@ -469,9 +469,8 @@
 
 <script>
 export default {
-  props:{
-
-  },
+  name:'TestReport',
+  props:["reportData"],
   data(){
     return {
       resultTable:[
@@ -500,15 +499,13 @@
 
 <style lang="scss" scoped>
 .content-wrapper{
-  background-color: #f0f2f5;
-  width: 100%;
-  height: 100vh;
-  overflow-y: auto;
+  // background-color: #f0f2f5;
+  // width: 100%;
+  // height: 100vh;
+  // overflow-y: auto;
   .content-main{
-    margin: -50px auto;
-    width: 50%;
-    // background-color: #fff;
-    // background-color: #bfa;
+    margin: -100px auto;
+    width: 90%;
     .cover{
       margin: 80px 0px;
       padding:0px 50px;
diff --git a/src/views/experiment/checkTheReport/index.vue b/src/views/experiment/checkTheReport/index.vue
index dce2174..b4efda6 100644
--- a/src/views/experiment/checkTheReport/index.vue
+++ b/src/views/experiment/checkTheReport/index.vue
@@ -60,8 +60,8 @@
           <el-button type="primary" @click="printFun()">鎵撳嵃</el-button>
         </span>
         <div class="printStyle">
-          <preview id="printDiv" :reportData="reportData" v-if="reportType===0"></preview>
-          <div v-else>鎴愬搧妫�娴嬫姤鍛�</div>
+          <Preview id="printRaw" :reportData="reportData" v-if="reportType===0"></Preview>
+          <TestReport id="printFinished" :reportData="reportData" v-else></TestReport>
         </div>
       </el-dialog>
       <div class="table-box">
@@ -182,6 +182,7 @@
 <script>
 import { selectAllReport,getReportData } from "@/api/experiment/checkTheReport";
 import Preview from "@/components/experiment/checkTheReport/index.vue";
+import TestReport from "@/components/experiment/template_testReport/index.vue"
 import PrintJS from 'print-js'
 export default {
   data() {
@@ -194,7 +195,26 @@
         application_code: ''
       },
       checkStatus: undefined,
-      reportTable: [],
+      reportTable: [
+        {
+          materialCode:'SN23-0517001',
+          reportCode: 'SN23-0517001',
+          inspectionCode: 'SN23-0517001',
+          approver:'榛勫皬鏄�',
+          status: '',
+          conclusion: 1,
+          name: '榛勫皬鏄�'
+        },
+        {
+          materialCode:'SN23-0517001',
+          reportCode: 'SN23-0517001',
+          inspectionCode: 'SN23-0517001',
+          approver:'榛勫皬鏄�',
+          status: '',
+          conclusion: 1,
+          name: '榛勫皬鏄�'
+        }
+      ],
       page: 1,
       total: 0,
       pageSize: 10,
@@ -203,12 +223,13 @@
     };
   },
   created() {
-    this.getData();
+    // this.getData();
   },
   mounted(){
   },
   components:{
-    Preview
+    Preview,
+    TestReport
   },
   methods: {
     async queryReportByRCode(code){
@@ -219,6 +240,7 @@
     },
     //鏌ョ湅鎶ュ憡鎸夐挳
     previewFun(row){
+      console.log(row)
       this.reportType = row.type;
       this.queryReportByRCode(row.reportCode);
     },
@@ -226,7 +248,7 @@
     printFun(){
       this.dialogVisible = false;
       PrintJS({
-        printable: "printDiv",
+        printable: this.reportType===0 ? "printRaw" : "printFinished",
         type: "html",
         // header: "鍘熸潗鏂欐娴嬫姤鍛�",
         targetStyles: ["*"],

--
Gitblit v1.9.3