From 6067d24e3bc33a511f1044de92201ef3b73b0391 Mon Sep 17 00:00:00 2001 From: b2894lxlx <517289602@qq.com> Date: Fri, 16 Oct 2026 16:03:26 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20=E4=BF=AE=E5=A4=8D=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E4=BA=8C=E6=AC=A1=E6=90=9C=E7=B4=A2=E4=B8=8E=E7=BB=93=E7=AE=97?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=E5=9B=9E=E5=88=97=E8=A1=A8=EF=BC=8C=E5=B9=B6?= =?UTF-8?q?=E5=AE=8C=E5=96=84=E4=BB=98=E6=AC=BE=E7=94=B3=E8=AF=B7=E5=A4=9A?= =?UTF-8?q?=E7=BB=93=E7=AE=97=E5=8D=95=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Cursor --- src/utils/search-range.js | 32 ++++++++ src/views/base/airport-master.vue | 3 +- src/views/base/currency.vue | 3 +- src/views/base/customer-type.vue | 3 +- src/views/base/fee-item.vue | 3 +- src/views/base/measurement-unit.vue | 3 +- src/views/base/port-terminal.vue | 3 +- src/views/base/railway-station.vue | 3 +- src/views/business/process-config.vue | 4 +- .../payment/payment-application-form.vue | 62 ++++++++++++--- .../components/formal-settlement-editor.vue | 53 +++++++++---- .../components/pre-settlement-editor.vue | 78 ++++++++++--------- .../components/settlement-import-page.vue | 12 ++- .../settlement/receivable-payable-detail.vue | 8 +- src/views/settlement/settlement-import.vue | 24 ++++++ src/views/vehicle/accident-record.vue | 4 +- .../vehicle/credit-score-quantification.vue | 10 ++- src/views/vehicle/customer-archive.vue | 46 +++++++---- src/views/vehicle/insurance-record.vue | 4 +- src/views/vehicle/maintenance-plan.vue | 4 +- src/views/vehicle/maintenance-record.vue | 4 +- src/views/vehicle/mileage-record.vue | 4 +- src/views/vehicle/tire-replacement-record.vue | 4 +- src/views/vehicle/transport-change-record.vue | 4 +- src/views/vehicle/violation-record.vue | 4 +- 25 files changed, 276 insertions(+), 106 deletions(-) diff --git a/src/utils/search-range.js b/src/utils/search-range.js index e5723cd..34865bb 100644 --- a/src/utils/search-range.js +++ b/src/utils/search-range.js @@ -1,3 +1,35 @@ +/** + * 合并列表搜索条件:新条件覆盖旧条件,本次显式清空的字段从查询中移除。 + */ +export const applyIncomingSearch = (current = {}, incoming = {}) => { + const merged = { ...current, ...incoming }; + Object.keys(incoming || {}).forEach(key => { + const value = incoming[key]; + if ( + value === '' || + value === null || + value === undefined || + (Array.isArray(value) && value.length === 0) + ) { + delete merged[key]; + } + }); + return merged; +}; + +/** + * 启停状态下拉「全部」在数字类型下会被转成 0/-1,不能当作查询条件。 + * 状态 0 表示草稿等有效值的页面不要调用。 + */ +export const omitInvalidListStatus = (params = {}) => { + const values = { ...params }; + const status = values.status; + if (status === 0 || status === '0' || status === -1 || status === '-1') { + delete values.status; + } + return values; +}; + export const normalizeSearchRangeParams = (params = {}, rangeMap = {}) => { const values = { ...params }; diff --git a/src/views/base/airport-master.vue b/src/views/base/airport-master.vue index 3c94260..9969378 100644 --- a/src/views/base/airport-master.vue +++ b/src/views/base/airport-master.vue @@ -150,6 +150,7 @@ import { mapGetters } from 'vuex'; import { downloadXls } from '@/utils/util'; import { openImportDialog } from '@/utils/import-excel'; import { formatUpdateUserName } from '@/utils/audit'; +import { omitInvalidListStatus } from '@/utils/search-range'; import { getToken, isAdministrator } from '@/utils/auth'; import { getCoordinateValidationMessage, normalizeCoordinateInput } from '@/utils/coordinate'; import AddressMapPicker from '@/components/address-map-picker/main.vue'; @@ -1182,7 +1183,7 @@ export default { }, onLoad(page, params = {}) { this.loading = true; - getList(page.currentPage, page.pageSize, { ...params, ...this.query }) + getList(page.currentPage, page.pageSize, omitInvalidListStatus({ ...params, ...this.query })) .then(res => { const data = res.data.data; this.page.total = data.total; diff --git a/src/views/base/currency.vue b/src/views/base/currency.vue index 0ad39fe..903fae0 100644 --- a/src/views/base/currency.vue +++ b/src/views/base/currency.vue @@ -104,6 +104,7 @@ import { mapGetters } from 'vuex'; import { downloadXls } from '@/utils/util'; import { openImportDialog } from '@/utils/import-excel'; import { formatUpdateUserName } from '@/utils/audit'; +import { omitInvalidListStatus } from '@/utils/search-range'; import { getToken } from '@/utils/auth'; import NProgress from 'nprogress'; import 'nprogress/nprogress.css'; @@ -507,7 +508,7 @@ export default { this.onLoad(this.page, this.query); }, buildQuery(params = {}) { - const values = { ...params, ...this.query }; + const values = omitInvalidListStatus({ ...params, ...this.query }); const rangeMap = { effectiveDateRange: ['effectiveDateStart', 'effectiveDateEnd'], expiryDateRange: ['expiryDateStart', 'expiryDateEnd'], diff --git a/src/views/base/customer-type.vue b/src/views/base/customer-type.vue index fb68968..6653a85 100644 --- a/src/views/base/customer-type.vue +++ b/src/views/base/customer-type.vue @@ -63,6 +63,7 @@