exportpdfshowstyle

This commit is contained in:
chenjianan
2019-01-04 16:52:47 +08:00
parent 62f58a1e43
commit 40e3ce44ad
2 changed files with 4 additions and 2 deletions

View File

@@ -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()

View File

@@ -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()