diff --git a/src/views/material/back/component/dialogFormByCq.vue b/src/views/material/back/component/dialogFormByCq.vue index 852e2b4a..f66074a2 100644 --- a/src/views/material/back/component/dialogFormByCq.vue +++ b/src/views/material/back/component/dialogFormByCq.vue @@ -166,7 +166,7 @@ - +
@@ -430,6 +430,13 @@ export default { this.$modal.msgSuccess('单据文件已保存到服务器') // 上传成功后执行打印 + const images = element.querySelectorAll('img') + images.forEach(img => { + if (!img.complete || img.naturalWidth === 0) { + console.warn('图片加载失败,替换为透明图:', img.src) + img.src = 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==' // 透明1x1 + } + }) printJS({ printable: 'checkId', type: 'html', @@ -456,6 +463,13 @@ export default { this.$modal.msgError('上传单据文件时发生错误') // 即使上传失败也执行打印 + const images = element.querySelectorAll('img') + images.forEach(img => { + if (!img.complete || img.naturalWidth === 0) { + console.warn('图片加载失败,替换为透明图:', img.src) + img.src = 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==' // 透明1x1 + } + }) printJS({ printable: 'checkId', type: 'html', @@ -589,6 +603,13 @@ export default { this.$modal.msgSuccess('单据PDF文件已保存到服务器') // 上传成功后执行打印 + const images = element.querySelectorAll('img') + images.forEach(img => { + if (!img.complete || img.naturalWidth === 0) { + console.warn('图片加载失败,替换为透明图:', img.src) + img.src = 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==' // 透明1x1 + } + }) printJS({ printable: 'checkIdTwo', type: 'html', @@ -603,6 +624,13 @@ export default { this.$modal.msgError('上传明细单据文件时发生错误') // 即使上传失败也执行打印 + const images = element.querySelectorAll('img') + images.forEach(img => { + if (!img.complete || img.naturalWidth === 0) { + console.warn('图片加载失败,替换为透明图:', img.src) + img.src = 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==' // 透明1x1 + } + }) printJS({ printable: 'checkIdTwo', type: 'html', @@ -660,13 +688,84 @@ export default { font-size: 18px; } } -@media print { - .no-print { - display: none; +@media screen { + body { + font-family: 'Microsoft YaHei', sans-serif; + background-color: #f5f5f5; + padding: 20px; } - .print-content { - /* 打印内容的样式 */ + .print-container { + max-width: 1000px; + margin: 0 auto; + background: white; + padding: 20px; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); + } + + .action-buttons { + text-align: center; + margin: 20px 0; + } + + button { + padding: 10px 20px; + margin: 0 10px; + background: #409eff; + color: white; + border: none; + border-radius: 4px; + cursor: pointer; + font-size: 16px; + } + + button:hover { + background: #66b1ff; } } + +/* 通用样式 */ +.text-center { + text-align: center; +} + +.text-bold { + font-weight: bold; +} + +.title { + font-size: 20px; + font-weight: bold; + margin: 15px 0; + text-align: center; +} + +.info-row { + display: flex; + justify-content: space-between; + margin: 10px 0; +} + +.info-item { + flex: 1; +} + +.signature-area { + display: flex; + justify-content: space-between; + margin-top: 30px; +} + +.signature-box { + width: 30%; + min-height: 100px; + border-bottom: 1px solid #000; + text-align: center; + padding-top: 60px; +} + +.is-rotate { + transform: rotate(90deg); + transform-origin: center center; +} diff --git a/src/views/material/repair/testExamine/component/homeApply.vue b/src/views/material/repair/testExamine/component/homeApply.vue index 6e7a7700..385d7dc5 100644 --- a/src/views/material/repair/testExamine/component/homeApply.vue +++ b/src/views/material/repair/testExamine/component/homeApply.vue @@ -21,9 +21,9 @@ - +
序号