300 lines
5.8 KiB
TypeScript
300 lines
5.8 KiB
TypeScript
// src/api/warehouse.js
|
|
|
|
import request from '@/utils/request'
|
|
|
|
export function getWarehouseZones(data:any) {
|
|
return request({
|
|
url: '/system',
|
|
method: 'post',
|
|
params: {
|
|
method: 'warehouse.getWarehouseZones',
|
|
v: '1.0',
|
|
timestamp: new Date().getTime()
|
|
},
|
|
data: data || {},
|
|
isSystemApi: true
|
|
} as any)
|
|
}
|
|
|
|
export function getWarehouseTree(warehouseId:any) {
|
|
return request({
|
|
url: '/system',
|
|
method: 'post',
|
|
params: {
|
|
method: 'warehouse.getWarehouseTree',
|
|
v: '1.0',
|
|
timestamp: new Date().getTime()
|
|
},
|
|
data: { warehouseId },
|
|
isSystemApi: true
|
|
} as any)
|
|
}
|
|
|
|
// 获取子区域,未使用
|
|
export function getChildren(zoneId:any) {
|
|
return request({
|
|
url: '/system',
|
|
method: 'post',
|
|
params: {
|
|
method: 'warehouse.getChildren',
|
|
v: '1.0',
|
|
timestamp: new Date().getTime()
|
|
},
|
|
data: { zoneId },
|
|
isSystemApi: true
|
|
} as any)
|
|
}
|
|
|
|
export function create(data:any) {
|
|
return request({
|
|
url: '/system',
|
|
method: 'post',
|
|
params: {
|
|
method: 'warehouse.create',
|
|
v: '1.0',
|
|
timestamp: new Date().getTime()
|
|
},
|
|
data: data,
|
|
isSystemApi: true
|
|
} as any)
|
|
}
|
|
|
|
export function update(data:any, id:any) {
|
|
return request({
|
|
url: '/system',
|
|
method: 'post',
|
|
params: {
|
|
method: 'warehouse.update',
|
|
v: '1.0',
|
|
timestamp: new Date().getTime()
|
|
},
|
|
data: { id, ...data },
|
|
isSystemApi: true
|
|
} as any )
|
|
}
|
|
|
|
export function deleteZone(id:any) { // 避免使用保留字
|
|
return request({
|
|
url: '/system',
|
|
method: 'post',
|
|
params: {
|
|
method: 'warehouse.delete',
|
|
v: '1.0',
|
|
timestamp: new Date().getTime()
|
|
},
|
|
data: { id },
|
|
isSystemApi: true
|
|
} as any)
|
|
}
|
|
|
|
export function detail(id:any) {
|
|
return request({
|
|
url: '/system',
|
|
method: 'post',
|
|
params: {
|
|
method: 'warehouse.detail',
|
|
v: '1.0',
|
|
timestamp: new Date().getTime()
|
|
},
|
|
data: { id },
|
|
isSystemApi: true
|
|
} as any)
|
|
}
|
|
|
|
// 切换激活状态,未使用
|
|
export function toggleActive(id:any, isActive:any) {
|
|
return request({
|
|
url: '/system',
|
|
method: 'post',
|
|
params: {
|
|
method: 'warehouse.toggleActive',
|
|
v: '1.0',
|
|
timestamp: new Date().getTime()
|
|
},
|
|
data: { id, isActive },
|
|
isSystemApi: true
|
|
} as any)
|
|
}
|
|
|
|
// 切换激活状态,未使用
|
|
export function getPath(id:any) {
|
|
return request({
|
|
url: '/system',
|
|
method: 'post',
|
|
params: {
|
|
method: 'warehouse.getPath',
|
|
v: '1.0',
|
|
timestamp: new Date().getTime()
|
|
},
|
|
data: { id },
|
|
isSystemApi: true
|
|
} as any)
|
|
}
|
|
|
|
// 检测连通性
|
|
export function checkConnectivity(data:any) {
|
|
return request({
|
|
url: '/system',
|
|
method: 'post',
|
|
params: {
|
|
method: 'warehouse.checkConnectivity',
|
|
v: '1.0',
|
|
timestamp: new Date().getTime()
|
|
},
|
|
data: data,
|
|
isSystemApi: true
|
|
} as any)
|
|
}
|
|
|
|
export function getSpacesByRack(id:any){
|
|
return request({
|
|
url: '/system',
|
|
method: 'post',
|
|
params: {
|
|
method: 'warehouse.getSpacesByRack',
|
|
v: '1.0',
|
|
timestamp: new Date().getTime()
|
|
},
|
|
data: {id:id},
|
|
isSystemApi: true
|
|
} as any)
|
|
}
|
|
|
|
export function createRackWithSpaces(id:any){
|
|
return request({
|
|
url: '/system',
|
|
method: 'post',
|
|
params: {
|
|
method: 'warehouse.createRackWithSpaces',
|
|
v: '1.0',
|
|
timestamp: new Date().getTime()
|
|
},
|
|
data: {id:id},
|
|
isSystemApi: true
|
|
} as any)
|
|
}
|
|
|
|
export function getSpaceInfo(id:any){
|
|
return request({
|
|
url: '/system',
|
|
method: 'post',
|
|
params: {
|
|
method: 'warehouse.getSpaceInfo',
|
|
v: '1.0',
|
|
timestamp: new Date().getTime()
|
|
},
|
|
data: {id:id},
|
|
isSystemApi: true
|
|
} as any)
|
|
}
|
|
export function checkBarcodeUnique(data:any){
|
|
return request({
|
|
url: '/system',
|
|
method: 'post',
|
|
params: {
|
|
method: 'warehouse.checkBarcodeUnique',
|
|
v: '1.0',
|
|
timestamp: new Date().getTime()
|
|
},
|
|
data: data,
|
|
isSystemApi: true
|
|
} as any)
|
|
}
|
|
export function updateSpaceInfo(data:any){
|
|
return request({
|
|
url: '/system',
|
|
method: 'post',
|
|
params: {
|
|
method: 'warehouse.updateSpaceInfo',
|
|
v: '1.0',
|
|
timestamp: new Date().getTime()
|
|
},
|
|
data: data,
|
|
isSystemApi: true
|
|
} as any)
|
|
}
|
|
|
|
export function createRack(data: any) {
|
|
return request({
|
|
url: '/system',
|
|
method: 'post',
|
|
params: {
|
|
method: 'warehouse.createRack',
|
|
v: '1.0',
|
|
timestamp: new Date().getTime()
|
|
},
|
|
data,
|
|
isSystemApi: true
|
|
} as any)
|
|
}
|
|
|
|
export function getPickPath(data: any) {
|
|
return request({
|
|
url: '/system',
|
|
method: 'post',
|
|
params: {
|
|
method: 'warehouse.getPickPath',
|
|
v: '1.0',
|
|
timestamp: new Date().getTime()
|
|
},
|
|
data,
|
|
isSystemApi: true
|
|
} as any)
|
|
}
|
|
|
|
export function updateRackPosition(data: any) {
|
|
return request({
|
|
url: '/system',
|
|
method: 'post',
|
|
params: {
|
|
method: 'warehouse.updateRackPosition',
|
|
v: '1.0',
|
|
timestamp: new Date().getTime()
|
|
},
|
|
data,
|
|
isSystemApi: true
|
|
} as any)
|
|
}
|
|
|
|
export function recalculatePickPath(warehouse_id: any) {
|
|
return request({
|
|
url: '/system',
|
|
method: 'post',
|
|
params: {
|
|
method: 'warehouse.recalculatePickPath',
|
|
v: '1.0',
|
|
timestamp: new Date().getTime()
|
|
},
|
|
data: { warehouse_id },
|
|
isSystemApi: true
|
|
} as any)
|
|
}
|
|
|
|
export function updateNeighbors(warehouse_id: any) {
|
|
return request({
|
|
url: '/system',
|
|
method: 'post',
|
|
params: {
|
|
method: 'warehouse.updateNeighbors',
|
|
v: '1.0',
|
|
timestamp: new Date().getTime()
|
|
},
|
|
data: { warehouse_id },
|
|
isSystemApi: true
|
|
} as any)
|
|
}
|
|
|
|
export function getAreaRacks(area_id: any) {
|
|
return request({
|
|
url: '/system',
|
|
method: 'post',
|
|
params: {
|
|
method: 'warehouse.getAreaRacks',
|
|
v: '1.0',
|
|
timestamp: new Date().getTime()
|
|
},
|
|
data: { area_id },
|
|
isSystemApi: true
|
|
} as any)
|
|
}
|