diff --git a/dist.tar.gz b/dist.tar.gz index b5be6e15..3853487e 100644 Binary files a/dist.tar.gz and b/dist.tar.gz differ diff --git a/src/api/setting.warehouse/settingwarehouse.ts b/src/api/setting.warehouse/settingwarehouse.ts index 47eb91bc..11da3594 100644 --- a/src/api/setting.warehouse/settingwarehouse.ts +++ b/src/api/setting.warehouse/settingwarehouse.ts @@ -24,8 +24,39 @@ export const DEFAULT_AUTO_OUTBOUND_RULES: Required = { + sender_name: '', + sender_tel: '', + province_name: '', + city_name: '', + district_name: '', + town_name: '', + address: '' +} + /** 与 module setting.warehouse 文档 subject_config 对齐 */ -export type SettingWarehouseSubjectConfig = { +export type SettingWarehouseSubjectConfig = SettingWarehouseSenderConfig & { enable_external_express_code?: boolean auto_outbound_rules?: SettingWarehouseAutoOutboundRules max_wave_quantity?: number @@ -82,6 +113,12 @@ export function normalizeWarehouseSubjectConfig( ) } as SettingWarehouseAutoOutboundRules + for (const key of WAREHOUSE_SENDER_FIELD_KEYS) { + if (typeof base[key] !== 'string') { + base[key] = DEFAULT_WAREHOUSE_SENDER_FIELDS[key] + } + } + return base as SettingWarehouseSubjectConfig } diff --git a/src/api/storage.entry/entry.ts b/src/api/storage.entry/entry.ts index a61a3c89..48c3663d 100644 --- a/src/api/storage.entry/entry.ts +++ b/src/api/storage.entry/entry.ts @@ -8,7 +8,15 @@ export type StorageEntryListPagination = { pageSize?: number } -export type StorageEntryListWhere = Record +export type StorageEntryListWhere = Record & { + /** 虚拟字段:true 仅已绑定收货单,false 仅未绑定 */ + hasReceiving?: boolean +} + +export type StorageEntryListItem = Record & { + hasReceiving?: boolean + receivingBindings?: EntryOrderReceivingBinding[] +} export type StorageEntryListSort = { sortField?: string @@ -24,7 +32,7 @@ export type StorageEntryListParams = { export type StorageEntryListResponse = { code?: number message?: string - list?: Record[] + list?: StorageEntryListItem[] pagination?: { page?: number pageSize?: number @@ -74,6 +82,25 @@ export type EntryDetailBinding = { [key: string]: unknown } +export type EntryAvailableReceivingDetail = { + receiving_detail_id?: number + receiving_id?: number + receiving_number?: string + product_name?: string + actual_quantity?: number + stored_quantity?: number + allocated_quantity?: number + receiving_allocated?: number + available_quantity?: number + binding_id?: number + binding_status?: string + status?: string + batch_number?: string + production_date?: string + expiry_date?: string + [key: string]: unknown +} + export type EntryDetailItemBarcode = { id?: number barcode?: string @@ -107,6 +134,8 @@ export type EntryDetailItem = { total_planned?: number /** pending 绑定列表 */ bindings?: EntryDetailBinding[] + /** 可绑定/已绑定的收货明细(含可用量) */ + available_receiving_details?: EntryAvailableReceivingDetail[] [key: string]: unknown } @@ -233,6 +262,55 @@ export function detailChange(data:any): Promise { return Promise.reject(new Error('storage.entry.detailChange 已下线,入库单明细不再对外编辑')) } +export type BindReceivingParams = { + /** 入库单ID */ + entry_order_id: number + /** 要绑定的收货单ID列表 */ + receiving_ids: number[] +} + +export type BindReceivingSuccessItem = { + receiving_id?: number + receiving_number?: string + [key: string]: unknown +} + +export type BindReceivingFailedItem = { + receiving_id?: number + error_code?: string + message?: string + [key: string]: unknown +} + +export type BindReceivingResponse = { + code?: number + message?: string + success?: BindReceivingSuccessItem[] + failed?: BindReceivingFailedItem[] + success_count?: number + failed_count?: number + data?: { + success?: BindReceivingSuccessItem[] + failed?: BindReceivingFailedItem[] + success_count?: number + failed_count?: number + } +} + +/** 将收货单绑定到入库单(主表级关联) */ +export function bindReceiving(data: BindReceivingParams): Promise { + return request({ + url: '/system', + method: 'post', + params: { + method: 'storage.entry.bindReceiving', + v, + timestamp: new Date().getTime() + }, + data + }) +} + export type BindReceivingDetailsBinding = { entry_item_id: number receiving_detail_id: number @@ -621,6 +699,7 @@ export type ReceivingCompareRow = { receiving_quantity?: number actual_quantity?: number box_quantity?: number + receiving_allocated?: number match_status?: ReceivingCompareMatchStatus [key: string]: unknown } @@ -665,6 +744,7 @@ export type ReceivingCompareResponse = { receiving_id?: number receiving_number?: string comparison?: ReceivingCompareRow[] + entry_only?: ReceivingCompareRow[] receiving_only?: ReceivingCompareRow[] summary?: ReceivingCompareSummary data?: Partial> diff --git a/src/components/UpperTable/index.vue b/src/components/UpperTable/index.vue index 764e55f3..ec9cdbf7 100644 --- a/src/components/UpperTable/index.vue +++ b/src/components/UpperTable/index.vue @@ -69,8 +69,8 @@ :sort-orders="column.sortOrders" :resizable="column.resizable" :show-overflow-tooltip="column.showOverflowTooltip !== false" - :align="column.align || 'left'" - :header-align="column.headerAlign || column.align || 'left'" + :align="column.align || defaultAlign" + :header-align="column.headerAlign || column.align || defaultAlign" :class-name="column.className" :label-class-name="column.labelClassName" :filters="column.filters" @@ -85,7 +85,36 @@ + + + + @@ -104,6 +115,18 @@ + + @@ -119,8 +142,9 @@
- + + @@ -167,6 +191,13 @@ /> + + = { details: entrydetail, + bindingRelations: EntryBindingRelations, directInboundLogs: DirectInboundLogs, logs: log, operate: entryoperate @@ -318,6 +357,26 @@ const selectedRow = computed(() => { const quickInboundDialogVisible = ref(false) const quickInboundTarget = ref(null) +const bindDialogVisible = ref(false) +const bindTargetRow = ref(null) + +function openBindDialog(row: any) { + if (!canBindEntryOrder(row?.order_status)) return + bindTargetRow.value = row + bindDialogVisible.value = true +} + +function handleBindDialogClosed() { + bindTargetRow.value = null +} + +async function handleBindDialogSuccess() { + bindDialogVisible.value = false + bindTargetRow.value = null + await loadData() + entryDetailRefreshTick.value += 1 +} + function translateField(fieldValue: string, value: any) { return translateEntryField(fieldValue, value) } @@ -389,7 +448,7 @@ function normalizeToWhere(condition: any) { const result = processConditionValue(k, condition.conditions[k]) if (result) where[k] = result }) - return where + return finalizeEntryListWhere(where) } // 普通自定义条件对象 @@ -399,10 +458,10 @@ function normalizeToWhere(condition: any) { const result = processConditionValue(k, condition[k]) if (result) where[k] = result }) - return where + return finalizeEntryListWhere(where) } - return {} + return finalizeEntryListWhere({}) } function getSyncStatusType(status: string) { diff --git a/src/views/system/setting/basicManagement/index.vue b/src/views/system/setting/basicManagement/index.vue index 0b22296b..5f658b30 100644 --- a/src/views/system/setting/basicManagement/index.vue +++ b/src/views/system/setting/basicManagement/index.vue @@ -323,6 +323,13 @@ const FALLBACK_FIELDS: NormalizedField[] = [ description: '开启后允许按外部系统传入的快递编码进行处理(如无匹配仍以业务校验为准);默认关闭。' }, + { key: 'sender_name', label: '默认发件人姓名', type: 'string', maxLength: 50 }, + { key: 'sender_tel', label: '默认发件人联系电话', type: 'string', maxLength: 20 }, + { key: 'province_name', label: '默认发件省份', type: 'string', maxLength: 50 }, + { key: 'city_name', label: '默认发件城市', type: 'string', maxLength: 50 }, + { key: 'district_name', label: '默认发件区/县', type: 'string', maxLength: 50 }, + { key: 'town_name', label: '默认发件镇/街道', type: 'string', maxLength: 50 }, + { key: 'address', label: '默认发件详细地址', type: 'string', maxLength: 200 }, { key: 'auto_outbound_rules', label: '自动出库规则',