|
@@ -284,11 +284,24 @@ export default {
|
|
},
|
|
},
|
|
// 导出
|
|
// 导出
|
|
handleExport () {
|
|
handleExport () {
|
|
|
|
+ const _this = this
|
|
const params = this.queryParam
|
|
const params = this.queryParam
|
|
this.exportLoading = true
|
|
this.exportLoading = true
|
|
sparePartsPurExport(params).then(res => {
|
|
sparePartsPurExport(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) {
|