serve.printOrder(sheetNos, type).then(res => {
const fileReader = new FileReader();
fileReader.readAsText(res, 'utf-8');
fileReader.onloadend = () => {
// 方法1:
if (res.type === 'application/json') {
const jsonData = JSON.parse(fileReader.result); // 说明是普通对象数据,后台转换失败
// 后台信息返回的报错信息
this.$message.error(jsonData.errorMsg);
} else {
const binaryData = [];
binaryData.push(res);
//获取blob链接
window.open(
window.URL.createObjectURL(new Blob(binaryData, { type: 'application/pdf' }))
);
}
};
});
网页打印预览
最新推荐文章于 2024-08-04 16:33:59 发布