Browse Source

完善维修单(结算)

master
yunuo970428 1 month ago
parent
commit
012b2dc41b
  1. 54
      yxt-as-ui/src/views/operation/repairbill/repairbillBySettleAccounts.vue

54
yxt-as-ui/src/views/operation/repairbill/repairbillBySettleAccounts.vue

@ -421,33 +421,33 @@ export default {
getOrgSidByPath({ orgPath: window.sessionStorage.getItem('defaultOrgPath') }).then((res) => {
if (res.success) {
this.temp.createOrgSid = res.data
}
})
this.temp.sid = this.sids[0]
this.temp.useOrgSid = window.sessionStorage.getItem('defaultOrgPath').substring(window.sessionStorage.getItem('defaultOrgPath').lastIndexOf('/') + 1)
this.temp.userSid = window.sessionStorage.getItem('userSid')
req.printSettlement(this.temp).then((res) => {
if (res.success) {
var xhr = new XMLHttpRequest()
xhr.open('GET', process.env.VUE_APP_BASE_API + '/base/file/download?filePath=' + res.data + '&outFileName=' + '结算单', true)
xhr.setRequestHeader('token', getStorage())
xhr.responseType = 'blob'
xhr.onload = function(e) {
//
var blob = this.response
var filename = '结算单.pdf'
var a = document.createElement('a')
// blob.type="application/octet-stream";
// url
var url = URL.createObjectURL(blob)
a.href = url
a.download = filename
a.click()
// URL
window.URL.revokeObjectURL(url)
}
//
xhr.send()
this.temp.sid = this.sids[0]
this.temp.useOrgSid = window.sessionStorage.getItem('defaultOrgPath').substring(window.sessionStorage.getItem('defaultOrgPath').lastIndexOf('/') + 1)
this.temp.userSid = window.sessionStorage.getItem('userSid')
req.printSettlement(this.temp).then((res) => {
if (res.success) {
var xhr = new XMLHttpRequest()
xhr.open('GET', process.env.VUE_APP_BASE_API + '/base/file/download?filePath=' + res.data + '&outFileName=' + '结算单', true)
xhr.setRequestHeader('token', getStorage())
xhr.responseType = 'blob'
xhr.onload = function(e) {
//
var blob = this.response
var filename = '结算单.pdf'
var a = document.createElement('a')
// blob.type="application/octet-stream";
// url
var url = URL.createObjectURL(blob)
a.href = url
a.download = filename
a.click()
// URL
window.URL.revokeObjectURL(url)
}
//
xhr.send()
}
})
}
})
},

Loading…
Cancel
Save