Files
FT541-WMS/RuoYi-App-master/api/out/appointOut.js
2026-06-16 13:29:22 +08:00

53 lines
1.7 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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'
})
}