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 |  525 ++++++++++++++++++++++++++++++++++++++++-----------------
 1 files changed, 365 insertions(+), 160 deletions(-)

diff --git a/src/views/reservation/reservations/index.vue b/src/views/reservation/reservations/index.vue
index a9cb9a9..53eb1b0 100644
--- a/src/views/reservation/reservations/index.vue
+++ b/src/views/reservation/reservations/index.vue
@@ -99,81 +99,118 @@
       v-show="showSearch"
       label-width="68px"
     >
-      <el-form-item label="濮撳悕" prop="name">
-        <el-input
-          style="width: 120px"
-          v-model="queryParams.name"
-          placeholder="璇疯緭鍏ュ鍚�"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="韬唤璇佸彿" prop="idCard">
-        <el-input
-          v-model="queryParams.idCard"
-          placeholder="璇疯緭鍏ヨ韩浠借瘉鍙�"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="鑱旂郴鐢佃瘽" prop="phoe">
-        <el-input
-          v-model="queryParams.phoe"
-          placeholder="璇疯緭鍏ヨ仈绯荤數璇�"
-          clearable
-          @keyup.enter.native="handleQuery"
-          style="width: 140px"
-        />
-      </el-form-item>
-      <el-form-item label="鍗曚綅鍚嶇О" prop="company">
-        <el-select
-          :remote-method="getRemoteData"
-          v-model="queryParams.company"
-          remote
-          default-first-option
-          allow-create
-          filterable
-          style="width: 200px"
-          placeholder="璇烽�夋嫨鍗曚綅鍚嶇О"
-          clearable
-          @change="idFn1"
-        >
-          <el-option
-            v-for="dict in CompanyList"
-            :key="dict.cnName"
-            :label="dict.cnName"
-            :value="dict.drugManufacturerId"
-          />
-        </el-select>
-        <i class="el-icon-circle-plus-outline" @click="handleAdd1"></i>
-      </el-form-item>
-      <el-form-item label="棰勭害瓒呮湡" prop="isExpire">
-        <el-select
-          v-model="queryParams.isExpire"
-          placeholder="璇烽�夋嫨鏄惁瓒呮湡"
-          clearable
-          style="width: 140px"
-        >
-          <el-option
-            v-for="dict in options"
-            :key="dict.value"
-            :label="dict.label"
-            :value="dict.value"
-          />
-        </el-select>
-      </el-form-item>
-      <el-form-item>
-        <el-button
-          type="primary"
-          icon="el-icon-search"
-          size="mini"
-          @click="handleQuery"
-          >鎼滅储</el-button
-        >
-        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
-          >閲嶇疆</el-button
-        >
-      </el-form-item>
+      <el-row>
+        <el-col>
+          <el-form-item label="濮撳悕" prop="name">
+            <el-input
+              style="width: 120px"
+              v-model="queryParams.name"
+              placeholder="璇疯緭鍏ュ鍚�"
+              clearable
+              @keyup.enter.native="handleQuery"
+            />
+          </el-form-item>
+          <el-form-item label="韬唤璇佸彿" prop="idCard">
+            <el-input
+              v-model="queryParams.idCard"
+              placeholder="璇疯緭鍏ヨ韩浠借瘉鍙�"
+              clearable
+              @keyup.enter.native="handleQuery"
+            />
+          </el-form-item>
+
+          <el-form-item label="鍗曚綅鍚嶇О" prop="companyId">
+            <el-select
+              :remote-method="getRemoteData"
+              v-model="queryParams.companyId"
+              remote
+              default-first-option
+              allow-create
+              filterable
+              style="width: 200px"
+              placeholder="璇烽�夋嫨鍗曚綅鍚嶇О"
+              clearable
+              @change="idFn1"
+            >
+              <el-option
+                v-for="dict in CompanyList"
+                :key="dict.cnName"
+                :label="dict.cnName"
+                :value="dict.drugManufacturerId"
+              />
+            </el-select>
+            <i class="el-icon-circle-plus-outline" @click="handleAdd1"></i>
+          </el-form-item>
+
+          <!-- <el-form-item label="濂楅鍚嶇О" prop="dwDeptName">
+            <el-select v-model="queryParams.dwDeptName" placeholder="璇烽�夋嫨濂楅鍚嶇О" clearable style="width: 100%"
+              @change="idFn2">
+              <el-option v-for="dict in deptList" :key="dict.id" :label="dict.dwDeptName" :value="dict.id" />
+            </el-select>
+          </el-form-item>
+
+          <el-form-item label="鍒嗙粍鍚嶇О" prop="groupingName">
+            <el-select v-model="queryParams.groupingName" placeholder="璇烽�夋嫨鍒嗙粍鍚嶇О" clearable style="width: 100%">
+              <el-option v-for="dict in groupingList" :key="dict.id" :label="dict.pacName" :value="dict.id" />
+            </el-select>
+          </el-form-item> -->
+          <el-form-item label="棰勭害鏃堕棿">
+            <el-date-picker
+              clearable
+              v-model="createTimeList"
+              @change="dateChangebirthday2"
+              type="daterange"
+              range-separator="-"
+              start-placeholder="寮�濮嬫棩鏈�"
+              end-placeholder="缁撴潫鏃ユ湡"
+              :picker-options="pickerOptions"
+              value-format="yyyy-MM-dd"
+              placeholder="璇烽�夋嫨鍑洪绾︽椂闂�"
+              style="width: 300px"
+            >
+            </el-date-picker>
+          </el-form-item>
+        </el-col>
+        <el-col>
+          <el-form-item label="鑱旂郴鐢佃瘽" prop="phoe">
+            <el-input
+              v-model="queryParams.phoe"
+              placeholder="璇疯緭鍏ヨ仈绯荤數璇�"
+              clearable
+              @keyup.enter.native="handleQuery"
+              style="width: 140px"
+            />
+          </el-form-item>
+          <el-form-item label="棰勭害瓒呮湡" prop="isExpire">
+            <el-select
+              v-model="queryParams.isExpire"
+              placeholder="璇烽�夋嫨鏄惁瓒呮湡"
+              clearable
+              style="width: 140px"
+            >
+              <el-option
+                v-for="dict in options"
+                :key="dict.value"
+                :label="dict.label"
+                :value="dict.value"
+              />
+            </el-select>
+          </el-form-item>
+
+          <el-form-item>
+            <el-button
+              type="primary"
+              icon="el-icon-search"
+              size="mini"
+              @click="handleQuery"
+              >鎼滅储</el-button
+            >
+            <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
+              >閲嶇疆</el-button
+            >
+          </el-form-item>
+        </el-col>
+      </el-row>
     </el-form>
     <el-row :gutter="10" style="margin: 10px 15px">
       <el-col :span="1.5">
