给基础报表的导出走接口查询逻辑

This commit is contained in:
jishenghua 2024-01-14 20:05:55 +08:00
parent 9f2dee507e
commit 71e10b9fcb
14 changed files with 100 additions and 62 deletions

View File

@ -77,7 +77,6 @@
<script>
import AccountInOutList from './modules/AccountInOutList'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { openDownloadDialog, sheet2blob} from "@/utils/util"
import JEllipsis from '@/components/jeecg/JEllipsis'
import {getAction} from '@/api/manage'
export default {
@ -162,13 +161,16 @@
this.$refs.accountInOutList.disableSubmit = false;
},
exportExcel() {
let aoa = [['名称', '编号', '期初金额', '本月发生额', '当前余额']]
let list = []
let head = '名称,编号,期初金额,本月发生额,当前余额'
for (let i = 0; i < this.dataSource.length; i++) {
let item = []
let ds = this.dataSource[i]
let item = [ds.name, ds.serialNo, ds.initialAmount, ds.thisMonthAmount, ds.currentAmount]
aoa.push(item)
item.push(ds.name, ds.serialNo, ds.initialAmount, ds.thisMonthAmount, ds.currentAmount)
list.push(item)
}
openDownloadDialog(sheet2blob(aoa), '账户统计')
let tip = '账户统计查询'
this.handleExportXlsPost('账户统计', '账户统计', head, tip, list)
}
}
}

View File

@ -276,14 +276,17 @@
}
},
exportExcel() {
let aoa = [['单据编号', '条码', '名称', '规格', '型号', '单位', '数量', '单价', '金额', '调出仓库', '调入仓库', '调拨日期', '备注']]
let list = []
let head = '单据编号,条码,名称,规格,型号,单位,数量,单价,金额,调出仓库,调入仓库,调拨日期,备注'
for (let i = 0; i < this.dataSource.length; i++) {
let item = []
let ds = this.dataSource[i]
let item = [ds.number, ds.barCode, ds.mname, ds.standard, ds.model, ds.mUnit, ds.operNumber,
ds.unitPrice, ds.allPrice, ds.dname, ds.sname, ds.operTime, ds.newRemark]
aoa.push(item)
item.push(ds.number, ds.barCode, ds.mname, ds.standard, ds.model, ds.mUnit, ds.operNumber,
ds.unitPrice, ds.allPrice, ds.dname, ds.sname, ds.operTime, ds.newRemark)
list.push(item)
}
openDownloadDialog(sheet2blob(aoa), '调拨明细')
let tip = '单据日期' + this.queryParam.beginTime + '~' + this.queryParam.endTime
this.handleExportXlsPost('调拨明细', '调拨明细', head, tip, list)
}
}
}

View File

@ -261,14 +261,17 @@
}
},
exportExcel() {
let aoa = [['条码', '名称', '规格', '型号', '扩展信息', '单位', '进货数量', '进货金额', '退货数量', '退货金额', '实际采购金额']]
let list = []
let head = '条码,名称,规格,型号,扩展信息,单位,进货数量,进货金额,退货数量,退货金额,实际采购金额'
for (let i = 0; i < this.dataSource.length; i++) {
let item = []
let ds = this.dataSource[i]
let item = [ds.barCode, ds.materialName, ds.materialStandard, ds.materialModel, ds.materialOther, ds.materialUnit,
ds.inSum, ds.inSumPrice, ds.outSum, ds.outSumPrice, ds.inOutSumPrice]
aoa.push(item)
item.push(ds.barCode, ds.materialName, ds.materialStandard, ds.materialModel, ds.materialOther, ds.materialUnit,
ds.inSum, ds.inSumPrice, ds.outSum, ds.outSumPrice, ds.inOutSumPrice)
list.push(item)
}
openDownloadDialog(sheet2blob(aoa), '进货统计')
let tip = '单据日期' + this.queryParam.beginTime + '~' + this.queryParam.endTime
this.handleExportXlsPost('进货统计', '进货统计', head, tip, list)
}
}
}

View File

