|
|
@@ -1116,10 +1116,14 @@ export default {
|
|
|
}
|
|
|
params = { ...params, treeData: JSON.stringify(treeData) };
|
|
|
|
|
|
+ let pendingMsg = '';
|
|
|
uni.showLoading({ mask: true });
|
|
|
try {
|
|
|
- const res = await Fn(params);
|
|
|
- if (res.code == 1) {
|
|
|
+ // hideError:避免 luch-request 在 showLoading 期间 showToast 被挡住;错误在 finally hideLoading 后统一提示
|
|
|
+ const res = await Fn(params, { hideError: true });
|
|
|
+ if (!res || typeof res !== 'object') {
|
|
|
+ pendingMsg = '提交失败,请重试';
|
|
|
+ } else if (res.code == 1) {
|
|
|
if (res.data.respondType && res.data.respondType == 'priceError') {
|
|
|
that.diffPriceList = res.data.diff;
|
|
|
that.$refs.diffPriceRef.open('bottom');
|
|
|
@@ -1138,17 +1142,20 @@ export default {
|
|
|
this.$util.pageTo({ url: '/admin/billing/result', type: 2, query: { orderId: id, orderSn: orderSn, title: '开单成功' } });
|
|
|
}
|
|
|
} else {
|
|
|
- this.$msg('提交失败');
|
|
|
+ pendingMsg = '提交失败';
|
|
|
}
|
|
|
+ } else if (res.msg) {
|
|
|
+ pendingMsg = res.msg;
|
|
|
+ } else {
|
|
|
+ pendingMsg = '提交失败';
|
|
|
}
|
|
|
} catch (err) {
|
|
|
- // luch-request:code==0 等已在封装里 showToast,并 reject(response.data),此处不再重复提示
|
|
|
- if (err != null && Object.prototype.hasOwnProperty.call(err, 'code')) {
|
|
|
- return;
|
|
|
- }
|
|
|
- this.$msg('提交失败,请重试');
|
|
|
+ pendingMsg = '提交失败,请重试';
|
|
|
} finally {
|
|
|
uni.hideLoading();
|
|
|
+ if (pendingMsg) {
|
|
|
+ this.$msg(pendingMsg);
|
|
|
+ }
|
|
|
}
|
|
|
} finally {
|
|
|
this.formSubmitting = false;
|