|
@@ -229,6 +229,7 @@ export default class PrintTemplate extends Vue {
|
|
|
return
|
|
|
}
|
|
|
this.load=true;
|
|
|
+ const that:any = this;
|
|
|
preview({
|
|
|
templateEngine:data.templateEngine,
|
|
|
templateHtml:data.templateHtml,
|
|
@@ -236,7 +237,20 @@ export default class PrintTemplate extends Vue {
|
|
|
outType:'PDF'
|
|
|
}).then((res:any) => {
|
|
|
this.load=false;
|
|
|
-
|
|
|
+ if(res.type === 'application/json'){
|
|
|
+ const reader:any = new FileReader();
|
|
|
+ reader.onload = function (){
|
|
|
+ const d:any = JSON.parse(reader.result);
|
|
|
+ if(d && d.msg){
|
|
|
+ that.$message({
|
|
|
+ message:d.msg,
|
|
|
+ type:'error'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ reader.readAsText(res);
|
|
|
+ return
|
|
|
+ }
|
|
|
const blob = new Blob([res],{
|
|
|
type: "application/pdf;chartset=UTF-8"
|
|
|
})
|