- ${item.code}
+ ${item.code}
- 名称:
- ${item.name}
+ 名 称:
+ ${item.name}
- 数量: ${item.amount}
+ 数 量:${item.amount}
${formattedDate}
@@ -103,9 +103,9 @@ const open = async ( vals) => {
`)
if(printCodeName.value.length > 1 && i < printCodeName.value.length - 1){
- qrCodeElement.innerHTML +=
+ qrCodeElement.innerHTML +=
`
-
+
`
}
}
@@ -123,11 +123,11 @@ defineExpose({ open })
min-height: 60mm;
margin: auto;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
- background-color: black;
- color: white;
+ background-color: white;
+ color: black;
padding: 2mm;
box-sizing: border-box;
-
+
/* 临时隐藏下划线,打印时会显示 */
.code-line span, .name-underline {
display: none;
@@ -137,9 +137,9 @@ defineExpose({ open })
/* 确保打印样式优先 */
@media print {
.page {
- background-color: black !important;
- color: white !important;
-
+ background-color: white !important;
+ color: black !important;
+
.code-line span, .name-underline {
display: inline-block;
}
diff --git a/mes-ui/mes-ui-admin-vue3/src/views/heli/plan/printFinalDialog.vue b/mes-ui/mes-ui-admin-vue3/src/views/heli/plan/printFinalDialog.vue
index 67c6f2d9..c93f7cf1 100644
--- a/mes-ui/mes-ui-admin-vue3/src/views/heli/plan/printFinalDialog.vue
+++ b/mes-ui/mes-ui-admin-vue3/src/views/heli/plan/printFinalDialog.vue
@@ -31,14 +31,14 @@ const endPageNum = ref(0);
const onPrint = () => {
const printNode = document.querySelector('.print-wrap1')
if (!printNode) return
-
+
const newIframe: any = document.createElement('iframe')
newIframe.setAttribute(
'style',
'width:0px;height:0px;position:absolute;left:-9999px;top:-9999px;'
)
document.body.appendChild(newIframe)
-
+
const doc = newIframe.contentWindow.document
// 添加基础样式
doc.write(`
@@ -47,38 +47,46 @@ const onPrint = () => {
@@ -167,7 +176,7 @@ const open = async ( vals) => {
console.log(vals)
datavals.value = []
printCodeName.value = []
-
+
vals.forEach((item) => {
const row1 = {
@@ -185,7 +194,7 @@ const open = async ( vals) => {
await Promise.all(
printCodeName.value.map(async (item) => {
const qrCodeData = await QRCode.toDataURL(item.name,{
- errorCorrectionLevel: 'H'
+ errorCorrectionLevel: 'H'
})
const qrCodeElement = document.getElementById('qrCodeContainer1')
if (qrCodeElement) {
@@ -195,12 +204,12 @@ const open = async ( vals) => {
${item.code}
- 数量: ${item.amount}
+ 数 量:${item.amount}
${formattedDate}
@@ -221,15 +230,15 @@ defineExpose({ open })
\ No newline at end of file
+
diff --git a/mes-ui/mes-ui-admin-vue3/src/views/heli/processdesign/printDialog.vue b/mes-ui/mes-ui-admin-vue3/src/views/heli/processdesign/printDialog.vue
index 562da8c8..f10a73aa 100644
--- a/mes-ui/mes-ui-admin-vue3/src/views/heli/processdesign/printDialog.vue
+++ b/mes-ui/mes-ui-admin-vue3/src/views/heli/processdesign/printDialog.vue
@@ -108,15 +108,15 @@ const open = async (bomCode, vals) => {
(qrCodeElement.innerHTML +=
`
- ${item.code}
+ ${item.code}
- 名称:
+ 名 称:
${item.name}
- 数量: ${item.amount}
+ 数 量:${item.amount}
${formattedDate}
diff --git a/mes-ui/mes-ui-admin-vue3/src/views/heli/processdesign/printFinalDialog.vue b/mes-ui/mes-ui-admin-vue3/src/views/heli/processdesign/printFinalDialog.vue
index c3d87750..497767be 100644
--- a/mes-ui/mes-ui-admin-vue3/src/views/heli/processdesign/printFinalDialog.vue
+++ b/mes-ui/mes-ui-admin-vue3/src/views/heli/processdesign/printFinalDialog.vue
@@ -27,20 +27,15 @@ const dialogVisible = ref(false)
let clauseId = null;
const startPageNum = ref(0);
const endPageNum = ref(0);
-
const onPrint = () => {
- const printNode = document.querySelector('.print-wrap1')
- if (!printNode) return
+ const printNode = document.querySelector('.print-wrap1');
+ if (!printNode) return;
- const newIframe: any = document.createElement('iframe')
- newIframe.setAttribute(
- 'style',
- 'width:0px;height:0px;position:absolute;left:-9999px;top:-9999px;'
- )
- document.body.appendChild(newIframe)
+ const newIframe: any = document.createElement('iframe');
+ newIframe.setAttribute('style', 'width:0; height:0; position:absolute; left:-9999px; top:-9999px;');
+ document.body.appendChild(newIframe);
- const doc = newIframe.contentWindow.document
- // 添加基础样式
+ const doc = newIframe.contentWindow.document;
doc.write(`
@@ -51,10 +46,11 @@ const onPrint = () => {
margin: 0;
}
body {
+
margin: 0;
padding: 0;
- background-color: white !important;
- color: black !important;
+ background-color: white;
+ color: black;
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
}
@@ -65,21 +61,27 @@ const onPrint = () => {
box-sizing: border-box;
font-family: monospace;
position: relative;
- background-color: white !important;
- color: black !important;
+ background-color: white;
+ color: black;
}
- .code-line, .name-line {
+ .code-line {
font-size: 14px;
- margin-bottom: 1mm;
-
+ margin-bottom: 1.4mm;
+ margin-left: 0.8mm;
}
.code-line span {
display: inline-block;
width: 100%;
+
+ font-family: "SimHei", "Microsoft YaHei", "PingFang SC", sans-serif;
border-bottom: 1px solid black;
padding-bottom: 0.2mm;
+ font-weight: bold !important; /* 仅此处加粗 item.code */
+ color: black;
}
.name-line {
+ font-size: 14px;
+ margin-bottom: 1mm;
display: flex;
align-items: center;
}
@@ -91,7 +93,7 @@ const onPrint = () => {
flex-grow: 1;
border-bottom: 1px solid black;
height: 1em;
- margin-left: 1mm;
+ margin-left: -1mm;
}
.bottom-section {
display: flex;
@@ -124,14 +126,15 @@ const onPrint = () => {
.quantity {
font-size: 14px;
margin-bottom: 0.5mm;
- margin-top:2mm;
- white-space: nowrap;
+ margin-top: 2mm;
+ white-space: nowrap;
}
.timestamp {
- font-size: 6px;
+ font-size: 10px;
line-height: 1;
+ margin-left: 0.5mm;
margin-top: auto;
- white-space: nowrap;
+ white-space: nowrap;
}
@@ -139,16 +142,16 @@ const onPrint = () => {
${printNode.innerHTML}