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 2e27f1d..562da8c 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 @@ -31,9 +31,9 @@ const endPageNum = ref(0); const printref = ref() const onPrint = () => { printref.value.open(bomCodes.value,cnenList.value) - + } - + function beforeDialogClose(doClose: (shouldClose: boolean) => void): void { outopen() } @@ -63,7 +63,7 @@ const open = async (bomCode, vals) => { // 如果当前段是数字,按数字比较 if (typeof aPart === 'number' && typeof bPart === 'number') { if (aPart !== bPart) return aPart - bPart; - } + } // 如果当前段是字符串,按字典序比较 else { if (aPart !== bPart) return String(aPart).localeCompare(String(bPart)); @@ -79,7 +79,7 @@ const open = async (bomCode, vals) => { specarr.value = [] datavals.value = [] printCodeName.value = [] - + sortedVals.forEach((item) => { const row = { blueprintNo: item.blueprintNo, @@ -101,18 +101,18 @@ const open = async (bomCode, vals) => { await Promise.all( printCodeName.value.map(async (item) => { const qrCodeData = await QRCode.toDataURL(item.name,{ - errorCorrectionLevel: 'H' + errorCorrectionLevel: 'H' }) const qrCodeElement = document.getElementById('qrCodeContainer') if (qrCodeElement) { (qrCodeElement.innerHTML += - `
+ `
- ${item.code} + ${item.code}
名称: - ${item.name} + ${item.name}
@@ -125,9 +125,9 @@ const open = async (bomCode, vals) => {
`) if(printCodeName.value.length > 1 && i < printCodeName.value.length - 1){ - qrCodeElement.innerHTML += + qrCodeElement.innerHTML += `
- +
` } } @@ -145,11 +145,11 @@ defineExpose({ open }) min-height: 60mm; margin: auto; box-shadow: 0 0 5px rgba(0, 0, 0, 0.1); - background-color: black; + background-color: white; color: white; padding: 2mm; box-sizing: border-box; - + /* 临时隐藏下划线,打印时会显示 */ .code-line span, .name-underline { display: none; @@ -159,12 +159,12 @@ defineExpose({ open }) /* 确保打印样式优先 */ @media print { .page { - background-color: black !important; + background-color: white !important; color: white !important; - + .code-line span, .name-underline { display: inline-block; } } } - \ No newline at end of file + 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 cf5753f..8415f94 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 @@ -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(` @@ -53,8 +53,8 @@ const onPrint = () => { body { margin: 0; padding: 0; - background-color: black !important; - color: white !important; + background-color: white !important; + color: black !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; } @@ -65,17 +65,18 @@ const onPrint = () => { box-sizing: border-box; font-family: monospace; position: relative; - background-color: black !important; - color: white !important; + background-color: white !important; + color: black !important; } .code-line, .name-line { font-size: 11px; margin-bottom: 1mm; + } .code-line span { display: inline-block; width: 100%; - border-bottom: 1px solid white; + border-bottom: 1px solid black; padding-bottom: 0.2mm; } .name-line { @@ -88,7 +89,7 @@ const onPrint = () => { } .name-underline { flex-grow: 1; - border-bottom: 1px solid white; + border-bottom: 1px solid black; height: 1em; margin-left: 1mm; } @@ -167,7 +168,7 @@ const open = async (bomCode, vals) => { console.log(vals) datavals.value = [] printCodeName.value = [] - + vals.forEach((item) => { const row = { blueprintNo: item.blueprintNo, @@ -189,7 +190,7 @@ const open = async (bomCode, 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) { @@ -229,11 +230,11 @@ defineExpose({ open }) min-height: 30mm; 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; @@ -243,12 +244,12 @@ 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; } } } - \ No newline at end of file +