From 6d2f5a43b9bf2922c137e18e3fb4ba91fcfce459 Mon Sep 17 00:00:00 2001
From: qx <1084500556@qq.com>
Date: 星期四, 17 四月 2025 11:14:56 +0800
Subject: [PATCH] qx

---
 src/views/reservation/resercopy/index.vue |   64 +++++++++++++++++++++-----------
 1 files changed, 42 insertions(+), 22 deletions(-)

diff --git a/src/views/reservation/resercopy/index.vue b/src/views/reservation/resercopy/index.vue
index c4abbc9..388739b 100644
--- a/src/views/reservation/resercopy/index.vue
+++ b/src/views/reservation/resercopy/index.vue
@@ -130,6 +130,13 @@
           width="200"
         >
         </el-table-column>
+        <el-table-column
+          label="鍗曚綅閮ㄩ棬"
+          align="center"
+          prop="department"
+          width="200"
+        >
+        </el-table-column>
         <!-- <el-table-column label="宸ュ彿" align="center" prop="jobNo" width="80" /> -->
         <el-table-column label="濮撳悕" align="center" prop="name" width="75" />
         <el-table-column label="鎬у埆" align="center" prop="sex" width="75">
@@ -201,7 +208,8 @@
       <el-upload
         ref="upload"
         :limit="1"
-        accept=".xlsx, .xls"
+        :key="uploadKey" 
+        accept=".xls"
         :headers="upload.headers"
         :data="data"
         :action="upload.url"
@@ -218,7 +226,7 @@
             <el-checkbox v-model="upload.updateSupport" />
             鏄惁鏇存柊宸茬粡瀛樺湪鐨勭敤鎴锋暟鎹�
           </div>
-          <span>浠呭厑璁稿鍏ls銆亁lsx鏍煎紡鏂囦欢銆�</span>
+          <span>浠呭厑璁稿鍏ls鏍煎紡鏂囦欢銆�</span>
           <el-link
             type="primary"
             :underline="false"
@@ -390,6 +398,7 @@
 </template>
 
 <script>
+import Cookies from "js-cookie"
 import {
   addDept,
   addComp,
@@ -429,7 +438,7 @@
       }
     };
     return {
-     
+      uploadKey: 0,
       leftList: "",
       isdisabled: true,
       setDisabled: {
@@ -505,7 +514,7 @@
         // 鏄惁鏇存柊宸茬粡瀛樺湪鐨勭敤鎴锋暟鎹�
         updateSupport: 0,
         // 璁剧疆涓婁紶鐨勮姹傚ご閮�
-        headers: { Authorization: "Bearer " + getToken() },
+        headers: { Authorization: "Bearer " + getToken(),hospId: Cookies.get("hospId") },
         // 涓婁紶鐨勫湴鍧�
         url:
           process.env.VUE_APP_BASE_API +
@@ -848,7 +857,6 @@
       this.objs.drugManufacturerId = "";
       this.objs.dwDeptName = "";
       this.objs.reservationTime = "";
-      this.objs.yxts = "";
       this.TotalPrice = "";
       this.tableData[0] = [];
       this.TotalPrice1 = "";
@@ -864,6 +872,10 @@
     /** 瀵煎叆鎸夐挳鎿嶄綔 */
     handleImport() {
       if (this.objs.drugManufacturerId && this.objs.reservationTime) {
+          // 娓呯┖缁勪欢鍐呴儴鐘舵�侊紙鍚凡涓婁紶鏂囦欢锛�
+      this.$refs.upload?.clearFiles();
+      this.uploadKey = Date.now(); // 鏀瑰彉 key 寮哄埗閲嶆柊娓叉煋缁勪欢
+      // 鍚屾鏁版嵁婧愶紙Vue2 闇�鐢� $set 纭繚鍝嶅簲寮忥級
         this.upload.title = "鐢ㄦ埛瀵煎叆";
         this.upload.open = true;
       } else {
@@ -883,25 +895,29 @@
       this.upload.isUploading = true;
     },
     // 鏂囦欢涓婁紶鎴愬姛澶勭悊
+    // 鏂囦欢涓婁紶鎴愬姛澶勭悊
     handleFileSuccess(response, file, fileList) {
-      console.log(response, 666666);
+      console.log(response, file, fileList)
       if (response.code == 500) {
-        console.log(22222222222);
+        this.isdisabled = true;
         // Message.warning(response.msg);
         // this.$modal.msgError(response.msg);
         // this.$modal.msgError("浜哄憳"+ response.data.list + "淇℃伅閿欒");
-        const errorList = response.data.list.join(", ");
-        this.$confirm(`${errorList}`, "浠ヤ笅浜哄憳淇℃伅鏈夎锛岃鏍稿鍚庡鍏ワ細", {
+       
+        // const errorList = response.data.list.join(", ");
+       
+        this.$confirm( `${response.msg}`, {
           confirmButtonText: "纭畾",
           cancelButtonText: "鍙栨秷",
           type: "error",
           center: true,
           dangerouslyUseHTMLString: true,
         });
-      }
-      this.ListObj = response.data;
+      }else{
+        this.isdisabled = false;
+        this.ListObj = response.data;
       this.userList = response.data.list;
-
+     
       this.userList.forEach((item) => {
         this.CompanyList.forEach((item1) => {
           if (item1.drugManufacturerId == this.objs.drugManufacturerId) {
@@ -909,11 +925,12 @@
           }
         });
       });
+      }
+     
       this.upload.open = false;
       this.upload.isUploading = false;
       this.$refs.upload.clearFiles();
       this.leftList = response.msg;
-      console.log(response.code);
 
       if (this.leftList == "鎿嶄綔澶辫触") {
         this.isdisabled = true;
@@ -927,15 +944,17 @@
           "瀵煎叆缁撴灉",
           { dangerouslyUseHTMLString: true }
         );
-      } else {
-        this.isdisabled = false;
-        this.$alert(
-          "<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
-            response.msg,
-          { dangerouslyUseHTMLString: true }
-        );
-        this.rightList = response;
-      }
+      } 
+      // else {
+      //   console.log(11111)
+      //   this.isdisabled = false;
+      //   this.$alert(
+      //     "<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
+      //       response.msg,
+      //     { dangerouslyUseHTMLString: true }
+      //   );
+      //   this.rightList = response;
+      // }
       for (let i = 0; i < fileList.length; i++) {
         if (file.name != fileList[i].name) {
           this.fileList.push({
@@ -958,6 +977,7 @@
     },
     // 鎻愪氦涓婁紶鏂囦欢
     submitFileForm() {
+      console.log(9999)
       this.$refs.upload.submit();
       this.isShow = false;
     },

--
Gitblit v1.8.0