From c0b8a21206c58a0161a179c15dfb73e4a8bbf55d Mon Sep 17 00:00:00 2001
From: lkk <364857242@qq.com>
Date: 星期一, 19 五月 2025 17:36:17 +0800
Subject: [PATCH] 1

---
 src/views/system/zhiye/index.vue |  230 +++++++++++++++++++++++++--------------------------------
 1 files changed, 101 insertions(+), 129 deletions(-)

diff --git a/src/views/system/zhiye/index.vue b/src/views/system/zhiye/index.vue
index bb2d6b6..1ae360c 100644
--- a/src/views/system/zhiye/index.vue
+++ b/src/views/system/zhiye/index.vue
@@ -222,22 +222,7 @@
             <el-form-item label="鏌ヤ綋鍒嗙被" prop="examCategory" label-width="99px">
               <el-input :disabled="isDisabled" v-model="form.examCategory" placeholder="璇疯緭鍏ユ煡浣撳垎绫�" />
             </el-form-item>
-            <el-form-item label="鎺ュ宸ラ緞骞�" prop="hazardYears" label-width="104px">
-              <el-input :disabled="isDisabled" v-model="form.hazardYears" placeholder="璇疯緭鍏ユ帴瀹冲伐榫勫勾" type="number" />
-            </el-form-item>
-            <el-form-item label="鎺ュ宸ラ緞鏈�" prop="hazardMonths" label-width="106px">
-              <el-input :disabled="isDisabled" v-model="form.hazardMonths" placeholder="璇疯緭鍏ユ帴瀹冲伐榫勬湀" type="number" />
-            </el-form-item>
-            <el-form-item label="寮�濮嬫帴瀹虫棩鏈�" prop="hazardStartDate" label-width="100px">
-              <el-date-picker :disabled="isDisabled" clearable v-model="form.hazardStartDate" type="date"
-                value-format="yyyy-MM-dd" placeholder="璇烽�夋嫨寮�濮嬫帴瀹虫棩鏈�" style="width: 93%" />
-            </el-form-item>
-            <el-form-item label="宸ュ彿" label-width="103px">
-              <el-input :disabled="isDisabled" v-model="form.wenHua" placeholder="璇疯緭鍏ュ伐鍙�" />
-            </el-form-item>
-            <el-form-item label="杞﹂棿" label-width="106px">
-              <el-input :disabled="isDisabled" v-model="form.wenHua" placeholder="璇疯緭鍏ヨ溅闂�" />
-            </el-form-item>
+
           </el-form>
           <el-form ref="form" :model="form" :rules="rules" :label-position="labelPosition" label-width="106px"
             v-show="top">
@@ -466,6 +451,7 @@
                 <span slot="label"> 璇佷欢鍙风爜 </span>
                 <el-input :disabled="isDisabled" v-model="form.cusIdcard" placeholder="璇疯緭鍏ヨ韩浠借瘉鍙�" @input="inputChange" />
               </el-form-item>
+
               <el-form-item label="鍗曚綅鍚嶇О" prop="firmName">
                 <el-select v-model="form.firmName" remote default-first-option allow-create filterable
                   style="width: 200px" placeholder="璇烽�夋嫨鍗曚綅鍚嶇О" clearable @change="idFn1" @clear="clear">
@@ -477,7 +463,7 @@
               </el-form-item>
               <el-form-item label="浣撴绫诲瀷">
                 <el-select v-model="form.tjType" placeholder="璇烽�夋嫨浣撴绫诲瀷">
-                  <el-option v-for="dict in dict.type.dict_team" :key="dict.value" :label="dict.label"
+                  <el-option v-for="dict in filteredDictTeam" :key="dict.value" :label="dict.label"
                     :value="dict.value"></el-option>
                 </el-select>
               </el-form-item>
@@ -500,6 +486,22 @@
               <el-form-item label="瀹炴敹閲戦">
                 <el-input placeholder="瀹炴敹閲戦" v-model="TotalPrice" style="width: 206px" @input="changeXianjia"
                   @blur="numberChangeXianPrice(discount, discount)" />
