| | |
| | | import { createTransferTableColumns } from './transferTable.columns.js' |
| | | import { |
| | | TRANSFER_REPORT_STYLE, |
| | | TRANSFER_REPORT_TITLE, |
| | | buildTransferDetailOrderQueryParams, |
| | | buildTransferDialogModel, |
| | | buildTransferPageQueryParams, |
| | |
| | | createTransferFormState, |
| | | createTransferSearchState, |
| | | getTransferPaginationKey, |
| | | getTransferReportTitle, |
| | | getTransferSourceOptions, |
| | | getTransferStatusOptions, |
| | | getTransferExceStatusOptions, |
| | |
| | | const router = useRouter() |
| | | const { t } = useI18n() |
| | | |
| | | const reportTitle = TRANSFER_REPORT_TITLE |
| | | const reportTitle = computed(() => getTransferReportTitle(t)) |
| | | const searchForm = ref(createTransferSearchState()) |
| | | const typeOptions = ref([]) |
| | | const areaOptions = ref([]) |
| | |
| | | label: t('pages.orders.transfer.search.exceStatus'), |
| | | key: 'exceStatus', |
| | | type: 'select', |
| | | props: { clearable: true, options: getTransferExceStatusOptions() } |
| | | props: { clearable: true, options: getTransferExceStatusOptions(t) } |
| | | }, |
| | | { label: t('pages.orders.transfer.search.orgWareName'), key: 'orgWareName', type: 'input', props: { clearable: true, placeholder: t('pages.orders.transfer.placeholder.orgWareName') } }, |
| | | { label: t('pages.orders.transfer.search.tarWareName'), key: 'tarWareName', type: 'input', props: { clearable: true, placeholder: t('pages.orders.transfer.placeholder.tarWareName') } }, |
| | |
| | | label: t('pages.orders.transfer.search.status'), |
| | | key: 'status', |
| | | type: 'select', |
| | | props: { clearable: true, options: getTransferStatusOptions() } |
| | | props: { clearable: true, options: getTransferStatusOptions(t) } |
| | | }, |
| | | { label: t('pages.orders.transfer.search.memo'), key: 'memo', type: 'input', props: { clearable: true, placeholder: t('pages.orders.transfer.placeholder.memo') } } |
| | | ]) |
| | |
| | | {}, |
| | | { timeoutMessage: t('pages.orders.transfer.messages.detailTimeout') } |
| | | ) |
| | | detailData.value = normalizeTransferDetailRecord(response) |
| | | detailData.value = normalizeTransferDetailRecord(response, t) |
| | | } finally { |
| | | detailLoading.value = false |
| | | } |
| | |
| | | { timeoutMessage: t('pages.orders.transfer.messages.ordersTimeout') } |
| | | ) |
| | | const normalized = defaultResponseAdapter(response) |
| | | detailOrderRows.value = normalized.records.map((item) => normalizeTransferOrderRow(item)) |
| | | detailOrderRows.value = normalized.records.map((item) => normalizeTransferOrderRow(item, t)) |
| | | detailOrderPagination.total = Number(normalized.total || 0) |
| | | detailOrderPagination.current = Number(normalized.current || detailOrderPagination.current || 1) |
| | | detailOrderPagination.size = Number(normalized.size || detailOrderPagination.size || 20) |
| | |
| | | columnsFactory: () => createTransferTableColumns({ handleActionClick }) |
| | | }, |
| | | transform: { |
| | | dataTransformer: (records) => (Array.isArray(records) ? records.map((item) => normalizeTransferRow(item)) : []) |
| | | dataTransformer: (records) => (Array.isArray(records) ? records.map((item) => normalizeTransferRow(item, t)) : []) |
| | | } |
| | | }) |
| | | |
| | |
| | | } |
| | | }), |
| | | resolvePrintRecords, |
| | | buildPreviewRows: (records) => buildTransferPrintRows(records), |
| | | buildPreviewRows: (records) => buildTransferPrintRows(records, t), |
| | | buildPreviewMeta: (rows) => { |
| | | const now = new Date() |
| | | return { |
| | | reportTitle, |
| | | reportTitle: reportTitle.value, |
| | | reportDate: now.toLocaleDateString('zh-CN'), |
| | | printedAt: now.toLocaleString('zh-CN', { hour12: false }), |
| | | operator: userStore.getUserInfo?.name || userStore.getUserInfo?.username || '', |
| | |
| | | buildTransferReportMeta({ |
| | | previewMeta: rawPreviewMeta.value, |
| | | count: previewRows.value.length, |
| | | orientation: rawPreviewMeta.value?.reportStyle?.orientation || TRANSFER_REPORT_STYLE.orientation |
| | | orientation: rawPreviewMeta.value?.reportStyle?.orientation || TRANSFER_REPORT_STYLE.orientation, |
| | | t |
| | | }) |
| | | ) |
| | | |