From f16661eac2b18c83040321f0654abd8bb559f3e1 Mon Sep 17 00:00:00 2001
From: wwl <xchao828@163.com>
Date: 星期一, 10 二月 2025 17:17:29 +0800
Subject: [PATCH] 1

---
 src/views/sampling/sampling/index.vue |   55 ++++++++++++++++++++++++++++++++++---------------------
 1 files changed, 34 insertions(+), 21 deletions(-)

diff --git a/src/views/sampling/sampling/index.vue b/src/views/sampling/sampling/index.vue
index 4fc83f2..0327f4e 100644
--- a/src/views/sampling/sampling/index.vue
+++ b/src/views/sampling/sampling/index.vue
@@ -14,7 +14,7 @@
           format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss" type="daterange" range-separator="-"
           start-placeholder="寮�濮嬫棩鏈�" end-placeholder="缁撴潫鏃ユ湡" :picker-options="pickerOptions"></el-date-picker>
       </el-form-item>
-      <el-form-item label="鍗曚綅鍚嶇О" prop="tjCompName" style="margin-left: 20px; margin-right: 500px">
+      <el-form-item label="鍗曚綅鍚嶇О" prop="compName" style="margin-left: 20px; margin-right: 500px">
         <el-select :remote-method="getRemoteData" v-model="queryParams.tjCompName" value-key="drugManufacturerId"
           style="width: 200px" remote filterable placeholder="璇烽�夋嫨鍗曚綅鍚嶇О" clearable @change="searchSelect">
           <el-option v-for="dict in CompanyList" :key="dict.drugManufacturerId" :label="dict.cnName" :value="dict" />
@@ -95,7 +95,7 @@
             </template>
           </el-table-column>
           <el-table-column label="鎵嬫満鍙�" align="center" prop="cusPhone" width="120px" />
-          <el-table-column label="鍗曚綅鍚嶇О" align="center" prop="firmName" width="120px" />
+          <el-table-column label="鍗曚綅鍚嶇О" align="center" prop="compName" width="120px" />
           <el-table-column label="鐢宠鏃堕棿" align="center" prop="applicationTime" width="210">
             <template slot-scope="scope">
               <span>{{ parseTime(scope.row.applicationTime) }}</span>
@@ -378,7 +378,7 @@
     // 閫夋鏁版嵁
     searchSelect(val) {
       this.CheckBox = val;
-      this.queryParams.dw = this.CheckBox.cnName;
+      this.queryParams.dw = this.CheckBox.drugManufacturerId;
       console.log(this.CheckBox, 9999);
     },
     getRemoteData(query) {
@@ -393,27 +393,40 @@
       }
     },
     async piliangPrint() {
-      for (const item of this.piliangList) {
-        try {
-          // 鑾峰彇鏁版嵁锛屽苟绛夊緟鏁版嵁鏇存柊瀹屾垚
-          const tableList = await this.fetchData(item.tjNumber);
+      const loadingInstance = this.$loading({
+        lock: true,
+        text: '鎵撳嵃涓�...',
+        spinner: 'el-icon-loading',
+        background: 'rgba(255, 255, 255, 0.7)'
+      });
 
-          // 鍙繚鐣欐渶鏂颁袱涓厓绱�
-          if (tableList.length > 0) {
-            this.selectList = tableList.slice(0, 2);
-          } else {
-            this.selectList = []; // 濡傛灉娌℃湁鏁版嵁锛屾竻绌簊electList
+      try {
+        for (const item of this.piliangList) {
+          try {
+            // 鑾峰彇鏁版嵁锛屽苟绛夊緟鏁版嵁鏇存柊瀹屾垚
+            const tableList = await this.fetchData(item.tjNumber);
+
+            // 鍙繚鐣欐渶鏂颁袱涓厓绱�
+            if (tableList.length > 0) {
+              this.selectList = tableList.slice(0, 2);
+            } else {
+              this.selectList = []; // 濡傛灉娌℃湁鏁版嵁锛屾竻绌簊electList
+            }
+
+            // 浣跨敤鏇存柊鍚庣殑tableList鑾峰彇ids
+            let ids = this.selectList.map(row => row.id);
+            await this.Confirmreceipt1(ids);
+
+            // 绛夊緟涓�娈垫椂闂�
+            await new Promise(resolve => setTimeout(resolve, 5000));
+          } catch (error) {
+            console.error(`澶勭悊浣撴鍙� ${item.tjNumber} 鏃跺嚭閿�:`, error);
           }
-
-          // 浣跨敤鏇存柊鍚庣殑tableList鑾峰彇ids
-          let ids = this.selectList.map(row => row.id);
-          await this.Confirmreceipt1(ids);
-
-          // 绛夊緟涓�娈垫椂闂�
-          await new Promise(resolve => setTimeout(resolve, 5000));
-        } catch (error) {
-          console.error(`澶勭悊浣撴鍙� ${item.tjNumber} 鏃跺嚭閿�:`, error);
         }
+      } finally {
+        this.ids = []; // 娓呯┖ids
+        this.selectList = []; // 娓呯┖selectList
+        loadingInstance.close();
       }
     },
     getTruncatedName(proName) {

--
Gitblit v1.8.0