@ -220,13 +220,16 @@
}
},
exportExcel() {
let aoa = [['客户', '联系人', '手机号码', '联系电话', '电子邮箱', '期初应收', '本期欠款', '本期收款', '期末应收']]
let list = []
let head = '客户,联系人,手机号码,联系电话,电子邮箱,期初应收,本期欠款,本期收款,期末应收'
for (let i = 0; i < this.dataSource.length; i++) {
let item = []
let ds = this.dataSource[i]
let item = [ds.supplier, ds.contacts, ds.telephone, ds.phoneNum, ds.email, ds.preNeed, ds.debtMoney, ds.backMoney, ds.allNeed]
aoa.push(item)
item.push(ds.supplier, ds.contacts, ds.telephone, ds.phoneNum, ds.email, ds.preNeed, ds.debtMoney, ds.backMoney, ds.allNeed)
list.push(item)
}
openDownloadDialog(sheet2blob(aoa), '客户对账')
let tip = '单据日期' + this.queryParam.beginTime + '~' + this.queryParam.endTime
this.handleExportXlsPost('客户对账', '客户对账', head, tip, list)
},
showDebtAccountList(record) {
this.$refs.debtAccountList.show(record.id, '出库', '销售', '客户', "", this.queryParam.beginTime, this.queryParam.endTime)

View File

@ -288,14 +288,17 @@
}
},
exportExcel() {
let aoa = [['单据编号', '条码', '名称', '规格', '型号', '单位', '数量', '单价', '金额', '税率(%)', '税额', '往来单位', '仓库', '入库日期', '备注']]
let list = []
let head = '单据编号,条码,名称,规格,型号,单位,数量,单价,金额,税率(%),税额,往来单位,仓库,入库日期,备注'
for (let i = 0; i < this.dataSource.length; i++) {
let item = []
let ds = this.dataSource[i]
let item = [ds.number, ds.barCode, ds.mname, ds.standard, ds.model, ds.mUnit, ds.operNumber, ds.unitPrice,
ds.allPrice, ds.taxRate, ds.taxMoney, ds.sname, ds.dname, ds.operTime, ds.newRemark]
aoa.push(item)
item.push(ds.number, ds.barCode, ds.mname, ds.standard, ds.model, ds.mUnit, ds.operNumber, ds.unitPrice,
ds.allPrice, ds.taxRate, ds.taxMoney, ds.sname, ds.dname, ds.operTime, ds.newRemark)
list.push(item)
}
openDownloadDialog(sheet2blob(aoa), '入库明细')
let tip = '单据日期' + this.queryParam.beginTime + '~' + this.queryParam.endTime
this.handleExportXlsPost('入库明细', '入库明细', head, tip, list)
}
}
}

View File

@ -228,13 +228,16 @@
}
},
exportExcel() {
let aoa = [['条码', '名称', '规格', '型号', '类别', '单位', '入库数量', '入库金额']]
let list = []
let head = '条码,名称,规格,型号,类别,单位,入库数量,入库金额'
for (let i = 0; i < this.dataSource.length; i++) {
let item = []
let ds = this.dataSource[i]
let item = [ds.barCode, ds.mName, ds.standard, ds.model, ds.categoryName, ds.materialUnit, ds.numSum, ds.priceSum]
aoa.push(item)
item.push(ds.barCode, ds.mName, ds.standard, ds.model, ds.categoryName, ds.materialUnit, ds.numSum, ds.priceSum)
list.push(item)
}
openDownloadDialog(sheet2blob(aoa), '入库汇总')
let tip = '单据日期' + this.queryParam.beginTime + '~' + this.queryParam.endTime
this.handleExportXlsPost('入库汇总', '入库汇总', head, tip, list)
}
}
}

View File

@ -245,14 +245,17 @@
}
},
exportExcel() {
let aoa = [['条码', '名称', '规格', '型号', '扩展信息', '单位', '单价', '上月结存数量', '入库数量', '出库数量', '本月结存数量', '结存金额']]
let list = []
let head = '条码,名称,规格,型号,扩展信息,单位,单价,上月结存数量,入库数量,出库数量,本月结存数量,结存金额'
for (let i = 0; i < this.dataSource.length; i++) {
let item = []
let ds = this.dataSource[i]
let item = [ds.barCode, ds.materialName, ds.materialStandard, ds.materialModel, ds.materialOther, ds.unitName, ds.unitPrice,
ds.prevSum, ds.inSum, ds.outSum, ds.thisSum, ds.thisAllPrice]
aoa.push(item)
item.push(ds.barCode, ds.materialName, ds.materialStandard, ds.materialModel, ds.materialOther, ds.unitName, ds.unitPrice,
ds.prevSum, ds.inSum, ds.outSum, ds.thisSum, ds.thisAllPrice)
list.push(item)
}
openDownloadDialog(sheet2blob(aoa), '进销存统计')
let tip = '月份' + this.queryParam.monthTime
this.handleExportXlsPost('进销存统计', '进销存统计', head, tip, list)
}
}
}

