|
@@ -43,7 +43,7 @@
|
|
<img v-if="status == 3" width="18" height="18" src="../../../public/img/radio-check.png"
|
|
<img v-if="status == 3" width="18" height="18" src="../../../public/img/radio-check.png"
|
|
alt="" />入库记录
|
|
alt="" />入库记录
|
|
</div>
|
|
</div>
|
|
- <el-table :data="warehouseList.records" height="560" v-show="this.warehouseType== '1'">
|
|
|
|
|
|
+ <el-table show-summary :summary-method="getSummaries" :data="warehouseList.records" height="560" v-show="this.warehouseType== '1'">
|
|
<el-table-column type="expand">
|
|
<el-table-column type="expand">
|
|
<template #default="props">
|
|
<template #default="props">
|
|
<ws-form ref="deptBudgetList" :model="deptBudgetList">
|
|
<ws-form ref="deptBudgetList" :model="deptBudgetList">
|
|
@@ -144,7 +144,7 @@
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
|
|
|
</el-table>
|
|
</el-table>
|
|
- <el-table :data="warehouseList.records" height="560" v-show="this.warehouseType== '2'">
|
|
|
|
|
|
+ <el-table show-summary :summary-method="getSummaries" :data="warehouseList.records" height="560" v-show="this.warehouseType== '2'">
|
|
<el-table-column type="expand">
|
|
<el-table-column type="expand">
|
|
<template #default="props">
|
|
<template #default="props">
|
|
<ws-form ref="deptBudgetList" :model="deptBudgetList">
|
|
<ws-form ref="deptBudgetList" :model="deptBudgetList">
|
|
@@ -354,6 +354,34 @@
|
|
this.showType = this.isShow
|
|
this.showType = this.isShow
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ //合计
|
|
|
|
+ getSummaries(param) {
|
|
|
|
+ const { columns, data } = param
|
|
|
|
+ const sums = []
|
|
|
|
+ columns.forEach((column, index) => {
|
|
|
|
+ if (index === 0) {
|
|
|
|
+ sums[index] = '合计'
|
|
|
|
+ } else if (
|
|
|
|
+ index === 7
|
|
|
|
+ ) {
|
|
|
|
+ const values = data.map((item) => Number(item[column.property]))
|
|
|
|
+ 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(3)
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ sums[index] = '--'
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ return sums
|
|
|
|
+ },
|
|
print(row){
|
|
print(row){
|
|
getPrintInfo({
|
|
getPrintInfo({
|
|
id: row.id
|
|
id: row.id
|