|
|
@@ -120,37 +120,37 @@ export default {
|
|
|
template: layout,
|
|
|
})
|
|
|
this.hiprintTemplate=hiprintTemplate
|
|
|
- hiprintTemplate.toPdf(printData,'单据打印',{isDownload:false,type:'datauristring'}).then(dataURL=>{
|
|
|
- this.blob=dataURL
|
|
|
- let pdf = this.dataURLtoFile(dataURL, "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)
|
|
|
- }
|
|
|
- })
|
|
|
- })
|
|
|
- // 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
|
|
|
+ // hiprintTemplate.toPdf(printData,'单据打印',{isDownload:false,type:'datauristring'}).then(dataURL=>{
|
|
|
+ // this.blob=dataURL
|
|
|
+ // let pdf = this.dataURLtoFile(dataURL, "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)
|
|
|
+ // }
|
|
|
// })
|
|
|
- // }, 1000)
|
|
|
+ // })
|
|
|
+ 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 {
|
|
|
this.$Message.warning(this.$t('W_006'))
|