From c140987b3ef6fd47e3b795fc3a2c6f880f49f9c2 Mon Sep 17 00:00:00 2001
From: qx <1084500556@qq.com>
Date: 星期三, 12 三月 2025 13:41:28 +0800
Subject: [PATCH] qx

---
 src/views/system/tijianall/index.vue |  115 +++++++++++++++++++++++++++++++++++----------------------
 1 files changed, 70 insertions(+), 45 deletions(-)

diff --git a/src/views/system/tijianall/index.vue b/src/views/system/tijianall/index.vue
index 2b15c48..bbbb03a 100644
--- a/src/views/system/tijianall/index.vue
+++ b/src/views/system/tijianall/index.vue
@@ -120,6 +120,7 @@
               ]"
             >
               <el-input
+              @input="form.cusName = $event.replace(/\s/g, '')"
                 v-model="form.cusName"
                 placeholder="璇疯緭鍏ュ鍚�"
                 style="width: 99%"
@@ -179,8 +180,9 @@
                   trigger: 'blur',
                 },
               ]"
-            >
-              <el-input v-model="form.cusPhone" placeholder="璇疯緭鍏ョ數璇�" />
+            > 
+              
+              <el-input v-model="form.cusPhone" placeholder="璇疯緭鍏ョ數璇�"   @input="form.cusPhone = $event.replace(/\s/g, '')"/>
             </el-form-item>
 
             <el-form-item label="濠氬Щ" prop="cusMarryStatus">
@@ -224,7 +226,9 @@
               <el-input
                 v-model="form.cusIdcard"
                 placeholder="璇疯緭鍏ヨ韩浠借瘉鍙�"
-                @input="inputChange"
+                @input="handleIdCardInput"
+                style="width: 190px"
+                
               />
               <!-- <i
                 style="font-size: 17px; margin-left: 3px"
@@ -242,14 +246,15 @@
             label-width="106px"
           >
             <el-form-item label="閭" prop="cusEmail">
-              <el-input v-model="form.cusEmail" placeholder="璇疯緭鍏ラ偖绠�" />
+          
+              <el-input v-model="form.cusEmail" placeholder="璇疯緭鍏ラ偖绠�"      @input="form.cusEmail = $event.replace(/\s/g, '')"/>
             </el-form-item>
             <el-form-item label="姘戞棌" prop="cusNational">
               <el-select
                 filterable
                 v-model="form.cusNational"
                 placeholder="璇烽�夋嫨姘戞棌"
-                style="width: 93%"
+                style="width: 94%"
               >
                 <el-option
                   v-for="dict in dict.type.dict_user_national"
@@ -269,7 +274,7 @@
               <el-select
                 :disabled="isDisabled"
                 v-model="form.ageUnit"
-                style="width: 20%"
+                style="width: 19%"
               >
                 <el-option
                   v-for="dict in dict.type.dict_ageunit"
@@ -289,7 +294,7 @@
             label-width="106px"
           >
             <el-form-item label="鍗″彿" prop="indexCard">
-              <el-input v-model="form.indexCard" placeholder="璇疯緭鍏ュ崱鍙�" />
+              <el-input v-model="form.indexCard" placeholder="璇疯緭鍏ュ崱鍙�"   @input="form.indexCard = $event.replace(/\s/g, '')"/>
             </el-form-item>
             <el-form-item label="鑱屼笟" prop="career">
               <el-select
@@ -330,13 +335,15 @@
             :rules="rules"
             label-width="106px"
           >
-          <el-form-item label="鍗曚綅鍚嶇О" prop="dictCompId">
+            <el-form-item label="鍗曚綅鍚嶇О" prop="compName">
               <el-select
-                :remote-method="getRemoteData"
+                :disabled="isDisabled"
                 v-model="form.compName"
                 remote
+                default-first-option
+                allow-create
                 filterable
-                style="width: 300px"
+                style="width: 200px"
                 placeholder="璇烽�夋嫨鍗曚綅鍚嶇О"
                 clearable
                 @change="idFn1"
@@ -345,16 +352,16 @@
                   v-for="dict in CompanyList"
                   :key="dict.cnName"
                   :label="dict.cnName"
-                  :value="dict.drugManufacturerId"
+                  :value="dict.cnName"
                 />
               </el-select>
-              <i class="el-icon-circle-plus-outline" @click="handleAdd1"></i>
+              <!-- <i class="el-icon-circle-plus-outline" @click="handleAdd1"></i> -->
             </el-form-item>
-            <el-form-item label="浣撴绫诲埆" prop="category">
+            <el-form-item label="浣撴绫诲埆" prop="category" label-width="95px">
               <el-select
                 v-model="form.category"
                 placeholder="璇烽�夋嫨浣撴绫诲埆"
-                style="width: 95%"
+                style="width: 94%"
               >
                 <el-option
                   v-for="dict in dict.type.dict_tjtype"
@@ -366,7 +373,11 @@
               <!-- <el-input v-model="form.category" placeholder="璇疯緭鍏ヤ綋妫�绫诲埆" /> -->
             </el-form-item>
             <el-form-item label="閮ㄩ棬" prop="department">
