feat:打印消息缓存

This commit is contained in:
houjunxiang
2025-11-25 14:36:18 +08:00
parent 44398c6004
commit 96cc747150
3 changed files with 48 additions and 13 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -91,7 +91,7 @@ function handleReturnToStock() {
}) })
if (res.isPrint == 1) { if (res.isPrint == 1) {
// 执行打印 // 执行打印
nx.$print.print(res) nx.$print.getPrintTemplateAndPrint(res.id)
} }
}) })
} }

View File

@@ -48,6 +48,7 @@
<up-button <up-button
v-if="sampleData.id" v-if="sampleData.id"
:disabled="sampleData.returnStatus !== 'completed'" :disabled="sampleData.returnStatus !== 'completed'"
:loading="btnLoading"
type="primary" type="primary"
style="width: 90%" style="width: 90%"
text="打印归库标签" text="打印归库标签"
@@ -110,8 +111,13 @@ async function getSampleDetail() {
sampleData.value = list[0] sampleData.value = list[0]
} }
} }
let btnLoading = ref(false)
function handlePrint() { function handlePrint() {
nx.$print.print(sampleData.value) btnLoading.value = true
nx.$print.getPrintTemplateAndPrint(sampleData.value.id, () => {
uni.showToast({ title: '已打印', icon: 'success' })
btnLoading.value = false
})
} }
</script> </script>