外购备料请款
This commit is contained in:
@@ -43,6 +43,7 @@
|
|||||||
:row-key="getRowKeys"
|
:row-key="getRowKeys"
|
||||||
:expand-row-keys="expands"
|
:expand-row-keys="expands"
|
||||||
:header-cell-style="{fontFamily:'YouYuan',fontSize:'13px',fontWeight:200}"
|
:header-cell-style="{fontFamily:'YouYuan',fontSize:'13px',fontWeight:200}"
|
||||||
|
:summary-method="getSummaries1"
|
||||||
border
|
border
|
||||||
stripe
|
stripe
|
||||||
style="margin-top: 3px;"
|
style="margin-top: 3px;"
|
||||||
@@ -271,6 +272,31 @@ export default {
|
|||||||
})
|
})
|
||||||
return sums
|
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() {
|
exportExcel() {
|
||||||
this.dateRange ? this.check1 = 1 : (this.check1 = 0, this.dateRange = '')
|
this.dateRange ? this.check1 = 1 : (this.check1 = 0, this.dateRange = '')
|
||||||
this.supplierName0 ? this.check2 = 1 : (this.check2 = 0, this.supplierName0 = '')
|
this.supplierName0 ? this.check2 = 1 : (this.check2 = 0, this.supplierName0 = '')
|
||||||
|
|||||||
Reference in New Issue
Block a user