diff --git a/src/views/PurchasingCenter/OfflineContract/index.vue b/src/views/PurchasingCenter/OfflineContract/index.vue index f5d29a13..14632376 100644 --- a/src/views/PurchasingCenter/OfflineContract/index.vue +++ b/src/views/PurchasingCenter/OfflineContract/index.vue @@ -969,11 +969,12 @@ export default { this.useqrcode(row.离线合同流水号) // 显示二维码 }).then(() => { const htmlNode = $('#offlineContract').html() - const body = $('body') + const body = $('body').attr('style', 'padding: 20px;margin: 0 auto;display: block;width: 800px;background: #fff;') body.children().hide() const printNode = $(htmlNode) body.append(printNode) window.print() + body.removeAttr('style') body.children().not('script').show() body.children().not('#app').hide() printNode.remove() diff --git a/src/views/PurchasingCenter/PurchaseContractSearch/index.vue b/src/views/PurchasingCenter/PurchaseContractSearch/index.vue index d3f6f5f9..7fd4a266 100644 --- a/src/views/PurchasingCenter/PurchaseContractSearch/index.vue +++ b/src/views/PurchasingCenter/PurchaseContractSearch/index.vue @@ -249,11 +249,12 @@ export default { if (this.contractValue) { // exportExcelMethod('print', '采购合同', '采购合同sheet1') const htmlNode = $('#print').html() - const body = $('body') + const body = $('body').attr('style', 'padding: 20px;margin: 0 auto;display: block;width: 800px;background: #fff;') body.children().hide() const printNode = $(htmlNode) body.append(printNode) window.print() + body.removeAttr('style') body.children().not('script').show() body.children().not('#app').hide() printNode.remove()