From 0a063c783a938ccdf93ba1e7d106360c9dd83aa3 Mon Sep 17 00:00:00 2001 From: wuteng <419274783@qq.com> Date: Fri, 13 Mar 2026 14:55:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=93=8D=E4=BD=9C=E4=BA=BA=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E7=BF=BB=E9=A1=B5=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EmisBaseTools/SysUserSimplePicker.vue | 27 +++++++------------ 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/src/views/emis/EmisBaseTools/SysUserSimplePicker.vue b/src/views/emis/EmisBaseTools/SysUserSimplePicker.vue index 2bf8b917..a0f7ce5b 100644 --- a/src/views/emis/EmisBaseTools/SysUserSimplePicker.vue +++ b/src/views/emis/EmisBaseTools/SysUserSimplePicker.vue @@ -61,7 +61,7 @@ import { getStaffList } from "@/api/emis/emisStaff"; mixins: [emitter], props: { value: { - type: String, + type: Number, required: false }, sideCode: { @@ -143,14 +143,8 @@ import { getStaffList } from "@/api/emis/emisStaff"; onClick(){ this.isInit=false; // 第一次点击时需要初始化 - if(!this.defaultItems){ this.queryParams.pageNum=1; - this.queryData(null,null); - }else{ - this.total = this.defaultTotal; - this.optionItems = [...this.defaultItems]; - } - // this.$refs.popoverRef.doShow(); + this.queryData(); }, onInput(val) { if(val == null ) return; @@ -158,7 +152,8 @@ import { getStaffList } from "@/api/emis/emisStaff"; this.isInputing = true; this.slable = val; this.queryParams.pageNum = 1 - this.queryData(val,null) + this.queryParams.searchValue = val; + this.queryData() }, onRowClick(row, column, event) { @@ -170,6 +165,7 @@ import { getStaffList } from "@/api/emis/emisStaff"; this.$emit("input", this.svalue); this.$emit("onChange",row); this.$refs.popoverRef.doClose(); + this.queryParams.searchValue = this.slable; }, isRed({ row }) { if (row.userId == this.svalue) { @@ -182,27 +178,24 @@ import { getStaffList } from "@/api/emis/emisStaff"; onClear(el){ this.slable = null; this.svalue = null; - + this.queryParams.searchValue = null; this.$emit("input", this.svalue); this.dispatch('ElFormItem', 'el.form.blur', [this.svalue]); }, onBlur(el) { - // 如果编辑没有选择则清关历史记录 - if( this.isInputing ){ - this.svalue = null; - this.slable = null; + if(this.svalue){ + this.queryParams.searchValue = this.slable; } this.$emit("input", this.svalue); this.dispatch('ElFormItem', 'el.form.blur', [this.svalue]); }, changePage(cur) { this.queryParams.pageNum = cur - this.queryData() + this.queryData(); }, queryData(val,key) { this.loading = true; - this.queryParams.searchValue = val; this.queryParams.userId = key; getStaffList(this.queryParams).then(response => { @@ -211,7 +204,7 @@ import { getStaffList } from "@/api/emis/emisStaff"; this.optionItems = response.rows; // 初始值存储 - if(key==null && val==null){ + if (!this.queryParams.userId && !this.queryParams.searchValue) { this.defaultTotal = this.total+0; this.defaultItems=[...this.optionItems] }