|
@@ -95,6 +95,7 @@ service.interceptors.request.use(config => {
|
|
|
|
|
|
// response interceptor
|
|
|
service.interceptors.response.use((response) => {
|
|
|
+ console.log(response)
|
|
|
const et = sessionStorage.getItem('errorTips')
|
|
|
// 无权限或登录超时
|
|
|
if ((response.data.status == '1001' || response.data.status == '1099') && !et) {
|
|
@@ -113,14 +114,27 @@ service.interceptors.response.use((response) => {
|
|
|
}
|
|
|
})
|
|
|
} else if (response.data.status != 200 && response.data.status && response.data.errCode != 'VALIDATE_STOCK_LACK') {
|
|
|
- // 其它业务错误提示
|
|
|
- notification.destroy()
|
|
|
- notification.error({
|
|
|
- message: '提示',
|
|
|
- description: response.data.message
|
|
|
- })
|
|
|
+ // 单据不存在
|
|
|
+ if(response.data.message.indexOf('不存在')>=0){
|
|
|
+ modal.destroyAll()
|
|
|
+ modal.error({
|
|
|
+ title: '提示',
|
|
|
+ content: response.data.message,
|
|
|
+ onOk () {
|
|
|
+ window.history.go(-1)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ // 其它业务错误提示
|
|
|
+ notification.destroy()
|
|
|
+ notification.error({
|
|
|
+ message: '提示',
|
|
|
+ description: response.data.message
|
|
|
+ })
|
|
|
+ }
|
|
|
+ store.commit('SET_loadingStatus', false)
|
|
|
}
|
|
|
- // store.commit('SET_loadingStatus', false)
|
|
|
+
|
|
|
return response.data
|
|
|
}, err)
|
|
|
|