修复智能装柜订单状态多选

This commit is contained in:
2026-09-03 22:15:25 +08:00
parent 38b435a7ac
commit 475b2a08e2
5 changed files with 35 additions and 24 deletions
@@ -63,8 +63,8 @@ const selectedCandidate = ref<SmartLoadingCandidateRow | null>(null)
const assignForm = reactive({ packageCount: 1 })
const quantityDrafts = reactive<Record<string, number>>({})
const planGroupsByInboundId = ref(new Map<string, SmartLoadingPlanCoLoadGroup>())
const query = ref<QueryModel>({ warehouseId: '', customerId: '', inboundCode: '', createdRange: [], orderStatus: '' })
const appliedQuery = ref<QueryModel>({ ...query.value })
const query = ref<QueryModel>({ warehouseId: '', customerId: '', inboundCode: '', createdRange: [], orderStatuses: [] })
const appliedQuery = ref<QueryModel>({ ...query.value, orderStatuses: [] })
const candidatePage = ref(1)
const candidatePageSize = ref(20)
const candidateTotal = ref(0)
@@ -185,7 +185,6 @@ const weightPercent = computed(() => weightLimit.value ? totalWeight.value / wei
const displayedVolumePercent = computed(() => percentage(volumePercent.value))
const displayedWeightPercent = computed(() => percentage(weightPercent.value))
const candidateOrderStatusOptions = [
{ value: '', label: '全部' },
{ value: 'PENDING_REVIEW', label: '待审核' },
{ value: 'WAIT_MEASURE', label: '待测量数据' },
{ value: 'WAIT_SPLIT', label: '待分柜' },
@@ -199,7 +198,7 @@ const queryFields = computed<QueryField[]>(() => [
{ key: 'customerId', type: 'select', label: '客户', placeholder: '全部客户', width: 180, options: customers.value.filter((customer) => customer.status === 'ACTIVE').map((customer) => ({ label: customer.tenantName, value: String(customer.id) })), props: { filterable: true, loading: customersLoading.value } },
{ key: 'inboundCode', type: 'input', label: '入仓码', placeholder: '请输入入仓码', width: 210 },
{ key: 'createdRange', type: 'daterange', label: '创建日期', placeholder: '请选择创建日期范围', width: 260 },
{ key: 'orderStatus', type: 'select', label: '订单状态', placeholder: '全部订单状态', width: 160, options: candidateOrderStatusOptions },
{ key: 'orderStatuses', type: 'select', label: '订单状态', placeholder: '全部订单状态', width: 210, options: candidateOrderStatusOptions, props: { multiple: true, collapseTags: true, collapseTagsTooltip: true, maxCollapseTags: 2 } },
])
const filteredContainers = computed(() => containers.value)
@@ -300,7 +299,9 @@ function candidateQueryParams(): Parameters<typeof listSmartLoadingCandidates>[0
const warehouseId = String(appliedQuery.value.warehouseId || '')
const customerId = String(appliedQuery.value.customerId || '')
const inboundCode = String(appliedQuery.value.inboundCode || '').trim()
const orderStatus = String(appliedQuery.value.orderStatus || '') as typeof params.orderStatus
const orderStatuses = Array.isArray(appliedQuery.value.orderStatuses)
? appliedQuery.value.orderStatuses.map((value) => String(value)).filter(Boolean) as NonNullable<typeof params.orderStatuses>
: []
if (warehouseId) params.warehouseId = warehouseId
if (customerId) params.customerId = customerId
if (inboundCode) params.inboundCode = inboundCode
@@ -308,7 +309,7 @@ function candidateQueryParams(): Parameters<typeof listSmartLoadingCandidates>[0
params.createdStart = createdRange[0]
params.createdEnd = createdRange[1]
}
if (orderStatus) params.orderStatus = orderStatus
if (orderStatuses.length) params.orderStatuses = orderStatuses
return params
}
@@ -443,7 +444,10 @@ async function selectChannels(codes: string[]) {
await loadWorkbenchData()
}
async function applyFilters(model: QueryModel) {
appliedQuery.value = { ...model }
appliedQuery.value = {
...model,
orderStatuses: Array.isArray(model.orderStatuses) ? model.orderStatuses.map((value) => String(value)) : [],
}
candidatePage.value = 1
await loadCandidateData()
}