From 3435a2b1b3e237ee53c98ae7c044d0e84cfa521c Mon Sep 17 00:00:00 2001
From: su1124 <1583764726@qq.com>
Date: 星期四, 25 一月 2024 18:01:18 +0800
Subject: [PATCH] su

---
 src/views/system/biol/index.vue |   60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 58 insertions(+), 2 deletions(-)

diff --git a/src/views/system/biol/index.vue b/src/views/system/biol/index.vue
index 1afa888..1e14668 100644
--- a/src/views/system/biol/index.vue
+++ b/src/views/system/biol/index.vue
@@ -24,7 +24,7 @@
           clearable
           @keyup.enter.native="handleQuery"
           ref="inputName"
-          @blur="handleQuery"
+          @blur="hb"
         />
       </el-form-item>
       <el-form-item label="鎶ュ憡鏃堕棿" prop="reportTimeList">
@@ -85,6 +85,15 @@
           :disabled="multiple"
           @click="jiankangReport"
           >鍋ュ悍妫�鏌ヨ〃鎵撳嵃</el-button
+        >
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          size="mini"
+          :disabled="multiple"
+          @click="baogaoyulan"
+          >鎶ュ憡棰勮</el-button
         >
       </el-col>
       <el-col :span="1.5">
@@ -441,6 +450,21 @@
         </div>
       </div>
     </div>
+     <el-dialog
+      class="dia"
+      title="PDF 棰勮"
+      :visible.sync="dialogVisibles"
+      :close-on-click-modal="false"
+    >
+      <div class="main">
+        <iframe
+          id="printIframe"
+          :src="url"
+          frameborder="0"
+          style="width: 100%; height: 100%"
+        ></iframe>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
@@ -511,6 +535,8 @@
           label: "绌哄彿",
         },
       ],
+      url: "",
+      dialogVisibles: false,
       barcode: null,
       value: "",
       dialogVisible: false,
@@ -685,6 +711,32 @@
       const viewNum = this.mobanId;
       const params = { viewNum, tjNum };
       this.$tab.openPage("鍋ュ悍璇佹鏌ヨ〃", "/report/jiankangzheng", params);
+    },
+    baogaoyulan() {
+      const tjNumber = this.report;
+      const flag = true;
+      getPdf(tjNumber, flag).then((response) => {
+        if (response.size === 0) {
+          const loading = this.$loading({
+            lock: true,
+            text: "Loading",
+            spinner: "el-icon-loading",
+            background: "rgba(0, 0, 0, 0.7)",
+          });
+          setTimeout(() => {
+            loading.close();
+          }, 3000);
+          // this.$message.msgSuccess("鎶ュ憡姝e湪鐢熸垚锛岃涓ゅ垎閽熷悗棰勮锛�");
+          this.$message({
+          message: '鎶ュ憡姝e湪鐢熸垚锛岃涓ゅ垎閽熷悗棰勮锛�',
+          type: 'warning'
+        });
+        } else {
+          this.dialogVisible = true;
+
+          this.url = window.webkitURL.createObjectURL(response); //灏嗗悗绔繑鍥炵殑blob鏂囦欢璇诲彇鍑簎rl
+        }
+      });
     },
     //鎵撳嵃灏忕エ
     printHandle() {
@@ -936,6 +988,11 @@
       };
       this.resetForm("form");
     },
+    hb() {
+      if (this.queryParams.tjNum != undefined) {
+        this.handleQuery();
+      }
+    },
     /** 鎼滅储鎸夐挳鎿嶄綔 */
     handleQuery() {
       this.queryParams.pageNum = 1;
@@ -960,7 +1017,6 @@
       // }
       this.multiple = !selection.length;
       this.report = selection.map((item) => item.tjNumber);
-      console.log(this.report);
     },
 
     investigation(row) {

--
Gitblit v1.8.0