From 30237639c7aa7ef824235b1115df9692ad3299ee Mon Sep 17 00:00:00 2001 From: chenghuan Date: Mon, 23 Mar 2026 16:02:59 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E5=8C=BB=E7=96=97=E6=A8=A1=E5=9D=97):=20?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=96=B0=E5=A2=9E/=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=BC=B9=E7=AA=97=E8=A1=A8=E5=8D=95=EF=BC=8C=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=85=B3=E8=81=94=E7=94=A8=E6=88=B7=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在新增/修改弹窗中,添加关联用户的输入框,支持手机号/邮箱的自动补全 - 更新表单验证规则,确保关联用户为必填项 - 调整表单项的样式,统一标签宽度,提升用户体验 - 增加用户列表加载功能,优化用户选择流程 --- src/views/modules/medical/inherit.vue | 85 +++++++++++++++++---- src/views/modules/vipList/user-open-vip.vue | 2 +- 2 files changed, 73 insertions(+), 14 deletions(-) diff --git a/src/views/modules/medical/inherit.vue b/src/views/modules/medical/inherit.vue index c20d5e5..7b52d00 100644 --- a/src/views/modules/medical/inherit.vue +++ b/src/views/modules/medical/inherit.vue @@ -61,7 +61,7 @@ - + @@ -76,17 +76,39 @@ - + + + + + + + + - + - + @@ -98,17 +120,19 @@ - - - - + +
+ + + +
- + @@ -131,6 +155,7 @@ cityEntity: [], provinceEntity: [], //省地址 typeList: [], //类型列表 + userList: [], //用户列表 booknameList: [], dataForm: { dictType: '', //分类 @@ -145,6 +170,7 @@ content: '', cityId: '', provId: '', + tel: '', sort: 0 }, editId: '', @@ -153,6 +179,10 @@ required: true, message: "请选择分类" }], + tel: [{ + required: true, + message: "请选择关联用户" + }], name: [{ required: true, message: "请输入姓名" @@ -239,6 +269,32 @@ this.dataListLoading = false }) }, + loadAll(queryString, cb) { + if (queryString == "") { + return false; + } + this.$http({ + url: this.$http.adornUrl("/book/user/getUserList"), + method: "post", + data: this.$http.adornData({ + page: 1, + limit: 20, + key: queryString + }) + }).then(({ data }) => { + if (data && data.code === 0) { + var arr = data.user.records; + cb(arr); + } else { + cb([]); + } + }); + }, + handleSelect(data) { + console.log("data at line 161:", data); + this.addForm.userId = data.id; + this.addForm.tel = data.tel; + }, provinceChange() { this.addForm.cityId = '' this.cityEntity = [] @@ -281,6 +337,7 @@ this.addForm.content = row.content this.addForm.typeId = row.type.toString() this.addForm.sort = row.sort + this.addForm.tel = row.tel this.fileList = row.imgList for (var i = 0; i < this.provinceEntity.length; i++) { for (var j = 0; j < this.provinceEntity[i].cityList.length; j++) { @@ -382,7 +439,9 @@ "content": this.addForm.content, "type": this.addForm.typeId, "cityId": this.addForm.cityId, - "sort": this.addForm.sort + "sort": this.addForm.sort, + "userId": this.addForm.userId, + "tel": this.addForm.tel }) }).then(({ data diff --git a/src/views/modules/vipList/user-open-vip.vue b/src/views/modules/vipList/user-open-vip.vue index 5f791f1..f78f238 100644 --- a/src/views/modules/vipList/user-open-vip.vue +++ b/src/views/modules/vipList/user-open-vip.vue @@ -27,7 +27,7 @@ size="small" style="width: 100%;" v-model="dataForm.userKey" - debounce="500" + :debounce="500" :fetch-suggestions="loadAll" placeholder="请输入手机号/邮箱" @select="handleSelect"