From 38a40fefc0c7c6afb17958f6827304dbefda9873 Mon Sep 17 00:00:00 2001
From: qx <1084500556@qq.com>
Date: 星期二, 24 六月 2025 08:58:28 +0800
Subject: [PATCH] Merge branch 'master' of http://101.42.27.146:5001/r/ltkj_peisweb_region

---
 src/views/system/zhiye/index.vue |  168 +++++++++++++++++++++++++++----------------------------
 1 files changed, 82 insertions(+), 86 deletions(-)

diff --git a/src/views/system/zhiye/index.vue b/src/views/system/zhiye/index.vue
index bb2d6b6..9459fcc 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,8 +752,8 @@
   getfindTj,
   getByTjNum,
 } from "@/api/hosp/customer";
+
 import { getPrintSetUp } from "@/api/system/examcharge";
-import cnchar from 'cnchar';
 import {
   tuantiSelect,
   deptTreeSelect,
@@ -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;
@@ -2365,8 +2380,7 @@
         }
       });
     },
-
-    Package() {
+Package() {
       this.activeNames = "first";
       if (this.form.cusSex == "鐢�") {
         this.form.cusSex = 0;
@@ -2381,7 +2395,7 @@
         sex: cusSex,
         dwId: this.form.firmId || "",
       };
-      if (this.form.tjType == 1) {
+      if (this.form.tjType == 6) {
         if (!this.form.firmId && !this.form.firmName) {
           this.$message({
             type: "warning",
@@ -2410,9 +2424,7 @@
             } catch (error) { }
             this.loading = false;
           });
-        }
-
-        else {
+        } else {
           this.taocan = true;
           this.loading = true;
           tuantiSelect(param).then((res) => {
@@ -2464,6 +2476,7 @@
 
     // 鐐瑰嚮澶氶�夋鑾峰彇閫変腑鏁版嵁
     handleSelectionChange(selection, row) {
+      console.log(selection)
       this.tableData = selection;
       if (selection.length > 1) {
         let del_row = selection.shift();
@@ -2508,37 +2521,6 @@
         });
       }
       if (selection[0]) {
-        // this.DataList = [];
-        // this.data = JSON.parse(JSON.stringify(this.dXData));
-        // selection[0].tjProjectList.forEach((selectionitem) => {
-        //   this.Treedata.forEach((item) => {
-        //     if (selectionitem.proName == item.proName) {
-        //       item.disabled = true;
-        //       item.tjProjectList = [];
-        //     }
-        // if (item.tjProjectList) {
-        //   item.tjProjectList.forEach((item1) => {
-        //     if (selectionitem.proName == item1.proName) {
-        //       item1.disabled = true;
-        //       item1.tjProjectList = [];
-        //     }
-        //     if (item1.tjProjectList) {
-        //       item1.tjProjectList.forEach((item2) => {
-        //         if (selectionitem.proName == item2.proName) {
-        //           item2.disabled = true;
-        //           item2.tjProjectList = [];
-        //         }
-        //       });
-        //     }
-        //   });
-        // }
-        // });
-        //   this.TreedataList.forEach((item3) => {
-        //     if (item3.proParentId == selectionitem.proId) {
-        //       item.disabled = true;
-        //     }
-        //   });
-        // });
       } else {
         this.treedataList = JSON.parse(JSON.stringify(this.dXData));
         return;
@@ -2887,6 +2869,7 @@
 
     // 椤圭洰鎻愪氦
     submit() {
+
       if (this.form.cusIdcard) {
         var cusId = this.form.cusIdcard;
       } else {
@@ -2946,6 +2929,15 @@
           this.isSubmitting = false; // 鎻愪氦瀹屾垚鍚庨噸缃爣蹇�
         }).catch(() => {
           this.isSubmitting = false; // 纭繚鍦ㄩ敊璇儏鍐典笅涔熼噸缃爣蹇�
+        });
+      }
+
+      // 濡傛灉 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);
+          }
         });
       }
 
@@ -3128,14 +3120,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 +3161,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 +3243,14 @@
     },
 
     listgetOrder(data) {
+      const loading = this.$loading({
+        lock: true,
+        text: '姝e湪鍔犺浇涓紝璇风◢绛夛紒',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      });
       getOrder(data).then((res) => {
+        loading.close();
         this.$modal.msgSuccess("鎻愪氦鎴愬姛");
         //璋冩帴鍙f樉绀哄妫�鍗�
         const tjNumber = res.msg;
@@ -3264,8 +3262,7 @@
       this.$tab.refreshPage();
     },
 
-    // 鏈�鍚庢彁浜ゆ寜閽�
-    submitPrice() {
+ submitPrice() {
       let _this = this;
       this.loadingSubmit = true;
       if (_this.tjCategory !== "") {
@@ -3316,12 +3313,11 @@
             discount: item.discount,
             parentProId: item.parentProId,
             cusIdCard: item.cusId,
-            yhj: item.nowPrice
+            yhj: item.nowPrice,
           })); // 鍒涘缓鏂扮殑瀵硅薄锛屽寘鍚� discount 鍜� id
         gaibianzhekou(newArray).then((res) => {
           this.loadingSubmit = false;
           if (res.code === 200) {
-
             let data;
 
             if (pacId || this.tjOrderList.length > 0) {

--
Gitblit v1.8.0