From 4bc0e18b94a2bf17c1b7277910d63ef82fbe616a Mon Sep 17 00:00:00 2001 From: wangxinhui <wangxinhui@hnkhzn.com> Date: 星期五, 10 一月 2025 09:39:51 +0800 Subject: [PATCH] Merge branch 'master' of http://115.159.85.185:8098/r/MeiRuiAn/HuaiAn --- 代码管理/WMS/WIDESEA_WMSClient/src/extension/basic/extend/printView.vue | 122 ++++++++++++++++++++++++++++++++++++++++ 1 files changed, 122 insertions(+), 0 deletions(-) diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/extension/basic/extend/printView.vue" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/extension/basic/extend/printView.vue" new file mode 100644 index 0000000..5b7a400 --- /dev/null +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/extension/basic/extend/printView.vue" @@ -0,0 +1,122 @@ +<template> + <div> + <vol-box + v-model="showDetialBox" + :lazy="true" + width="300px" + :padding="15" + title="鎵撳嵃" + > + <div + id="printContent" + style="display: flex; justify-content: center; align-items: center" + > + <div + style="display: flex; justify-content: center; align-items: center" + > + <VueQrcode id="qrcode" :value="palletCode" :size="200"></VueQrcode> + </div> + </div> + <div id="palletcode"> + <span + style="display: flex; justify-content: center; align-items: center" + >{{ palletCode }}</span + > + </div> + + <template #footer> + <el-button type="primary" size="small" @click="print()">鎵撳嵃</el-button> + <el-button type="danger" size="small" @click="showDetialBox = false" + >鍏抽棴</el-button + > + </template> + </vol-box> + </div> +</template> + + <script> +import VolBox from "@/components/basic/VolBox.vue"; +import VueQrcode from "vue-qrcode"; +import QRCode from "qrcode"; +export default { + components: { VolBox, VueQrcode }, + data() { + return { + showDetialBox: false, + row: null, + qrcodeDataURL: "", + palletCode: "", + }; + }, + methods: { + open(row) { + this.row = row; + this.showDetialBox = true; + if (row && row.palletCode) { + this.palletCode = row.palletCode; + } + }, + print() { + let printContent = document.getElementById("printContent"); + let palletcode=document.getElementById("palletcode"); + var printWindow = window.open("", ""); + printWindow.document.write(printContent.innerHTML); + printWindow.document.write(palletcode.innerHTML); + printWindow.document.close(); + printWindow.focus(); + printWindow.print(); + printWindow.close(); + this.http + .post("api/palletCodeInfo/PrintStatusUp?printCode="+this.palletCode, null, "鏁版嵁澶勭悊涓�") + .then((x) => { + if (!x.status) return this.$message.error(x.message); + this.$message.success("鎿嶄綔鎴愬姛"); + this.$parent.refresh(); + this.showDetialBox = false; + }); + }, + }, + created() {}, +}; +</script> + + <style scoped> +.el-col { + border-radius: 4px; +} + +.grid-content { + border-radius: 4px; + min-height: 36px; +} + +.content-text { + display: flex; + align-items: center; + justify-content: center; +} + +.right-text { + display: flex; + align-items: center; + justify-content: flex-end; +} +</style> + <style> +.el-table .warning-row { + background: #e6a23c; +} + +.el-table .success-row { + background: #f0f9eb; +} + +.el-table .error-row { + background: #f56c6c; +} + +canvas { + display: block; + margin: auto; +} +</style> \ No newline at end of file -- Gitblit v1.9.3