From cb1f69717eed3b6a61b6c61a8934bac752782b2d Mon Sep 17 00:00:00 2001 From: wwl <xchao828@163.com> Date: 星期三, 05 三月 2025 17:00:38 +0800 Subject: [PATCH] 1 --- src/views/hosp/customer/index.vue | 71 +++++++++++++++++++++-------------- 1 files changed, 42 insertions(+), 29 deletions(-) diff --git a/src/views/hosp/customer/index.vue b/src/views/hosp/customer/index.vue index 8108ad8..ea40064 100644 --- a/src/views/hosp/customer/index.vue +++ b/src/views/hosp/customer/index.vue @@ -255,6 +255,7 @@ size="mini" @click="handleBlacklist" :disabled="single" + :loading="blackloading" v-hasPermi="['hosp:order:export']" >鍔犲叆榛戝悕鍗�</el-button > @@ -632,27 +633,27 @@ style="width: 200px" /> </el-form-item> - <el-form-item label="鍗曚綅鍚嶇О" prop="dictCompId"> - <el-select - :remote-method="getRemoteData" - v-model="form.compName" - remote - - style="width: 300px" - 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="compName"> + <el-select + v-model="form.compName" + 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.cnName" + /> + </el-select> + <i class="el-icon-circle-plus-outline" @click="handleAdd1"></i> + </el-form-item> </el-form> <div slot="footer" class="dialog-footer"> <el-button type="primary" @click="submitForm">纭� 瀹�</el-button> @@ -1013,6 +1014,9 @@ // 閬僵灞� loading: true, + blackloading:false, + isAdding:false, + // 閫変腑鏁扮粍 ids: [], // 闈炲崟涓鐢� @@ -1128,6 +1132,7 @@ submitFormS() { this.$refs["form1"].validate((valid) => { if (valid) { + addComp(this.form1).then((response) => { this.$modal.msgSuccess("鏂板鎴愬姛"); this.open1 = false; @@ -1137,14 +1142,24 @@ }); }, 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 = ''; + } } }, // 鎼滅储 @@ -1285,11 +1300,13 @@ }, handleBlacklist() { + this.blackloading = true; let data = { cusId: this.ids[0], }; addCustomerBlack(data).then((res) => { this.$modal.msgSuccess("宸插姞鍏ラ粦鍚嶅崟"); + this.blackloading = false; this.getList(); }); }, @@ -1427,10 +1444,6 @@ .dialog-footer { display: flex; justify-content: center; -} -.el-icon-circle-plus-outline { - line-height: 20px; - font-size: 20px; } .dialog-footer2 { width: 960px; -- Gitblit v1.8.0