🐛 修复关联运单批次弹窗重新打开时残留上次筛选条件

- 打开弹窗时重置搜索条件与分页,并清空上一次的列表数据
- 重置按钮与打开时的重置共用 resetBatchSearch
This commit is contained in:
2026-11-06 08:31:15 +08:00
parent a6b4a7b2d1
commit e79e50bf40
+8 -1
View File
@@ -1044,6 +1044,10 @@ const openBatchDialog = async row => {
batchDialogMode.value = voucher?.id ? 'change' : 'upload';
batchTarget.value = voucher?.id ? voucher : undefined;
batchSelection.value = [];
// 弹窗内的搜索条件是模块级状态,不重置就会带着上一次的筛选条件打开。
resetBatchSearch();
batchRows.value = [];
batchPage.total = 0;
batchVisible.value = true;
if (!projectOptions.value.length) await loadProjects();
await loadBatches();
@@ -1076,7 +1080,7 @@ const handleWaybillCountInput = value => {
batchQuery.waybillCount = filtered.replace(/^0+/, '');
}
};
const resetBatchQuery = () => {
const resetBatchSearch = () => {
Object.assign(batchQuery, {
batchNo: '',
projectId: '',
@@ -1085,6 +1089,9 @@ const resetBatchQuery = () => {
});
batchCreateRange.value = [];
batchPage.current = 1;
};
const resetBatchQuery = () => {
resetBatchSearch();
loadBatches();
};
const updateWaybillBatch = async (target, selected) => {