dev
张同海 2 years ago
parent 2fe9eae8b4
commit b4fef96dc1

@ -925,6 +925,8 @@ export default {
sendBookingOrEDI(type) {
SendBookingOrClosingEDI(this.bookingModelFrom)
.then(res => {
this.EDISloading = false
this.EDIUloading = false
//
if (res.success) {
this.$message.success('发送成功')
@ -932,8 +934,6 @@ export default {
} else {
this.$message.error(res.message)
}
this.EDISloading = false
this.EDIUloading = false
})
.catch(() => {
this.EDISloading = false
@ -943,20 +943,21 @@ export default {
downloadBookingOrEDI(type) {
DownloadBookingOrClosingEDI(this.bookingModelFrom)
.then(res => {
this.EDISloading = false
this.EDIUloading = false
if (res.message) {
this.$message.error(res.message)
return false
} else {
const pdfUrl = window.URL.createObjectURL(new Blob([res], { type: 'text/plain;charset=utf-8' }))
const fname = `${this.details.mblno} - ${this.modelType === 'bookingSpace' ? '订舱' : '截单'}Edi` //
const link = document.createElement('a')
link.href = pdfUrl
link.setAttribute('download', fname)
document.body.appendChild(link)
link.click()
this.handleModelCancel()
}
const pdfUrl = window.URL.createObjectURL(new Blob([res], { type: 'text/plain;charset=utf-8' }))
const fname = `${this.details.mblno} - ${this.modelType === 'bookingSpace' ? '订舱' : '截单'}Edi` //
const link = document.createElement('a')
link.href = pdfUrl
link.setAttribute('download', fname)
document.body.appendChild(link)
link.click()
this.handleModelCancel()
this.EDISloading = false
this.EDIUloading = false
})
.catch(() => {
this.EDISloading = false
@ -966,6 +967,8 @@ export default {
handleModelCancel() {
this.modelType = ''
this.bookingModelvisible = false
this.EDISloading = false
this.EDIUloading = false
this.bookingModelFrom = {
id: this.$route.query.id,
orderNo: this.details.mblno,

Loading…
Cancel
Save