|
@@ -120,21 +120,9 @@ export default {
|
|
|
template: layout,
|
|
template: layout,
|
|
|
})
|
|
})
|
|
|
this.hiprintTemplate=hiprintTemplate
|
|
this.hiprintTemplate=hiprintTemplate
|
|
|
- // hiprintTemplate.toPdf(printData,'单据打印',{isDownload:false,type:'datauristring'}).then(dataURL=>{
|
|
|
|
|
- // let pdf = this.dataURLtoFile(dataURL, "pdf");
|
|
|
|
|
- // let formData = new FormData();
|
|
|
|
|
- // formData.append('file', pdf);
|
|
|
|
|
- // this.excute(this.$service.fileService, `upload?folder=pdf&uuid=${this.$route.query.uuid}`,formData).then(res => {
|
|
|
|
|
- // if (res.code === this.$config.SUCCESS_CODE) {
|
|
|
|
|
- // console.log('upload-res',res)
|
|
|
|
|
- // }
|
|
|
|
|
- // })
|
|
|
|
|
- // })
|
|
|
|
|
-
|
|
|
|
|
- //Blob
|
|
|
|
|
- hiprintTemplate.toPdf(printData,'单据打印',{isDownload:false,type:''}).then(blob=>{
|
|
|
|
|
- this.blob=blob
|
|
|
|
|
- let pdf =this.blobToFile(blob, 'blob.pdf')
|
|
|
|
|
|
|
+ hiprintTemplate.toPdf(printData,'单据打印',{isDownload:false,type:'datauristring'}).then(dataURL=>{
|
|
|
|
|
+ this.blob=dataURL
|
|
|
|
|
+ let pdf = this.dataURLtoFile(dataURL, "pdf");
|
|
|
this.pdf=pdf
|
|
this.pdf=pdf
|
|
|
let formData = new FormData();
|
|
let formData = new FormData();
|
|
|
formData.append('file', pdf);
|
|
formData.append('file', pdf);
|
|
@@ -144,9 +132,26 @@ export default {
|
|
|
console.log('upload-res',res)
|
|
console.log('upload-res',res)
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
- }).catch(err => {
|
|
|
|
|
- this.err=err
|
|
|
|
|
})
|
|
})
|
|
|
|
|
+ // setTimeout(function () {
|
|
|
|
|
+ // //Blob
|
|
|
|
|
+ // hiprintTemplate.toPdf(printData,'单据打印',{isDownload:false,type:''}).then(blob=>{
|
|
|
|
|
+ // this.blob=blob
|
|
|
|
|
+ // let pdf =this.blobToFile(blob, 'blob.pdf')
|
|
|
|
|
+ // this.pdf=pdf
|
|
|
|
|
+ // let formData = new FormData();
|
|
|
|
|
+ // formData.append('file', pdf);
|
|
|
|
|
+ // this.excute(this.$service.fileService, `upload?folder=pdf&uuid=${this.$route.query.uuid}`,formData).then(res => {
|
|
|
|
|
+ // this.uploadRes=res
|
|
|
|
|
+ // if (res.code === this.$config.SUCCESS_CODE) {
|
|
|
|
|
+ // console.log('upload-res',res)
|
|
|
|
|
+ // }
|
|
|
|
|
+ // })
|
|
|
|
|
+ // }).catch(err => {
|
|
|
|
|
+ // this.err=err
|
|
|
|
|
+ // })
|
|
|
|
|
+ // }, 1000)
|
|
|
|
|
+
|
|
|
}else {
|
|
}else {
|
|
|
this.$Message.warning(this.$t('W_006'))
|
|
this.$Message.warning(this.$t('W_006'))
|
|
|
}
|
|
}
|