|
|
|
|
@ -455,7 +455,6 @@
|
|
|
|
|
prop="spendMoney"
|
|
|
|
|
label="本次支付"
|
|
|
|
|
width="90"
|
|
|
|
|
|
|
|
|
|
>
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<div
|
|
|
|
|
@ -467,7 +466,7 @@
|
|
|
|
|
<i class="text-cyan el-icon-edit"></i>
|
|
|
|
|
</div>
|
|
|
|
|
<el-input
|
|
|
|
|
:disabled="scope.row.cardOvers==0"
|
|
|
|
|
:disabled="scope.row.cardOvers == 0"
|
|
|
|
|
v-else
|
|
|
|
|
v-focus
|
|
|
|
|
type="number"
|
|
|
|
|
@ -681,7 +680,6 @@ import recash from "./recash";
|
|
|
|
|
import orders from "./detail/detail";
|
|
|
|
|
import { partten } from "@/utils/partten/index.js";
|
|
|
|
|
export default {
|
|
|
|
|
|
|
|
|
|
components: {
|
|
|
|
|
member,
|
|
|
|
|
reccard,
|
|
|
|
|
@ -693,7 +691,7 @@ export default {
|
|
|
|
|
addmember,
|
|
|
|
|
repayment,
|
|
|
|
|
recash,
|
|
|
|
|
orders,
|
|
|
|
|
orders
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
@ -714,6 +712,8 @@ export default {
|
|
|
|
|
list: [], //主数组
|
|
|
|
|
listCopy: [],
|
|
|
|
|
rowList: [],
|
|
|
|
|
payMoneysum: 0,
|
|
|
|
|
payMoneysums: 0,
|
|
|
|
|
form: {
|
|
|
|
|
collectionCashAmount: 0,
|
|
|
|
|
collectionCashAmounts: 0,
|
|
|
|
|
@ -749,11 +749,11 @@ export default {
|
|
|
|
|
routeNumber: null,
|
|
|
|
|
copyAccountList: [],
|
|
|
|
|
projectMomey: 0,
|
|
|
|
|
money:0,
|
|
|
|
|
card1:0,
|
|
|
|
|
card2:0,
|
|
|
|
|
card3:0,
|
|
|
|
|
card4:0,
|
|
|
|
|
money: 0,
|
|
|
|
|
card1: 0,
|
|
|
|
|
card2: 0,
|
|
|
|
|
card3: 0,
|
|
|
|
|
card4: 0
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
@ -766,14 +766,17 @@ export default {
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
let num = this.list.reduce((pre, item) => {
|
|
|
|
|
console.log("🚀 ~ file: service.vue ~ line 804 ~ num ~ item.courseAccountId", item.collectionAmounts)
|
|
|
|
|
console.log(
|
|
|
|
|
"🚀 ~ file: service.vue ~ line 804 ~ num ~ item.courseAccountId",
|
|
|
|
|
item.collectionAmounts
|
|
|
|
|
);
|
|
|
|
|
item.transactionPrice = item.transactionPrice
|
|
|
|
|
?(item.transactionPrice*1).toFixed(2) * 1
|
|
|
|
|
? (item.transactionPrice * 1).toFixed(2) * 1
|
|
|
|
|
: 0; // 抵扣金额存在,项目金额存在
|
|
|
|
|
if(item.courseAccountId == null){
|
|
|
|
|
item.collectionAmounts = (item.collectionAmounts*1).toFixed(2) * 1;
|
|
|
|
|
}else{
|
|
|
|
|
item.collectionAmounts =(item.transactionPrice*1).toFixed(2) * 1;
|
|
|
|
|
if (item.courseAccountId == null) {
|
|
|
|
|
item.collectionAmounts = (item.collectionAmounts * 1).toFixed(2) * 1;
|
|
|
|
|
} else {
|
|
|
|
|
item.collectionAmounts = (item.transactionPrice * 1).toFixed(2) * 1;
|
|
|
|
|
}
|
|
|
|
|
if (item.collectionAmounts) {
|
|
|
|
|
return pre + (item.transactionPrice - item.collectionAmounts);
|
|
|
|
|
@ -793,17 +796,20 @@ export default {
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
let num = this.list.reduce((pre, item) => {
|
|
|
|
|
console.log("🚀 ~ file: service.vue ~ line 804 ~ num ~ item.courseAccountId", item)
|
|
|
|
|
console.log(
|
|
|
|
|
"🚀 ~ file: service.vue ~ line 804 ~ num ~ item.courseAccountId",
|
|
|
|
|
item
|
|
|
|
|
);
|
|
|
|
|
item.transactionPrice = item.transactionPrice
|
|
|
|
|
?(item.transactionPrice*1).toFixed(2) * 1
|
|
|
|
|
? (item.transactionPrice * 1).toFixed(2) * 1
|
|
|
|
|
: 0; // 抵扣金额存在,项目金额存在
|
|
|
|
|
if(item.isCardPay !== 0){
|
|
|
|
|
return pre
|
|
|
|
|
if (item.isCardPay !== 0) {
|
|
|
|
|
return pre;
|
|
|
|
|
}
|
|
|
|
|
if(item.courseAccountId == null){
|
|
|
|
|
item.collectionAmounts = (item.collectionAmounts*1).toFixed(2) * 1;
|
|
|
|
|
}else{
|
|
|
|
|
item.collectionAmounts =(item.transactionPrice*1).toFixed(2) * 1;
|
|
|
|
|
if (item.courseAccountId == null) {
|
|
|
|
|
item.collectionAmounts = (item.collectionAmounts * 1).toFixed(2) * 1;
|
|
|
|
|
} else {
|
|
|
|
|
item.collectionAmounts = (item.transactionPrice * 1).toFixed(2) * 1;
|
|
|
|
|
}
|
|
|
|
|
if (item.collectionAmounts) {
|
|
|
|
|
return pre + (item.transactionPrice - item.collectionAmounts);
|
|
|
|
|
@ -825,20 +831,23 @@ export default {
|
|
|
|
|
|
|
|
|
|
let total = this.list.reduce((pre, item) => {
|
|
|
|
|
item.transactionPrice = item.transactionPrice
|
|
|
|
|
? (item.transactionPrice*1).toFixed(2) * 1
|
|
|
|
|
? (item.transactionPrice * 1).toFixed(2) * 1
|
|
|
|
|
: 0; // 卡付金额/抵扣金额存在
|
|
|
|
|
if (item.transactionPrice && item.collectionAmounts) {
|
|
|
|
|
item.collectionRechargeAmount = item.collectionRechargeAmount
|
|
|
|
|
? (item.collectionRechargeAmount*1).toFixed(2) * 1
|
|
|
|
|
? (item.collectionRechargeAmount * 1).toFixed(2) * 1
|
|
|
|
|
: 0;
|
|
|
|
|
item.collectionAmounts = item.collectionAmounts
|
|
|
|
|
? (item.collectionAmounts*1).toFixed(2) * 1
|
|
|
|
|
? (item.collectionAmounts * 1).toFixed(2) * 1
|
|
|
|
|
: 0;
|
|
|
|
|
return (
|
|
|
|
|
pre +
|
|
|
|
|
(item.transactionPrice -
|
|
|
|
|
(
|
|
|
|
|
item.transactionPrice -
|
|
|
|
|
item.collectionAmounts +
|
|
|
|
|
item.collectionRechargeAmount*1).toFixed(2) * 1
|
|
|
|
|
item.collectionRechargeAmount * 1
|
|
|
|
|
).toFixed(2) *
|
|
|
|
|
1
|
|
|
|
|
); // 项目金额存在
|
|
|
|
|
} else if (item.transactionPrice) {
|
|
|
|
|
return pre + item.transactionPrice; // 项目金额不存在
|
|
|
|
|
@ -879,31 +888,37 @@ export default {
|
|
|
|
|
this.recIndex = index;
|
|
|
|
|
|
|
|
|
|
//console.log("🚀 ~ file: service.vue ~ line 843 ~ editcard ~ this.rowRecList[index].type", this.rowRecList[index].type)
|
|
|
|
|
if(this.rowRecList[index].type == 1){
|
|
|
|
|
|
|
|
|
|
if (this.rowRecList[index].type == 1) {
|
|
|
|
|
if (this.list[this.projectIndex].noDiscount == 1) {
|
|
|
|
|
this.rowRecList[index].spendMoney =this.appearPrice;
|
|
|
|
|
|
|
|
|
|
this.rowRecList[index].spendMoney = this.appearPrice;
|
|
|
|
|
} else {
|
|
|
|
|
this.rowRecList[index].spendMoney =
|
|
|
|
|
(
|
|
|
|
|
this.appearPrice *1 *(row.discount / 100) *1
|
|
|
|
|
).toFixed(2) * 1;
|
|
|
|
|
(this.appearPrice * 1 * (row.discount / 100) * 1).toFixed(2) * 1;
|
|
|
|
|
}
|
|
|
|
|
this.rowRecList[index].giftSpendMoney=0;
|
|
|
|
|
}else{
|
|
|
|
|
this.rowRecList[index].giftSpendMoney = 0;
|
|
|
|
|
} else {
|
|
|
|
|
if (this.useRecharge == 2) {
|
|
|
|
|
if (this.recForm.noDiscount == 0) {
|
|
|
|
|
//可以打折
|
|
|
|
|
if (this.rowRecList[index].offsetMoney > this.rowRecList[index]) {
|
|
|
|
|
//判断充值可用金额是否大于成交价如果大于直接用充值可用金额计算
|
|
|
|
|
this.rowRecList[index].spendMoney=(this.appearPrice *(this.rowRecList[index].discount / 100)).toFixed(2) * 1
|
|
|
|
|
this.rowRecList[index].spendMoney =
|
|
|
|
|
(
|
|
|
|
|
this.appearPrice *
|
|
|
|
|
(this.rowRecList[index].discount / 100)
|
|
|
|
|
).toFixed(2) * 1;
|
|
|
|
|
} else {
|
|
|
|
|
//判断充值可用金额是否大于成交价如果小于选择最大充值金额,剩下的用赠送金额计算
|
|
|
|
|
this.rowRecList[index].spendMoney = //获取充值金折扣金额
|
|
|
|
|
(this.rowRecList[index].cardOver * (this.rowRecList[index].discount / 100)).toFixed(2) * 1;
|
|
|
|
|
(
|
|
|
|
|
this.rowRecList[index].cardOver *
|
|
|
|
|
(this.rowRecList[index].discount / 100)
|
|
|
|
|
).toFixed(2) * 1;
|
|
|
|
|
this.rowRecList[index].giftSpendMoney =
|
|
|
|
|
((this.appearPrice - this.rowRecList[index].spendMoney)*this.rowRecList[index].discountFreeAmount).toFixed(2) * 1; //计算赠送金额
|
|
|
|
|
(
|
|
|
|
|
(this.appearPrice - this.rowRecList[index].spendMoney) *
|
|
|
|
|
this.rowRecList[index].discountFreeAmount
|
|
|
|
|
).toFixed(2) * 1; //计算赠送金额
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
//不可以打折
|
|
|
|
|
@ -912,37 +927,73 @@ export default {
|
|
|
|
|
this.rowRecList[index].spendMoney = this.appearPrice;
|
|
|
|
|
} else {
|
|
|
|
|
//判断充值可用金额是否大于成交价如果小于选择最大充值金额,剩下的用赠送金额计算
|
|
|
|
|
this.rowRecList[index].spendMoney = this.rowRecList[index].cardOver;
|
|
|
|
|
this.rowRecList[index].spendMoney = this.rowRecList[
|
|
|
|
|
index
|
|
|
|
|
].cardOver;
|
|
|
|
|
this.rowRecList[index].giftSpendMoney =
|
|
|
|
|
(this.appearPrice - this.rowRecList[index].spendMoney).toFixed(2) * 1;
|
|
|
|
|
(this.appearPrice - this.rowRecList[index].spendMoney).toFixed(
|
|
|
|
|
2
|
|
|
|
|
) * 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
let sunRatio =
|
|
|
|
|
(this.rowRecList[index].cardOver/this.rowRecList[index].discount + this.rowRecList[index].giftConsumeMoney/this.rowRecList[index].discountFreeAmount).toFixed(2) *1 * 1; ///可用余额+赠送余额
|
|
|
|
|
let recRatio = (this.rowRecList[index].cardOver/this.rowRecList[index].discount / sunRatio) .toFixed(2) *1; //可用余额比例
|
|
|
|
|
let recGiftRatio = (this.rowRecList[index].giftConsumeMoney/this.rowRecList[index].discountFreeAmount / sunRatio).toFixed(2) *1 ; //赠送余额比例
|
|
|
|
|
if (this.rowRecList[index].offsetMoney > this.appearPrice* recRatio) {
|
|
|
|
|
(
|
|
|
|
|
this.rowRecList[index].cardOver /
|
|
|
|
|
this.rowRecList[index].discount +
|
|
|
|
|
this.rowRecList[index].giftConsumeMoney /
|
|
|
|
|
this.rowRecList[index].discountFreeAmount
|
|
|
|
|
).toFixed(2) *
|
|
|
|
|
1 *
|
|
|
|
|
1; ///可用余额+赠送余额
|
|
|
|
|
let recRatio =
|
|
|
|
|
(
|
|
|
|
|
this.rowRecList[index].cardOver /
|
|
|
|
|
this.rowRecList[index].discount /
|
|
|
|
|
sunRatio
|
|
|
|
|
).toFixed(2) * 1; //可用余额比例
|
|
|
|
|
let recGiftRatio =
|
|
|
|
|
(
|
|
|
|
|
this.rowRecList[index].giftConsumeMoney /
|
|
|
|
|
this.rowRecList[index].discountFreeAmount /
|
|
|
|
|
sunRatio
|
|
|
|
|
).toFixed(2) * 1; //赠送余额比例
|
|
|
|
|
if (
|
|
|
|
|
this.rowRecList[index].offsetMoney >
|
|
|
|
|
this.appearPrice * recRatio
|
|
|
|
|
) {
|
|
|
|
|
if (this.recForm.noDiscount == 0) {
|
|
|
|
|
//可以打折
|
|
|
|
|
this.rowRecList[index].discoutMoney =
|
|
|
|
|
((this.appearPrice * 1) * recRatio).toFixed(2) *1; //充值卡支付的钱
|
|
|
|
|
this.rowRecList[index].discoutMoney= Math.trunc(this.rowRecList[index].discoutMoney)
|
|
|
|
|
(this.appearPrice * 1 * recRatio).toFixed(2) * 1; //充值卡支付的钱
|
|
|
|
|
this.rowRecList[index].discoutMoney = Math.trunc(
|
|
|
|
|
this.rowRecList[index].discoutMoney
|
|
|
|
|
);
|
|
|
|
|
//console.log("🚀 ~ file: service.vue ~ line 899 ~ editcard ~ this.appearPrice", this.appearPrice)
|
|
|
|
|
this.rowRecList[index].discoutGiftMoney =
|
|
|
|
|
|
|
|
|
|
(this.appearPrice-this.rowRecList[index].discoutMoney ).toFixed(2) * 1; //赠送实际出的钱
|
|
|
|
|
this.rowRecList[index].discoutGiftMoney= Math.trunc(this.rowRecList[index].discoutGiftMoney)
|
|
|
|
|
(
|
|
|
|
|
this.appearPrice - this.rowRecList[index].discoutMoney
|
|
|
|
|
).toFixed(2) * 1; //赠送实际出的钱
|
|
|
|
|
this.rowRecList[index].discoutGiftMoney = Math.trunc(
|
|
|
|
|
this.rowRecList[index].discoutGiftMoney
|
|
|
|
|
);
|
|
|
|
|
//console.log("🚀 ~ file: service.vue ~ line 897 ~ editcard ~ this.rowRecList[index].discoutGiftMoney", this.rowRecList[index].discoutGiftMoney)
|
|
|
|
|
this.rowRecList[index].spendMoney =(this.rowRecList[index].discoutMoney *(this.rowRecList[index].discount / 100)).toFixed(2) * 1; //赠送卡抵扣支付的钱
|
|
|
|
|
this.rowRecList[index].giftSpendMoney =(this.rowRecList[index].discoutGiftMoney *(this.rowRecList[index].discountFreeAmount / 100)).toFixed(2) * 1;
|
|
|
|
|
|
|
|
|
|
this.rowRecList[index].spendMoney =
|
|
|
|
|
(
|
|
|
|
|
this.rowRecList[index].discoutMoney *
|
|
|
|
|
(this.rowRecList[index].discount / 100)
|
|
|
|
|
).toFixed(2) * 1; //赠送卡抵扣支付的钱
|
|
|
|
|
this.rowRecList[index].giftSpendMoney =
|
|
|
|
|
(
|
|
|
|
|
this.rowRecList[index].discoutGiftMoney *
|
|
|
|
|
(this.rowRecList[index].discountFreeAmount / 100)
|
|
|
|
|
).toFixed(2) * 1;
|
|
|
|
|
} else {
|
|
|
|
|
//不可以打折
|
|
|
|
|
this.rowRecList[index].spendMoney =
|
|
|
|
|
((this.appearPrice * 1) * recRatio).toFixed(2) *1; //充值卡支付的钱
|
|
|
|
|
(this.appearPrice * 1 * recRatio).toFixed(2) * 1; //充值卡支付的钱
|
|
|
|
|
this.rowRecList[index].giftSpendMoney =
|
|
|
|
|
((this.appearPrice * 1) * recGiftRatio).toFixed(2) * 1; //赠送实际出的钱
|
|
|
|
|
(this.appearPrice * 1 * recGiftRatio).toFixed(2) * 1; //赠送实际出的钱
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// else {
|
|
|
|
|
@ -958,30 +1009,53 @@ export default {
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.card1=this.rowRecList[index].spendMoney;
|
|
|
|
|
this.card4=this.rowRecList[index].spendMoney;
|
|
|
|
|
this.card2=this.rowRecList[index].giftSpendMoney;
|
|
|
|
|
this.card3=this.rowRecList[index].spendMoney;
|
|
|
|
|
this.rowRecList[index].cardOvers=(this.rowRecList[index].cardOver-this.rowRecList[index].spendMoney).toFixed(2) * 1
|
|
|
|
|
this.rowRecList[index].cardOver=(this.rowRecList[index].cardOver-this.rowRecList[index].spendMoney).toFixed(2) * 1
|
|
|
|
|
this.rowRecList[index].cardGiftOvers=(this.rowRecList[index].giftConsumeMoney-this.rowRecList[index].giftSpendMoney).toFixed(2) * 1
|
|
|
|
|
this.rowRecList[index].giftConsumeMoney=(this.rowRecList[index].giftConsumeMoney-this.rowRecList[index].giftSpendMoney).toFixed(2) * 1
|
|
|
|
|
this.card1 = this.rowRecList[index].spendMoney;
|
|
|
|
|
this.card4 = this.rowRecList[index].spendMoney;
|
|
|
|
|
this.card2 = this.rowRecList[index].giftSpendMoney;
|
|
|
|
|
this.card3 = this.rowRecList[index].spendMoney;
|
|
|
|
|
this.rowRecList[index].cardOvers =
|
|
|
|
|
(
|
|
|
|
|
this.rowRecList[index].cardOver - this.rowRecList[index].spendMoney
|
|
|
|
|
).toFixed(2) * 1;
|
|
|
|
|
this.rowRecList[index].cardOver =
|
|
|
|
|
(
|
|
|
|
|
this.rowRecList[index].cardOver - this.rowRecList[index].spendMoney
|
|
|
|
|
).toFixed(2) * 1;
|
|
|
|
|
this.rowRecList[index].cardGiftOvers =
|
|
|
|
|
(
|
|
|
|
|
this.rowRecList[index].giftConsumeMoney -
|
|
|
|
|
this.rowRecList[index].giftSpendMoney
|
|
|
|
|
).toFixed(2) * 1;
|
|
|
|
|
this.rowRecList[index].giftConsumeMoney =
|
|
|
|
|
(
|
|
|
|
|
this.rowRecList[index].giftConsumeMoney -
|
|
|
|
|
this.rowRecList[index].giftSpendMoney
|
|
|
|
|
).toFixed(2) * 1;
|
|
|
|
|
|
|
|
|
|
if(this.rowRecList[index].cardOvers<0){
|
|
|
|
|
if (this.rowRecList[index].cardOvers < 0) {
|
|
|
|
|
this.$message.info({
|
|
|
|
|
message: "此卡可用余额不足。"
|
|
|
|
|
});
|
|
|
|
|
this.rowRecList[index].cardOvers=(this.rowRecList[index].cardOvers+this.rowRecList[index].spendMoney).toFixed(2) * 1
|
|
|
|
|
this.rowRecList[index].spendMoney =(this.rowRecList[index].cardOvers).toFixed(2) * 1;
|
|
|
|
|
this.rowRecList[index].cardOvers=0
|
|
|
|
|
this.rowRecList[index].cardOvers =
|
|
|
|
|
(
|
|
|
|
|
this.rowRecList[index].cardOvers + this.rowRecList[index].spendMoney
|
|
|
|
|
).toFixed(2) * 1;
|
|
|
|
|
this.rowRecList[index].spendMoney =
|
|
|
|
|
this.rowRecList[index].cardOvers.toFixed(2) * 1;
|
|
|
|
|
this.rowRecList[index].cardOvers = 0;
|
|
|
|
|
}
|
|
|
|
|
if(this.rowRecList[index].cardGiftOvers<0){
|
|
|
|
|
if (this.rowRecList[index].cardGiftOvers < 0) {
|
|
|
|
|
this.$message.info({
|
|
|
|
|
message: "此卡赠送余额不足。"
|
|
|
|
|
});
|
|
|
|
|
this.rowRecList[index].cardGiftOvers=(this.rowRecList[index].cardGiftOvers+this.rowRecList[index].gifSpendMoney).toFixed(2) * 1
|
|
|
|
|
this.rowRecList[index].gifSpendMoney =(this.rowRecList[index].cardGiftOvers).toFixed(2) * 1;
|
|
|
|
|
this.rowRecList[index].cardGiftOvers=0
|
|
|
|
|
this.rowRecList[index].cardGiftOvers =
|
|
|
|
|
(
|
|
|
|
|
this.rowRecList[index].cardGiftOvers +
|
|
|
|
|
this.rowRecList[index].gifSpendMoney
|
|
|
|
|
).toFixed(2) * 1;
|
|
|
|
|
this.rowRecList[index].gifSpendMoney =
|
|
|
|
|
this.rowRecList[index].cardGiftOvers.toFixed(2) * 1;
|
|
|
|
|
this.rowRecList[index].cardGiftOvers = 0;
|
|
|
|
|
}
|
|
|
|
|
// }
|
|
|
|
|
// this.recIndex = -1;
|
|
|
|
|
@ -999,18 +1073,17 @@ export default {
|
|
|
|
|
let debtMoney =
|
|
|
|
|
(this.recForm.amount * 1 - this.recForm.cashAmount * 1).toFixed(2) * 1; //获取成交价
|
|
|
|
|
let form = { ...row }; //复制row
|
|
|
|
|
if(form.spendMoney>this.card4){
|
|
|
|
|
if (form.spendMoney > this.card4) {
|
|
|
|
|
this.$message.info({
|
|
|
|
|
message: "卡付金额大于项目金额"
|
|
|
|
|
});
|
|
|
|
|
form.spendMoney=this.card4
|
|
|
|
|
|
|
|
|
|
form.spendMoney = this.card4;
|
|
|
|
|
}
|
|
|
|
|
if(form.spendMoney<0){
|
|
|
|
|
if (form.spendMoney < 0) {
|
|
|
|
|
this.$message.info({
|
|
|
|
|
message: "卡付金额不能小于0"
|
|
|
|
|
});
|
|
|
|
|
form.spendMoney=0
|
|
|
|
|
form.spendMoney = 0;
|
|
|
|
|
}
|
|
|
|
|
//console.log("🚀 ~ file: service.vue ~ line 964 ~ endEditcard ~ form", form)
|
|
|
|
|
if (debtMoney > 0) {
|
|
|
|
|
@ -1024,7 +1097,7 @@ export default {
|
|
|
|
|
if (form.offsetMoney > debtMoney) {
|
|
|
|
|
//判断充值可用金额是否大于成交价如果大于直接用充值可用金额计算
|
|
|
|
|
form.discoutMoney =
|
|
|
|
|
(form.spendMoney / form.discount * 100).toFixed(2) * 1;
|
|
|
|
|
((form.spendMoney / form.discount) * 100).toFixed(2) * 1;
|
|
|
|
|
} else {
|
|
|
|
|
//判断充值可用金额是否大于成交价如果小于选择最大充值金额,剩下的用赠送金额计算
|
|
|
|
|
form.spendMoney = form.cardOver;
|
|
|
|
|
@ -1058,41 +1131,48 @@ export default {
|
|
|
|
|
let sunRatio =
|
|
|
|
|
(form.cardOver + form.giftConsumeMoney).toFixed(2) * 1; ///可用余额+赠送余额
|
|
|
|
|
let recRatio = (form.cardOver / sunRatio).toFixed(2) * 1; //可用余额比例
|
|
|
|
|
let recGiftRatio = (form.giftConsumeMoney / sunRatio).toFixed(2) * 1; //赠送余额比例
|
|
|
|
|
let recGiftRatio =
|
|
|
|
|
(form.giftConsumeMoney / sunRatio).toFixed(2) * 1; //赠送余额比例
|
|
|
|
|
if (form.offsetMoney > debtMoney * recRatio) {
|
|
|
|
|
if (this.recForm.noDiscount == 0) {
|
|
|
|
|
//可以打折
|
|
|
|
|
form.discoutMoney =
|
|
|
|
|
((form.spendMoney * 1) / (form.discount / 100)).toFixed(2) *
|
|
|
|
|
1; //充值卡支付的钱
|
|
|
|
|
if(form.spendMoney==this.card3){
|
|
|
|
|
form.giftSpendMoney =this.card2; //赠送实际出的钱
|
|
|
|
|
if (form.spendMoney == this.card3) {
|
|
|
|
|
form.giftSpendMoney = this.card2; //赠送实际出的钱
|
|
|
|
|
form.discoutGiftMoney =
|
|
|
|
|
((form.giftSpendMoney * 1) / (form.discountFreeAmount / 100)).toFixed(2) *
|
|
|
|
|
1;
|
|
|
|
|
}else{
|
|
|
|
|
form.giftSpendMoney =(((form.spendMoney * 1) / recRatio) * recGiftRatio).toFixed(2) * 1; //赠送实际出的钱
|
|
|
|
|
(
|
|
|
|
|
(form.giftSpendMoney * 1) /
|
|
|
|
|
(form.discountFreeAmount / 100)
|
|
|
|
|
).toFixed(2) * 1;
|
|
|
|
|
} else {
|
|
|
|
|
form.giftSpendMoney =
|
|
|
|
|
(((form.spendMoney * 1) / recRatio) * recGiftRatio).toFixed(
|
|
|
|
|
2
|
|
|
|
|
) * 1; //赠送实际出的钱
|
|
|
|
|
form.discoutGiftMoney =
|
|
|
|
|
((form.giftSpendMoney * 1) / (form.discountFreeAmount / 100)).toFixed(2) *
|
|
|
|
|
1;
|
|
|
|
|
(
|
|
|
|
|
(form.giftSpendMoney * 1) /
|
|
|
|
|
(form.discountFreeAmount / 100)
|
|
|
|
|
).toFixed(2) * 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
//不可以打折
|
|
|
|
|
|
|
|
|
|
form.discoutMoney = (form.spendMoney*1).toFixed(2) * 1; //充值卡支付的钱
|
|
|
|
|
if(form.spendMoney==this.card3){
|
|
|
|
|
form.giftSpendMoney =this.card2; //赠送实际出的钱
|
|
|
|
|
form.discoutMoney = (form.spendMoney * 1).toFixed(2) * 1; //充值卡支付的钱
|
|
|
|
|
if (form.spendMoney == this.card3) {
|
|
|
|
|
form.giftSpendMoney = this.card2; //赠送实际出的钱
|
|
|
|
|
form.discoutGiftMoney =
|
|
|
|
|
(this.appearPrice * 1-form.discoutMoney*1).toFixed(2) * 1;
|
|
|
|
|
}else{
|
|
|
|
|
(this.appearPrice * 1 - form.discoutMoney * 1).toFixed(2) *
|
|
|
|
|
1;
|
|
|
|
|
} else {
|
|
|
|
|
form.giftSpendMoney =
|
|
|
|
|
(((form.spendMoney * 1) / recRatio) * recGiftRatio).toFixed(
|
|
|
|
|
2
|
|
|
|
|
) * 1; //赠送实际出的钱
|
|
|
|
|
form.discoutGiftMoney = form.giftSpendMoney.toFixed(2) * 1; //赠送卡抵扣支付的钱
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
form.spendMoney = form.cardOver;
|
|
|
|
|
@ -1139,27 +1219,36 @@ export default {
|
|
|
|
|
// form.spendMoney = form.cardOver;
|
|
|
|
|
// form.giftSpendMoney = form.cardGiftOvers;
|
|
|
|
|
// }
|
|
|
|
|
form.cardOvers=(form.cardOver+(this.card1-form.spendMoney)).toFixed(2) * 1
|
|
|
|
|
form.cardGiftOvers=(form.giftConsumeMoney+(this.card2-form.giftSpendMoney)).toFixed(2) * 1
|
|
|
|
|
form.cardOver=(form.cardOver+(this.card1-form.spendMoney)).toFixed(2) * 1
|
|
|
|
|
form.giftConsumeMoney=(form.giftConsumeMoney+(this.card2-form.giftSpendMoney)).toFixed(2) * 1
|
|
|
|
|
this.card1=form.spendMoney;
|
|
|
|
|
this.card2=form.giftSpendMoney
|
|
|
|
|
if(form.cardOvers<0){
|
|
|
|
|
form.cardOvers =
|
|
|
|
|
(form.cardOver + (this.card1 - form.spendMoney)).toFixed(2) * 1;
|
|
|
|
|
form.cardGiftOvers =
|
|
|
|
|
(form.giftConsumeMoney + (this.card2 - form.giftSpendMoney)).toFixed(
|
|
|
|
|
2
|
|
|
|
|
) * 1;
|
|
|
|
|
form.cardOver =
|
|
|
|
|
(form.cardOver + (this.card1 - form.spendMoney)).toFixed(2) * 1;
|
|
|
|
|
form.giftConsumeMoney =
|
|
|
|
|
(form.giftConsumeMoney + (this.card2 - form.giftSpendMoney)).toFixed(
|
|
|
|
|
2
|
|
|
|
|
) * 1;
|
|
|
|
|
this.card1 = form.spendMoney;
|
|
|
|
|
this.card2 = form.giftSpendMoney;
|
|
|
|
|
if (form.cardOvers < 0) {
|
|
|
|
|
this.$message.info({
|
|
|
|
|
message: "此卡可用余额不足。"
|
|
|
|
|
});
|
|
|
|
|
form.cardOvers=(form.cardOvers+form.spendMoney).toFixed(2) * 1
|
|
|
|
|
form.spendMoney =(form.cardOvers).toFixed(2) * 1;
|
|
|
|
|
form.cardOvers=0
|
|
|
|
|
form.cardOvers = (form.cardOvers + form.spendMoney).toFixed(2) * 1;
|
|
|
|
|
form.spendMoney = form.cardOvers.toFixed(2) * 1;
|
|
|
|
|
form.cardOvers = 0;
|
|
|
|
|
}
|
|
|
|
|
if(form.cardGiftOvers<0){
|
|
|
|
|
if (form.cardGiftOvers < 0) {
|
|
|
|
|
this.$message.info({
|
|
|
|
|
message: "此卡赠送余额不足。"
|
|
|
|
|
});
|
|
|
|
|
form.cardGiftOvers=(form.cardGiftOvers+form.giftSpendMoney).toFixed(2) * 1
|
|
|
|
|
form.giftSpendMoney =(form.cardGiftOvers).toFixed(2) * 1;
|
|
|
|
|
form.cardGiftOvers=0
|
|
|
|
|
form.cardGiftOvers =
|
|
|
|
|
(form.cardGiftOvers + form.giftSpendMoney).toFixed(2) * 1;
|
|
|
|
|
form.giftSpendMoney = form.cardGiftOvers.toFixed(2) * 1;
|
|
|
|
|
form.cardGiftOvers = 0;
|
|
|
|
|
}
|
|
|
|
|
this.rowRecList.splice(index, 1, form); //将卡付卡的数据替换掉
|
|
|
|
|
this.list[this.editProIndex].collectionCashAmounts =
|
|
|
|
|
@ -1171,13 +1260,24 @@ export default {
|
|
|
|
|
this.list.forEach(item => {
|
|
|
|
|
num = (num + item.collectionCashAmounts).toFixed(2) * 1;
|
|
|
|
|
});
|
|
|
|
|
console.log("🚀 ~ file: service.vue ~ line 1165 ~ endEditcard ~ form.spendMoney", form.spendMoney)
|
|
|
|
|
console.log("🚀 ~ file: service.vue ~ line 1165 ~ endEditcard ~ form.giftSpendMoney", form.giftSpendMoney)
|
|
|
|
|
console.log("🚀 ~ file: service.vue ~ line 1165 ~ endEditcard ~ form.discoutMoney", form.discoutMoney)
|
|
|
|
|
console.log("🚀 ~ file: service.vue ~ line 1165 ~ endEditcard ~ form.discoutGiftMoney", form.discoutGiftMoney)
|
|
|
|
|
console.log(
|
|
|
|
|
"🚀 ~ file: service.vue ~ line 1165 ~ endEditcard ~ form.spendMoney",
|
|
|
|
|
form.spendMoney
|
|
|
|
|
);
|
|
|
|
|
console.log(
|
|
|
|
|
"🚀 ~ file: service.vue ~ line 1165 ~ endEditcard ~ form.giftSpendMoney",
|
|
|
|
|
form.giftSpendMoney
|
|
|
|
|
);
|
|
|
|
|
console.log(
|
|
|
|
|
"🚀 ~ file: service.vue ~ line 1165 ~ endEditcard ~ form.discoutMoney",
|
|
|
|
|
form.discoutMoney
|
|
|
|
|
);
|
|
|
|
|
console.log(
|
|
|
|
|
"🚀 ~ file: service.vue ~ line 1165 ~ endEditcard ~ form.discoutGiftMoney",
|
|
|
|
|
form.discoutGiftMoney
|
|
|
|
|
);
|
|
|
|
|
this.form.collectionCashAmounts = num;
|
|
|
|
|
this.sumNum();
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
sumNum() {
|
|
|
|
|
@ -1189,9 +1289,6 @@ export default {
|
|
|
|
|
(
|
|
|
|
|
spendMoney +
|
|
|
|
|
(item.discoutMoney * 1 + item.discoutGiftMoney * 1) * 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
).toFixed(2) * 1;
|
|
|
|
|
|
|
|
|
|
spendNumber =
|
|
|
|
|
@ -1219,10 +1316,13 @@ export default {
|
|
|
|
|
this.recForm.collectionCashAmount +
|
|
|
|
|
this.recForm.collectionIntegralAmount
|
|
|
|
|
).toFixed(2) * 1;
|
|
|
|
|
console.log("🚀 ~ file: service.vue ~ line 1213 ~ sumNum ~ this.recForm", this.recForm)
|
|
|
|
|
this.recForm.collectionAmounts =spendMoney?spendMoney.toFixed(2) * 1:0;;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
console.log(
|
|
|
|
|
"🚀 ~ file: service.vue ~ line 1213 ~ sumNum ~ this.recForm",
|
|
|
|
|
this.recForm
|
|
|
|
|
);
|
|
|
|
|
this.recForm.collectionAmounts = spendMoney
|
|
|
|
|
? spendMoney.toFixed(2) * 1
|
|
|
|
|
: 0;
|
|
|
|
|
|
|
|
|
|
this.recForm.rechargeAmount = spendNumber.toFixed(2) * 1;
|
|
|
|
|
this.list.splice(this.recForm.index, 1, this.recForm);
|
|
|
|
|
@ -1409,7 +1509,7 @@ export default {
|
|
|
|
|
this.$refs.repayment.show(this.memberForm);
|
|
|
|
|
},
|
|
|
|
|
inputMember() {
|
|
|
|
|
console.log('为什么会触发这么多次')
|
|
|
|
|
console.log("为什么会触发这么多次");
|
|
|
|
|
if (partten.phoneNum.test(this.memberForm.mobilePhone)) {
|
|
|
|
|
storeMemberOne({
|
|
|
|
|
mobilePhone: this.memberForm.mobilePhone,
|
|
|
|
|
@ -1478,9 +1578,10 @@ export default {
|
|
|
|
|
} else {
|
|
|
|
|
row.courseMoney = row.courseConsumePrice;
|
|
|
|
|
// row.collectionAmounts=row.transactionPrice
|
|
|
|
|
console.log("🚀 ~ file: service.vue ~ line 1466 ~ setProOne ~ row.transactionPrice", row)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
console.log(
|
|
|
|
|
"🚀 ~ file: service.vue ~ line 1466 ~ setProOne ~ row.transactionPrice",
|
|
|
|
|
row
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
let form = {};
|
|
|
|
|
proOne({
|
|
|
|
|
@ -1655,7 +1756,6 @@ export default {
|
|
|
|
|
let sumMoney = 0;
|
|
|
|
|
|
|
|
|
|
this.list.forEach((item, index) => {
|
|
|
|
|
|
|
|
|
|
if (item.courseAccountId == null) {
|
|
|
|
|
sumMoney +=
|
|
|
|
|
(
|
|
|
|
|
@ -1663,20 +1763,22 @@ export default {
|
|
|
|
|
item.collRecAmonnt -
|
|
|
|
|
item.collectionIntegralAmount
|
|
|
|
|
).toFixed(2) * 1;
|
|
|
|
|
}else{
|
|
|
|
|
item.transactionPrice*1;
|
|
|
|
|
console.log("🚀 ~ file: service.vue ~ line 1649 ~ this.list.forEach ~ item.transactionPrice", item.transactionPrice)
|
|
|
|
|
console.log("🚀 ~ file: service.vue ~ line 1649 ~ this.list.forEach ~ this.appearPrices", this.appearPrices)
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
item.transactionPrice * 1;
|
|
|
|
|
console.log(
|
|
|
|
|
"🚀 ~ file: service.vue ~ line 1649 ~ this.list.forEach ~ item.transactionPrice",
|
|
|
|
|
item.transactionPrice
|
|
|
|
|
);
|
|
|
|
|
console.log(
|
|
|
|
|
"🚀 ~ file: service.vue ~ line 1649 ~ this.list.forEach ~ this.appearPrices",
|
|
|
|
|
this.appearPrices
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
console.log("🚀 ~ file: service.vue ~ line 1695 ~ confirm ~ sumMoney", sumMoney)
|
|
|
|
|
console.log("🚀 ~ file: service.vue ~ line 1695 ~ confirm ~ this.form.collectionCashAmounts", this.appearPrices)
|
|
|
|
|
|
|
|
|
|
if (
|
|
|
|
|
this.balance <=
|
|
|
|
|
(this.appearPrices*1 - sumMoney).toFixed(2) * 1 ||
|
|
|
|
|
(this.appearPrices*1 - sumMoney).toFixed(2) * 1 < 0
|
|
|
|
|
this.balance <= (this.appearPrices * 1 - sumMoney).toFixed(2) * 1 ||
|
|
|
|
|
(this.appearPrices * 1 - sumMoney).toFixed(2) * 1 < 0
|
|
|
|
|
) {
|
|
|
|
|
flag = false;
|
|
|
|
|
this.$alert("实付金额不等于项目金额", "提示", {
|
|
|
|
|
@ -1686,8 +1788,6 @@ export default {
|
|
|
|
|
center: true,
|
|
|
|
|
callback: action => {}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if (this.isAddition == 1 && !this.additionDate) {
|
|
|
|
|
flag = false;
|
|
|
|
|
@ -1767,6 +1867,10 @@ export default {
|
|
|
|
|
let payLists = [];
|
|
|
|
|
let rechargeAccountList = [];
|
|
|
|
|
this.payLists.forEach(item => {
|
|
|
|
|
this.payMoneysum = this.payMoneysum * 1 + item.payMoney * 1;
|
|
|
|
|
|
|
|
|
|
this.payMoneysums = this.payMoneysum / this.list.length;
|
|
|
|
|
|
|
|
|
|
if (item.payMoney > 0) {
|
|
|
|
|
let items = {
|
|
|
|
|
payMoney: item.payMoney,
|
|
|
|
|
@ -1792,23 +1896,38 @@ export default {
|
|
|
|
|
list.push(item);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
let collectionAmountsum=0
|
|
|
|
|
list.forEach(item => {
|
|
|
|
|
collectionAmountsum=item.collectionAmount*1+collectionAmountsum*1;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// console.log("🚀 ~ file: service.vue ~ line 1796 ~ addCashConfirm ~ list", list)
|
|
|
|
|
// list.forEach(item => {
|
|
|
|
|
// console.log(item.collectionAmount)
|
|
|
|
|
// collectionAmountsum=item.collectionAmount*1+collectionAmountsum*1;
|
|
|
|
|
// });
|
|
|
|
|
// console.log("🚀 ~ file: service.vue ~ line 1800 ~ addCashConfirm ~ collectionAmountsum", collectionAmountsum)
|
|
|
|
|
this.formData.append("cashListRequestList", JSON.stringify(list));
|
|
|
|
|
// collectionAmount
|
|
|
|
|
if(collectionAmountsum==0){
|
|
|
|
|
if (this.payMoneysums != this.appearPrices) {
|
|
|
|
|
this.$alert("还未进行支付", "提示", {
|
|
|
|
|
confirmButtonText: "确定",
|
|
|
|
|
confirmButtonClass: "confirmbtnFalses",
|
|
|
|
|
type: "warning",
|
|
|
|
|
center: true,
|
|
|
|
|
callback: action => {}
|
|
|
|
|
callback: action => {
|
|
|
|
|
this.payMoneysum = 0;
|
|
|
|
|
this.payMoneysums = 0;
|
|
|
|
|
this.payLists.forEach(item=>{
|
|
|
|
|
item.payMoney=0
|
|
|
|
|
});
|
|
|
|
|
var that = this;
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
that.$nextTick(() => {
|
|
|
|
|
that.$refs.payment.show(that.form, that.payLists);
|
|
|
|
|
});
|
|
|
|
|
}, 500);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
this.formData = new FormData();
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
addCash(this.formData).then(res => {
|
|
|
|
|
if (res.code == "000000") {
|
|
|
|
|
this.$message.success({
|
|
|
|
|
@ -1832,9 +1951,6 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
openStaffRatio(row, index, text) {
|
|
|
|
|
this.editIndex = index;
|
|
|
|
|
@ -1862,7 +1978,7 @@ export default {
|
|
|
|
|
payLists: this.payLists,
|
|
|
|
|
rechargeAccountList: [], //卡付列表
|
|
|
|
|
collectionCashAmounts: 0,
|
|
|
|
|
collectionAmounts:0,
|
|
|
|
|
collectionAmounts: 0
|
|
|
|
|
};
|
|
|
|
|
this.projectMomey = 0;
|
|
|
|
|
this.recIndex = -1;
|
|
|
|
|
@ -1870,10 +1986,10 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
delPro(row) {
|
|
|
|
|
//console.log("🚀 ~ file: service.vue ~ line 1761 ~ delPro ~ row", row)
|
|
|
|
|
row.rechargeAccountList.forEach((item)=>{
|
|
|
|
|
item.cardOvers= item.cardOvers+item.spendMoney
|
|
|
|
|
item.cardGiftOvers= item.cardGiftOvers+item.giftSpendMoney
|
|
|
|
|
})
|
|
|
|
|
row.rechargeAccountList.forEach(item => {
|
|
|
|
|
item.cardOvers = item.cardOvers + item.spendMoney;
|
|
|
|
|
item.cardGiftOvers = item.cardGiftOvers + item.giftSpendMoney;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// this.czRecList(row);
|
|
|
|
|
this.list.splice(row.index, 1);
|
|
|
|
|
@ -2373,9 +2489,9 @@ export default {
|
|
|
|
|
).toFixed(2) * 1;
|
|
|
|
|
money += debtMoney;
|
|
|
|
|
}
|
|
|
|
|
collectionRechargeAmountg =collectionRechargeAmountg+
|
|
|
|
|
collectionRechargeAmountg =
|
|
|
|
|
collectionRechargeAmountg +
|
|
|
|
|
item.collectionRechargeAmount.toFixed(2) * 1;
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// 总付金额计算
|
|
|
|
|
|