Browse Source

修复报检单作废失败的问题

master
李磊 3 years ago
parent
commit
0c68a494bf
  1. 9
      src/utils/api.js
  2. 51
      src/utils/apibjd.js
  3. 11
      src/views/bjd/dj_list.vue
  4. 15
      src/views/bjd/dt_list.vue
  5. 11
      src/views/bjd/jj_list.vue
  6. 15
      src/views/bjd/qy_list.vue

9
src/utils/api.js

@ -29,16 +29,7 @@ service.interceptors.response.use(
hideLoading() hideLoading()
const res = response.data const res = response.data
if (res.code === 1) { if (res.code === 1) {
if (res.data !== null) {
if (res.data.returnData !== undefined && JSON.stringify(res.data.returnData) !== '{}') {
return res.data.returnData
} else {
return res.data return res.data
}
}
return null
} else if (res.returnCode === 1) {
return res.returnData
} else if (res.code === 20001) { } else if (res.code === 20001) {
Notification({ Notification({
showClose: true, showClose: true,

51
src/utils/apibjd.js

@ -1,6 +1,5 @@
import axios from 'axios' import axios from 'axios'
import { Notification } from 'element-ui' import { Notification } from 'element-ui'
import store from '../store'
import { showLoading, hideLoading } from './apiHelper' import { showLoading, hideLoading } from './apiHelper'
// 创建axios实例 // 创建axios实例
const service = axios.create({ const service = axios.create({
@ -27,55 +26,8 @@ service.interceptors.response.use(
response => { response => {
hideLoading() hideLoading()
const res = response.data const res = response.data
if (res.returnCode === '1000') {
return res
}
if (res.code === 1) { if (res.code === 1) {
if (res.data !== null) {
if (res.data.returnCode) {
if (res.data.returnCode === 1) {
return res.data.returnData
} else if (res.data.returnCode === '20011') {
Notification({
showClose: true,
message: res.returnMsg,
type: 'error',
duration: 500,
onClose: () => {
store.dispatch('FedLogOut').then(() => {
location.reload()// 为了重新实例化vue-router对象 避免bug
})
}
})
return Promise.reject('未登录')
} else {
Notification({
message: res.data.returnMsg || '请求处理异常,请稍后再试',
type: 'error',
duration: 3 * 1000
})
return Promise.reject(res)
}
} else {
return res.data return res.data
}
}
return null
} if (res.returnCode === 1) {
return res.returnData
} else if (res.returnCode === '20011') {
Notification({
showClose: true,
message: res.returnMsg,
type: 'error',
duration: 500,
onClose: () => {
store.dispatch('FedLogOut').then(() => {
location.reload()// 为了重新实例化vue-router对象 避免bug
})
}
})
return Promise.reject('未登录')
} else { } else {
let msg = '' let msg = ''
if (res.message) { if (res.message) {
@ -85,9 +37,6 @@ service.interceptors.response.use(
} else { } else {
msg = res.returnMsg msg = res.returnMsg
} }
if (res.data && res.data.constructor === String) {
msg = msg ? msg + ':' + res.data : res.data
}
Notification({ Notification({
message: msg, message: msg,
type: 'error', type: 'error',

11
src/views/bjd/dj_list.vue

@ -418,16 +418,7 @@ export default {
return qs.stringify(params, { indices: false }) return qs.stringify(params, { indices: false })
} }
}).then((data) => { }).then((data) => {
this.$message({ this.$notify.success('操作成功!')
message:
(data.bianhao !== null && data.bianhao !== undefined
? '流水号为' +
data.bianhao +
'的项目关联的任务已经分配不能作废!'
: '') +
(data.count === 0 ? '' : data.count + '条项目作废成功'),
type: 'info'
})
this.getList() this.getList()
}) })
}) })

15
src/views/bjd/dt_list.vue

@ -272,16 +272,7 @@ export default {
return qs.stringify(params, { indices: false }) return qs.stringify(params, { indices: false })
} }
}).then((data) => { }).then((data) => {
this.$message({ this.$notify.success('操作成功!')
message:
(data.bianhao !== null && data.bianhao !== undefined
? '流水号为' +
data.bianhao +
'的项目关联的任务已经分配不能作废!'
: '') +
(data.count === 0 ? '' : data.count + '条项目作废成功'),
type: 'info'
})
this.getList() this.getList()
}) })
}) })
@ -357,7 +348,7 @@ export default {
editBjd($index) { editBjd($index) {
const bjd = this.list[$index] const bjd = this.list[$index]
let type = '/update' let type = '/update'
if (bjd.bjState === '2') { if (bjd.bjState === 2) {
type = '/finish' type = '/finish'
} }
if (bjd.jianyanleibie === 'DJ') { if (bjd.jianyanleibie === 'DJ') {
@ -466,7 +457,7 @@ export default {
this.$message({ message: '只允许单台报检单收回', type: 'error' }) this.$message({ message: '只允许单台报检单收回', type: 'error' })
return false return false
} }
if (this.multipleSelection[0].bjState !== '2') { if (this.multipleSelection[0].bjState !== 2) {
this.$message({ message: '非审核通过数据不允许异常收回!', type: 'error' }) this.$message({ message: '非审核通过数据不允许异常收回!', type: 'error' })
return false return false
} }

11
src/views/bjd/jj_list.vue

@ -330,16 +330,7 @@ export default {
return qs.stringify(params, { indices: false }) return qs.stringify(params, { indices: false })
} }
}).then((data) => { }).then((data) => {
this.$message({ this.$notify.success('操作成功!')
message:
(data.bianhao !== null && data.bianhao !== undefined
? '流水号为' +
data.bianhao +
'的项目关联的任务已经分配不能作废!'
: '') +
(data.count === 0 ? '' : data.count + '条项目作废成功'),
type: 'info'
})
this.getList() this.getList()
}) })
}) })

15
src/views/bjd/qy_list.vue

@ -250,17 +250,8 @@ export default {
paramsSerializer: function(params) { paramsSerializer: function(params) {
return qs.stringify(params, { indices: false }) return qs.stringify(params, { indices: false })
} }
}).then((data) => { }).then(() => {
this.$message({ this.$notify.success('操作成功!')
message:
(data.bianhao !== null && data.bianhao !== undefined
? '流水号为' +
data.bianhao +
'的项目关联的任务已经分配不能作废!'
: '') +
(data.count === 0 ? '' : data.count + '条项目作废成功'),
type: 'info'
})
this.getList() this.getList()
}) })
}) })
@ -385,7 +376,7 @@ export default {
this.$message({ message: '只允许单台报检单收回', type: 'error' }) this.$message({ message: '只允许单台报检单收回', type: 'error' })
return false return false
} }
if (this.multipleSelection[0].bjState !== '2') { if (this.multipleSelection[0].bjState !== 2) {
this.$message({ message: '非审核通过数据不允许异常收回!', type: 'error' }) this.$message({ message: '非审核通过数据不允许异常收回!', type: 'error' })
return false return false
} }

Loading…
Cancel
Save