| | |
| | | export namespace MesProBagCodeApi { |
| | | /** 袋码(一袋一码) */ |
| | | export interface BagCode { |
| | | inboundTime?: string; |
| | | id?: number; // 编号 |
| | | uuid?: string; // 生成组 UUID |
| | | code?: string; // 袋码(二维码内容) |
| | | businessCode?: string; // 内部出入库业务码(纯码值) |
| | | bagNo?: number; // 批次内袋序号 |
| | | batchId?: number; // 生产批次编号 |
| | | batchCode?: string; // 批次号 |
| | |
| | | /** 袋码分页查询参数 */ |
| | | export interface PageParams extends PageParam { |
| | | code?: string; |
| | | businessCode?: string; |
| | | batchId?: number; |
| | | batchCode?: string; |
| | | uuid?: string; |
| | |
| | | |
| | | /** 扫码追溯信息 */ |
| | | export interface BagCodeTrace { |
| | | inboundTime?: string; |
| | | id?: number; // 袋码编号 |
| | | code?: string; // 袋码(二维码内容) |
| | | businessCode?: string; // 内部出入库业务码 |
| | | bagNo?: number; // 袋序号 |
| | | status?: number; // 袋码状态 |
| | | printTime?: string; // 导出印刷时间 |
| | |
| | | ); |
| | | } |
| | | |
| | | /** |
| | | * 扫码追溯:根据编码解析其类型(bag / pallet / batch)。 |
| | | * 编码统一为「16 位纯数字」后无法按前缀判断类型,改由后端解析;均不匹配返回 null。 |
| | | */ |
| | | export function resolveTraceType(code: string) { |
| | | return requestClient.get<'bag' | 'batch' | 'pallet' | null>( |
| | | `/mes/pro/trace/resolve-type?code=${encodeURIComponent(code)}`, |
| | | ); |
| | | } |
| | | |
| | | /** 查询袋码分页 */ |
| | | export function getBagCodePage(params: MesProBagCodeApi.PageParams) { |
| | | return requestClient.get<PageResult<MesProBagCodeApi.BagCode>>( |
| | |
| | | export function exportBagQr(params: { uuid?: string; batchId?: number }) { |
| | | return requestClient.download('/mes/pro/bag-code/export-qr', { params }); |
| | | } |
| | | |
| | | /** 补生成已有袋码的业务码,重复操作不更换已有码值。 */ |
| | | export function generateBagBusinessCodes(ids: number[]) { |
| | | return requestClient.post<number>('/mes/pro/bag-code/generate-business-code', { ids }); |
| | | } |
| | | |
| | | /** 业务二维码仅编码存储的业务码值,不拼接追溯网址。 */ |
| | | export function exportBagBusinessQr(params: { uuid?: string; batchId?: number }) { |
| | | return requestClient.download('/mes/pro/bag-code/export-business-qr', { params }); |
| | | } |