From ec13e61f741b3d5adb0bd60772d20f6ebafb2668 Mon Sep 17 00:00:00 2001 From: zhangdingyu <974548713@qq.com> Date: Mon, 7 Jan 2019 09:31:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9B=E5=BB=BA=E5=A4=87=E6=96=99=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CreatePreparationBill/index.vue | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/views/ManufacturingCenter/CreatePreparationBill/index.vue b/src/views/ManufacturingCenter/CreatePreparationBill/index.vue index cdb8bb53..38eb9858 100644 --- a/src/views/ManufacturingCenter/CreatePreparationBill/index.vue +++ b/src/views/ManufacturingCenter/CreatePreparationBill/index.vue @@ -103,14 +103,18 @@ export default { }, methods: { exportTable() { - const htmlNode = $('#BL').html() - const body = $('body') - body.children().hide() - const printNode = $(htmlNode) - body.append(printNode) - window.print() - body.children().not('script').show() - printNode.remove() + if (this.tableData2.length === 0) { + this.$message.warning('暂无数据') + } else { + const htmlNode = $('#BL').html() + const body = $('body') + body.children().hide() + const printNode = $(htmlNode) + body.append(printNode) + window.print() + body.children().not('script').show() + printNode.remove() + } }, // 查询表格数据 searchTable() {