View File

@ -288,7 +288,7 @@
},
exportExcel() {
let list = []
let head = '条码, 名称, 规格, 型号, 颜色, 类别, 单位, 单价, 初始库存, 库存, 库存金额, 重量'
let head = '条码,名称,规格,型号,颜色,类别,单位,单价,初始库存,库存,库存金额,重量'
for (let i = 0; i < this.dataSource.length; i++) {
let item = []
let ds = this.dataSource[i]

View File

@ -288,14 +288,17 @@
}
},
exportExcel() {
let aoa = [['单据编号', '条码', '名称', '规格', '型号', '单位', '数量', '单价', '金额', '税率(%)', '税额', '往来单位', '仓库', '出库日期', '备注']]
let list = []
let head = '单据编号,条码,名称,规格,型号,单位,数量,单价,金额,税率(%),税额,往来单位,仓库,出库日期,备注'
for (let i = 0; i < this.dataSource.length; i++) {
let item = []
let ds = this.dataSource[i]
let item = [ds.number, ds.barCode, ds.mname, ds.standard, ds.model, ds.mUnit, ds.operNumber, ds.unitPrice,
ds.allPrice, ds.taxRate, ds.taxMoney, ds.sname, ds.dname, ds.operTime, ds.newRemark]
aoa.push(item)
item.push(ds.number, ds.barCode, ds.mname, ds.standard, ds.model, ds.mUnit, ds.operNumber, ds.unitPrice,
ds.allPrice, ds.taxRate, ds.taxMoney, ds.sname, ds.dname, ds.operTime, ds.newRemark)
list.push(item)
}
openDownloadDialog(sheet2blob(aoa), '出库明细')
let tip = '单据日期' + this.queryParam.beginTime + '~' + this.queryParam.endTime
this.handleExportXlsPost('出库明细', '出库明细', head, tip, list)
}
}
}

View File

@ -228,13 +228,16 @@
}
},
exportExcel() {
let aoa = [['条码', '名称', '规格', '型号', '类型', '单位', '出库数量', '出库金额']]
let list = []
let head = '条码,名称,规格,型号,类型,单位,出库数量,出库金额'
for (let i = 0; i < this.dataSource.length; i++) {
let item = []
let ds = this.dataSource[i]
let item = [ds.barCode, ds.mName, ds.standard, ds.model, ds.categoryName, ds.materialUnit, ds.numSum, ds.priceSum]
aoa.push(item)
item.push(ds.barCode, ds.mName, ds.standard, ds.model, ds.categoryName, ds.materialUnit, ds.numSum, ds.priceSum)
list.push(item)
}
openDownloadDialog(sheet2blob(aoa), '出库汇总')
let tip = '单据日期' + this.queryParam.beginTime + '~' + this.queryParam.endTime
this.handleExportXlsPost('出库汇总', '出库汇总', head, tip, list)
}
}
}

View File

@ -263,14 +263,17 @@
}
},
exportExcel() {
let aoa = [['条码', '名称', '规格', '型号', '扩展信息', '单位', '零售数量', '零售金额', '退货数量', '退货金额', '实际零售金额']]
let list = []
let head = '条码,名称,规格,型号,扩展信息,单位,零售数量,零售金额,退货数量,退货金额,实际零售金额'
for (let i = 0; i < this.dataSource.length; i++) {
let item = []
let ds = this.dataSource[i]
let item = [ds.barCode, ds.materialName, ds.materialStandard, ds.materialModel, ds.materialOther, ds.materialUnit, ds.outSum,
ds.outSumPrice, ds.inSum, ds.inSumPrice, ds.outInSumPrice]
aoa.push(item)
item.push(ds.barCode, ds.materialName, ds.materialStandard, ds.materialModel, ds.materialOther, ds.materialUnit, ds.outSum,
ds.outSumPrice, ds.inSum, ds.inSumPrice, ds.outInSumPrice)
list.push(item)
}
openDownloadDialog(sheet2blob(aoa), '零售统计')
let tip = '单据日期' + this.queryParam.beginTime + '~' + this.queryParam.endTime
this.handleExportXlsPost('零售统计', '零售统计', head, tip, list)
}
}
}

