打印调试

dev
qiuhongwu 2 months ago
parent ee5494ee77
commit 0ac8a9cd3a

@ -42,32 +42,10 @@ const onPrint = () => {
doc.write(` doc.write(`
<style type="text/css"> <style type="text/css">
/* 浏览器打印基本样式 */ /* 浏览器打印基本样式 */
.page {
width: 200mm;
min-height: 500px;
margin: auto;
text-align: center;
border: 1px #d3d3d3 solid;
border-radius: 5px;
background: white;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
position: relative;
font-size: 14px !important;
}
.qrCodeContainer {
width: 200mm;
height: 69mm;
border: 1px #d3d3d3 solid;
border-radius: 5px;
background: white;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
position: relative;
font-size: 14px !important;
}
@page { @page {
size: 200mm 70mm landscape; size: 200mm 200mm;
margin: 0; margin: 0;
orientation: portrait; /* 或 portrait 根据实际情况 */
} }
@media print { @media print {
.page { .page {
@ -79,29 +57,25 @@ const onPrint = () => {
box-shadow: initial; box-shadow: initial;
background: initial; background: initial;
page-break-after: always; page-break-after: always;
} }
} }
.qr-page { .qr-page {
page-break-after: always; page-break-after: always;
position: relative; /* 添加 position: relative; 以便使用 top 和 left */
transform: rotate(90deg);
transform-origin: left bottom; /* 设置旋转原点为左下角 */
top:-50mm; /* 调整 top 以确保元素位置正确 */
left: 0; /* 调整 left 以确保元素位置正确 */
} }
.qr-code-container { .qr-code-container {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
flex-wrap: nowrap; flex-wrap: nowrap;
justify-content: flex-start; justify-content: flex-start;
width: 200mm;
height: 69mm;
margin-bottom: 10px;
} }
.qr-code-container-img {
width: 70mm;
height: 69mm;
}
.qr-code-container-item {
width: 100mm;
height: 69mm;
}
</style> </style>
<div> <div>
${printNode.innerHTML} ${printNode.innerHTML}
@ -131,10 +105,10 @@ const datavals = ref([])
const specarr: any = ref([]) const specarr: any = ref([])
const cnenList: any = ref([]) const cnenList: any = ref([])
let allSpecs = [] let allSpecs = []
const open = async (Fdata, vals, val,allSorts) => { const open = async (Fdata, vals, val, allSorts) => {
console.log(Fdata, vals, val); console.log(Fdata, vals, val)
specarr.value=[] specarr.value = []
allSpecs=[] allSpecs = []
// //
cnenList.value = await ProjectOrderApi.getcnenList() cnenList.value = await ProjectOrderApi.getcnenList()
@ -252,7 +226,6 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗
page-break-after: always; page-break-after: always;
} }
.qr-code-container { .qr-code-container {
display: flex; display: flex;
justify-content: flex-start; justify-content: flex-start;
align-items: center; align-items: center;
@ -262,7 +235,7 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗
} }
.qr-code-container-item { .qr-code-container-item {
width: 100mm ; width: 100mm;
height: 69mm; height: 69mm;
} }
/* /*

Loading…
Cancel
Save