From c26281ff05585d8f3f337b290831803fe766748b Mon Sep 17 00:00:00 2001
From: su1124 <1583764726@qq.com>
Date: 星期二, 02 一月 2024 18:31:44 +0800
Subject: [PATCH] su

---
 src/views/system/biol/index.vue |   52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 52 insertions(+), 0 deletions(-)

diff --git a/src/views/system/biol/index.vue b/src/views/system/biol/index.vue
index 1afa888..e340101 100644
--- a/src/views/system/biol/index.vue
+++ b/src/views/system/biol/index.vue
@@ -88,6 +88,15 @@
         >
       </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">
         <div id="main111">
           <el-input style="width: 920px" v-model="form.name"></el-input>
         </div>
@@ -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,
@@ -686,6 +712,32 @@
       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() {
       setTimeout(function () {

--
Gitblit v1.8.0