feat:波次前调用小车列表接口,波次参数增加car_id/car_code
This commit is contained in:
parent
92860f29d1
commit
af2b05a6a8
@ -2326,6 +2326,12 @@ export default {
|
|||||||
? String(this.stock ?? '1')
|
? String(this.stock ?? '1')
|
||||||
: String(this.noIsbnStock ?? '1')
|
: String(this.noIsbnStock ?? '1')
|
||||||
|
|
||||||
|
const token = uni.getStorageSync('token') || ''
|
||||||
|
|
||||||
|
// 先查询小车列表
|
||||||
|
await this.callCarListApi(timestamp)
|
||||||
|
|
||||||
|
// 调用波次接口
|
||||||
const params = {
|
const params = {
|
||||||
app_key: 'psi',
|
app_key: 'psi',
|
||||||
client_id: 'psi',
|
client_id: 'psi',
|
||||||
@ -2334,6 +2340,8 @@ export default {
|
|||||||
'items[0][quantity]': stock,
|
'items[0][quantity]': stock,
|
||||||
'items[0][unit_price]': price,
|
'items[0][unit_price]': price,
|
||||||
direction: '1',
|
direction: '1',
|
||||||
|
car_id: '',
|
||||||
|
car_code: '',
|
||||||
timestamp: timestamp,
|
timestamp: timestamp,
|
||||||
sign_method: 'md5'
|
sign_method: 'md5'
|
||||||
}
|
}
|
||||||
@ -2341,7 +2349,6 @@ export default {
|
|||||||
var sign = calculateSign(params)
|
var sign = calculateSign(params)
|
||||||
params.sign = sign
|
params.sign = sign
|
||||||
|
|
||||||
const token = uni.getStorageSync('token') || ''
|
|
||||||
var waveUrl = 'https://psi.api.buzhiyushu.cn/api/purchase-order/create-with-wave'
|
var waveUrl = 'https://psi.api.buzhiyushu.cn/api/purchase-order/create-with-wave'
|
||||||
console.log('【波次】请求地址:', waveUrl)
|
console.log('【波次】请求地址:', waveUrl)
|
||||||
console.log('【波次】请求参数:', params)
|
console.log('【波次】请求参数:', params)
|
||||||
@ -2366,6 +2373,40 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 查看小车列表
|
||||||
|
async callCarListApi(timestamp) {
|
||||||
|
const token = uni.getStorageSync('token') || ''
|
||||||
|
const params = {
|
||||||
|
app_key: 'psi',
|
||||||
|
client_id: 'psi',
|
||||||
|
page: '1',
|
||||||
|
page_size: '999999',
|
||||||
|
timestamp: timestamp,
|
||||||
|
sign_method: 'md5'
|
||||||
|
}
|
||||||
|
var sign = calculateSign(params)
|
||||||
|
params.sign = sign
|
||||||
|
|
||||||
|
try {
|
||||||
|
const res = await new Promise(function (resolve, reject) {
|
||||||
|
uni.request({
|
||||||
|
url: 'https://psi.api.buzhiyushu.cn/api/car/list',
|
||||||
|
method: 'POST',
|
||||||
|
header: {
|
||||||
|
'Content-Type': 'application/x-www-form-urlencoded',
|
||||||
|
'Authorization': 'Bearer ' + token
|
||||||
|
},
|
||||||
|
data: params,
|
||||||
|
success: function (r) { resolve(r) },
|
||||||
|
fail: function (e) { reject(e) }
|
||||||
|
})
|
||||||
|
})
|
||||||
|
console.log('【小车列表】返回值:', res.statusCode, res.data)
|
||||||
|
} catch (e) {
|
||||||
|
console.warn('【小车列表】请求失败:', e)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
// 无ISBN - 书名搜索(使用与ISBN相同的kongfz接口)
|
// 无ISBN - 书名搜索(使用与ISBN相同的kongfz接口)
|
||||||
searchNoIsbn() {
|
searchNoIsbn() {
|
||||||
if (!this.isLoggedIn) {
|
if (!this.isLoggedIn) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user