给报表增加合计的功能

This commit is contained in:
季圣华
2021-10-15 19:40:57 +08:00
parent 1817733512
commit 28c9b3ed52
14 changed files with 293 additions and 128 deletions

View File

@@ -55,11 +55,27 @@
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:pagination="false"
:scroll="scroll"
:loading="loading"
@change="handleTableChange">
</a-table>
<a-row :gutter="24" style="margin-top: 8px;text-align:right;">
<a-col :md="24" :sm="24">
<a-pagination @change="paginationChange" @showSizeChange="paginationShowSizeChange"
size="small"
show-size-changer
:showQuickJumper="true"
:page-size="ipagination.pageSize"
:page-size-options="ipagination.pageSizeOptions"
:total="ipagination.total"
:show-total="(total, range) => ` ${total} `">
<template slot="buildOptionText" slot-scope="props">
<span>{{ props.value-1 }}条/页</span>
</template>
</a-pagination>
</a-col>
</a-row>
</section>
<!-- table区域-end -->
</a-card>
@@ -98,7 +114,8 @@
mpList: getMpListShort(Vue.ls.get('materialPropertyList')) //扩展属性
},
ipagination:{
pageSizeOptions: ['10', '20', '30', '100', '200']
pageSize: 11,
pageSizeOptions: ['11', '21', '31', '101', '201']
},
tabKey: "1",
depotList: [],
@@ -106,21 +123,17 @@
// 表头
columns: [
{
title: '#',
dataIndex: '',
key:'rowIndex',
width:60,
align:"center",
title: '#', dataIndex: 'rowIndex', width:40, align:"center",
customRender:function (t,r,index) {
return parseInt(index)+1;
return (t !== '合计') ? (parseInt(index) + 1) : t
}
},
{title: '条码', dataIndex: 'barCode', width: 120},
{title: '条码', dataIndex: 'barCode', width: 100},
{title: '名称', dataIndex: 'materialName', width: 120},
{title: '规格', dataIndex: 'materialStandard', width: 80},
{title: '型号', dataIndex: 'materialModel', width: 80},
{title: '扩展信息', dataIndex: 'materialOther', width: 120},
{title: '单位', dataIndex: 'unitName', width: 80},
{title: '扩展信息', dataIndex: 'materialOther', width: 80},
{title: '单位', dataIndex: 'unitName', width: 60},
{title: '单价', dataIndex: 'unitPrice', sorter: (a, b) => a.unitPrice - b.unitPrice, width: 60},
{title: '上月结存数量', dataIndex: 'prevSum', sorter: (a, b) => a.prevSum - b.prevSum, width: 80},
{title: '入库数量', dataIndex: 'inSum', sorter: (a, b) => a.inSum - b.inSum, width: 60},
@@ -146,7 +159,7 @@
param.monthTime = this.queryParam.monthTime;
param.field = this.getQueryField();
param.currentPage = this.ipagination.current;
param.pageSize = this.ipagination.pageSize;
param.pageSize = this.ipagination.pageSize-1;
return param;
},
getDepotData() {