diff --git a/src/router/index.ts b/src/router/index.ts index 616d019..5522b34 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -26,6 +26,11 @@ import Layout from '@/layout/index.vue'; // 公共路由 export const constantRoutes: RouteRecordRaw[] = [ + { + path: '/test', + hidden: true, + component: () => import('@/views/print/test.vue') + }, { path: '/externalPrint', hidden: true, diff --git a/src/views/mes/productPlanDetail/index.vue b/src/views/mes/productPlanDetail/index.vue index 0aada43..8af17ee 100644 --- a/src/views/mes/productPlanDetail/index.vue +++ b/src/views/mes/productPlanDetail/index.vue @@ -310,6 +310,8 @@ diff --git a/src/views/print/externalPrint.vue b/src/views/print/externalPrint.vue index 40db1a0..d9a4477 100644 --- a/src/views/print/externalPrint.vue +++ b/src/views/print/externalPrint.vue @@ -1,58 +1,54 @@ - - - - {{ printName() }} - - - 导出PDF - 本地打印 - {{ i.name }} - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - - - - - 关闭 - - + + + {{ printName() }} + + + 导出PDF + 本地打印 + {{ i.name }} + + + + + { + if (event.data === 'print') { + printFun(); + } + console.log(event); +}); onMounted(() => { nodes.value = JSON.parse(localStorage.getItem('printNodes') || '[]'); + const param = route.query.data; + if (isJSON(param)) { + let data = JSON.parse(param); + if (Array.isArray(data)) { + + } + // if() + } }); const printInfoObj = { @@ -222,6 +235,16 @@ defineExpose({ position: absolute; } +.left { + display: inline-block; + width: calc(100% - 200px); +} + +.right { + vertical-align: top; + display: inline-block; + width: 200px; +} diff --git a/src/views/print/view.vue b/src/views/print/view.vue index 604bd8a..439b4f5 100644 --- a/src/views/print/view.vue +++ b/src/views/print/view.vue @@ -237,6 +237,12 @@ defineExpose({ /* 打印样式:仅显示图片区域 */ @media print { + @page { + + + margin: 0; + + } body * { visibility: hidden !important; }