| | |
| | | |
| | | <script setup> |
| | | import { computed, onMounted, reactive, ref } from 'vue' |
| | | import { useI18n } from 'vue-i18n' |
| | | import { useTableColumns } from '@/hooks/core/useTableColumns' |
| | | import { guardRequestWithMessage } from '@/utils/sys/requestGuard' |
| | | import { |
| | |
| | | } from './locPreviewPage.helpers' |
| | | |
| | | defineOptions({ name: 'LocPreview' }) |
| | | const { t } = useI18n() |
| | | |
| | | const loading = ref(false) |
| | | const detailLoading = ref(false) |
| | |
| | | |
| | | const searchItems = computed(() => [ |
| | | { |
| | | label: '关键字', |
| | | label: t('pages.manager.locPreview.search.condition'), |
| | | key: 'condition', |
| | | type: 'input', |
| | | props: { |
| | | clearable: true, |
| | | placeholder: '请输入库位编码/条码' |
| | | placeholder: t('pages.manager.locPreview.search.conditionPlaceholder') |
| | | } |
| | | }, |
| | | { |
| | | label: '库位编码', |
| | | label: t('pages.manager.locPreview.search.code'), |
| | | key: 'code', |
| | | type: 'input', |
| | | props: { |
| | | clearable: true, |
| | | placeholder: '请输入库位编码' |
| | | placeholder: t('pages.manager.locPreview.search.codePlaceholder') |
| | | } |
| | | }, |
| | | { |
| | | label: '条码', |
| | | label: t('pages.manager.locPreview.search.barcode'), |
| | | key: 'barcode', |
| | | type: 'input', |
| | | props: { |
| | | clearable: true, |
| | | placeholder: '请输入条码' |
| | | placeholder: t('pages.manager.locPreview.search.barcodePlaceholder') |
| | | } |
| | | } |
| | | ]) |
| | |
| | | return [ |
| | | { |
| | | prop: 'locCode', |
| | | label: '库位编码', |
| | | label: t('pages.manager.locPreview.table.locCode'), |
| | | minWidth: 140, |
| | | showOverflowTooltip: true |
| | | }, |
| | | { |
| | | prop: 'wareArea', |
| | | label: '库区', |
| | | label: t('pages.manager.locPreview.table.areaLabel'), |
| | | minWidth: 140, |
| | | showOverflowTooltip: true |
| | | }, |
| | | { |
| | | prop: 'orderCode', |
| | | label: '单据编号', |
| | | label: t('pages.orders.common.orderCode'), |
| | | minWidth: 180, |
| | | showOverflowTooltip: true |
| | | }, |
| | | { |
| | | prop: 'matnrCode', |
| | | label: '物料编码', |
| | | label: t('table.materialCode'), |
| | | minWidth: 160, |
| | | showOverflowTooltip: true |
| | | }, |
| | | { |
| | | prop: 'maktx', |
| | | label: '物料名称', |
| | | label: t('table.materialName'), |
| | | minWidth: 220, |
| | | showOverflowTooltip: true |
| | | }, |
| | | { |
| | | prop: 'batch', |
| | | label: '批次', |
| | | label: t('table.batch'), |
| | | minWidth: 140, |
| | | showOverflowTooltip: true |
| | | }, |
| | | { |
| | | prop: 'trackCode', |
| | | label: '追踪码', |
| | | label: t('pages.orders.common.trackCode'), |
| | | minWidth: 150, |
| | | showOverflowTooltip: true |
| | | }, |
| | | { |
| | | prop: 'unit', |
| | | label: '单位', |
| | | label: t('table.unit'), |
| | | width: 100 |
| | | }, |
| | | { |
| | | prop: 'anfme', |
| | | label: '可用数量', |
| | | label: t('pages.manager.freeze.table.anfme'), |
| | | width: 120 |
| | | }, |
| | | { |
| | | prop: 'qty', |
| | | label: '库存数量', |
| | | label: t('pages.manager.freeze.table.qty'), |
| | | width: 120 |
| | | }, |
| | | { |
| | | prop: 'workQty', |
| | | label: '执行中数量', |
| | | label: t('pages.manager.freeze.table.workQty'), |
| | | width: 120 |
| | | }, |
| | | ...enabledFields.value.map((field) => ({ |
| | |
| | | })), |
| | | { |
| | | prop: 'createTimeText', |
| | | label: '创建时间', |
| | | label: t('table.createTime'), |
| | | minWidth: 180, |
| | | showOverflowTooltip: true |
| | | } |
| | |
| | | |
| | | async function loadEnabledFieldDefinitions() { |
| | | const fields = await guardRequestWithMessage(fetchEnabledFields(), [], { |
| | | timeoutMessage: '扩展字段加载超时,已停止等待' |
| | | timeoutMessage: t('pages.manager.locPreview.messages.fieldsTimeout') |
| | | }) |
| | | enabledFields.value = normalizeLocPreviewEnabledFields(fields) |
| | | } |
| | |
| | | current: pagination.current, |
| | | size: pagination.size |
| | | }, |
| | | { timeoutMessage: '库位明细加载超时,已停止等待' } |
| | | { timeoutMessage: t('pages.manager.locPreview.messages.pageTimeout') } |
| | | ) |
| | | tableData.value = Array.isArray(response?.records) |
| | | ? response.records.map((record) => normalizeLocPreviewRow(record)) |
| | |
| | | try { |
| | | const [detailResponse, itemResponse] = await Promise.all([ |
| | | guardRequestWithMessage(fetchLocPreviewDetail(activeLocRow.value.id), {}, { |
| | | timeoutMessage: '库位详情加载超时,已停止等待' |
| | | timeoutMessage: t('pages.manager.locPreview.messages.detailTimeout') |
| | | }), |
| | | guardRequestWithMessage( |
| | | fetchLocPreviewItemsPage({ |
| | |
| | | current: detailPagination.current, |
| | | size: detailPagination.size |
| | | }, |
| | | { timeoutMessage: '库位库存明细加载超时,已停止等待' } |
| | | { timeoutMessage: t('pages.manager.locPreview.messages.itemPageTimeout') } |
| | | ) |
| | | ]) |
| | | |