From c75e2224a53af183284815f4be04dd49a5f6968d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A3=E5=9C=A3=E5=8D=8E?= <752718920@qq.com> Date: Wed, 19 Oct 2022 22:15:50 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=99=E9=87=87=E8=B4=AD=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E5=92=8C=E9=94=80=E5=94=AE=E8=AE=A2=E5=8D=95=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?excel=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/bill/dialog/BillDetail.vue | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/jshERP-web/src/views/bill/dialog/BillDetail.vue b/jshERP-web/src/views/bill/dialog/BillDetail.vue index bb71c5e2..268ebdbe 100644 --- a/jshERP-web/src/views/bill/dialog/BillDetail.vue +++ b/jshERP-web/src/views/bill/dialog/BillDetail.vue @@ -26,6 +26,8 @@ 普通打印 普通打印 普通打印 + + 导出 取消 @@ -976,7 +978,7 @@ import pick from 'lodash.pick' import { getAction } from '@/api/manage' import { findBillDetailByNumber, findFinancialDetailByNumber, getPlatformConfigByKey, getCurrentSystemConfig} from '@/api/api' - import { getMpListShort } from "@/utils/util" + import { getMpListShort, openDownloadDialog, sheet2blob } from "@/utils/util" import BillPrintIframe from './BillPrintIframe' import FinancialDetail from '../../financial/dialog/FinancialDetail' import JUpload from '@/components/jeecg/JUpload' @@ -1498,6 +1500,29 @@ this.$refs.modalDetail.title = this.billType + "-三联打印预览"; } }) + }, + exportExcel() { + let aoa = [] + let finishType = '' + let organType = '' + if(this.billType === '采购订单') { + finishType = '已入库' + organType = '供应商:' + } else if(this.billType === '销售订单') { + finishType = '已出库' + organType = '客户:' + } + aoa = [[organType, this.model.organName, '', '单据日期:', this.model.operTimeStr, '', '单据编号:', this.model.number],[]] + let title = ['条码', '名称', '规格', '型号', '颜色', '扩展信息', '库存', '单位', '多属性', '数量', finishType, + '单价', '金额', '税率(%)', '税额', '价税合计', '备注'] + aoa.push(title) + for (let i = 0; i < this.dataSource.length; i++) { + let ds = this.dataSource[i] + let item = [ds.barCode, ds.name, ds.standard, ds.model, ds.color, ds.materialOther, ds.stock, ds.unit, ds.sku, + ds.operNumber, ds.finishNumber, ds.unitPrice, ds.allPrice, ds.taxRate, ds.taxMoney, ds.taxLastMoney, ds.remark] + aoa.push(item) + } + openDownloadDialog(sheet2blob(aoa), this.billType + '_' + this.model.number) } } }