手持机-制定出库页面

This commit is contained in:
刘汗青
2026-06-16 13:29:22 +08:00
parent aab14ac716
commit 4cf67d3610
8 changed files with 758 additions and 266 deletions

View File

@@ -0,0 +1,52 @@
import request from '@/utils/request'
/**
* 根据托盘码查询库存物料信息
* GET /out/handAllotStock/list
* @param {Object} params - { trayCode: '托盘码' }
* 返回字段:trayCode, stockId, productId, productName, quantity, spare1(规格), spare3(单位),
* spare4(型号), cargoSpaceId, cargoSpaceName, warehouseId, inDate, lotNo 等
*/
export function queryTrayInfo(params) {
return request({
url: '/out/handAllotStock/list',
method: 'get',
params: params
})
}
/**
* 获取出口列表(portType=2 为出口)
* GET /bas/warehousePort/list
* @param {Object} params - { portType: '2', warehouseId: '' }
*/
export function getExitPortList(params) {
return request({
url: '/bas/warehousePort/list',
method: 'get',
params: { portType: '2', ...params }
})
}
/**
* 指定货位出库 - 生成出库作业
* POST /job/outmydoJob/pointOut
* @param {Array} stockIds - 库存ID数组,如 ['KC202601220164']
* @param {String} exitId - 出口ID
* @param {String} type - 出库类型(传 '2')
*
* 注意:后端用 @RequestParam String[] stockIds,Spring 要求重复同名参数:
* stockIds=A&stockIds=B
* axios 默认序列化数组会带方括号(stockIds[]=A),需手动拼 URL 避免 400 报错。
*/
export function pointOut(stockIds, exitId, type) {
// 把数组拼成重复参数:stockIds=A&stockIds=B&exitId=1&type=2
const idPart = (Array.isArray(stockIds) ? stockIds : [stockIds])
.map(id => `stockIds=${encodeURIComponent(id)}`)
.join('&')
const url = `/job/outmydoJob/pointOut?${idPart}&exitId=${encodeURIComponent(exitId)}&type=${encodeURIComponent(type)}`
return request({
url,
method: 'post'
})
}