直接收银收银

master
Wangxubin1999 3 years ago
parent c8c073997c
commit 21f66198a6

@ -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"
@ -635,7 +634,7 @@
<el-button size="samll" type="primary" plain @click="openList"
>收银列表</el-button
>
<el-button size="samll" type="primary" plain @click="goBack">{{
isAddition == 1 ? "收银" : "补单"
}}</el-button>
@ -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,15 +766,18 @@ 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,18 +796,21 @@ 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.courseAccountId == null){
item.collectionAmounts = (item.collectionAmounts*1).toFixed(2) * 1;
}else{
item.collectionAmounts =(item.transactionPrice*1).toFixed(2) * 1;
}
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.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; //
@ -877,119 +886,184 @@ export default {
editcard(row, index) {
//console.log("🚀 ~ file: service.vue ~ line 837 ~ editcard ~ row", row);
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.list[this.projectIndex].noDiscount == 1) {
this.rowRecList[index].spendMoney =this.appearPrice;
} else {
this.rowRecList[index].spendMoney =
(
this.appearPrice *1 *(row.discount / 100) *1
).toFixed(2) * 1;
}
this.rowRecList[index].giftSpendMoney=0;
}else{
if (this.useRecharge == 2) {
if (this.recForm.noDiscount == 0) {
if (this.rowRecList[index].type == 1) {
if (this.list[this.projectIndex].noDiscount == 1) {
this.rowRecList[index].spendMoney = this.appearPrice;
} else {
this.rowRecList[index].spendMoney =
(this.appearPrice * 1 * (row.discount / 100) * 1).toFixed(2) * 1;
}
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;
} else {
//
this.rowRecList[index].spendMoney = //
(
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; //
}
} else {
//
if (form.offsetMoney > debtMoney) {
//
this.rowRecList[index].spendMoney = this.appearPrice;
} else {
//
this.rowRecList[index].spendMoney = this.rowRecList[
index
].cardOver;
this.rowRecList[index].giftSpendMoney =
(this.appearPrice - this.rowRecList[index].spendMoney).toFixed(
2
) * 1;
}
}
} 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
) {
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
} else {
//
this.rowRecList[index].spendMoney = //
(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.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
);
//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;
} else {
//
if (form.offsetMoney > debtMoney) {
//
this.rowRecList[index].spendMoney = this.appearPrice;
} else {
//
this.rowRecList[index].spendMoney = this.rowRecList[index].cardOver;
this.rowRecList[index].giftSpendMoney =
(this.appearPrice - this.rowRecList[index].spendMoney).toFixed(2) * 1;
}
this.rowRecList[index].spendMoney =
(this.appearPrice * 1 * recRatio).toFixed(2) * 1; //
this.rowRecList[index].giftSpendMoney =
(this.appearPrice * 1 * recGiftRatio).toFixed(2) * 1; //
}
}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) {
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)
//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)
//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;
} else {
//
this.rowRecList[index].spendMoney =
((this.appearPrice * 1) * recRatio).toFixed(2) *1; //
this.rowRecList[index].giftSpendMoney =
((this.appearPrice * 1) * recGiftRatio).toFixed(2) * 1; //
}
}
// else {
// form.spendMoney = form.cardOver;
// form.discoutMoney =
// (form.spendMoney * 1 * (form.discount / 100)).toFixed(2) * 1;
// form.giftSpendMoney =
// (((form.spendMoney * 1) / recRatio) * recGiftRatio).toFixed(2) *
// 1;
}
// else {
// form.spendMoney = form.cardOver;
// form.discoutMoney =
// (form.spendMoney * 1 * (form.discount / 100)).toFixed(2) * 1;
// form.giftSpendMoney =
// (((form.spendMoney * 1) / recRatio) * recGiftRatio).toFixed(2) *
// 1;
// form.discoutGiftMoney = //
// (form.giftSpendMoney * (form.discount / 100)).toFixed(2) * 1;
// }
// form.discoutGiftMoney = //
// (form.giftSpendMoney * (form.discount / 100)).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
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
}
if(this.rowRecList[index].cardGiftOvers<0){
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;
}
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
}
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.recIndex = -1;
},
endEditcard(row, index) {
this.recForm.cashAmount = 0;
//console.log(this.recForm);
// if(this.projectMomey==this.recForm.amount){
// this.projectMomey=0
// }
@ -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
message: "卡付金额大于项目金额"
});
form.spendMoney = this.card4;
}
if(form.spendMoney<0){
if (form.spendMoney < 0) {
this.$message.info({
message: "卡付金额不能小于0"
});
form.spendMoney=0
message: "卡付金额不能小于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; //
(((form.spendMoney * 1) / recRatio) * recGiftRatio).toFixed(
2
) * 1; //
form.discoutGiftMoney = form.giftSpendMoney.toFixed(2) * 1; //
}
}
} else {
form.spendMoney = form.cardOver;
@ -1139,28 +1219,37 @@ 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
}
if(form.cardGiftOvers<0){
message: "此卡可用余额不足。"
});
form.cardOvers = (form.cardOvers + form.spendMoney).toFixed(2) * 1;
form.spendMoney = form.cardOvers.toFixed(2) * 1;
form.cardOvers = 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
}
message: "此卡赠送余额不足。"
});
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;
@ -1726,7 +1826,7 @@ export default {
}
}
},
addCashConfirm() {
let list = [];
//console.log("🚀 ~ file: service.vue ~ line 1728 ~ addCashConfirm ~ this.list", this.list)
@ -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,49 +1896,61 @@ 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){
this.$alert("还未进行支付", "提示", {
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{
addCash(this.formData).then(res => {
if (res.code == "000000") {
this.$message.success({
message: "验证成功 , 收银" + res.message
});
this.formData = new FormData();
this.notData();
} else {
this.payLists = this.payListsCopy;
this.list.forEach(item => {
item.collectionCashAmount = 0;
});
this.$alert("收银" + res.message, "提示", {
confirmButtonText: "确定",
confirmButtonClass: "confirmbtnFalses",
type: "warning",
center: true,
callback: action => {}
});
this.formData = new FormData();
}
});
}
} else {
addCash(this.formData).then(res => {
if (res.code == "000000") {
this.$message.success({
message: "验证成功 , 收银" + res.message
});
this.formData = new FormData();
this.notData();
} else {
this.payLists = this.payListsCopy;
this.list.forEach(item => {
item.collectionCashAmount = 0;
});
this.$alert("收银" + res.message, "提示", {
confirmButtonText: "确定",
confirmButtonClass: "confirmbtnFalses",
type: "warning",
center: true,
callback: action => {}
});
this.formData = new FormData();
}
});
}
},
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;
});
//

Loading…
Cancel
Save