+              </el-form-item>
+              <el-form-item label="鎺ュ宸ラ緞骞�" prop="zhiyeJhgln" label-width="84px">
+                <el-input v-model="form.zhiyeJhgln" type="number" style="width: 140px" />
+              </el-form-item>
+              <el-form-item label="鎺ュ宸ラ緞鏈�" prop="zhiyeJhgln" label-width="84px">
+                <el-input v-model="form.zhiyeJhgly" style="width: 140px" type="number" />
+              </el-form-item>
+              <el-form-item label="寮�濮嬫帴瀹虫棩鏈�" prop="zhiyeKsjhrq" label-width="100px">
+                <el-date-picker clearable v-model="form.zhiyeKsjhrq" type="date" value-format="yyyy-MM-dd"
+                  style="width: 200px" />
+              </el-form-item>
+              <el-form-item label="宸ュ彿" label-width="50px">
+                <el-input v-model="form.zhiyeGh" />
+              </el-form-item>
+              <el-form-item label="杞﹂棿" label-width="106px">
+                <el-input v-model="form.zhiyeCj" />
               </el-form-item>
               <br />
 
@@ -548,9 +550,6 @@
                 font-size: 16px;
                 margin-right: 20px;
               ">
-              <span v-if="this.tableData1[0]">{{
-                this.tableData1[0].pacName || ""
-              }}</span>
               宸查�夐」鐩潯鏁帮細<span style="font-weight: 700; color: red; margin-right: 5px">{{ this.tableData1.length || 0
                 }}</span>鏉�
             </div>
@@ -753,13 +752,13 @@
   getfindTj,
   getByTjNum,
 } from "@/api/hosp/customer";
+
 import { getPrintSetUp } from "@/api/system/examcharge";
-import cnchar from 'cnchar';
 import {
   tuantiSelect,
   deptTreeSelect,
   projectGetList,
-  getOrder,
+  getOrderzhiye,
   getProParentIdDxList,
   getProSonDxList,
   getCusIdcard,
@@ -804,6 +803,7 @@
   },
   data() {
     return {
+      tjLei: [],
       isSubmitting: false,
       open1: false,
       filterage: "",
@@ -1013,9 +1013,11 @@
       form: {
         educationLevel: "", // 鏂囧寲绋嬪害
         examCategory: "", // 鏌ヤ綋鍒嗙被
-        hazardYears: "", // 鎺ュ宸ラ緞骞�
-        hazardMonths: "", // 鎺ュ宸ラ緞鏈�
-        hazardStartDate: "", // 寮�濮嬫帴瀹虫棩鏈�
+        zhiyeJhgln: "", // 鎺ュ宸ラ緞骞�
+        zhiyeJhgly: "", // 鎺ュ宸ラ緞鏈�
+        zhiyeKsjhrq: "", // 寮�濮嬫帴瀹虫棩鏈�
+        zhiyeGh: "", // 宸ュ彿
+        zhiyeCj: "", // 杞﹂棿
         cusIdcard: "",
         tjType: "",
         cusSex: 1,
@@ -1083,6 +1085,14 @@
       this.$refs.treas.filter(val);
     },
   },
+  computed: {
+    filteredDictTeam() {
+      // 杩囨护 dict.type.dict_team锛屽彧淇濈暀 value 鍦� tjLei 涓殑椤�
+      return this.dict.type.dict_team.filter(dict =>
+        this.tjLei.includes(dict.value.toString())
+      );
+    }
+  },
   created() {
     this.getCompanyList();
 
@@ -1096,6 +1106,13 @@
     this.TreedataList = [];
     this.DataList = [];
     this.marryall = 0;
+    getconfigKey("zhiye_tj_type").then((res) => {
+      if (res.code === 200) {
+        const values = res.msg.split(",");
+        this.tjLei.push(...values);
+      }
+    });
+
   },
   methods: {
     handleIdCardInput(value) {
@@ -1266,9 +1283,9 @@
       }
 
       if (this.form.firmName) {
-        this.form.tjType = this.dict.type.dict_team[1].value;
+        this.form.tjType = "6";
       } else {
-        this.form.tjType = this.dict.type.dict_team[0].value;
+        this.form.tjType = "5";
       }
 
     },
@@ -1627,6 +1644,12 @@
         deleted: null,
         firmid: "",
         firmDeptName: "",
+        examCategory: "", // 鏌ヤ綋鍒嗙被
+        zhiyeJhgln: "", // 鎺ュ宸ラ緞骞�
+        zhiyeJhgly: "", // 鎺ュ宸ラ緞鏈�
+        zhiyeKsjhrq: "", // 寮�濮嬫帴瀹虫棩鏈�
+        zhiyeGh: "", // 宸ュ彿
+        zhiyeCj: "", // 杞﹂棿
       };
       this.resetForm("form");
     },
