diff --git a/src/api/storage.inventory/inventory.ts b/src/api/storage.inventory/inventory.ts index 35b948dc..4f3ede1b 100644 --- a/src/api/storage.inventory/inventory.ts +++ b/src/api/storage.inventory/inventory.ts @@ -52,7 +52,7 @@ export function matchPutaway(data: { isSystemApi: true } as any) } -// 非本项目接口,不使用 +/** 按库位+商品维度移库(合并模式);quantity 必填 */ export function transferByProduct(data: { space_id: number stock_id: number @@ -71,8 +71,12 @@ export function transferByProduct(data: { isSystemApi: true } as any) } -// 非本项目接口,不使用 -export function transferLocation(data:any) { +/** 按单条 wms_storage 记录移库;quantity 可选,不传则全量 */ +export function transferLocation(data: { + storage_id: number + target_space_id: number + quantity?: number +}): Promise { return request({ url: '/system', method: 'post', diff --git a/src/views/order/waveOrder/GroupWaveBatchListPanel.vue b/src/views/order/waveOrder/GroupWaveBatchListPanel.vue index 22015023..feb21c3d 100644 --- a/src/views/order/waveOrder/GroupWaveBatchListPanel.vue +++ b/src/views/order/waveOrder/GroupWaveBatchListPanel.vue @@ -906,7 +906,8 @@ import WaveStrategyQuickScanProgressDialog from './component/WaveStrategyQuickSc import * as indexApi from '@/api/index/index' import { settingWarehouseGetSettings as getWarehouseSettings, - unwrapSettingWarehousePayload + unwrapSettingWarehousePayload, + type SettingWarehouseSettingsPayload } from '@/api/setting.warehouse/settingwarehouse' import { orderWaveBatchAllocateExpress, @@ -1450,7 +1451,9 @@ async function loadWarehouseSettings() { if (!res || !okCode(res.code)) { throw new Error(res?.message || '获取仓库配置失败') } - const payload = unwrapSettingWarehousePayload(res as Record) + const payload = unwrapSettingWarehousePayload( + res as Record + ) as SettingWarehouseSettingsPayload const maxWaveQuantity = Number(payload?.subject_config?.max_wave_quantity) waveMaxOrderLimit.value = Number.isFinite(maxWaveQuantity) && maxWaveQuantity > 0 ? maxWaveQuantity : null } catch (error) { diff --git a/src/views/order/waveOrder/SandanWaveBatchListPanel.vue b/src/views/order/waveOrder/SandanWaveBatchListPanel.vue index 3a5c3fb2..f1a3ab83 100644 --- a/src/views/order/waveOrder/SandanWaveBatchListPanel.vue +++ b/src/views/order/waveOrder/SandanWaveBatchListPanel.vue @@ -487,7 +487,8 @@ import WaveFetchTaskProgressDialog from './component/WaveFetchTaskProgressDialog import * as indexApi from '@/api/index/index' import { settingWarehouseGetSettings as getWarehouseSettings, - unwrapSettingWarehousePayload + unwrapSettingWarehousePayload, + type SettingWarehouseSettingsPayload } from '@/api/setting.warehouse/settingwarehouse' import { orderWaveBatchAllocateExpress, @@ -865,7 +866,9 @@ async function loadWarehouseSettings() { if (!res || !okCode(res.code)) { throw new Error(res?.message || '获取仓库配置失败') } - const payload = unwrapSettingWarehousePayload(res as Record) + const payload = unwrapSettingWarehousePayload( + res as Record + ) as SettingWarehouseSettingsPayload const maxWaveQuantity = Number(payload?.subject_config?.max_wave_quantity) waveMaxOrderLimit.value = Number.isFinite(maxWaveQuantity) && maxWaveQuantity > 0 ? maxWaveQuantity : null } catch (error) { diff --git a/src/views/stock/stock/component/info.vue b/src/views/stock/stock/component/info.vue index 561aa956..44fab088 100644 --- a/src/views/stock/stock/component/info.vue +++ b/src/views/stock/stock/component/info.vue @@ -716,15 +716,6 @@ watch(() => props.id, (newVal) => { } }) -// 体积计算相关监听 -watch([() => formData.length, () => formData.width, () => formData.height], () => { - formData.volume = totalVolume(formData.length, formData.width, formData.height) -}) - -watch([() => formData.box_length, () => formData.box_width, () => formData.box_height], () => { - formData.box_volume = totalVolume(formData.box_length, formData.box_width, formData.box_height) -}) - // 管理标识监听 watch(() => formData.managementFlags, (newFlags) => { if (newFlags) { @@ -802,21 +793,29 @@ function normalizeStockInfoFormNumbers() { } } -function totalVolume(length: number, width: number, height: number) { +/** 商品体积(cm³):长×宽×高,尺寸单位为 cm */ +function calcVolumeCm3(length: number, width: number, height: number) { + if (length && width && height) { + return Math.round(length * width * height) + } + return 0 +} + +/** 箱体积(m³):尺寸 cm 换算为米后相乘 */ +function calcBoxVolumeM3(length: number, width: number, height: number) { if (length && width && height) { - // 将厘米转换为米计算体积 const volume = (length / 100) * (width / 100) * (height / 100) - return parseFloat(volume.toFixed(2)) + return parseFloat(volume.toFixed(6)) } return 0 } function calculateVolume() { - formData.volume = totalVolume(formData.length, formData.width, formData.height) + formData.volume = calcVolumeCm3(formData.length, formData.width, formData.height) } function calculateBoxVolume() { - formData.box_volume = totalVolume(formData.box_length, formData.box_width, formData.box_height) + formData.box_volume = calcBoxVolumeM3(formData.box_length, formData.box_width, formData.box_height) } function updateManagementFlags() { diff --git a/src/views/storage/inventory/component/panelstockdetail.vue b/src/views/storage/inventory/component/panelstockdetail.vue index ef24ccc0..0e9f5ad0 100644 --- a/src/views/storage/inventory/component/panelstockdetail.vue +++ b/src/views/storage/inventory/component/panelstockdetail.vue @@ -1,23 +1,71 @@