|
@@ -1162,16 +1162,17 @@ export default {
|
|
) {
|
|
) {
|
|
sums[index] = "";
|
|
sums[index] = "";
|
|
} else if (!values.every((value) => isNaN(value))) {
|
|
} else 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)
|
|
|
|
- ?.toFixed(2);
|
|
|
|
|
|
+ sums[index] = values.reduce((prev, curr) => {
|
|
|
|
+ const value = Number(curr);
|
|
|
|
+ if (!isNaN(value)) {
|
|
|
|
+ return prev + curr;
|
|
|
|
+ } else {
|
|
|
|
+ return prev;
|
|
|
|
+ }
|
|
|
|
+ }, 0);
|
|
|
|
+ if (index == 3 || index == 4) {
|
|
|
|
+ sums[index] = sums[index]?.toFixed(2);
|
|
|
|
+ }
|
|
console.log(sums[index], index);
|
|
console.log(sums[index], index);
|
|
if (index == 4) {
|
|
if (index == 4) {
|
|
this.totalMoney = sums[index];
|
|
this.totalMoney = sums[index];
|
|
@@ -2157,7 +2158,7 @@ export default {
|
|
</tr>`;
|
|
</tr>`;
|
|
}
|
|
}
|
|
// 计算小计
|
|
// 计算小计
|
|
- amountTotal = amountTotal.toFixed(2);
|
|
|
|
|
|
+ amountTotal = amountTotal;
|
|
singlTotal = singlTotal.toFixed(2);
|
|
singlTotal = singlTotal.toFixed(2);
|
|
moneyTotal = moneyTotal.toFixed(2);
|
|
moneyTotal = moneyTotal.toFixed(2);
|
|
printStr += `
|
|
printStr += `
|