From f1bd6c371da44538248ea8fd479f0f4a2180e337 Mon Sep 17 00:00:00 2001 From: wwl <xchao828@163.com> Date: 星期四, 26 六月 2025 11:33:45 +0800 Subject: [PATCH] 今日通知,限制电话输入位数,富文本 --- src/views/system/tijianall/index.vue | 123 ++++++++++++++++++++++++++-------------- 1 files changed, 79 insertions(+), 44 deletions(-) diff --git a/src/views/system/tijianall/index.vue b/src/views/system/tijianall/index.vue index 2b15c48..6dc5ab7 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%" @@ -180,7 +181,12 @@ }, ]" > - <el-input v-model="form.cusPhone" placeholder="璇疯緭鍏ョ數璇�" /> + <el-input + maxlength="11" + v-model="form.cusPhone" + placeholder="璇疯緭鍏ョ數璇�" + @input="form.cusPhone = $event.replace(/\s/g, '')" + /> </el-form-item> <el-form-item label="濠氬Щ" prop="cusMarryStatus"> @@ -224,7 +230,8 @@ <el-input v-model="form.cusIdcard" placeholder="璇疯緭鍏ヨ韩浠借瘉鍙�" - @input="inputChange" + @input="handleIdCardInput" + style="width: 190px" /> <!-- <i style="font-size: 17px; margin-left: 3px" @@ -242,14 +249,18 @@ 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 +280,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 +300,11 @@ 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 +345,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 +362,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 +383,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 +839,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 +854,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 +1105,6 @@ </template> <script> - import printJS from "print-js"; import { getInfo } from "@/api/login"; import Packages from "@/components/Packages"; @@ -1104,10 +1125,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 +1183,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 +1480,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; @@ -1486,6 +1511,10 @@ }); }); } + }, + handleIdCardInput(value) { + this.form.cusIdcard = value.replace(/\s/g, ""); + this.inputChange(); // 淇濈暀鍘熸湁鐨勮韩浠借瘉杈撳叆澶勭悊閫昏緫 }, inputChange() { const reg = @@ -1783,6 +1812,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