| | |
| | | }); |
| | | } |
| | | |
| | | /** 库存现有量导入结果 */ |
| | | export interface ImportResult { |
| | | /** 新建库存记录成功的行,元素格式「物料编码-仓库」 */ |
| | | createNames?: string[]; |
| | | /** 已存在库存记录调整成功的行,元素格式「物料编码-仓库」 */ |
| | | updateNames?: string[]; |
| | | /** 导入失败的记录,key 为「物料编码-仓库」,value 为失败原因 */ |
| | | failureNames?: Record<string, string>; |
| | | } |
| | | |
| | | /** 下载库存现有量导入模板 */ |
| | | export function importMaterialStockTemplate() { |
| | | return requestClient.download('/mes/wm/material-stock/import-template'); |
| | | } |
| | | |
| | | /** 导入库存现有量 */ |
| | | export function importMaterialStock(file: File) { |
| | | return requestClient.upload<MesWmMaterialStockApi.ImportResult>( |
| | | '/mes/wm/material-stock/import', |
| | | { file }, |
| | | ); |
| | | } |
| | | |
| | | /** 库存调整(自定义出入库)- 入库 */ |
| | | export interface MaterialStockAdjustInParams { |
| | | itemId: number; // 物料ID |
| | |
| | | return requestClient.post<number>('/mes/wm/material-stock/adjust-out', data); |
| | | } |
| | | |
| | | /** 库存移库 */ |
| | | export interface MaterialStockMoveParams { |
| | | materialStockId: number; // 库存记录ID |
| | | toWarehouseId: number; // 目标仓库ID |
| | | toLocationId: number; // 目标库区ID |
| | | toAreaId: number; // 目标库位ID |
| | | quantity: number; // 移库数量 |
| | | remark?: string; // 备注 |
| | | } |
| | | |
| | | /** 库存移库 */ |
| | | export function moveMaterialStock(data: MaterialStockMoveParams) { |
| | | return requestClient.post<boolean>('/mes/wm/material-stock/move', data); |
| | | } |
| | | |
| | | /** 库存调整(正数=入库,负数=出库)- 旧接口,保留兼容 */ |
| | | export interface MaterialStockAdjustParams { |
| | | itemId: number; // 物料ID |