-              <el-input v-model="form.department" placeholder="璇疯緭鍏ラ儴闂�" />
+              <el-input
+                v-model="form.department"
+                placeholder="璇疯緭鍏ラ儴闂�"
+                style="width: 93%"
+              />
             </el-form-item>
           </el-form>
           <el-form
@@ -818,7 +829,7 @@
             <el-form
               :model="form"
               :inline="true"
-              label-width="100px"
+              label-width="104px"
               style="margin-left: 10px"
             >
               <el-form-item label="搴旀敹閲戦" style="margin-right: 20px">
@@ -833,14 +844,15 @@
                 <el-input-number style="width: 140px" v-model="discount" :precision="2" :step="0.1" :max="10" :min="1"
                   @change="numberChange" :disabled="isfalse"></el-input-number>
               </el-form-item> -->
-              <el-form-item label="瀹炴敹閲戦">
+              <el-form-item label="瀹炴敹閲戦" label-width="96px">
                 <el-input
                   placeholder="瀹炴敹閲戦"
                   v-model="TotalPrice"
                   disabled
+                  style="width: 192px"
                 ></el-input>
               </el-form-item>
-              <el-form-item>
+              <el-form-item style="margin-left: 50px">
                 <el-button type="primary" @click="Package" size="mini"
                   >閫夋嫨濂楅</el-button
                 >
@@ -1083,7 +1095,6 @@
 </template>
   
 <script>
-
 import printJS from "print-js";
 import { getInfo } from "@/api/login";
 import Packages from "@/components/Packages";
@@ -1104,10 +1115,7 @@
 } from "@/api/system/tijian";
 import VTreeTransfer from "../tijian/TreeTransfer.vue";
 import historyTj from "@/components/historyTj/index";
-import {
-  getCompany,
-  queryCompany,
-} from "@/api/team/tuanti";
+import { getCompany, queryCompany } from "@/api/team/tuanti";
 export default {
   components: {
     VTreeTransfer,
@@ -1165,24 +1173,20 @@
     // };
     return {
       rules1: {
-      cnName: [
-        { required: true,  trigger: 'blur' },
-      ],
-      contactPerson: [
-        { required: true, trigger: 'blur' },
-      ],
-      contactPhone: [
-        { 
-          required: true, 
-          trigger: 'blur' 
-        },
-        { 
-          pattern: /^1[3-9]\d{9}$/, 
-          trigger: 'blur'
-        }
-      ],
-    },
-      title: '',
+        cnName: [{ required: true, trigger: "blur" }],
+        contactPerson: [{ required: true, trigger: "blur" }],
+        contactPhone: [
+          {
+            required: true,
+            trigger: "blur",
+          },
+          {
+            pattern: /^1[3-9]\d{9}$/,
+            trigger: "blur",
+          },
+        ],
+      },
+      title: "",
       open1: false,
       CompanyList: [],
       marryall: 0,
@@ -1466,16 +1470,27 @@
       this.title = "娣诲姞浣撴鍗曚綅淇℃伅缁存姢";
     },
     idFn1(value) {
-      console.log(value);
       if (value) {
-        this.form.dictCompId = value;
+        // 淇濆瓨淇敼鍓嶇殑 dictCompId
+        const originalCompId = this.form.dictCompId;
+
+        // 鏇存柊鍏徃鍚嶇О
+        this.form.compName = value;
+
+        // 閬嶅巻鍏徃鍒楄〃锛屾牴鎹叕鍙稿悕绉拌缃搴旂殑 drugManufacturerId
         this.CompanyList.forEach((item) => {
-          if (item.drugManufacturerId == this.form.dictCompId) {
-            this.form.compName = item.cnName;
+          if (item.cnName == this.form.compName) {
+            this.form.dictCompId = item.drugManufacturerId;
           }
         });
+
+        // 濡傛灉 dictCompId 娌℃湁鍙樺寲锛岄噸缃负绌�
+        if (this.form.dictCompId === originalCompId) {
+          this.form.dictCompId = '';
+        }
       }
     },
+
     getRemoteData(query) {
       if (query) {
         let compName = query;
@@ -1487,6 +1502,10 @@
         });
       }
     },
+    handleIdCardInput(value) {
+  this.form.cusIdcard = value.replace(/\s/g, '');
+  this.inputChange(); // 淇濈暀鍘熸湁鐨勮韩浠借瘉杈撳叆澶勭悊閫昏緫
+},
     inputChange() {
       const reg =
         /^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/;
@@ -1783,6 +1802,12 @@
               if (this.form.tjType == null) {
                 this.form.tjType = 2;
               }
+              if (this.form.cusMarryStatus === "null") {
+                this.form.cusMarryStatus = "5";
+              }
+              if (this.form.cusNational === "null") {
+                this.form.cusNational = "1";
+              }
               this.loading = false;
               if (this.form) {
                 _this.tcShow = true;

--
Gitblit v1.8.0