Browse Source

采购收货指引单readFile报错

hella_online_20240906
zhang_li 3 months ago
parent
commit
fc47f7b681
  1. 14
      src/pages/pointPutawayJob/index.vue

14
src/pages/pointPutawayJob/index.vue

@ -138,17 +138,19 @@
}, },
methods: { methods: {
// #ifdef APP
// //
printImage() { printImage() {
// #ifdef APP
if (this.tabIndex == 1) { if (this.tabIndex == 1) {
testModule.doHTMLPrint(this.newHtmlContent1) testModule.doHTMLPrint(this.newHtmlContent1)
} else { } else {
testModule.doHTMLPrint(this.newHtmlContent) testModule.doHTMLPrint(this.newHtmlContent)
} }
// #endif
}, },
// html // html
readFile(path, callback) { readFile(path, callback) {
// #ifdef APP
plus.io.resolveLocalFileSystemURL(path, function(entry) { plus.io.resolveLocalFileSystemURL(path, function(entry) {
entry.file(function(file) { entry.file(function(file) {
var reader = new plus.io.FileReader(); var reader = new plus.io.FileReader();
@ -162,8 +164,8 @@
}, function(e) { }, function(e) {
console.log("获取图片资源失败:" + e.message); console.log("获取图片资源失败:" + e.message);
}); });
},
// #endif // #endif
},
formatDate(val) { formatDate(val) {
return dateFormat(val) return dateFormat(val)
}, },
@ -171,6 +173,7 @@
getPointPutawayJobHtml() { getPointPutawayJobHtml() {
this.$nextTick(async () => { this.$nextTick(async () => {
let str = '' let str = ''
// #ifdef APP-PLUS
this.readFile(htmlFileUrl, (htmlContent) => { this.readFile(htmlFileUrl, (htmlContent) => {
this.newHtmlContent = htmlContent this.newHtmlContent = htmlContent
this.data.sublist.forEach(item => { this.data.sublist.forEach(item => {
@ -200,13 +203,14 @@
this.newHtmlContent = this.newHtmlContent.replace( this.newHtmlContent = this.newHtmlContent.replace(
"mainBody", str); // "mainBody", str); //
}); });
// #endif
}) })
}, },
// html // html
getPurchaseReceiptJobHtml() { getPurchaseReceiptJobHtml() {
this.$nextTick(async () => { this.$nextTick(async () => {
let str = '' let str = ''
// #ifdef APP-PLUS
this.readFile(htmlFileUrl1, (htmlContent) => { this.readFile(htmlFileUrl1, (htmlContent) => {
this.newHtmlContent1 = htmlContent this.newHtmlContent1 = htmlContent
this.data1.inspectDTOList.forEach(item => { this.data1.inspectDTOList.forEach(item => {
@ -272,7 +276,7 @@
"mainBody", str); // "mainBody", str); //
console.log(333, this.newHtmlContent1) console.log(333, this.newHtmlContent1)
}); });
// #endif
}) })
}, },
getTableSubList() { getTableSubList() {
@ -435,6 +439,7 @@
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
.mb-kw { .mb-kw {
border-bottom: 1px solid #dedede; border-bottom: 1px solid #dedede;
padding: 20rpx; padding: 20rpx;
@ -489,5 +494,4 @@
text-align: center; text-align: center;
width: 100%; width: 100%;
} }
</style> </style>
Loading…
Cancel
Save