@@ -295,7 +332,7 @@
           <span>{{ parseTime(scope.row.reservationTime, "{y}-{m}-{d}") }}</span>
         </template>
       </el-table-column>
-      <el-table-column
+      <!-- <el-table-column
         label="浣撴绫诲瀷"
         align="center"
         prop="tjType"
@@ -305,7 +342,7 @@
         <template slot-scope="scope">
           <dict-tag :options="dict.type.dict_team" :value="scope.row.tjType" />
         </template>
-      </el-table-column>
+      </el-table-column> -->
       <el-table-column
         label="濠氬Щ"
         align="center"
@@ -355,9 +392,23 @@
         :show-overflow-tooltip="true"
       />
       <el-table-column
-        label="閭"
+        label="濂楅鍚嶇О"
         align="center"
-        prop="email"
+        prop="dwDeptName"
+        :show-overflow-tooltip="true"
+        width="160px"
+      />
+      <el-table-column
+        label="鍒嗙粍鍚嶇О"
+        align="center"
+        prop="groupingName"
+        :show-overflow-tooltip="true"
+        width="160px"
+      />
+      <el-table-column
+        label="鍗曚綅閮ㄩ棬"
+        align="center"
+        prop="department"
         :show-overflow-tooltip="true"
         width="160px"
       />
@@ -554,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
@@ -569,7 +620,7 @@
                 >
                   <el-option
                     v-for="dict in CompanyList"
-                    :key="dict.cnName"
+                    :key="dict.drugManufacturerId"
                     :label="dict.cnName"
                     :value="dict.drugManufacturerId"
                   />
@@ -877,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>
@@ -1360,7 +1411,7 @@
                 >
                   <el-option
                     v-for="dict in CompanyList"
-                    :key="dict.cnName"
+                    :key="dict.drugManufacturerId"
                     :label="dict.cnName"
                     :value="dict.drugManufacturerId"
                   />
@@ -1896,7 +1947,12 @@
 </template>
 
 <script>
-import { addComp, addPlOrderAndDetail } from "@/api/system/comp";
+import {
+  addComp,
+  addPlOrderAndDetail,
+  Deptlist,
+  getDwAndDwDept,
+} from "@/api/system/comp";
 import Big from "big.js";
 import { Loading } from "element-ui";
 import {
@@ -1965,6 +2021,8 @@
       taocan: false,
       webSocket: null,
       defaultKeys: [],
+      deptList: [],
+      groupingList: [],
       value1: "",
       pacName: "",
       hides: false,
@@ -2038,6 +2096,8 @@
       cusIds: [],
       // 缁撴灉
       result: "",
+      createTimeList: "",
+      startTime: "",
       proIds: [],
       // 鏄剧ず鎼滅储鏉′欢
       showSearch: true,
@@ -2069,6 +2129,8 @@
         cusBrithday: null,
         cusAddr: null,
         cusPhone: null,
+        yykssj: "", // 棰勭害寮�濮嬫椂闂�
+        yyjssj: "", // 棰勭害缁撴潫鏃堕棿
         cusPostcode: null,
         cusEmail: null,
         indexCard: null,
@@ -2078,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,
@@ -2173,21 +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,
-        idCard: null,
-        phoe: null,
-        email: null,
-        tjType: null,
-        company: null,
-        reservationTime: null,
-        isExpire: null,
-      },
+
       // 琛ㄥ崟鍙傛暟
       form: {},
       // 琛ㄥ崟鏍¢獙
