diff --git a/src/api/storage.entry/entry.ts b/src/api/storage.entry/entry.ts index 3fc99784..66d84538 100644 --- a/src/api/storage.entry/entry.ts +++ b/src/api/storage.entry/entry.ts @@ -65,6 +65,20 @@ export function getEntryList(data: StorageEntryListParams = {}): Promise { + return request({ + url: '/system', + method: 'post', + params: { + method: 'storage.entry.listStore', + v, + timestamp: new Date().getTime(), + }, + data, + }) +} + export type GetEntryDetailParams = { /** 入库单ID(必填) */ id: number @@ -231,6 +245,20 @@ export function getEntryDetail(data: GetEntryDetailParams): Promise { + return request({ + url: '/system', + method: 'post', + params: { + method: 'storage.entry.getStore', + v, + timestamp: new Date().getTime(), + }, + data, + }) +} + export type CancelEntryParams = { /** 入库单ID,兼容旧调用;与 ids 二选一。若同时传入 ids,以 ids 为准 */ id?: number diff --git a/src/api/storage.report/report.ts b/src/api/storage.report/report.ts index 8c092072..9c834bf8 100644 --- a/src/api/storage.report/report.ts +++ b/src/api/storage.report/report.ts @@ -27,6 +27,8 @@ export interface StorageReportSearchBody { end_time?: string | Date store_ids?: number[] by_space?: boolean + warehouse_id?: number | string + keyword?: string } sort?: { sortField?: 'begin_total' | 'inbound_total' | 'outbound_total' | 'end_total' diff --git a/src/api/storage_receiving/receiving.ts b/src/api/storage_receiving/receiving.ts index 5bdae740..3a87f6f5 100644 --- a/src/api/storage_receiving/receiving.ts +++ b/src/api/storage_receiving/receiving.ts @@ -22,6 +22,20 @@ export function getReceivingList(data: any): Promise { }) } +/** storage.receiving.getStoreReceivingList — 货主侧收货单列表 */ +export function getReceivingListStore(data: any): Promise { + return request({ + url: '/system', + method: 'post', + params: { + method: 'storage.receiving.getStoreReceivingList', + v, + timestamp: new Date().getTime() + }, + data: data + }) +} + export function getReceivingDetail(data: any): Promise { return request({ @@ -36,6 +50,20 @@ export function getReceivingDetail(data: any): Promise { }) } +/** storage.receiving.getStore — 货主侧收货单详情 */ +export function getReceivingDetailStore(data: any): Promise { + return request({ + url: '/system', + method: 'post', + params: { + method: 'storage.receiving.getStore', + v, + timestamp: new Date().getTime() + }, + data: data + }) +} + export function queryReceivingLogs(data: QueryReceivingLogsParams = {}): Promise { return request({ url: '/system', diff --git a/src/components/WarehouseSelect.vue b/src/components/WarehouseSelect.vue new file mode 100644 index 00000000..2c369574 --- /dev/null +++ b/src/components/WarehouseSelect.vue @@ -0,0 +1,126 @@ + + + diff --git a/src/router/map.ts b/src/router/map.ts index 4cbe75ac..0a2e52b9 100644 --- a/src/router/map.ts +++ b/src/router/map.ts @@ -26,10 +26,14 @@ export const componentMap: Record = { 'stock/pickingShortage/index': () => import('@/views/storage/management/replenishmentDemand/index.vue'), 'storage/management/replenishmentDemand/index': () => import('@/views/storage/management/replenishmentDemand/index.vue'), 'storage/receiving': () => import('@/views/storage/receiving/index.vue'), + /** 货主侧收货单管理 */ + 'storage/receiving_owner': () => import('@/views/storage/receiving_owner/index.vue'), 'storage/report': () => import('@/views/storage/report/index.vue'), /** 货主侧库存报表 */ 'store/report': () => import('@/views/storage/report/store.vue'), 'storage/entry': () => import('@/views/storage/entry/index.vue'), + /** 货主侧入库单管理 */ + 'storage/entry_owner': () => import('@/views/storage/entry_owner/index.vue'), 'storage/inventory': () => import('@/views/storage/inventory/index.vue'), 'storage/stockout': () => import('@/views/storage/stockout/index.vue'), 'store/productflow': () => import('@/views/storage/productflow/index.vue'), diff --git a/src/views/stock/external_stock/index.vue b/src/views/stock/external_stock/index.vue index 16022b1d..427e7c61 100644 --- a/src/views/stock/external_stock/index.vue +++ b/src/views/stock/external_stock/index.vue @@ -19,22 +19,12 @@ 字段设置
- - - + /> ([]) - -async function loadWarehouseList() { - try { - const res = await loadWarehouses() as any - const raw = res?.warehouses || res?.data?.list || res?.data || [] - warehouseList.value = raw.map((item: any) => ({ - warehouse_id: item.value ?? item.warehouse_id ?? item.id, - warehouse_name: item.label || item.warehouse_name || item.company_name || String(item.value ?? '') - })) - } catch { - // 仓库列表加载失败不影响主流程 - } -} +// ─── 仓库列表(已由 WarehouseSelect 组件接管)─────────────────────────── function handleWarehouseChange() { pagination.currentPage = 1 @@ -607,7 +584,6 @@ async function handleEditSave() { // ─── 初始化 ──────────────────────────────────────────────────────────────── onMounted(() => { - loadWarehouseList() loadList() }) diff --git a/src/views/storage/entry/component/DirectInboundLogs.vue b/src/views/storage/entry/component/DirectInboundLogs.vue index f6b0f345..4ef009d9 100644 --- a/src/views/storage/entry/component/DirectInboundLogs.vue +++ b/src/views/storage/entry/component/DirectInboundLogs.vue @@ -66,6 +66,7 @@ import UpperTable from '@/components/UpperTable/index.vue' import { collectDirectInboundLogs, getEntryDetail, + getEntryDetailStore, removeItem, type DirectInboundLog, } from '@/api/storage.entry/entry' @@ -80,6 +81,8 @@ import { const props = defineProps<{ id?: string | number row?: Record | null + /** 货主侧模式,使用 getEntryDetailStore 接口 */ + storeMode?: boolean }>() const emit = defineEmits<{ @@ -144,7 +147,8 @@ async function loadLogs() { loading.value = true try { - const res = await getEntryDetail({ id: entryId }) + const fetchDetail = props.storeMode ? getEntryDetailStore : getEntryDetail + const res = await fetchDetail({ id: entryId }) if (res?.code !== 200 && res?.code !== undefined) { throw new Error(res?.message || '获取入库记录失败') } diff --git a/src/views/storage/entry/component/EntryBindingRelations.vue b/src/views/storage/entry/component/EntryBindingRelations.vue index 6111bf1b..093ba939 100644 --- a/src/views/storage/entry/component/EntryBindingRelations.vue +++ b/src/views/storage/entry/component/EntryBindingRelations.vue @@ -127,6 +127,7 @@ import { computed, ref, watch, onActivated } from 'vue' import { ElMessage } from 'element-plus' import { getEntryDetail, + getEntryDetailStore, receivingCompare, type EntryAvailableReceivingDetail, type EntryDetailItem, @@ -181,6 +182,8 @@ const props = defineProps<{ id?: string | number row?: Record | null entryDetailRefreshTick?: number + /** 货主侧模式,使用 getEntryDetailStore 接口 */ + storeMode?: boolean }>() const loading = ref(false) @@ -332,7 +335,8 @@ async function loadBindingData() { loading.value = true try { - const res = await getEntryDetail({ id: entryOrderId }) + const fetchDetail = props.storeMode ? getEntryDetailStore : getEntryDetail + const res = await fetchDetail({ id: entryOrderId }) if (!isApiSuccess(res)) { throw new Error(res?.message || '获取绑定关系失败') } diff --git a/src/views/storage/entry/component/entrydetail.vue b/src/views/storage/entry/component/entrydetail.vue index 7fb9f507..f7d1fe84 100644 --- a/src/views/storage/entry/component/entrydetail.vue +++ b/src/views/storage/entry/component/entrydetail.vue @@ -86,6 +86,7 @@ import UpperTable from '@/components/UpperTable/index.vue' import { commit, getEntryDetail, + getEntryDetailStore, type EntryDetailItem, type EntryDetailItemBarcode, } from '@/api/storage.entry/entry' @@ -102,6 +103,8 @@ const props = defineProps<{ row?: Record | null /** 由父级递增,用于跨 Tab 触发明细刷新 */ entryDetailRefreshTick?: number + /** 货主侧模式,使用 getEntryDetailStore 接口 */ + storeMode?: boolean }>() const emit = defineEmits(['refresh']) @@ -213,7 +216,8 @@ async function loadEntryDetail() { if (!props.id) return loading.value = true try { - const res = await getEntryDetail({ id: Number(props.id) }) + const fetchDetail = props.storeMode ? getEntryDetailStore : getEntryDetail + const res = await fetchDetail({ id: Number(props.id) }) if (res && res.code === 200 && res.data?.entryOrder) { const entryOrder = res.data.entryOrder diff --git a/src/views/storage/entry/entry-config.ts b/src/views/storage/entry/entry-config.ts index 84d3e7dd..e19b09b0 100644 --- a/src/views/storage/entry/entry-config.ts +++ b/src/views/storage/entry/entry-config.ts @@ -216,6 +216,29 @@ export const entryColums = [ { prop: 'row_action', label: '操作', width: '300', fixed: 'right' }, ] +/** 货主侧入库单列表列(listStore 返回字段,无 store_name / receivingBindings) */ +export const entryStoreColums = [ + { prop: 'id', label: 'ID', width: '50' }, + { prop: 'entry_order_code', label: '入库单号', width: '160' }, + { prop: 'order_type', label: '类型', width: '100' }, + { prop: 'purchase_order_code', label: '单据编号', width: '160' }, + { prop: 'total_order_lines', label: '商品数', width: '80', sortable: 'custom' }, + { prop: 'order_status', label: '订单状态', width: '100' }, + { prop: 'hasReceiving', label: '收货绑定', width: '100' }, + { prop: 'sync_status', label: '入库状态', width: '100' }, + { prop: 'sync_message', label: '同步信息', minWidth: '220' }, + { prop: 'supplier_code', label: '供应商编码', width: '120' }, + { prop: 'supplier_name', label: '供应商名称', width: '140' }, + { prop: 'express_code', label: '运单号', width: '140' }, + { prop: 'logistics_code', label: '物流公司编码', width: '140' }, + { prop: 'logistics_name', label: '物流公司名称', width: '140' }, + { prop: 'order_create_time', label: '单据创建时间', width: '160' }, + { prop: 'expect_start_time', label: '预计开始时间', width: '160' }, + { prop: 'expect_end_time', label: '预计结束时间', width: '160' }, + { prop: 'source_type', label: '数据来源', width: '100' }, + { prop: 'remark', label: '备注', width: '160' }, +] + const entryInventoryTypeLabelMap: Record = { ZP: '正品', CC: '次品', diff --git a/src/views/storage/entry_owner/index.vue b/src/views/storage/entry_owner/index.vue new file mode 100644 index 00000000..1df232d4 --- /dev/null +++ b/src/views/storage/entry_owner/index.vue @@ -0,0 +1,632 @@ + + + + + diff --git a/src/views/storage/receiving/receiving-config.ts b/src/views/storage/receiving/receiving-config.ts index 42ed7306..363dedcc 100644 --- a/src/views/storage/receiving/receiving-config.ts +++ b/src/views/storage/receiving/receiving-config.ts @@ -151,6 +151,30 @@ export const receivingColumns = [ { prop: 'actions', label: '操作', width: '120', fixed: 'right' }, ] +/** 货主侧收货单列表列(getStoreReceivingList 返回字段) */ +export const receivingStoreColumns = [ + { prop: 'receiving_number', label: '收货单号', width: '110', fixed: 'left' }, + { prop: 'status', label: '收货状态', width: '90' }, + { prop: 'detail_status', label: '匹配状态', width: '90' }, + { prop: 'storage_status', label: '入库状态', width: '90' }, + { prop: 'total_items', label: '商品种类', width: '90', sortable: true }, + { prop: 'total_quantity', label: '总数量', width: '90', sortable: true }, + { prop: 'total_boxes', label: '总箱数', width: '90', sortable: true }, + { prop: 'total_pallets', label: '总托盘数', width: '90', sortable: true }, + { prop: 'available_quantity', label: '可用数量', width: '90' }, + { prop: 'lock_rate_display', label: '锁定率', width: '90' }, + { prop: 'license_plate', label: '车牌号', width: '100' }, + { prop: 'tracking_number', label: '物流单号', width: '120' }, + { prop: 'delivery_method', label: '来货方式', width: '90' }, + { prop: 'loading_method', label: '装卸方式', width: '100' }, + { prop: 'creator_name', label: '创建人', width: '100' }, + { prop: 'receiving_start_time', label: '收货开始', width: '150', sortable: true, formatter: (row: any) => formatDateTime(row.receiving_start_time) }, + { prop: 'receiving_end_time', label: '收货结束', width: '150', sortable: true, formatter: (row: any) => formatDateTime(row.receiving_end_time) }, + { prop: 'create_at_display', label: '创建时间', width: '150' }, + { prop: 'update_at_display', label: '更新时间', width: '150' }, + { prop: 'remark', label: '备注', minWidth: '120' }, +] + // receiving配置(基础信息在前,流程状态在后;对齐待处理订单 ScanBox 分组) export const availableFields: ReceivingScanFieldConfig[] = [ diff --git a/src/views/storage/receiving_owner/index.vue b/src/views/storage/receiving_owner/index.vue new file mode 100644 index 00000000..5fb597e0 --- /dev/null +++ b/src/views/storage/receiving_owner/index.vue @@ -0,0 +1,487 @@ + + + + + diff --git a/src/views/storage/report/index.vue b/src/views/storage/report/index.vue index 18805a0e..0acd0730 100644 --- a/src/views/storage/report/index.vue +++ b/src/views/storage/report/index.vue @@ -26,6 +26,21 @@ 出库合计 {{ formatNumber(sumOutbound) }}
+
+ + + +
@@ -105,6 +120,7 @@