This commit is contained in:
linfso 2025-06-18 13:19:36 +08:00
parent 4a0deecdba
commit acda1e88f6

View File

@ -421,43 +421,10 @@ export default {
sums[index] = '合计';
return;
}
if (
column.property === 'recMoney'
) {
const values = data.map(item => Number(item.recMoney));
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 if (
column.property === 'recdMoneyIn'
column.property === 'totalMoneyBillCount'
) {
const values = data.map(item => Number(item.recdMoneyIn));
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 if (
column.property === 'recdPayMoney60D'
) {
const values = data.map(item => Number(item.recdPayMoney60D));
const values = data.map(item => Number(item.totalMoneyBillCount));
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr);
if (!isNaN(value)) {
@ -468,11 +435,48 @@ export default {
}, 0);
sums[index] = sums[index].toFixed(0);
}
else if (
column.property === 'totalMoneyRecAmount'
) {
const values = data.map(item => Number(item.totalMoneyRecAmount));
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 if (
column.property === 'recdPayMoneyGreat60D'
column.property === 'totalMoneyRecdIn'
) {
const values = data.map(item => Number(item.recdPayMoneyGreat60D));
const values = data.map(item => Number(item.totalMoneyRecdIn));
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);
}
// <el-table-column :label="$t('账单数')" align="center" prop="totalMonthBillCount" min-width="100" />
// <el-table-column :label="$t('账单金额')" align="center" prop="totalMonthRecAmount" min-width="100" />
// <el-table-column :label="$t('账期内收款金额(100%)')" align="center" prop="totalMonthRecdIn" min-width="170" />
// <el-table-column :label="$t('超期收款金额(70%)')" align="center" prop="totalMonthRecd70" min-width="150" />
else if (
column.property === 'totalMonthBillCount'
) {
const values = data.map(item => Number(item.totalMonthBillCount));
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr);
if (!isNaN(value)) {
@ -484,9 +488,9 @@ export default {
sums[index] = sums[index].toFixed(0);
}
else if(
column.property === 'noRecMoney'
column.property === 'totalMonthRecAmount'
){
const values = data.map(item => Number(item.noRecMoney));
const values = data.map(item => Number(item.totalMonthRecAmount));
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr);
if (!isNaN(value)) {
@ -495,7 +499,37 @@ export default {
return prev;
}
}, 0);
sums[index] = sums[index].toFixed(0);
sums[index] = sums[index].toFixed(2);
}
else if(
column.property === 'totalMonthRecdIn'
){
const values = data.map(item => Number(item.totalMonthRecdIn));
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 if(
column.property === 'totalMonthRecd70'
){
const values = data.map(item => Number(item.totalMonthRecd70));
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);
}
});
console.log(sums);