View File

@ -263,14 +263,17 @@
}
},
exportExcel() {
let aoa = [['条码', '名称', '规格', '型号', '扩展信息', '单位', '销售数量', '销售金额', '退货数量', '退货金额', '实际销售金额']]
let list = []
let head = '条码,名称,规格,型号,扩展信息,单位,销售数量,销售金额,退货数量,退货金额,实际销售金额'
for (let i = 0; i < this.dataSource.length; i++) {
let item = []
let ds = this.dataSource[i]
let item = [ds.barCode, ds.materialName, ds.materialStandard, ds.materialModel, ds.materialOther, ds.materialUnit, ds.outSum,
ds.outSumPrice, ds.inSum, ds.inSumPrice, ds.outInSumPrice]
aoa.push(item)
item.push(ds.barCode, ds.materialName, ds.materialStandard, ds.materialModel, ds.materialOther, ds.materialUnit, ds.outSum,
ds.outSumPrice, ds.inSum, ds.inSumPrice, ds.outInSumPrice)
list.push(item)
}
openDownloadDialog(sheet2blob(aoa), '销售统计')
let tip = '单据日期' + this.queryParam.beginTime + '~' + this.queryParam.endTime
this.handleExportXlsPost('销售统计', '销售统计', head, tip, list)
}
}
}

View File

@ -153,14 +153,17 @@
})
},
exportExcel() {
let aoa = [['仓库', '条码', '名称', '规格', '型号', '扩展信息', '单位', '库存', '最低安全库存', '最高安全库存', '建议入库量', '建议出库量']]
let list = []
let head = '仓库,条码,名称,规格,型号,扩展信息,单位,库存,最低安全库存,最高安全库存,建议入库量,建议出库量'
for (let i = 0; i < this.dataSource.length; i++) {
let item = []
let ds = this.dataSource[i]
let item = [ds.depotName, ds.barCode, ds.mname, ds.mstandard, ds.mmodel, ds.materialOther, ds.materialUnit,
ds.currentNumber, ds.lowSafeStock, ds.highSafeStock, ds.lowCritical, ds.highCritical]
aoa.push(item)
item.push(ds.depotName, ds.barCode, ds.mname, ds.mstandard, ds.mmodel, ds.materialOther, ds.materialUnit,
ds.currentNumber, ds.lowSafeStock, ds.highSafeStock, ds.lowCritical, ds.highCritical)
list.push(item)
}
openDownloadDialog(sheet2blob(aoa), '库存预警')
let tip = '库存预警查询'
this.handleExportXlsPost('库存预警', '库存预警', head, tip, list)
}
}
}

View File

@ -220,13 +220,16 @@
}
},
exportExcel() {
let aoa = [['供应商', '联系人', '手机号码', '联系电话', '电子邮箱', '期初应付', '本期欠款', '本期付款', '期末应付']]
let list = []
let head = '供应商,联系人,手机号码,联系电话,电子邮箱,期初应付,本期欠款,本期付款,期末应付'
for (let i = 0; i < this.dataSource.length; i++) {
let item = []
let ds = this.dataSource[i]
let item = [ds.supplier, ds.contacts, ds.telephone, ds.phoneNum, ds.email, ds.preNeed, ds.debtMoney, ds.backMoney, ds.allNeed]
aoa.push(item)
item.push(ds.supplier, ds.contacts, ds.telephone, ds.phoneNum, ds.email, ds.preNeed, ds.debtMoney, ds.backMoney, ds.allNeed)
list.push(item)
}
openDownloadDialog(sheet2blob(aoa), '供应商对账')
let tip = '单据日期' + this.queryParam.beginTime + '~' + this.queryParam.endTime
this.handleExportXlsPost('供应商对账', '供应商对账', head, tip, list)
},
showDebtAccountList(record) {
this.$refs.debtAccountList.show(record.id, '入库', '采购', '供应商', "", this.queryParam.beginTime, this.queryParam.endTime)