From 809f8b1279bf84f28bccabc4f95a8eba6c22a24d Mon Sep 17 00:00:00 2001
From: Fixiaobai <fixiaobai@163.com>
Date: 星期二, 29 八月 2023 10:30:04 +0800
Subject: [PATCH] 放行委托新增

---
 src/views/experiment/checkTheReport/index.vue |   44 ++++++++++++++++++++++++++++----------------
 1 files changed, 28 insertions(+), 16 deletions(-)

diff --git a/src/views/experiment/checkTheReport/index.vue b/src/views/experiment/checkTheReport/index.vue
index 171ca9d..dce2174 100644
--- a/src/views/experiment/checkTheReport/index.vue
+++ b/src/views/experiment/checkTheReport/index.vue
@@ -57,10 +57,11 @@
         :visible.sync="dialogVisible"
         width="60%">
         <span slot="footer" class="dialog-footer">
-          <el-button type="primary" size="small" @click="printFun()">鎵撳嵃</el-button>
+          <el-button type="primary" @click="printFun()">鎵撳嵃</el-button>
         </span>
         <div class="printStyle">
-          <preview id="printDiv"></preview>
+          <preview id="printDiv" :reportData="reportData" v-if="reportType===0"></preview>
+          <div v-else>鎴愬搧妫�娴嬫姤鍛�</div>
         </div>
       </el-dialog>
       <div class="table-box">
@@ -93,14 +94,14 @@
             </template></el-table-column
           >
           <el-table-column
-            prop="materialCode"
+            prop="reportCode"
             label="鎶ュ憡鍗曞彿"
             sortable
             min-width="10%"
           >
             <template slot-scope="scope">
               <span style="color: #409eff;">
-                  {{ scope.row.materialCode }}
+                  {{ scope.row.reportCode }}
               </span>
             </template></el-table-column
           >
@@ -179,12 +180,14 @@
 </template>
 
 <script>
-import { selectAllReport } from "@/api/experiment/checkTheReport";
+import { selectAllReport,getReportData } from "@/api/experiment/checkTheReport";
 import Preview from "@/components/experiment/checkTheReport/index.vue";
 import PrintJS from 'print-js'
 export default {
   data() {
     return {
+      reportData: [],
+      reportType: 0,
       searchData:{
         sample_code:'',
         reportCode:'',
@@ -203,25 +206,32 @@
     this.getData();
   },
   mounted(){
-    // this.dialogVisible = true;
   },
   components:{
     Preview
   },
   methods: {
-    //棰勮鎸夐挳
-    previewFun(){
+    async queryReportByRCode(code){
+      const resp = await getReportData({code:code});
+      this.reportData = resp.data;
       this.dialogVisible = true;
+      console.log(this.reportData);
+    },
+    //鏌ョ湅鎶ュ憡鎸夐挳
+    previewFun(row){
+      this.reportType = row.type;
+      this.queryReportByRCode(row.reportCode);
     },
     //鎵撳嵃鎸夐挳
     printFun(){
-        PrintJS({
-          printable: "printDiv",
-          type: "html",
-          // header: "鍘熸潗鏂欐娴嬫姤鍛�",
-          targetStyles: ["*"],
-          ignoreElements: ["no-ignore"],
-        });
+      this.dialogVisible = false;
+      PrintJS({
+        printable: "printDiv",
+        type: "html",
+        // header: "鍘熸潗鏂欐娴嬫姤鍛�",
+        targetStyles: ["*"],
+        ignoreElements: ["no-ignore"],
+      });
     },
     // 鐘舵�佹寜閽�
     handleRadioChange() {
@@ -288,6 +298,8 @@
   }
 }
 .library-table {
+  height: 80vh;
+  overflow: scroll;
   background-color: #fff;
   flex: 1;
   margin: 0px -15px;
@@ -317,7 +329,7 @@
   }
   .printStyle{
     overflow: scroll;
-    height:600px;
+    height:500px;
     .el-button{
       position: absolute;
       top: 10vh;

--
Gitblit v1.9.3