2 天以前 1c1af9b0fc10778ae5ac13cc68fd4030affbcfe1
src/api/mes/wm/sn/index.ts
@@ -29,7 +29,60 @@
    unitName?: string; // 单位名称
    batchCode?: string; // 批次号
    workOrderId?: number; // 生产订单编号
    status?: number; // 状态(1-在库 2-已出库)
    warehouseId?: number; // 在库仓库 ID
    locationId?: number; // 在库库区 ID
    areaId?: number; // 在库库位 ID
    createTime?: Date; // 生成时间
  }
  /** MES SN 码单件详情 */
  export interface SnDetail {
    id?: number; // 编号
    code?: string; // SN 码
    itemId?: number; // 物料编号
    itemCode?: string; // 物料编码
    itemName?: string; // 物料名称
    batchCode?: string; // 批次号
    status?: number; // 状态(1-在库 2-已出库)
    warehouseId?: number; // 在库仓库 ID
    locationId?: number; // 在库库区 ID
    areaId?: number; // 在库库位 ID
    lastTransactionType?: number; // 最近事务类型(1-入库 2-出库)
    lastTransactionTypeName?: string; // 最近事务类型名称
    lastTransactionQuantity?: number; // 最近事务变动数量
    lastTransactionBizType?: number; // 最近事务业务类型
    lastTransactionBizCode?: string; // 最近事务业务单号
    lastTransactionTime?: string; // 最近事务发生时间
  }
  /** SN 码入库登记参数 */
  export interface SnInStock {
    code?: string; // SN 码
    itemId?: number; // 物料编号
    warehouseId?: number; // 仓库 ID
    locationId?: number; // 库区 ID
    areaId?: number; // 库位 ID
    batchCode?: string; // 批次号
    remark?: string; // 备注
  }
  /** SN 码出库核销参数 */
  export interface SnOutStock {
    code?: string; // SN 码
    itemId?: number; // 物料编号
    remark?: string; // 备注
  }
  /** SN 码在库/状态分页查询参数 */
  export interface SnInStockPageParams extends PageParam {
    code?: string; // SN 码
    itemId?: number; // 物料编号
    batchCode?: string; // 批次号
    warehouseId?: number; // 仓库 ID
    locationId?: number; // 库区 ID
    areaId?: number; // 库位 ID
    status?: number; // 状态(1-在库 2-已出库)
  }
  /** MES SN 码生成参数 */
@@ -77,6 +130,31 @@
  });
}
/** SN 码入库登记 */
export function registerSnInStock(data: MesWmSnApi.SnInStock) {
  return requestClient.post<boolean>('/mes/wm/sn/in-stock', data);
}
/** SN 码出库核销 */
export function outboundSn(data: MesWmSnApi.SnOutStock) {
  return requestClient.post<boolean>('/mes/wm/sn/out-stock', data);
}
/** 查询 SN 码单件详情 */
export function getSnDetail(code: string) {
  return requestClient.get<MesWmSnApi.SnDetail>('/mes/wm/sn/detail', {
    params: { code },
  });
}
/** 查询 SN 码在库/状态分页 */
export function getSnInStockPage(params: MesWmSnApi.SnInStockPageParams) {
  return requestClient.get<PageResult<MesWmSnApi.Sn>>(
    '/mes/wm/sn/in-stock-page',
    { params },
  );
}
/** 导出 SN 码分组 Excel */
export function exportSnGroupExcel(params: MesWmSnApi.PageParams) {
  return requestClient.download('/mes/wm/sn/group-export-excel', { params });