接口联调

This commit is contained in:
2023-12-19 16:41:33 +08:00
parent a9f94178bf
commit 6bcb32e8eb
8 changed files with 126 additions and 39 deletions

View File

@@ -5,7 +5,7 @@ import {post} from '@config/http.js'
*/
// 读取托盘码
export const RFReadTrayStatePick = (id) => post('RF_ReadTrayState_Pick', {
TrayID: id
js: JSON.stringify({TrayID: id})
})
// export const RFReadTrayStatePick = (id) => {
// let res = {'ErrNO': '1', 'ErrMsg': '读取成功'}
@@ -13,7 +13,7 @@ export const RFReadTrayStatePick = (id) => post('RF_ReadTrayState_Pick', {
// }
// 托盘待拣货信息
export const RFReadTrayStoragePick = (id) => post('RF_ReadTrayStorage_Pick', {
TrayID: id
js: JSON.stringify({TrayID: id})
})
// export const RFReadTrayStoragePick = (id) => {
// let res = {'ErrNO': '1', 'ErrMsg': '读取成功!', 'StorageList': [{'BillID': '000001', 'MatCode': '物料编码001', 'MatName': '物料名称001', 'BatchNumber': '批次001', 'MatNum': '100', 'FactNumOut': '50'}, {'BillID': '000002', 'MatCode': '物料编码002', 'MatName': '物料名称002', 'BatchNumber': '批次002', 'MatNum': '100', 'FactNumOut': '50'}]}
@@ -22,8 +22,7 @@ export const RFReadTrayStoragePick = (id) => post('RF_ReadTrayStorage_Pick', {
// 读取物料条码
export const RFReadMatBarCodeStatePick = (id, code) => post('RF_ReadMatBarCodeState_Pick', {
TrayID: id,
MatBarCode: code
js: JSON.stringify({TrayID: id, MatBarCode: code})
})
// export const RFReadMatBarCodeStatePick = (id, code) => {
// let res = {'ErrNO': '1', 'ErrMsg': '读取成功'}
@@ -32,9 +31,7 @@ export const RFReadMatBarCodeStatePick = (id, code) => post('RF_ReadMatBarCodeSt
// 拣货
export const RFStoragePick = (id, code, uid) => post('RF_Storage_Pick', {
TrayID: id,
MatBarCode: code,
UserPID: uid
js: JSON.stringify({TrayID: id, MatBarCode: code, UserPID: uid})
})
// export const RFStoragePick = (id, code, uid) => {
// let res = {'ErrNO': '1', 'ErrMsg': '拣货成功'}
@@ -46,7 +43,7 @@ export const RFStoragePick = (id, code, uid) => post('RF_Storage_Pick', {
*/
// 读取托盘码
export const RFReadTrayStateInventory = (id) => post('RF_ReadTrayState_Inventory', {
TrayID: id
js: JSON.stringify({TrayID: id})
})
// export const RFReadTrayStateInventory = (id) => {
// let res = {'ErrNO': '1', 'ErrMsg': '读取成功'}
@@ -55,7 +52,7 @@ export const RFReadTrayStateInventory = (id) => post('RF_ReadTrayState_Inventory
// 托盘待盘点信息
export const RFReadTrayStorageInventory = (id) => post('RF_ReadTrayStorage_Inventory', {
TrayID: id
js: JSON.stringify({TrayID: id})
})
// export const RFReadTrayStorageInventory = (id) => {
// let res = {'ErrNO': '1', 'ErrMsg': '读取成功!', 'StorageList': [{'BillID': '000001', 'MatCode': '物料编码001', 'MatName': '物料名称001', 'BatchNumber': '批次001', 'MatNum': '100', 'FactNumOut': '50'}, {'BillID': '000002', 'MatCode': '物料编码002', 'MatName': '物料名称002', 'BatchNumber': '批次002', 'MatNum': '100', 'FactNumOut': '50'}]}
@@ -64,8 +61,7 @@ export const RFReadTrayStorageInventory = (id) => post('RF_ReadTrayStorage_Inven
// 读取物料条码
export const RFReadMatBarCodeStateInventory = (id, code) => post('RF_ReadMatBarCodeState_Inventory', {
TrayID: id,
MatBarCode: code
js: JSON.stringify({TrayID: id, MatBarCode: code})
})
// export const RFReadMatBarCodeStateInventory = (id, code) => {
// let res = {'ErrNO': '1', 'ErrMsg': '读取成功'}
@@ -74,9 +70,7 @@ export const RFReadMatBarCodeStateInventory = (id, code) => post('RF_ReadMatBarC
// 盘点
export const RFStorageInventory = (id, code, uid) => post('RF_Storage_Inventory', {
TrayID: id,
MatBarCode: code,
UserPID: uid
js: JSON.stringify({TrayID: id, MatBarCode: code, UserPID: uid})
})
// export const RFStorageInventory = (id, code, uid) => {
// let res = {'ErrNO': '1', 'ErrMsg': '盘点成功'}

View File

@@ -2,8 +2,7 @@ import {post} from '@config/http.js'
// 手持登录
export const rfLogin = (user, password) => post('RF_Login', {
UserID: user,
UserPassWord: password
js: JSON.stringify({UserID: user, UserPassWord: password})
})
// export const rfLogin = (user, password) => {
// let res = {'ErrNO': '1', 'ErrMsg': '登录成功', 'UserName': '张三', 'UserPID': '1001'}
@@ -15,7 +14,7 @@ export const rfLogin = (user, password) => post('RF_Login', {
*/
// 读取托盘码
export const rfReadTrayStatePackage = (id) => post('RF_ReadTrayState_Package', {
TrayID: id
js: JSON.stringify({TrayID: id})
})
// export const rfReadTrayStatePackage = (id) => {
// let res = {'ErrNO': '1', 'ErrMsg': '读取成功'}
@@ -23,7 +22,7 @@ export const rfReadTrayStatePackage = (id) => post('RF_ReadTrayState_Package', {
// }
// 托盘库存信息
export const rfReadTrayStoragePackage = (id) => post('RF_ReadTrayStorage_Package', {
TrayID: id
js: JSON.stringify({TrayID: id})
})
// export const rfReadTrayStoragePackage = (id) => {
// let res = {'ErrNO': '1', 'ErrMsg': '读取成功!', 'StorageList': [{'BillID': '000001', 'MatCode': '物料编码001', 'MatName': '物料名称001', 'BatchNumber': '批次001', 'MatNum': '1'}, {'BillID': '000002', 'MatCode': '物料编码002', 'MatName': '物料名称002', 'BatchNumber': '批次002', 'MatNum': '1'}]}
@@ -32,8 +31,7 @@ export const rfReadTrayStoragePackage = (id) => post('RF_ReadTrayStorage_Package
// 读取物料条码
export const rfReadMatBarCodeStatePackage = (id, code) => post('RF_ReadMatBarCodeState_Package', {
TrayID: id,
MatBarCode: code
js: JSON.stringify({TrayID: id, MatBarCode: code})
})
// export const rfReadMatBarCodeStatePackage = (id, code) => {
// let res = {'ErrNO': '1', 'ErrMsg': '读取成功'}
@@ -42,10 +40,7 @@ export const rfReadMatBarCodeStatePackage = (id, code) => post('RF_ReadMatBarCod
// 组盘
export const rfTrayPackage = (id, code, size, uid) => post('RF_Tray_Package', {
TrayID: id,
MatBarCode: code,
MatSize: size,
UserPID: uid
js: JSON.stringify({TrayID: id, MatBarCode: code, MatSize: size, UserPID: uid})
})
// export const rfTrayPackage = (id, code, size, uid) => {
// let res = {'ErrNO': '1', 'ErrMsg': '组盘成功'}
@@ -57,7 +52,7 @@ export const rfTrayPackage = (id, code, size, uid) => post('RF_Tray_Package', {
*/
// 读取托盘码
export const rfReadTrayStateUnPackage = (id) => post('RF_ReadTrayState_UnPackage', {
TrayID: id
js: JSON.stringify({TrayID: id})
})
// export const rfReadTrayStateUnPackage = (id) => {
// let res = {'ErrNO': '1', 'ErrMsg': '读取成功'}
@@ -66,7 +61,7 @@ export const rfReadTrayStateUnPackage = (id) => post('RF_ReadTrayState_UnPackage
// 托盘库存信息
export const rfReadTrayStorageUnPackage = (id) => post('RF_ReadTrayStorage_UnPackage', {
TrayID: id
js: JSON.stringify({TrayID: id})
})
// export const rfReadTrayStorageUnPackage = (id) => {
// let res = {'ErrNO': '1', 'ErrMsg': '读取成功!', 'StorageList': [{'BillID': '000001', 'MatCode': '物料编码001', 'MatName': '物料名称001', 'BatchNumber': '批次001', 'MatNum': '1'}, {'BillID': '000002', 'MatCode': '物料编码002', 'MatName': '物料名称002', 'BatchNumber': '批次002', 'MatNum': '1'}, {'BillID': '000003', 'MatCode': '物料编码002', 'MatName': '物料名称002', 'BatchNumber': '批次002', 'MatNum': '1'}]}
@@ -75,8 +70,7 @@ export const rfReadTrayStorageUnPackage = (id) => post('RF_ReadTrayStorage_UnPac
// 解盘
export const rfTrayUnPackage = (id, uid) => post('RF_Tray_UnPackage', {
TrayID: id,
UserPID: uid
js: JSON.stringify({TrayID: id, UserPID: uid})
})
// export const rfTrayUnPackage = (id, uid) => {
// let res = {'ErrNO': '1', 'ErrMsg': '组盘成功'}

View File

@@ -2,9 +2,12 @@ import axios from 'axios'
import { Dialog } from './mUtils.js'
import store from '../vuex/store'
import router from '@/router'
import qs from 'qs'
const baseUrl = process.env.NODE_ENV === 'development' ? '/api/ZD_WMS_WebService/ZD_WMS_WebService.asmx/' : 'http://njxb.v1.idcfengye.com/ZD_WMS_WebService/ZD_WMS_WebService.asmx/'
axios.defaults.timeout = 50000
axios.defaults.headers.post['Content-Type'] = 'application/json;charset=UTF-8'
axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded; charset=UTF-8'
axios.interceptors.request.use(
config => {
@@ -14,11 +17,7 @@ axios.interceptors.request.use(
// }
// token && (config.headers.Authorization = token)
if (config.method === 'post') {
if (!config.data.flag) {
config.data = config.data
} else {
config.data = config.data.formData
}
config.data = qs.stringify(config.data)
}
return config
},
@@ -51,10 +50,13 @@ axios.interceptors.response.use(
export const post = (sevmethod, params) => {
return new Promise((resolve, reject) => {
// axios.post(`${store.getters.baseUrl}/` + 'ZD_WMS_WebService/ZD_WMS_WebService.asmx?op=' + sevmethod, params)
axios.post('/api/ZD_WMS_WebService/ZD_WMS_WebService.asmx?op=' + sevmethod, params)
axios.post(baseUrl + sevmethod, params)
.then(response => {
resolve(response.data)
let parser = new DOMParser()
let _xml = parser.parseFromString(response.data, 'text/xml')
let jsonXml = _xml.getElementsByTagName('string')[0].innerHTML
let jsonArr = JSON.parse(jsonXml)
resolve(jsonArr)
}, error => {
Dialog(error || error.message)
reject(error.message)

View File

@@ -63,7 +63,7 @@ export default {
this.$store.dispatch('setUserInfo', JSON.stringify(obj))
this.$router.push('/home')
} else {
this.Dialog(res.desc)
this.Dialog(res.ErrMsg)
}
this.disabled = false
} catch (err) {

View File

@@ -92,6 +92,7 @@ export default {
try {
let res = await rfReadTrayStatePackage(val)
if (res.ErrNO === '1') {
this.toast(res.ErrMsg)
this._rfReadTrayStoragePackage()
} else {
this.toast(res.ErrMsg)