diff --git a/src/modules/container-loading/api/platformContainerLoading.ts b/src/modules/container-loading/api/platformContainerLoading.ts index 2c0947a3..da5d5f19 100644 --- a/src/modules/container-loading/api/platformContainerLoading.ts +++ b/src/modules/container-loading/api/platformContainerLoading.ts @@ -104,6 +104,8 @@ function item(raw: SmartLoadingItem): SmartLoadingItem { packageCount: numberValue(raw.packageCount), pickedPackageCount: numberValue(raw.pickedPackageCount), minPackageCount: numberValue(raw.minPackageCount, 1), + totalPackageCount: numberValue(raw.totalPackageCount, raw.packageCount), + remainingPackageCount: numberValue(raw.remainingPackageCount), canAdjust: Boolean(raw.canAdjust), canRemove: Boolean(raw.canRemove), productQuantity: raw.productQuantity == null ? null : numberValue(raw.productQuantity), grossWeightKg: raw.grossWeightKg == null ? null : numberValue(raw.grossWeightKg), diff --git a/src/modules/container-loading/pages/GlobalSmartLoadingView.test.ts b/src/modules/container-loading/pages/GlobalSmartLoadingView.test.ts index 2d58fb54..59fbba3c 100644 --- a/src/modules/container-loading/pages/GlobalSmartLoadingView.test.ts +++ b/src/modules/container-loading/pages/GlobalSmartLoadingView.test.ts @@ -255,6 +255,37 @@ describe('GlobalSmartLoadingView', () => { expect(wrapper.text()).toContain('柜子数量2 个') }) + it('selects only the double-clicked channel as a shortcut', async () => { + const other = { + ...container, + id: '9007199254740998', + planId: '9007199254740999', + cabinetNo: 'CB-2', + containerNo: 'MSCU-2', + channelCode: 'HDHK', + channelName: '合德海卡包税', + } + vi.mocked(listContainers).mockResolvedValue({ records: [container, other], page: 1, size: 100, total: 2, pages: 1 }) + mockContainerSearch([container, other]) + vi.mocked(getSmartLoadingPlanByBooking).mockImplementation(async (bookingId) => ({ ...plan, bookingId })) + const wrapper = mount(GlobalSmartLoadingView, { global: { plugins: [ElementPlus] } }) + await flushPromises() + + const hedeChannel = wrapper.findAllComponents(ElCheckboxButton).find((item) => item.text() === '合德')! + await hedeChannel.find('input').setValue(true) + await flushPromises() + expect(wrapper.findAll('.channel-tags .el-checkbox-button.is-checked')).toHaveLength(2) + + await hedeChannel.trigger('dblclick') + await flushPromises() + + expect(wrapper.findAll('.channel-tags .el-checkbox-button.is-checked').map((item) => item.text())).toEqual(['合德']) + expect(listSmartLoadingCandidates).toHaveBeenLastCalledWith(expect.objectContaining({ channelGroupCodes: ['HEDE'] })) + expect(listSmartLoadingWorkbenchContainers).toHaveBeenLastCalledWith({ channelGroupCodes: ['HEDE'], page: 1, size: 200 }) + expect(wrapper.text()).toContain('MSCU-2') + expect(wrapper.text()).not.toContain('MSCU-1') + }) + it('merges detailed pricing channels into the same confirmed display group', async () => { const parcelContainer = { ...container, @@ -523,9 +554,12 @@ describe('GlobalSmartLoadingView', () => { expect(assignSmartLoadingGroup).not.toHaveBeenCalled() }) - it('keeps the package count editor inside its table cell without overflow ellipsis', () => { + it('shows the package summary first and opens the editor from an icon', () => { const source = readFileSync(resolve(process.cwd(), 'src/modules/container-loading/pages/GlobalSmartLoadingView.vue'), 'utf8') - expect(source).toContain('