diff --git a/src/modules/container-loading/components/ContainerSimulationCreate.test.ts b/src/modules/container-loading/components/ContainerSimulationCreate.test.ts index 5bb68189..35da5f4e 100644 --- a/src/modules/container-loading/components/ContainerSimulationCreate.test.ts +++ b/src/modules/container-loading/components/ContainerSimulationCreate.test.ts @@ -23,19 +23,17 @@ describe('ContainerSimulationCreate opted-in form', () => { await wrapper.findAll('button').find(button => button.text().includes('新增模拟柜'))!.trigger('click') await flushPromises() const dialog = wrapper.findComponent(AppDialog) - expect(dialog.props('width')).toBe(dense ? 'min(1000px, calc(100vw - 28px))' : 'min(560px, calc(100vw - 28px))') + expect(dialog.props('width')).toBe('min(800px, calc(100vw - 32px))') dialog.vm.$emit('confirm') await flushPromises() expect(createContainerSimulation).not.toHaveBeenCalled() const fields = dialog.findAllComponents({ name: 'ElFormItem' }) - expect(fields).toHaveLength(4) + expect(fields).toHaveLength(3) fields.find(field => field.props('prop') === 'warehouseId')!.findComponent({ name: 'ElSelect' }).vm.$emit('update:modelValue', '8') await flushPromises() expect(listWarehouseLogisticsChannels).toHaveBeenCalledExactlyOnceWith('8') fields.find(field => field.props('prop') === 'channelGroupCode')!.findComponent({ name: 'ElSelect' }).vm.$emit('update:modelValue', 'MATSON_CLX') await flushPromises() - const specification = fields.find(field => field.props('label') === '统一规格')! - expect(specification.find('input').exists()).toBe(!dense) dialog.vm.$emit('confirm') await flushPromises() expect(createContainerSimulation).toHaveBeenCalledExactlyOnceWith({ warehouseId: '8', channelGroupCode: 'MATSON_CLX', containerType: '40HQ', capacityCbm: 68, maxWeightKg: 19500 }) diff --git a/src/modules/container-loading/components/ContainerSimulationCreate.vue b/src/modules/container-loading/components/ContainerSimulationCreate.vue index 10f6bff3..78ce2aa3 100644 --- a/src/modules/container-loading/components/ContainerSimulationCreate.vue +++ b/src/modules/container-loading/components/ContainerSimulationCreate.vue @@ -2,7 +2,7 @@ import '@/styles/adminDensity.css' import '@/styles/adminWorkbench.css' import { computed, reactive, ref } from 'vue' -import { Plus } from '@lucide/vue' +import { Container, Plus } from '@lucide/vue' import { ElMessage, type FormInstance, type FormRules } from 'element-plus' import { listAllPlatformWarehouses, type PlatformWarehouseSummaryResource } from '@/modules/warehouses' import { listWarehouseLogisticsChannels, type OceanLogisticsChannel } from '@/modules/ocean-bookings' @@ -10,7 +10,7 @@ import AppDialog from '@/shared/components/AppDialog.vue' import ApiErrorMeta from '@/shared/components/ApiErrorMeta.vue' import LoadErrorState from '@/shared/components/LoadErrorState.vue' import { getApiErrorDetails, type ApiErrorDetails } from '@/shared/api/http' -import { CONTAINER_SPECIFICATIONS, DEFAULT_CONTAINER_TYPE, applyContainerSpecification, containerSpecification } from '@/shared/domain/containerSpecifications' +import { CONTAINER_SPECIFICATIONS, DEFAULT_CONTAINER_TYPE, applyContainerSpecification } from '@/shared/domain/containerSpecifications' import { createContainerSimulation } from '../api/platformContainerLoading' import type { ContainerSimulationCreateRequest } from '../types' import { SMART_LOADING_CHANNEL_GROUPS } from '../smartLoadingChannelGroups' @@ -96,14 +96,54 @@ async function saveSimulation() { diff --git a/src/modules/inbounds/components/InboundTaskList.vue b/src/modules/inbounds/components/InboundTaskList.vue index 27a0f55e..c8f704e2 100644 --- a/src/modules/inbounds/components/InboundTaskList.vue +++ b/src/modules/inbounds/components/InboundTaskList.vue @@ -20,7 +20,7 @@ import LineClampText from '@/shared/components/LineClampText.vue' import QueryToolbar, { type QueryField, type QueryModel } from '@/shared/components/QueryToolbar.vue' import { firstLegBusinessTypeLabel } from '@/shared/utils/firstLegBusinessLabels' import { listPlatformInbounds } from '../core/api' -import type { InboundOrderSummary } from '../core/types' +import type { InboundOrderSummary, InboundPageResult } from '../core/types' import InboundMeasurementDialog from '../measurement/InboundMeasurementDialog.vue' import MeasurementReviewPanel from '../review/MeasurementReviewPanel.vue' import { approveMeasurement, getMeasurementReviewDetail } from '../review/api' @@ -34,7 +34,11 @@ type FilterModel = QueryModel & { expectedArrivalRange: string[] } -const props = defineProps<{ mode: InboundTaskMode; title?: string }>() +const props = defineProps<{ + mode: InboundTaskMode + title?: string + taskLoader?: (pagination: { page: number; size: number }) => Promise +}>() const emit = defineEmits<{ changed: [] }>() const router = useRouter() const access = useAccessPreviewStore() @@ -144,6 +148,7 @@ function dateParam(value: string | undefined, end = false) { } async function loadOptions() { + if (props.taskLoader) return const serial = ++optionsRequestSerial customerLoadError.value = null try { @@ -170,7 +175,7 @@ async function loadTasks() { loadError.value = null const applied = appliedFilters.value try { - const response = await listPlatformInbounds(applied.customerId || undefined, buildInboundTaskQuery(props.mode, { + const response = props.taskLoader ? await props.taskLoader({ page: page.value, size: pageSize.value }) : await listPlatformInbounds(applied.customerId || undefined, buildInboundTaskQuery(props.mode, { page: page.value, size: pageSize.value, warehouseId: applied.warehouseId || undefined, @@ -329,6 +334,12 @@ function clearSelectedInbound() { reviewNavigationLoading.value = false } +function reload() { + if (page.value === 1) return loadTasks() + page.value = 1 +} +defineExpose({ reload }) + watch([page, pageSize], () => { void loadTasks() }) onMounted(() => { void loadOptions(); void loadTasks() }) onActivated(() => { @@ -364,6 +375,7 @@ onBeforeUnmount(() => { disposed = true; requestSerial += 1; optionsRequestSeria >