@@ -1754,14 +1777,11 @@
             if (formData.cusSex === "鏈煡") {
               formData.cusSex = 2;
             }
-            if (formData.tjType === "") {
-              formData.tjType = this.dict.type.dict_team[0].value;
 
-            }
 
             addCustomer(formData).then((response) => {
               this.responseList = response.data;
-              this.form.tjType = this.dict.type.dict_team[0].value;
+              this.form.tjType = '';
               this.$modal.msgSuccess("鏂板鎴愬姛");
               _this.tcShow = true;
               _this.isDisabled = true;
@@ -1797,7 +1817,7 @@
               this.discount = this.form.discount;
             }
             if (this.form.tjType === null) {
-              this.form.tjType = this.dict.type.dict_team[0].value;
+              this.form.tjType = null;
             }
             if (this.form.cusMarryStatus === "null") {
               this.form.cusMarryStatus = "5";
@@ -1808,12 +1828,7 @@
             if (this.form.reservationId != null) {
               if (this.form.groupingId) {
                 this.form.firmName = this.form.compName;
-                this.dict.type.dict_team.forEach((item) => {
-                  if (item.label == "鍥㈤槦") {
-                    this.form.tjType = item.value;
-                  }
-                })
-                // this.form.tjType = this.dict.type.dict_team[1].value;
+
                 this.CompanyList.forEach((item) => {
                   if (item.cnName == this.form.firmName) {
                     this.form.firmId = item.drugManufacturerId;
@@ -2376,90 +2391,29 @@
       let cusSex = this.form.cusSex;
       this.datekey = Date.now();
       //鍏ㄩ儴濂楅
-
-      let param = {
-        sex: cusSex,
-        dwId: this.form.firmId || "",
-      };
-      if (this.form.tjType == 1) {
-        if (!this.form.firmId && !this.form.firmName) {
-          this.$message({
-            type: "warning",
-            message: "璇峰厛缁存姢鍗曚綅锛�",
-          });
-        } else if (!this.form.firmId && this.form.firmName) {
-          this.taocan = true;
-          this.loading = true;
-          deptTreeSelect(cusSex).then((response) => {
-            this.newpacName = response.rows;
-            try {
-              if (this.tableData1.length >= 1) {
-                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();
-                      }
+      this.taocan = true;
+      this.loading = true;
+      deptTreeSelect(cusSex).then((response) => {
+        this.newpacName = response.rows;
+        try {
+          if (this.tableData1.length >= 1) {
+            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);
                     });
-                  });
-                });
-              }
-            } catch (error) { }
-            this.loading = false;
-          });
-        }
-
-        else {
-          this.taocan = true;
-          this.loading = true;
-          tuantiSelect(param).then((res) => {
-            this.newpacName = res.data;
-            try {
-              if (this.tableData1.length >= 1) {
-                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();
-                      }
-                    });
-                  });
-                });
-              }
-            } catch (error) { }
-            this.loading = false;
-          });
-        }
-      } else {
-        this.taocan = true;
-        this.loading = true;
-        deptTreeSelect(cusSex).then((response) => {
-          this.newpacName = response.rows;
-          try {
-            if (this.tableData1.length >= 1) {
-              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();
-                    }
-                  });
+                    throw Error();
+                  }
                 });
               });
-            }
-          } catch (error) { }
-          this.loading = false;
-        });
-      }
+            });
+          }
+        } catch (error) { }
+        this.loading = false;
+      });
+
     },
 
     // 鐐瑰嚮澶氶�夋鑾峰彇閫変腑鏁版嵁