@@ -2221,10 +2315,46 @@
         //   },
         // ],
       },
+      pickerOptions: {
+        shortcuts: [
+          {
+            text: "鏈�杩戜竴鍛�",
+            onClick(picker) {
+              const end = new Date();
+              const start = new Date(new Date().setHours(0, 0, 0, 0));
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
+              picker.$emit("pick", [start, end]);
+            },
+          },
+          {
+            text: "鏈�杩戜竴涓湀",
+            onClick(picker) {
+              const end = new Date();
+              const start = new Date(new Date().setHours(0, 0, 0, 0));
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
+              picker.$emit("pick", [start, end]);
+            },
+          },
+          {
+            text: "鏈�杩戜笁涓湀",
+            onClick(picker) {
+              const end = new Date();
+              const start = new Date(new Date().setHours(0, 0, 0, 0));
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
+              picker.$emit("pick", [start, end]);
+            },
+          },
+        ],
+      },
     };
   },
   created() {
     this.getList();
+  },
+  watch: {
+    "formIn.company"(val) {
+      console.log("formIn.company changed:", val, typeof val);
+    },
   },
   methods: {
     isAll(value) {
@@ -2254,6 +2384,10 @@
         (Math.floor((this.TotalPrice / this.TotalPrice1) * 100) / 100) * 10;
     },
 
+    dateChangebirthday2(val) {
+      this.startTime = val;
+    },
+
     /** 鍒犻櫎鎸夐挳鎿嶄綔 */
     handleDelete1(row) {
       // console.log(row);
@@ -2269,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;
@@ -2328,19 +2462,43 @@
       this.title = "娣诲姞浣撴鍗曚綅淇℃伅缁存姢";
     },
     idFn1(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;
         });
       }
+    },
+    idFn2(value) {
+      let data = {
+        deptId: value,
+        dwId: this.form.dictCompId,
+      };
+      getDwAndDwDept(data).then((response) => {
+        // 閮ㄩ棬鍚嶇О
+        this.groupingList = response.data;
+      });
     },
     /** 鏌ヨ浣撴棰勭害鍒楄〃 */
     getList() {
       this.loading = true;
+      if (this.startTime) {
+        this.queryParams.yykssj = this.startTime[0];
+        this.queryParams.yyjssj = this.startTime[1];
+      } else if (this.createTimeList) {
+        this.queryParams.yykssj = this.createTimeList[0];
+        this.queryParams.yyjssj = this.createTimeList[1];
+      } else if (this.createTimeList == null) {
+        this.queryParams.yykssj = null;
+        this.queryParams.yyjssj = null;
+      }
       listReservation(this.queryParams).then((response) => {
         this.reservationList = response.rows;
         //  response.rows.forEach((item, index) =>
@@ -2393,6 +2551,7 @@
         proIds: null,
         pacId: null,
         company: null,
+        drugManufacturerId: null,
         companyId: null,
         jobNo: null,
         department: null,
@@ -2416,7 +2575,29 @@
     },
     /** 閲嶇疆鎸夐挳鎿嶄綔 */
     resetQuery() {
+      this.startTime = [];
+      this.createTimeList = [];
       this.resetForm("queryForm");
+      this.queryParams = {
+        pageNum: 1,
+        pageSize: 10,
+        cusName: null,
+        cusSex: null,
+        cusBrithday: null,
+        cusAddr: null,
+        cusPhone: null,
+        yykssj: "", // 棰勭害寮�濮嬫椂闂�
+        yyjssj: "", // 棰勭害缁撴潫鏃堕棿
+        cusPostcode: null,
+        cusEmail: null,
+        indexCard: null,
+        cusNational: null,
+        cusMarryStatus: null,
+        cusIdcard: null,
+        cusIntroduce: null,
+        cusNumber: null,
+        cusIsvip: null,
+      };
       this.handleQuery();
     },
     // 澶氶�夋閫変腑鏁版嵁
@@ -2504,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) => {
@@ -2548,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;
@@ -2605,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;
@@ -2655,7 +2859,6 @@
       this.discount = currentValue;
       this.TotalPrice = (this.TotalPrice1 * (this.discount / 10)).toFixed(2);
     },
-
     Package() {
       this.taocan = true;
       this.datekey = Date.now();
@@ -2774,8 +2977,8 @@
               alert("11111");
             }
             websocket.onopen = function () {
-              console.log('res',res);
-              
+              console.log("res", res);
+
               try {
                 // 杩炴帴璁惧
                 var jsonObjs = {
@@ -2975,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,
@@ -3263,12 +3466,14 @@
   -moz-border-radius: 2em;
   border-radius: 2em;
 }
+
 .dialog-footer2 {
   width: 960px;
   height: 36px;
   display: flex;
   justify-content: center;
 }
+
 /* 淇敼 婊戝潡 */
 #printIframe::-webkit-scrollbar-thumb {
   background-color: #dcdfe6;

--
Gitblit v1.8.0