diff --git a/klp-ui/public/websocket-test.html b/klp-ui/public/websocket-test.html deleted file mode 100644 index 9b0c42b0..00000000 --- a/klp-ui/public/websocket-test.html +++ /dev/null @@ -1,558 +0,0 @@ - - - - - - WebSocket测试界面 - - - - - -
-
- -
- -

WebSocket实时通信测试

- -
-
- - -
- -
- - - - -
- -
-
- - -
-
- -
-
- -
-
- - -
-
- - -
-
- - -
-
- -
- 未连接 -
-
- -
-
- - -
- -
- -
-
- -
- -
-
-
- - - - \ No newline at end of file diff --git a/klp-ui/src/views/wms/delivery/components/wayBill.vue b/klp-ui/src/views/wms/delivery/components/wayBill.vue index 6204f51b..4fbf4652 100644 --- a/klp-ui/src/views/wms/delivery/components/wayBill.vue +++ b/klp-ui/src/views/wms/delivery/components/wayBill.vue @@ -83,10 +83,7 @@
-

1、品名:冷硬钢卷(酸连轧)、冷轧钢卷(脱脂退火火拉矫)、镀锌卷板,镀锌管料(镀锌分剪料);2、切边:净边/毛边;3、包装:

-

- 裸包:周三径四;简包1:周三径四内外护角;简包2:周三径四+防锈纸;普包:周三径四+内外护角+防锈纸+端护板;精包1:周三径四+内外护角+防锈纸+薄膜+端护板+内外护板;精包2:周三径四+内外护角+防锈纸+薄膜+端护板+内外护板+木托。 -

+

1、品名:冷硬钢卷(酸连轧)、冷轧钢卷(脱脂退火火拉矫)、镀锌卷板,镀锌管料(镀锌分剪料);2、切边:净边/毛边;3、包装:裸包:周三径四;简包1:周三径四内外护角;简包2:周三径四+防锈纸;普包:周三径四+内外护角+防锈纸+端护板;精包1:周三径四+内外护角+防锈纸+薄膜+端护板+内外护板;精包2:周三径四+内外护角+防锈纸+薄膜+端护板+内外护板+木托。

@@ -221,7 +218,27 @@ export default { // 保存为图片 saveAsImage() { const node = this.$refs.waybillRef; - domtoimage.toPng(node) + // 确保容器在保存图片时能完整显示所有内容 + const originalWidth = node.style.width; + const originalOverflow = node.style.overflow; + + // 临时调整容器样式,确保所有内容可见 + node.style.width = 'auto'; + node.style.overflow = 'visible'; + + // 获取实际内容宽度 + const contentWidth = node.scrollWidth; + const contentHeight = node.scrollHeight; + + domtoimage.toPng(node, { + width: contentWidth, + height: contentHeight, + style: { + width: `${contentWidth}px`, + height: `${contentHeight}px`, + overflow: 'visible' + } + }) .then(dataUrl => { const link = document.createElement('a'); link.download = `发货单_${this.waybill.waybillName || this.waybill.waybillNo || Date.now()}.png`; @@ -231,18 +248,45 @@ export default { .catch(error => { console.error('保存图片失败:', error); this.$message.error('保存图片失败'); + }) + .finally(() => { + // 恢复原始样式 + node.style.width = originalWidth; + node.style.overflow = originalOverflow; }); }, // 打印发货单 printWaybill() { const node = this.$refs.waybillRef; + // 确保容器在打印时能完整显示所有内容 + const originalWidth = node.style.width; + const originalOverflow = node.style.overflow; + + // 临时调整容器样式,确保所有内容可见 + node.style.width = 'auto'; + node.style.overflow = 'visible'; + + // 获取实际内容宽度 + const contentWidth = node.scrollWidth; + printJS({ printable: node, - maxWidth: 1200, + maxWidth: contentWidth, type: 'html', scanStyles: true, + style: ` + @page { size: A4 landscape; margin: 1cm; } + .waybill-container { width: 100%; max-width: none; overflow: visible; } + .waybill-table { width: 100%; table-layout: auto; } + `, targetStyles: ['*'] }); + + // 恢复原始样式 + setTimeout(() => { + node.style.width = originalWidth; + node.style.overflow = originalOverflow; + }, 100); } } } @@ -250,15 +294,16 @@ export default {