This commit is contained in:
liushuai
2020-03-11 18:09:35 +08:00
parent b6c062607f
commit c099ccf0be
14 changed files with 312 additions and 140 deletions

View File

@@ -2,7 +2,7 @@
<div class="app-container">
<div style="width: 100%;overflow:auto">
<div style="white-space: nowrap">
<el-card style="width: 1663px">
<el-card style="width: 1545px">
<el-col>
<el-input v-model="supplierName0" placeholder="供应商" style="width: 220px" size="small" clearable/>
<el-date-picker
@@ -40,13 +40,14 @@
:data="tableData1"
:row-key="getRowKeys"
:expand-row-keys="expands"
:summary-method="getSummaries1"
:header-cell-style="{fontFamily:'YouYuan',fontSize:'13px',fontWeight:200}"
show-summary
border
stripe
style="margin-top: 3px;"
height="600px"
size="mini"
show-summary
highlight-current-row
@row-click="searchTable02">
<el-table-column label="供应商" prop="供应商名称" align="center" min-width="180" width="350" show-overflow-tooltip>
@@ -115,7 +116,7 @@
@current-change="handleCurrentChange1"/>
</div>
</el-card>
<el-card style="margin-left: 0px;width:524px; margin-left: 1px; display: inline-block;vertical-align: top">
<el-card style="margin-left: 0px;width:405px; margin-left: 1px; display: inline-block;vertical-align: top">
<el-table :data="gridData" :header-cell-style="{fontFamily:'YouYuan',fontSize:'13px',fontWeight:200}" :summary-method="getSummaries" border class="subTableHeader" size="mini" show-summary style="">
<el-table-column width="50" align="center" type="index" label="序号"/>
<el-table-column width="120" align="center" label="发票号">
@@ -123,12 +124,12 @@
{{ scope.row.发票号 }}
</template>
</el-table-column>
<el-table-column width="170" align="center" label="供应商" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.供应商名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="到票金额(元)" width="90px" prop="到票金额">
<!--<el-table-column width="170" align="center" label="供应商" show-overflow-tooltip>-->
<!--<template slot-scope="scope">-->
<!--{{ scope.row.供应商名称 }}-->
<!--</template>-->
<!--</el-table-column>-->
<el-table-column align="center" label="到票金额(元)" width="120px" prop="到票金额">
<template slot-scope="scope">
{{ scope.row.开票金额.toFixed(2) }}
</template>
@@ -255,7 +256,7 @@ export default {
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '合计'
} else if (index === 3) {
} else if (index === 2) {
const values = data.map(item => Number(parseFloat(item['开票金额'])))
if (!values.every(value => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => {
@@ -274,6 +275,31 @@ export default {
})
return sums
},
getSummaries1(param) { // 合计
const { columns, data } = param
const sums = []
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '合计'
} else if (index === 3) {
const values = data.map(item => Number(parseFloat(item['请款金额'])))
if (!values.every(value => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr)
if (!isNaN(value)) {
return prev + curr
} else {
return prev
}
}, 0)
sums[index] = sums[index].toFixed(2) + ' 元'
} else {
sums[index] = 'N/A'
}
}
})
return sums
},
exportExcel() {
this.dateRange ? this.check1 = 1 : (this.check1 = 0, this.dateRange = '')
this.supplierName0 ? this.check2 = 1 : (this.check2 = 0, this.supplierName0 = '')