From 6c570f06c5778687290382e760c9416571988e66 Mon Sep 17 00:00:00 2001
From: aihe <961836564@qq.com>
Date: Thu, 1 Aug 2024 13:52:44 +0800
Subject: [PATCH] uu
---
.../tpx-bluetooth-print-preview.vue | 21 ++++++++++++-------
.../tpx-bluetooth-print.vue | 3 +++
pages/post/openorder.vue | 4 +---
pages/print/courierNote.vue | 19 +++++++++++------
pages/user/exclusiveQrcode.vue | 6 +++---
5 files changed, 33 insertions(+), 20 deletions(-)
diff --git a/components/tpx-bluetooth-print/tpx-bluetooth-print-preview.vue b/components/tpx-bluetooth-print/tpx-bluetooth-print-preview.vue
index 8bd33f7..0921619 100644
--- a/components/tpx-bluetooth-print/tpx-bluetooth-print-preview.vue
+++ b/components/tpx-bluetooth-print/tpx-bluetooth-print-preview.vue
@@ -4,7 +4,7 @@
v-model:show="previewModel.show"
@onClose="handleCloseModal"
custom-style="width: 600rpx;padding: 10rpx;"
- title="打印预览"
+ title="预览"
>
@@ -18,7 +18,7 @@
-
+
确认打印
@@ -37,7 +37,11 @@ import { promiseTimeout } from "@/common/untool"
export default {
props:{
-
+ showPrint: {
+ default () {
+ return false
+ }
+ },
},
computed: {
},
@@ -66,7 +70,7 @@ export default {
current:index
})
},
- async startPrint({ imageUrl } = {}) {
+ async showPreview({ imageUrl } = {}) {
this.imageUrl = [] // 每次打印前,清空历史数据
// 默认先做预览
if(imageUrl.length > 0) {
@@ -77,13 +81,14 @@ export default {
this.previewModel.show = true
}
},
- async confirmPrint(){
- if(this.imageUrl.length == 0) {
+ async confirmPrint(imgs){
+ imgs = imgs || this.imageUrl
+ if(imgs.length == 0) {
this.showToast('缺少预览内容')
} else {
- this.goto(`print/bluetoothPrinter?imageUrl=${this.imageUrl.join(",")}`)
+ this.goto(`print/bluetoothPrinter?imageUrl=${imgs.join(",")}`)
}
- }
+ },
}
}
diff --git a/components/tpx-bluetooth-print/tpx-bluetooth-print.vue b/components/tpx-bluetooth-print/tpx-bluetooth-print.vue
index f54b705..8515641 100644
--- a/components/tpx-bluetooth-print/tpx-bluetooth-print.vue
+++ b/components/tpx-bluetooth-print/tpx-bluetooth-print.vue
@@ -86,6 +86,7 @@ export default {
})
},
async startPrint({ imageUrl, paperWidth } = {}, preview = true) {
+
this.imageUrl = [] // 每次打印前,清空历史数据
this.allImgRes = []
// 默认先做预览
@@ -112,9 +113,11 @@ export default {
url = `${url}?t=${new Date().valueOf()}`
return this.$refs[`curCanvas${index}`][0].renderCanvasImg(url, this.paperWidth)
})
+ this.showLoading()
return Promise.all(allRes).then((imgsRes)=> {
that.allImgRes = imgsRes
console.log("setAllImgRes len======", imgsRes.length)
+ that.hideLoading()
return imgsRes
})
},
diff --git a/pages/post/openorder.vue b/pages/post/openorder.vue
index b41c198..6ab6aa6 100644
--- a/pages/post/openorder.vue
+++ b/pages/post/openorder.vue
@@ -526,9 +526,7 @@
}
let prtRes = await apiService.getRealGetWaybillPrintData({ ...param, _loading: true })
let imgUrls = prtRes?.data?.map(t=> t.imageUrl) || []
- this.$refs.curPrint.startPrint({
- imageUrl: imgUrls.filter(v=> !!v),
- })
+ this.$refs.curPrint.confirmPrint(imgUrls.filter(v=> !!v))
this.resetForm()
},
async saveSuccessBack(){
diff --git a/pages/print/courierNote.vue b/pages/print/courierNote.vue
index e05ac11..40d10e2 100644
--- a/pages/print/courierNote.vue
+++ b/pages/print/courierNote.vue
@@ -38,6 +38,9 @@
打印配置
+
+ 预览
+
注意:当打印出来寄件分拨或未端分拨返回为空时,请等待5分钟后再补 打印
@@ -118,7 +121,7 @@
- 打印
@@ -211,11 +214,9 @@
handleSearch(){
this.triggerListReload()
},
- async handleSubmit() {
+ async handleSubmitPrint() {
const imgUrls = await this.getPrintImages()
- this.$refs.curPrint.startPrint({
- imageUrl: imgUrls.filter(v=> !!v),
- })
+ this.$refs.curPrint.confirmPrint(imgUrls.filter(v=> !!v))
},
handleSelAll() {
if(this.submitParam.billCode.length == this.resData.list.length) {
@@ -238,7 +239,13 @@
let res = await this.getRealGetWaybillPrintData()
const imgUrls = res?.data?.map(t=> t.imageUrl) || []
return imgUrls
- }
+ },
+ async handlePreview(){
+ const imgUrls = await this.getPrintImages()
+ this.$refs.curPrint.showPreview({
+ imageUrl: imgUrls.filter(v=> !!v)
+ })
+ },
}
}
diff --git a/pages/user/exclusiveQrcode.vue b/pages/user/exclusiveQrcode.vue
index a5411b5..650bcbf 100644
--- a/pages/user/exclusiveQrcode.vue
+++ b/pages/user/exclusiveQrcode.vue
@@ -23,12 +23,12 @@
-
+
保存到本地
-
+