| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163 |
- // @ts-ignore
- import request from '@/utils/request'
- // 库位合并详情
- export interface LocationMergeDetails {
- id?: number
- code?: string
- warehouse?: string
- sourceLocation?: string
- targetLocation?: string
- sourceBox?: string
- targetBox?: string
- status?: string
- quantity?: number
- moveQty?: number
- sku?: string
- barcode?: string
- productName?: string
- lotNumber?: string
- owner?: string
- qualityStatus?: string
- warehouseType?: string
- productionDate?: string
- expiryDate?: string
- involveBox?: string[]
- }
- // 料箱相关的并库详情VO
- export interface BoxRelatedMergeDetailsVO {
- boxCode: string
- station: string
- mergeDetails: LocationMergeDetails[]
- boxStatus: number // 0,10-等待调箱, 20-到达, 30-取消, 40-异常
- inventoryLocations: string[]
- }
- /**
- * 通过料箱号查看相关作业中任务详情
- * @param boxCode 料箱号
- */
- export function getWorkingDetailsByBox(boxCode: string, warehouse: string) {
- return request<BoxRelatedMergeDetailsVO[]>({
- url: '/api/wms/location/merge/workingDetailsByBox',
- method: 'get',
- params: { boxCode, warehouse }
- })
- }
- /**
- * 获取料箱库位的隔口种类
- * @param warehouse 仓库
- * @param locations 库位列表
- */
- export function getBoxSplitCode(warehouse: string, locations: string[]) {
- return request<Record<string, number>>({
- url: `/api/basic/location/getBoxSplitCode/${warehouse}`,
- method: 'post',
- data: locations
- })
- }
- /**
- * 料箱回库结果
- */
- export interface BoxInboundResult {
- t1: string // 料箱编码
- t2: string // 执行结果消息
- }
- /**
- * 执行料箱回库(呼唤机器人)
- * @param warehouse 仓库
- * @param boxCodes 可选的料箱编码列表,如果不传则回库所有料箱
- */
- export function boxInbound(warehouse: string, boxCodes?: string[]): Promise<BoxInboundResult[]> {
- const params: any = { warehouse }
- if (boxCodes && boxCodes.length > 0) {
- params.boxCodes = boxCodes
- }
- return request<BoxInboundResult[]>({
- url: '/api/wms/location/merge/boxInbound',
- method: 'post',
- params,
- paramsSerializer: (params: any) => {
- const searchParams = new URLSearchParams()
- Object.keys(params).forEach(key => {
- const value = params[key]
- if (Array.isArray(value)) {
- // Spring @RequestParam List 期望格式: key=v1&key=v2
- value.forEach(item => searchParams.append(key, item))
- } else {
- searchParams.append(key, value)
- }
- })
- return searchParams.toString()
- }
- })
- }
- /**
- * 重新下发指定站点和料箱的任务
- * @param warehouse 仓库
- * @param stationCode 站点编码
- * @param boxCode 料箱编码
- */
- export function reissueTask(warehouse: string, stationCode: string, boxCode: string) {
- return request<boolean>({
- url: '/api/wms/location/merge/reissueTask',
- method: 'post',
- params: { warehouse, stationCode, boxCode }
- })
- }
- /**
- * 获取料箱状态映射
- * @param warehouse 仓库
- * @param boxCodeList 料箱编码列表
- */
- export function getBoxStatus(warehouse: string, boxCodeList: string[]) {
- return request<Record<string, number>>({
- url: '/api/wms/location/merge/boxStatus',
- method: 'get',
- params: { warehouse, boxCodeList },
- paramsSerializer: (params: any) => {
- const searchParams = new URLSearchParams()
- Object.keys(params).forEach(key => {
- const value = params[key]
- if (Array.isArray(value)) {
- // Spring @RequestParam List 期望格式: key=v1&key=v2
- value.forEach(item => searchParams.append(key, item))
- } else {
- searchParams.append(key, value)
- }
- })
- return searchParams.toString()
- }
- })
- }
- /**
- * 获取正在作业中的并库任务详情
- * @param warehouse 仓库
- */
- export function getWorkingMergeTasks(warehouse: string) {
- return request<LocationMergeDetails[]>({
- url: '/api/wms/location/merge/workingTasks',
- method: 'get',
- params: { warehouse }
- })
- }
- /**
- * 海康-站点解绑
- * @param data
- */
- export function boxAndStationUnbindTask(params:any) {
- return request({
- url: '/api/wms/location/merge/boxAndStationUnbindTask',
- method: 'post',
- params
- })
- }
|