loading
This commit is contained in:
@@ -47,6 +47,7 @@ export const easOutInBillDetailPage = (djid, page, size) => request({
|
||||
// 3.审核出入库单据
|
||||
export const easOutInBillUpdate = (arr) => request({
|
||||
url:'api/easOutInBill/audit',
|
||||
type: 1,
|
||||
data: arr
|
||||
})
|
||||
// 4.查询出单据明细库位
|
||||
@@ -127,6 +128,7 @@ export const allocationBillUpdate = (obj) => request({
|
||||
// 5.单据直接调拨
|
||||
export const allocationBillConfirm = (arr) => request({
|
||||
url:'api/allocationBill/confirm',
|
||||
type: 1,
|
||||
data: arr
|
||||
})
|
||||
// 6.根据跟踪号查询库存列表
|
||||
@@ -166,5 +168,6 @@ export const receiptBillUpdate = (obj) => request({
|
||||
// 4.单据直接调拨
|
||||
export const receiptBillConfirm = (arr) => request({
|
||||
url:'api/receiptBill/confirm',
|
||||
type: 1,
|
||||
data: arr
|
||||
})
|
||||
|
||||
@@ -5,17 +5,6 @@ const request = (params) => {
|
||||
let url = params.url;
|
||||
let method = params.method || 'POST';
|
||||
let data = params.data || {};
|
||||
// data.token = "default-access_token"
|
||||
// if (!params.token) {
|
||||
// let token = uni.getStorageSync('token');
|
||||
// if (!token) {
|
||||
// uni.navigateTo({
|
||||
// url: '/pages/login/login'
|
||||
// });
|
||||
// } else {
|
||||
// data.token = '179509245-9c91827e0224bdc18d0b118b8be1b5af';
|
||||
// }
|
||||
// }
|
||||
let token = ''
|
||||
if (store.getters.saveToken !== '') {
|
||||
token = store.getters.saveToken
|
||||
@@ -35,9 +24,18 @@ const request = (params) => {
|
||||
// data = qs.stringify(data)
|
||||
}
|
||||
const requestUrl = `${store.getters.baseUrl}/` + url;
|
||||
uni.showLoading({
|
||||
title: '加载中...'
|
||||
});
|
||||
let type = params.type
|
||||
if (type === 1) {
|
||||
uni.showLoading({
|
||||
mask: true,
|
||||
title: '正在推送,如未审核成功,请查看单据审核结果信息。'
|
||||
});
|
||||
} else {
|
||||
uni.showLoading({
|
||||
mask: true,
|
||||
title: '加载中...'
|
||||
});
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.request({
|
||||
url: requestUrl,
|
||||
@@ -69,45 +67,11 @@ const request = (params) => {
|
||||
url: '/pages/login/login'
|
||||
})
|
||||
} else if (res[1] && res[1].statusCode === 200) {
|
||||
uni.hideLoading();
|
||||
let {
|
||||
data: dataType
|
||||
} = res[1]
|
||||
resolve(dataType)
|
||||
// switch (dataType.code * 1) { // 拦截返回参数
|
||||
// case 0:
|
||||
// resolve(dataType)
|
||||
// break;
|
||||
// case 1003:
|
||||
// uni.showModal({
|
||||
// title: '登录已过期',
|
||||
// content: '很抱歉,登录已过期,请重新登录',
|
||||
// confirmText: '重新登录',
|
||||
// success: function(res) {
|
||||
// if (res.confirm) {
|
||||
// uni.navigateTo({
|
||||
// // 切记这儿需要哈pages.json保持一致;不能有.vue后缀
|
||||
// url: '/pages/login/login'
|
||||
// });
|
||||
// } else if (res.cancel) {
|
||||
// console.log('用户点击取消');
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
// break;
|
||||
// case -1:
|
||||
// uni.showModal({
|
||||
// title: '请求数据失败',
|
||||
// content: '获取数据失败!',
|
||||
// confirmText: '确定',
|
||||
// showCancel: false,
|
||||
// success: function(res) {
|
||||
// if (res.confirm) {} else if (res.cancel) {
|
||||
// console.log('用户点击取消');
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
// break
|
||||
// }
|
||||
}else {
|
||||
uni.showModal({
|
||||
content: `${res[1].data.message}`,
|
||||
@@ -120,7 +84,7 @@ const request = (params) => {
|
||||
reject(err)
|
||||
})
|
||||
.finally(() => {
|
||||
uni.hideLoading();
|
||||
// uni.hideLoading();
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user