|
@@ -1937,14 +1937,16 @@
|
|
|
|
|
|
|
|
if(+ratioSum == 100) {
|
|
if(+ratioSum == 100) {
|
|
|
const difference = payAmount - receiptPaymentListSum;
|
|
const difference = payAmount - receiptPaymentListSum;
|
|
|
- if (Math.abs(difference) > 0 && commitData.receiptPaymentList.length > 0) {
|
|
|
|
|
|
|
+ if (Math.abs(difference) > 0.01 && commitData.receiptPaymentList.length > 0) {
|
|
|
const lastIndex = commitData.receiptPaymentList.length - 1;
|
|
const lastIndex = commitData.receiptPaymentList.length - 1;
|
|
|
commitData.receiptPaymentList[lastIndex].price = (+commitData.receiptPaymentList[lastIndex].price + difference).toFixed(2);
|
|
commitData.receiptPaymentList[lastIndex].price = (+commitData.receiptPaymentList[lastIndex].price + difference).toFixed(2);
|
|
|
receiptPaymentListSum = commitData.receiptPaymentList.reduce((acc, cur) => acc + +cur.price, 0);
|
|
receiptPaymentListSum = commitData.receiptPaymentList.reduce((acc, cur) => acc + +cur.price, 0);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if(Math.abs(+receiptPaymentListSum - payAmount) > 0){
|
|
|
|
|
|
|
+ console.log('receiptPaymentListSum~~~', +receiptPaymentListSum, payAmount);
|
|
|
|
|
+
|
|
|
|
|
+ if(Math.abs(+receiptPaymentListSum - payAmount) > 0.01){
|
|
|
this.$message.error('计划收款金额合计与优惠后金额不一致');
|
|
this.$message.error('计划收款金额合计与优惠后金额不一致');
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|