From a8c0679305c980a9878bc44a44408de9c00d3a64 Mon Sep 17 00:00:00 2001
From: qx <1084500556@qq.com>
Date: 星期四, 03 四月 2025 17:46:22 +0800
Subject: [PATCH] qx

---
 src/views/reservation/resercopy/index.vue |   89 +++++++++++++++++++++++++++++++-------------
 1 files changed, 62 insertions(+), 27 deletions(-)

diff --git a/src/views/reservation/resercopy/index.vue b/src/views/reservation/resercopy/index.vue
index eedffce..beb9822 100644
--- a/src/views/reservation/resercopy/index.vue
+++ b/src/views/reservation/resercopy/index.vue
@@ -67,7 +67,7 @@
       </el-form-item>
       <el-form-item label="鏈夋晥澶╂暟" prop="yxts">
         <el-input
-          style="width:100px"
+          style="width: 100px"
           v-model="objs.yxts"
           placeholder="鏈夋晥澶╂暟"
         />澶�(鍙嚜瀹氫箟)
@@ -90,7 +90,6 @@
           icon="el-icon-upload2"
           size="mini"
           @click="handleImport"
-          
           >瀵煎叆</el-button
         >
       </el-col>
@@ -100,7 +99,6 @@
           icon="el-icon-upload2"
           size="mini"
           @click="importTemplate"
-         
           >涓嬭浇妯℃澘</el-button
         >
       </el-col>
@@ -129,6 +127,13 @@
           label="鍗曚綅鍚嶇О"
           align="center"
           prop="company"
+          width="200"
+        >
+        </el-table-column>
+        <el-table-column
+          label="鍗曚綅閮ㄩ棬"
+          align="center"
+          prop="department"
           width="200"
         >
         </el-table-column>
@@ -203,6 +208,7 @@
       <el-upload
         ref="upload"
         :limit="1"
+        :key="uploadKey" 
         accept=".xlsx, .xls"
         :headers="upload.headers"
         :data="data"
@@ -231,7 +237,7 @@
         </div>
       </el-upload>
       <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="submitFileForm">纭� 瀹�</el-button>
+        <el-button type="primary" @click="submitFileForm">淇濆瓨淇℃伅</el-button>
         <el-button @click="upload.open = false">鍙� 娑�</el-button>
       </div>
     </el-dialog>
@@ -392,6 +398,7 @@
 </template>
 
 <script>
+import Cookies from "js-cookie"
 import {
   addDept,
   addComp,
@@ -399,9 +406,13 @@
   getDwAndDwDept,
   newExcelImport,
 } from "@/api/system/comp";
-import { newConfirm, getCompany, queryCompany } from "@/api/team/tuanti";
+import {
+  newConfirm,
+  getCompany,
+  queryCompany,
+  getconfigKey,
+} from "@/api/team/tuanti";
 import { getToken } from "@/utils/auth";
-import { read, utils } from "xlsx";
 
 export default {
   dicts: [
@@ -427,6 +438,7 @@
       }
     };
     return {
+      uploadKey: 0,
       leftList: "",
       isdisabled: true,
       setDisabled: {
@@ -475,7 +487,7 @@
       objs: {
         drugManufacturerId: "",
         reservationTime: "",
-        yxts: "30",
+        yxts: "",
       },
       DataList: [],
       tjOrderList: [], //鍗曚釜椤圭洰闆嗗悎
@@ -502,7 +514,7 @@
         // 鏄惁鏇存柊宸茬粡瀛樺湪鐨勭敤鎴锋暟鎹�
         updateSupport: 0,
         // 璁剧疆涓婁紶鐨勮姹傚ご閮�
-        headers: { Authorization: "Bearer " + getToken() },
+        headers: { Authorization: "Bearer " + getToken(),hospId: Cookies.get("hospId") },
         // 涓婁紶鐨勫湴鍧�
         url:
           process.env.VUE_APP_BASE_API +
@@ -769,6 +781,7 @@
     },
     // 鎼滅储
     getRemoteData(query) {
+      
       if (query) {
         let compName = query;
         queryCompany(compName).then((response) => {
@@ -783,6 +796,10 @@
     // 鑾峰彇鍗曚綅淇℃伅闆嗗悎
     getCompanyList() {
       this.loading = true;
+      getconfigKey('team_reservation_default_day').then((res) => {
+        console.log(res, 1111);
+        this.objs.yxts = res.msg;
+      });
       getCompany(this.queryParam).then((response) => {
         this.CompanyList = response.data;
         this.total = response.total;
@@ -840,10 +857,10 @@
       this.objs.drugManufacturerId = "";
       this.objs.dwDeptName = "";
       this.objs.reservationTime = "";
-      this.objs.yxts = "";
       this.TotalPrice = "";
       this.tableData[0] = [];
       this.TotalPrice1 = "";
+      this.userList = []
       // this.resetForm("form");
       this.form = {};
     },
@@ -852,10 +869,13 @@
     selectTime(val) {
       this.objs.reservationTime = val;
     },
-
     /** 瀵煎叆鎸夐挳鎿嶄綔 */
     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 {
@@ -875,15 +895,27 @@
       this.upload.isUploading = true;
     },
     // 鏂囦欢涓婁紶鎴愬姛澶勭悊
+    // 鏂囦欢涓婁紶鎴愬姛澶勭悊
     handleFileSuccess(response, file, fileList) {
-      console.log(response,666666);
-       if (response.code == 500) {
-        console.log(22222222222);
+      if (response.code == 500) {
+        this.isdisabled = true;
         // Message.warning(response.msg);
-        this.$modal.msgError(response.msg);
-      }
-      this.ListObj = response.data;
+        // this.$modal.msgError(response.msg);
+        // this.$modal.msgError("浜哄憳"+ response.data.list + "淇℃伅閿欒");
+        const errorList = response.data.list.join(", ");
+       
+        this.$confirm(`${errorList}`, `${response.msg}`, {
+          confirmButtonText: "纭畾",
+          cancelButtonText: "鍙栨秷",
+          type: "error",
+          center: true,
+          dangerouslyUseHTMLString: true,
+        });
+      }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) {
@@ -891,12 +923,13 @@
           }
         });
       });
+      }
+     
       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;
         this.$alert(
@@ -909,15 +942,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({

--
Gitblit v1.8.0