diff --git a/src/pages/eashier/raiseReatment/components/index.vue b/src/pages/eashier/raiseReatment/components/index.vue
index 1b81ccd..75ada42 100644
--- a/src/pages/eashier/raiseReatment/components/index.vue
+++ b/src/pages/eashier/raiseReatment/components/index.vue
@@ -123,7 +123,7 @@
成交金额 : {{ inMoneys }}
转入金额 : {{ outMoneys }}
现付金额 : {{ payMoneys }}
- 欠款金额金额 : {{ debtMoney }}
+ 欠款金额 : {{ debtMoney }}
{
this.loading = false;
if (res.code == "000000") {
diff --git a/src/pages/eashier/service/service.vue b/src/pages/eashier/service/service.vue
index 3bca68c..cb51d6c 100644
--- a/src/pages/eashier/service/service.vue
+++ b/src/pages/eashier/service/service.vue
@@ -455,7 +455,6 @@
prop="spendMoney"
label="本次支付"
width="90"
-
>
收银列表
-
+
{{
isAddition == 1 ? "收银" : "补单"
}}
@@ -688,7 +687,6 @@ import recash from "./recash";
import orders from "./detail/detail";
import { partten } from "@/utils/partten/index.js";
export default {
-
components: {
member,
reccard,
@@ -723,6 +721,8 @@ export default {
list: [], //主数组
listCopy: [],
rowList: [],
+ payMoneysum: 0,
+ payMoneysums: 0,
form: {
collectionCashAmount: 0,
collectionCashAmounts: 0,
@@ -758,11 +758,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
};
},
computed: {
@@ -774,13 +774,13 @@ export default {
*/
let num = this.list.reduce((pre, item) => {
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);
} // 抵扣金额不存在,项目金额存在
@@ -817,20 +817,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; // 项目金额不存在
@@ -867,114 +870,206 @@ export default {
},
//修改卡付金额
editcard(row, index) {
- this.recIndex = index
- 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) {
+ //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].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)
- this.rowRecList[index].discoutGiftMoney =
- (this.appearPrice-this.rowRecList[index].discoutMoney ).toFixed(2) * 1; //赠送实际出的钱
- this.rowRecList[index].discoutGiftMoney= Math.trunc(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;
+
+ // 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
+ // }
+ // if(this.projectMomey<0){
+ // this.projectMomey=this.recForm.amount
+ // }
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;
}
if (debtMoney > 0) {
//判断成交价是否大于0
@@ -988,7 +1083,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;
@@ -1023,7 +1118,8 @@ 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) {
console.log('会到这里---|||---',this.recForm.noDiscount)
if (this.recForm.noDiscount == 0) {
@@ -1031,34 +1127,40 @@ export default {
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;
@@ -1092,28 +1194,41 @@ export default {
}
} else {
}
- 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){
+ // if (form.spendMoney > form.cardOver) {
+ // 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) {
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 =
(
@@ -1124,10 +1239,22 @@ 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.recIndex =-1
this.sumNum();
@@ -1141,9 +1268,6 @@ export default {
(
spendMoney +
(item.discoutMoney * 1 + item.discoutGiftMoney * 1) * 1
-
-
-
).toFixed(2) * 1;
spendNumber =
@@ -1171,8 +1295,14 @@ 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);
let rList = [];
@@ -1430,9 +1560,10 @@ export default {
} else {
row.courseMoney = row.courseConsumePrice;
// row.collectionAmounts=row.transactionPrice
- console.log("----||-->>", row)
-
-
+ console.log(
+ "🚀 ~ file: service.vue ~ line 1466 ~ setProOne ~ row.transactionPrice",
+ row
+ );
}
let form = {};
proOne({
@@ -1606,7 +1737,6 @@ export default {
}
let sumMoney = 0;
this.list.forEach((item, index) => {
-
if (item.courseAccountId == null) {
sumMoney +=
(
@@ -1614,15 +1744,22 @@ export default {
item.collRecAmonnt -
item.collectionIntegralAmount
).toFixed(2) * 1;
- }else{
- item.transactionPrice*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
+ );
}
});
+
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("实付金额不等于项目金额", "提示", {
@@ -1632,8 +1769,6 @@ export default {
center: true,
callback: action => {}
});
-
-
}
if (this.isAddition == 1 && !this.additionDate) {
flag = false;
@@ -1672,7 +1807,7 @@ export default {
}
}
},
-
+
addCashConfirm() {
let list = [];
//console.log("🚀 ~ file: service.vue ~ line 1728 ~ addCashConfirm ~ this.list", this.list)
@@ -1713,6 +1848,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,
@@ -1738,20 +1877,35 @@ 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{
@@ -1829,7 +1983,7 @@ export default {
payLists: this.payLists,
rechargeAccountList: [], //卡付列表
collectionCashAmounts: 0,
- collectionAmounts:0,
+ collectionAmounts: 0
};
this.projectMomey = 0;
this.recIndex = -1;
@@ -1837,10 +1991,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);
@@ -2340,9 +2494,9 @@ export default {
).toFixed(2) * 1;
money += debtMoney;
}
- collectionRechargeAmountg =collectionRechargeAmountg+
- (item.collectionRechargeAmount.toFixed(2) * 1);
-
+ collectionRechargeAmountg =
+ collectionRechargeAmountg +
+ item.collectionRechargeAmount.toFixed(2) * 1;
});
// 总付金额计算
diff --git a/src/pages/storeManage/storeParameters/storeParameters.vue b/src/pages/storeManage/storeParameters/storeParameters.vue
index 13e1ec4..23d5335 100644
--- a/src/pages/storeManage/storeParameters/storeParameters.vue
+++ b/src/pages/storeManage/storeParameters/storeParameters.vue
@@ -690,9 +690,9 @@ export default {
dataList.cardCangeListDebt == 0 &&
dataList.cardCangeListDebt != undefined
) {
- dataList.cardCangeListDebt = true;
- } else {
dataList.cardCangeListDebt = false;
+ } else {
+ dataList.cardCangeListDebt = true;
}
if (dataList.promotion == 1 && dataList.promotion != undefined) {
@@ -852,9 +852,9 @@ export default {
"|" +
"数字加价转疗程欠款的最大欠款比例";
}
- dataList.cardCangeListDebt = 0;
- } else {
dataList.cardCangeListDebt = 1;
+ } else {
+ dataList.cardCangeListDebt = 0;
delete dataList.cardCangeListDebtUsable;
delete dataList.cardCangeListRatio;
}
@@ -1135,6 +1135,7 @@ export default {
},
});
}
+ console.log(dataList)
},
//同步总店参数
copy() {