|
@@ -224,18 +224,24 @@ export default {
|
|
},
|
|
},
|
|
// 导出
|
|
// 导出
|
|
handleExport () {
|
|
handleExport () {
|
|
|
|
+ const _this = this
|
|
const params = this.queryParam
|
|
const params = this.queryParam
|
|
- if (this.time && this.time.length) {
|
|
|
|
- params.beginDate = moment(this.time[0]).format('YYYY-MM-DD')
|
|
|
|
- params.endDate = moment(this.time[1]).format('YYYY-MM-DD')
|
|
|
|
- } else {
|
|
|
|
- params.beginDate = ''
|
|
|
|
- params.endDate = ''
|
|
|
|
- }
|
|
|
|
this.exportLoading = true
|
|
this.exportLoading = true
|
|
oosDetailExport(params).then(res => {
|
|
oosDetailExport(params).then(res => {
|
|
this.exportLoading = false
|
|
this.exportLoading = false
|
|
- this.download(res)
|
|
|
|
|
|
+ if (res.type == 'application/json') {
|
|
|
|
+ var reader = new FileReader()
|
|
|
|
+ reader.addEventListener('loadend', function () {
|
|
|
|
+ const obj = JSON.parse(reader.result)
|
|
|
|
+ _this.$notification.error({
|
|
|
|
+ message: '提示',
|
|
|
|
+ description: obj.message
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ reader.readAsText(res)
|
|
|
|
+ } else {
|
|
|
|
+ this.download(res)
|
|
|
|
+ }
|
|
})
|
|
})
|
|
},
|
|
},
|
|
download (data) {
|
|
download (data) {
|