@@ -2949,6 +2903,15 @@
         });
       }
 
+      // 濡傛灉 tjCategory 涓� "02"锛岀‘淇濋�変腑鐨勫椁愯娣诲姞鍒� tableData1
+      if (this.tjCategory === "02" && this.tableData.length > 0) {
+        this.tableData.forEach((item) => {
+          if (!this.tableData1.some((existingItem) => existingItem.pacId === item.pacId)) {
+            this.tableData1.push(item);
+          }
+        });
+      }
+
       this.taocan = false;
       this.defaultKeys = [];
       this.DataLists = [];
@@ -3078,7 +3041,7 @@
           };
         }
 
-        getOrder(data).then((res) => {
+        getOrderzhiye(data).then((res) => {
           this.$modal.msgSuccess("鎻愪氦鎴愬姛");
           this.tjNumbers = res.msg;
           this.charge = true;
@@ -3128,14 +3091,17 @@
           cusPhone: item.tjPhone,
           cusSex: item.sex === "鐢�" ? "0" : "1",
         };
+        // 鍔ㄦ�佷粠filteredDictTeam鑾峰彇tjType
+        const dictItem = this.filteredDictTeam.find(dict => dict.label === item.tjType);
+        const tjTypeValue = dictItem ? dictItem.value : (this.filteredDictTeam.length > 0 ? this.filteredDictTeam[0].value : "0"); // 鍥為��鍒扮涓�涓�兼垨榛樿"0"
         if (item.tjComp != null) {
           this.standard = {
             company: item.tjComp,
-            tjType: item.tjType === "鍥㈤槦" ? "1" : "2",
+            tjType: tjTypeValue,
           };
         } else {
           this.standard = {
-            tjType: item.tjType === "鍥㈤槦" ? "1" : "2",
+            tjType: tjTypeValue,
           };
         }
       });
@@ -3166,19 +3132,15 @@
                 this.formInline.paidIn = item.proPrice;
               }
             });
-            const r = /^\+?[0-9][0-9]*$/; //姝f暣鏁帮紙鍙互浠ユ墦澶达級
-            //const r=/^\+?[1-9][0-9]*$/;//姝f暣鏁�
+            const r = /^\+?[0-9][0-9]*$/; // 姝f暣鏁�
             if (r.test(this.formInline.paidIn)) {
               this.formInline.paidIn = this.formInline.paidIn + ".00";
             }
-            this.discount =
-              (this.formInline.paidIn / this.formInline.price) * 10;
-
+            this.discount = (this.formInline.paidIn / this.formInline.price) * 10;
           } else {
             this.discount = 10;
             this.formInline.paidIn = "0.00";
           }
-
           this.total = response.data.total;
         } else {
           this.tableList = [];
@@ -3252,7 +3214,7 @@
     },
 
     listgetOrder(data) {
-      getOrder(data).then((res) => {
+      getOrderzhiye(data).then((res) => {
         this.$modal.msgSuccess("鎻愪氦鎴愬姛");
         //璋冩帴鍙f樉绀哄妫�鍗�
         const tjNumber = res.msg;
@@ -3336,6 +3298,10 @@
                 firmId: this.form.firmId,
                 firmName: this.form.firmName,
                 firmDeptName: this.form.firmDeptName,
+                zhiyeJhgly: this.form.zhiyeJhgly,
+                zhiyeKsjhrq: this.form.zhiyeKsjhrq,
+                zhiyeGh: this.form.zhiyeGh,
+                zhiyeCj: this.form.zhiyeCj
               };
 
               this.listgetOrder(data);
@@ -3350,6 +3316,12 @@
                 firmId: this.form.firmId,
                 firmName: this.form.firmName,
                 firmDeptName: this.form.firmDeptName,
+                zhiyeJhgly: this.form.zhiyeJhgly,
+                zhiyeKsjhrq: this.form.zhiyeKsjhrq,
+                zhiyeGh: this.form.zhiyeGh,
+                zhiyeCj: this.form.zhiyeCj
+
+
               };
               this.listgetOrder(data);
             } else {

--
Gitblit v1.8.0