From 196bcb5caf222eea3e6a74d84a8367b169fd228a Mon Sep 17 00:00:00 2001
From: lkk <364857242@qq.com>
Date: 星期三, 23 七月 2025 10:47:35 +0800
Subject: [PATCH] 1

---
 src/views/reservation/reservations/index.vue |  224 +++++++++++++++++++++++++++++++++++---------------------
 1 files changed, 140 insertions(+), 84 deletions(-)

diff --git a/src/views/reservation/reservations/index.vue b/src/views/reservation/reservations/index.vue
index 525fb4c..53eb1b0 100644
--- a/src/views/reservation/reservations/index.vue
+++ b/src/views/reservation/reservations/index.vue
@@ -605,10 +605,10 @@
                   style="width: 160px"
                 />
               </el-form-item>
-              <el-form-item label="鍗曚綅鍚嶇О" prop="company">
+              <el-form-item label="鍗曚綅鍚嶇О" prop="companyId">
                 <el-select
                   :remote-method="getRemoteData"
-                  v-model="formIn.company"
+                  v-model="formIn.companyId"
                   remote
                   default-first-option
                   allow-create
@@ -620,7 +620,7 @@
                 >
                   <el-option
                     v-for="dict in CompanyList"
-                    :key="dict.cnName"
+                    :key="dict.drugManufacturerId"
                     :label="dict.cnName"
                     :value="dict.drugManufacturerId"
                   />
@@ -928,7 +928,7 @@
                         <template v-else>
                           <dict-tag
                             :options="dict.type.sys_user_sex"
-                            :value="scope.row.proType"
+                            :value="String(scope.row.proType || '')"
                           />
                         </template>
                       </template>
@@ -1411,7 +1411,7 @@
                 >
                   <el-option
                     v-for="dict in CompanyList"
-                    :key="dict.cnName"
+                    :key="dict.drugManufacturerId"
                     :label="dict.cnName"
                     :value="dict.drugManufacturerId"
                   />
@@ -2140,31 +2140,77 @@
         cusIntroduce: null,
         cusNumber: null,
         cusIsvip: null,
+        orderByColumn: "reservationTime",
+        isAsc: "desc",
+        name: "",
+        reservationTime: null,
+        idCard: null,
+        phoe: null,
+        email: null,
+        tjType: null,
+        companyId: null,
+        isExpire: null,
       },
+      // 鏌ヨ鍙傛暟
+      /*  queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        orderByColumn: "reservationTime",
+        isAsc: "desc",
+        name: null,
+        reservationTime: null,
+        idCard: null,
+        phoe: null,
+        email: null,
+        tjType: null,
+        companyId: null,
+        reservationTime: null,
+        isExpire: null,
+      }, */
+      /* formIn: {
+        name: "",
+        // age: "",
+        // idCard: "",
+        // remark: null,
+        // pacName: "",
+        // cusaddr: null,
+        // idType: null,
+        // ageUnit: null,
+        // sex: null,
+        // phoe: "",
+        // nation: null,
+        // email: "",
+        // marriage: null,
+        // address: "",
+        // tjCategory: null,
+        company: "",
+        // career: null,
+        // reservationTime: null,
+        // timeRegion: null,
+        // indexCard: "",
+        // department: "",
+      }, */
+      fmobj: {},
       formIn: {
         name: "",
-        age: "",
+        idType: "",
         idCard: "",
-        remark: null,
-        pacName: "",
-        cusaddr: null,
-        idType: null,
-        ageUnit: null,
-        sex: null,
+        age: "",
+        ageUnit: "",
+        sex: "",
         phoe: "",
-        nation: null,
+        nation: "",
         email: "",
-        marriage: null,
+        marriage: "",
         address: "",
-        tjCategory: null,
-        company: "",
-        career: null,
-        reservationTime: null,
-        timeRegion: null,
-        indexCard: "",
+        tjCategory: "",
         department: "",
+        company: "", // 涓嶈璁句负瀵硅薄
+        career: "",
+        reservationTime: "",
+        timeRegion: "",
+        indexCard: "",
       },
