diff --git a/web-admin/src/views/pl/plan/index.vue b/web-admin/src/views/pl/plan/index.vue index 341a2b228..aab9871c4 100644 --- a/web-admin/src/views/pl/plan/index.vue +++ b/web-admin/src/views/pl/plan/index.vue @@ -104,10 +104,10 @@ - + 打印单据 @@ -115,19 +115,19 @@ 入库单 送(提)货单 分装单 @@ -436,6 +436,7 @@ import ListToolbarDateShortcuts from '@/components/core/list-toolbar-date-shortc import { useDbInstantSearch } from '@/composables/useDbInstantSearch' import { useListDateShortcut } from '@/composables/useListDateShortcut' import { canDeleteByCreator, CREATOR_DELETE_TIP } from '@/utils/creator-delete' +import { canBatchPrintSlip } from '@/utils/pl-batch-print' import { canPrintSlipCommand, formatPlVehiclePlateDisplay, @@ -767,8 +768,23 @@ function handleViewPrintSlipCommand(command: string) { } function handleToolbarPrintSlip(command: string) { - if (selectedRows.value.length !== 1) return - handlePrintSlip(command as PlPrintSlipCommand, selectedRows.value[0]) + const cmd = command as PlPrintSlipCommand + const plans = selectedRows.value + const check = canBatchPrintSlip(plans, cmd) + if (!check.ok) { + ElMessage.warning(check.reason || '无法打印') + return + } + const ids = plans.map((p) => p.id) + if (cmd === 'inbound') { + inboundSlipPrintRef.value?.open(ids) + return + } + if (cmd === 'delivery') { + deliverySlipPrintRef.value?.open(ids) + return + } + subpackSlipPrintRef.value?.open(ids) } function handleToolbarEdit() {