From 025cba317d60d9ddaf2b7cd82ad856b8c4277afa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=B3=89=E4=BD=B3?= <1107186916@qq.com> Date: Fri, 30 Oct 2026 12:12:57 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=AE=A2=E5=95=86?= =?UTF-8?q?=E6=A1=A3=E6=A1=88=E6=B8=85=E7=A9=BA=E5=AE=A2=E5=95=86=E9=A3=8E?= =?UTF-8?q?=E9=99=A9=E5=90=8E=E4=BB=8D=E6=8C=89=E4=B8=8A=E6=AC=A1=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Avue 搜索事件只回传非空筛选项,被清空的字段不会出现在参数里, 与上一次查询条件合并会保留旧值,改为点击查询时整体重建查询条件。 --- src/views/vehicle/customer-archive.vue | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/views/vehicle/customer-archive.vue b/src/views/vehicle/customer-archive.vue index 1f57db2..2b3cbb5 100644 --- a/src/views/vehicle/customer-archive.vue +++ b/src/views/vehicle/customer-archive.vue @@ -5519,7 +5519,9 @@ export default { this.onLoad(this.page); }, searchChange(params, done) { - this.query = this.buildQuery(params); + // Avue 只回传非空筛选项,被清空的字段不会出现在 params 里, + // 因此查询条件必须整体重建,不能与上一次的 this.query 合并,否则清空后仍会带上次的值 + this.query = this.buildQuery(params, true); this.page.currentPage = 1; this.onLoad(this.page, this.query); done(); @@ -5611,9 +5613,10 @@ export default { [this.website.tokenHeader]: getToken(), }; }, - buildQuery(params = {}) { - // 新条件覆盖旧条件;本次显式清空的字段必须从查询里去掉,避免第二次搜索仍带着上一次的客商名称。 - const merged = { ...this.query, ...params }; + // replace=true 表示以本次搜索条件为准整体重建(清空字段不会回传,需丢弃旧条件); + // 翻页、刷新等场景传 false,沿用上一次的查询条件 + buildQuery(params = {}, replace = false) { + const merged = replace ? { ...params } : { ...this.query, ...params }; Object.keys(params).forEach(key => { const value = params[key]; if (