-      fmobj: {},
       // 琛ㄥ崟鏍¢獙
       form1: {},
       open1: false,
@@ -2235,22 +2281,7 @@
       valueUrls: "ws://127.0.0.1:6789/websocket",
       drawer: false,
       drawer1: false,
-      // 鏌ヨ鍙傛暟
-      queryParams: {
-        pageNum: 1,
-        pageSize: 10,
-        orderByColumn: "reservationTime",
-        isAsc: "desc",
-        name: null,
-        reservationTime: null,
-        idCard: null,
-        phoe: null,
-        email: null,
-        tjType: null,
-        companyId: null,
-        reservationTime: null,
-        isExpire: null,
-      },
+
       // 琛ㄥ崟鍙傛暟
       form: {},
       // 琛ㄥ崟鏍¢獙
@@ -2320,6 +2351,11 @@
   created() {
     this.getList();
   },
+  watch: {
+    "formIn.company"(val) {
+      console.log("formIn.company changed:", val, typeof val);
+    },
+  },
   methods: {
     isAll(value) {
       return value === "" || value === null;
@@ -2367,7 +2403,7 @@
         .then(() => {
           this.TotalPrice1 = 0;
           getTransitionList1(row.cusId).then((response) => {
-            this.tableData1 = response.data;
+            this.tableData1 = response.data.list;
 
             this.tableData1.forEach((item) => {
               this.TotalPrice1 += item.ordPrice;
@@ -2426,15 +2462,15 @@
       this.title = "娣诲姞浣撴鍗曚綅淇℃伅缁存姢";
     },
     idFn1(value) {
-      console.log(value);
+      console.log(value, 888888);
       if (value) {
         this.form.dictCompId = value;
-        this.CompanyList.forEach((item) => {
-          if (item.drugManufacturerId == this.form.dictCompId) {
-            this.form.compName = item.cnName;
-            // this.queryParams.company = item.cnName;
-          }
-        });
+        // this.CompanyList.forEach((item) => {
+        //   if (item.drugManufacturerId == this.form.dictCompId) {
+        //     this.form.compName = item.cnName;
+        //     this.queryParams.company = item.cnName;
+        //   }
+        // });
         Deptlist(value).then((response) => {
           this.deptList = response.data;
         });
@@ -2464,8 +2500,6 @@
         this.queryParams.yyjssj = null;
       }
       listReservation(this.queryParams).then((response) => {
-        console.log(this.queryParams,9999999);
-        
         this.reservationList = response.rows;
         //  response.rows.forEach((item, index) =>
         // {item.newID =(this.queryParams.pageNum - 1) * this.queryParams.pageSize +index +1;
@@ -2517,7 +2551,7 @@
         proIds: null,
         pacId: null,
         company: null,
-        drugManufacturerId:null,
+        drugManufacturerId: null,
         companyId: null,
         jobNo: null,
         department: null,
@@ -2651,7 +2685,7 @@
               let cusId = response.data.idCard;
               getTransitionList1(cusId).then((response) => {
                 if (response.data) {
-                  this.tableData1 = response.data;
+                  this.tableData1 = response.data.list;
                   if (this.tableData1.length != 0) {
                     this.TotalPrice1 = 0;
                     this.tableData1.forEach((item) => {
@@ -2695,41 +2729,28 @@
     /** 淇敼璇︾粏鎸夐挳鎿嶄綔 */
     handleUpdate1(row) {
       this.title = "棰勭害璇︾粏淇℃伅";
-      this.formIn = row;
-      if (this.formIn.timeRegion === 0) {
-        this.formIn.timeRegion = "8:00-9:00";
-      }
-      if (row.timeRegion === 1) {
-        this.formIn.timeRegion = "9:00-10:00";
-      }
-      if (row.timeRegion === 2) {
-        this.formIn.timeRegion = "10:00-11:00";
-      }
-      if (row.timeRegion === 3) {
-        this.formIn.timeRegion = "11:00-12:00";
-      }
-      if (this.formIn.isExpire === 1) {
-        this.tijiao1 = false;
-      }
-      this.drawer1 = true;
-      if (this.formIn.discount != null) {
-        this.discount = this.formIn.discount;
-      }
+
       //鍏ㄩ儴濂楅
-      if (this.formIn.sex != null) {
-        let cusSex = this.formIn.sex;
+      if (row.sex != null) {
+        let cusSex = row.sex;
         deptTreeSelect(cusSex).then((response) => {
           this.newpacName = response.rows;
           this.newpacName.forEach((item3) => {
             this.tableData1.forEach((item4) => {
-              item4.list.forEach((item6) => {
-                if (item6.pacName === item3.pacName) {
-                  this.$nextTick(() => {
-                    this.$refs.tb.toggleRowSelection(item3, true);
-                  });
-                  throw Error();
-                }
-              });
+              // item4.list.forEach((item6) => {
+              //   if (item6.pacName === item3.pacName) {
+              //     this.$nextTick(() => {
+              //       this.$refs.tb.toggleRowSelection(item3, true);
+              //     });
+              //     throw Error();
+              //   }
+              // });
+              if (item4.pacName === item3.pacName) {
+                this.$nextTick(() => {
+                  this.$refs.tb.toggleRowSelection(item3, true);
+                });
+                throw Error();
+              }
             });
           });
           this.loading = false;
@@ -2752,16 +2773,52 @@
           this.loading = false;
         });
       }
-      let id = this.formIn.id;
+      let id = row.id;
       this.list1 = true;
       (this.tableData1 = []),
         (this.newpacName = []),
+        this.drawer1 = true;
         getReservation(id).then((response) => {
+
           if (response.data) {
-            let cusId = response.data.idCard;
+            // console.log("formIn data:", this.formIn);
+            this.formIn = response.data;
+            /* for (const key in this.formIn) {
+              if (
+                typeof this.formIn[key] === "object" &&
+                this.formIn[key] !== null
+              ) {
+                console.warn(
+                  `formIn.${key} 鏄璞★紝鍙兘瀵艰嚧缁戝畾閿欒`,
+                  this.formIn[key]
+                );
+              }
+            } */
+
+            if (this.formIn.timeRegion === 0) {
+              this.formIn.timeRegion = "8:00-9:00";
+            }
+            if (row.timeRegion === 1) {
+              this.formIn.timeRegion = "9:00-10:00";
+            }
+            if (row.timeRegion === 2) {
+              this.formIn.timeRegion = "10:00-11:00";
+            }
+            if (row.timeRegion === 3) {
+              this.formIn.timeRegion = "11:00-12:00";
+            }
+            if (this.formIn.isExpire === 1) {
+              this.tijiao1 = false;
+            }
+            // this.drawer1 = true;
+            if (this.formIn.discount != null) {
+              this.discount = this.formIn.discount;
+            }
+            let cusId = this.formIn.idCard;
             getTransitionList1(cusId).then((response) => {
               if (response.data) {
-                this.tableData1 = response.data;
+                this.tableData1 = response.data.list;
+                console.log('tableData1', this.tableData1);
 
                 if (this.tableData1.length != 0) {
                   this.TotalPrice1 = 0;
@@ -2802,7 +2859,6 @@
       this.discount = currentValue;
       this.TotalPrice = (this.TotalPrice1 * (this.discount / 10)).toFixed(2);
     },
-
     Package() {
       this.taocan = true;
       this.datekey = Date.now();
@@ -3122,7 +3178,7 @@
           id: this.formIn.id,
           isExpire: this.formIn.isExpire,
           address: this.formIn.address,
-          company: this.formIn.company,
+          company: this.formIn.companyId,
           department: this.formIn.department,
           discount: this.discount,
           email: this.formIn.email,

--
Gitblit v1.8.0