From 9315c7ec6cdf79af57eb29ad2e951c2f4f1cf53e Mon Sep 17 00:00:00 2001 From: chenjianan Date: Wed, 19 Dec 2018 11:47:33 +0800 Subject: [PATCH] =?UTF-8?q?jquery;=E5=AF=BC=E5=87=BApdf?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + .../PurchaseContractSearch/index.vue | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index ea662239..8618c4a3 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "echarts": "^4.2.0-rc.2", "element-ui": "2.4.6", "file-saver": "^1.3.8", + "jquery": "^3.3.1", "js-cookie": "2.2.0", "node-sass": "^4.10.0", "normalize.css": "7.0.0", diff --git a/src/views/PurchasingCenter/PurchaseContractSearch/index.vue b/src/views/PurchasingCenter/PurchaseContractSearch/index.vue index 2c78c44b..76caa6b0 100644 --- a/src/views/PurchasingCenter/PurchaseContractSearch/index.vue +++ b/src/views/PurchasingCenter/PurchaseContractSearch/index.vue @@ -142,7 +142,7 @@ 二维码:
-
+
附件图:
@@ -155,7 +155,8 @@ import { initContract, initBuyer, searchTable1, searchTable2 } from '@/api/PurchasingCenter/PurchaseContractSearch' import { searchFile } from '@/api/PurchasingCenter/CreateContract' import QRCode from 'qrcode' -import { exportExcelMethod } from './exportExcel' +import $ from 'jquery' +// import { exportExcelMethod } from './exportExcel' export default { data() { @@ -213,7 +214,15 @@ export default { methods: { download() { if (this.contractValue) { - exportExcelMethod('print', '采购合同', '采购合同sheet1') + // exportExcelMethod('print', '采购合同', '采购合同sheet1') + const htmlNode = $('#print').html() + const body = $('body') + body.children().hide() + const printNode = $(htmlNode) + body.append(printNode) + window.print() + body.children().show() + printNode.remove() } else { this.$message.error('请选择合同') }