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 (