|
|
|
|
@ -221,7 +221,7 @@
|
|
|
|
|
</el-table>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- <recash ref="recash" @recashData="recashData"></recash> -->
|
|
|
|
|
<el-button slot="reference">充值卡</el-button>
|
|
|
|
|
<el-button slot="reference" @click="selectindex(props.row)">充值卡</el-button>
|
|
|
|
|
</el-popover>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-else>不允许卡付</div>
|
|
|
|
|
@ -393,6 +393,9 @@ export default {
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
selectindex(row) {
|
|
|
|
|
console.log(row)
|
|
|
|
|
},
|
|
|
|
|
changeMember() {
|
|
|
|
|
if (this.cashNumber == 1) {
|
|
|
|
|
Object.assign(this.$data, this.$options.data.call(this));
|
|
|
|
|
@ -415,139 +418,16 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
//修改卡付金额
|
|
|
|
|
editcard(row, index) {
|
|
|
|
|
|
|
|
|
|
this.recIndex = index;
|
|
|
|
|
// let debtMoney =
|
|
|
|
|
// (this.recForm.amount * 1 - this.recForm.cashAmount * 1).toFixed(2) * 1;
|
|
|
|
|
// let form = { ...row };
|
|
|
|
|
// //console.log(debtMoney);//套餐价格
|
|
|
|
|
// if (debtMoney > 0) {
|
|
|
|
|
// // let cardMoney =
|
|
|
|
|
// // (form.offsetMoney + form.offsetGiftMoney).toFixed(2) * 1;
|
|
|
|
|
// // if (cardMoney < debtMoney) {
|
|
|
|
|
// // form.spendMoney = form.cardOver;
|
|
|
|
|
// // form.giftSpendMoney = form.giftConsumeMoney;
|
|
|
|
|
// // form.discoutMoney = form.offsetMoney;
|
|
|
|
|
// // form.discoutGiftMoney = form.offsetGiftMoney;
|
|
|
|
|
// // } else {
|
|
|
|
|
// //console.log(form);
|
|
|
|
|
// //console.log(form.type);
|
|
|
|
|
// //console.log(this.useRecharge);
|
|
|
|
|
// if (form.type == 2 || form.type == 0) {
|
|
|
|
|
// if (this.useRecharge == 2) {
|
|
|
|
|
// //先用充值再用赠送
|
|
|
|
|
// if (this.recForm.noDiscount == 0) {
|
|
|
|
|
// if (form.offsetMoney > debtMoney) {
|
|
|
|
|
// form.spendMoney =
|
|
|
|
|
// ((debtMoney * form.discount) / 100).toFixed(2) * 1;
|
|
|
|
|
// } else {
|
|
|
|
|
// form.spendMoney = form.cardOver;
|
|
|
|
|
// form.discoutMoney =
|
|
|
|
|
// (form.cardOver * (form.discount / 100)).toFixed(2) * 1;
|
|
|
|
|
|
|
|
|
|
// form.giftSpendMoney =
|
|
|
|
|
// (
|
|
|
|
|
// (debtMoney - form.discoutMoney) *
|
|
|
|
|
// (form.discountFreeAmount / 100)
|
|
|
|
|
// ).toFixed(2) * 1;
|
|
|
|
|
// form.discoutGiftMoney =
|
|
|
|
|
// (debtMoney - form.discoutMoney).toFixed(2) * 1;
|
|
|
|
|
// }
|
|
|
|
|
// } else {
|
|
|
|
|
// if (form.offsetMoney > debtMoney) {
|
|
|
|
|
// form.spendMoney = debtMoney;
|
|
|
|
|
// } else {
|
|
|
|
|
// form.spendMoney = form.cardOver;
|
|
|
|
|
// form.discoutMoney = form.cardOver.toFixed(2) * 1;
|
|
|
|
|
// form.giftSpendMoney =
|
|
|
|
|
// (debtMoney - form.discoutMoney).toFixed(2) * 1;
|
|
|
|
|
// form.discoutGiftMoney =
|
|
|
|
|
// (debtMoney - form.discoutMoney).toFixed(2) * 1;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// } else {
|
|
|
|
|
// //按比例使用
|
|
|
|
|
// let sunRatio =
|
|
|
|
|
// (form.cardRestMoney + form.cardGiftOvers).toFixed(2) * 1;///可用余额+赠送余额
|
|
|
|
|
// let recRatio = (form.cardRestMoney / sunRatio).toFixed(2) * 1;//可用余额比例
|
|
|
|
|
// let recGiftRatio = (form.cardGiftOvers / sunRatio).toFixed(2) * 1;//赠送余额比例
|
|
|
|
|
// //console.log(form.cardRestMoney);//可用余额
|
|
|
|
|
// //console.log(form.cardGiftOvers);//赠送余额
|
|
|
|
|
// //console.log(sunRatio);//可用余额+赠送余额
|
|
|
|
|
// //console.log()
|
|
|
|
|
// if (form.offsetMoney > debtMoney * recRatio) {//
|
|
|
|
|
// if (this.recForm.noDiscount == 0) {
|
|
|
|
|
// form.spendMoney =//充值卡支付的钱
|
|
|
|
|
// (debtMoney * recRatio * (form.discount / 100)).toFixed(2) * 1;
|
|
|
|
|
// //console.log(recRatio)
|
|
|
|
|
// //console.log(form.spendMoney)
|
|
|
|
|
// form.discoutMoney = (debtMoney * recRatio).toFixed(2) * 1;//
|
|
|
|
|
// form.giftSpendMoney =//赠送卡支付的钱
|
|
|
|
|
// (
|
|
|
|
|
// debtMoney *
|
|
|
|
|
// recGiftRatio *
|
|
|
|
|
// (form.discountFreeAmount / 100)
|
|
|
|
|
// ).toFixed(2) * 1;
|
|
|
|
|
// //console.log(form.giftSpendMoney)
|
|
|
|
|
// form.discoutGiftMoney =
|
|
|
|
|
// (debtMoney * recGiftRatio).toFixed(2) * 1;
|
|
|
|
|
// } else {
|
|
|
|
|
// //console.log(debtMoney);
|
|
|
|
|
// form.spendMoney = (debtMoney * recRatio).toFixed(2) * 1;
|
|
|
|
|
// form.discoutMoney = (debtMoney * recRatio).toFixed(2) * 1;
|
|
|
|
|
// form.giftSpendMoney = (debtMoney * recGiftRatio).toFixed(2) * 1;
|
|
|
|
|
// form.discoutGiftMoney =
|
|
|
|
|
// (debtMoney * recGiftRatio).toFixed(2) * 1;
|
|
|
|
|
// }
|
|
|
|
|
// } else {
|
|
|
|
|
// form.spendMoney = form.cardOver;
|
|
|
|
|
// form.discoutMoney =
|
|
|
|
|
// (form.cardOver / (form.discount / 100)).toFixed(2) * 1;
|
|
|
|
|
// form.giftSpendMoney =
|
|
|
|
|
// debtMoney * recRatio -
|
|
|
|
|
// form.discoutMoney +
|
|
|
|
|
// (debtMoney * recGiftRatio).toFixed(2) * 1;
|
|
|
|
|
// form.discoutGiftMoney =
|
|
|
|
|
// (
|
|
|
|
|
// debtMoney * recRatio -
|
|
|
|
|
// form.discoutMoney +
|
|
|
|
|
// (debtMoney * recGiftRatio) / (form.discountFreeAmount / 100)
|
|
|
|
|
// ).toFixed(2) * 1;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// if (form.spendMoney == 0) {
|
|
|
|
|
// form.giftSpendMoney = 0;
|
|
|
|
|
// form.discoutMoney = 0;
|
|
|
|
|
// form.discoutGiftMoney = 0;
|
|
|
|
|
// }
|
|
|
|
|
// } else {
|
|
|
|
|
// if (this.recForm.noDiscount == 0) {
|
|
|
|
|
// // 可以打折
|
|
|
|
|
// form.spendMoney =
|
|
|
|
|
// ((debtMoney * form.discount) / 100).toFixed(2) * 1;
|
|
|
|
|
// } else {
|
|
|
|
|
// // 不可以打折
|
|
|
|
|
// form.spendMoney = debtMoney;
|
|
|
|
|
// }
|
|
|
|
|
// form.discoutMoney = debtMoney;
|
|
|
|
|
// }
|
|
|
|
|
// } else {
|
|
|
|
|
// form.spendMoney = 0;
|
|
|
|
|
// form.giftSpendMoney = 0;
|
|
|
|
|
// }
|
|
|
|
|
// if (form.spendMoney > form.cardOver) {
|
|
|
|
|
// form.spendMoney = form.cardOver;
|
|
|
|
|
// form.giftSpendMoney = form.cardGiftOvers;
|
|
|
|
|
// }
|
|
|
|
|
// this.rowRecList.splice(index, 1, form);
|
|
|
|
|
console.log(index)
|
|
|
|
|
},
|
|
|
|
|
endEditcard(row, index) {
|
|
|
|
|
//console.log(row)
|
|
|
|
|
|
|
|
|
|
console.log(index)
|
|
|
|
|
let debtMoney =
|
|
|
|
|
(this.recForm.amount * 1 - this.recForm.cashAmount * 1).toFixed(2) * 1;
|
|
|
|
|
console.log(this.recForm)
|
|
|
|
|
let form = { ...row };
|
|
|
|
|
//console.log(form)
|
|
|
|
|
console.log(form)
|
|
|
|
|
//console.log(debtMoney);//套餐价格
|
|
|
|
|
if (debtMoney > 0) {
|
|
|
|
|
if (form.type == 2 || form.type == 0) {
|
|
|
|
|
@ -588,19 +468,14 @@ export default {
|
|
|
|
|
(form.cardRestMoney + form.cardGiftOvers).toFixed(2) * 1;///可用余额+赠送余额
|
|
|
|
|
let recRatio = (form.cardRestMoney / sunRatio).toFixed(2) * 1;//可用余额比例
|
|
|
|
|
let recGiftRatio = (form.cardGiftOvers / sunRatio).toFixed(2) * 1;//赠送余额比例
|
|
|
|
|
//console.log(form.cardRestMoney);//可用余额
|
|
|
|
|
//console.log(form.cardGiftOvers);//赠送余额
|
|
|
|
|
//console.log(sunRatio);//可用余额+赠送余额
|
|
|
|
|
//console.log(form.spendMoney)
|
|
|
|
|
if (form.offsetMoney > debtMoney * recRatio) {//
|
|
|
|
|
if (this.recForm.noDiscount == 0) {
|
|
|
|
|
form.discoutMoney =//充值卡支付的钱
|
|
|
|
|
((form.spendMoney * 1) / (form.discount / 100)).toFixed(2) * 1;
|
|
|
|
|
//console.log(recRatio)
|
|
|
|
|
//console.log(form.spendMoney)
|
|
|
|
|
form.giftSpendMoney = ((form.spendMoney * 1) / recRatio * recGiftRatio).toFixed(2) * 1;
|
|
|
|
|
console.log("这个是赠送金额" + form.giftSpendMoney)
|
|
|
|
|
form.discoutGiftMoney =//赠送卡支付的钱
|
|
|
|
|
((form.spendMoney * 1) / recRatio * recGiftRatio / (form.discountFreeAmount / 100)).toFixed(2) * 1;
|
|
|
|
|
(form.giftSpendMoney / (form.discountFreeAmount / 100)).toFixed(2) * 1;
|
|
|
|
|
//console.log(form.discoutGiftMoney)
|
|
|
|
|
} else {
|
|
|
|
|
//console.log(debtMoney);
|
|
|
|
|
@ -616,6 +491,7 @@ export default {
|
|
|
|
|
form.discoutMoney =
|
|
|
|
|
((form.spendMoney * 1) * (form.discount / 100)).toFixed(2) * 1;
|
|
|
|
|
form.giftSpendMoney = ((form.spendMoney * 1) / recRatio * recGiftRatio).toFixed(2) * 1;
|
|
|
|
|
console.log("这个是赠送金额" + form.giftSpendMoney)
|
|
|
|
|
form.discoutGiftMoney =//赠送卡支付的钱
|
|
|
|
|
(form.giftSpendMoney * (form.discount / 100)).toFixed(2) * 1;
|
|
|
|
|
}
|
|
|
|
|
@ -628,15 +504,16 @@ export default {
|
|
|
|
|
} else {
|
|
|
|
|
if (this.recForm.noDiscount == 0) {
|
|
|
|
|
// 可以打折
|
|
|
|
|
form.spendMoney =
|
|
|
|
|
((debtMoney * form.discount) / 100).toFixed(2) * 1;
|
|
|
|
|
|
|
|
|
|
form.discoutMoney =
|
|
|
|
|
((form.spendMoney * form.discount) / 100).toFixed(2) * 1;
|
|
|
|
|
} else {
|
|
|
|
|
// 不可以打折
|
|
|
|
|
form.spendMoney = debtMoney;
|
|
|
|
|
不可以打折
|
|
|
|
|
form.discoutMoney = form.spendMoney;
|
|
|
|
|
}
|
|
|
|
|
form.discoutMoney = debtMoney;
|
|
|
|
|
form.discoutGiftMoney=0
|
|
|
|
|
}
|
|
|
|
|
if (form.discoutGiftMoney + form.discoutMoney > this.list[index].amount) {
|
|
|
|
|
if (form.discoutGiftMoney + form.discoutMoney > this.list[this.editProIndex].amount) {
|
|
|
|
|
this.$message.info({
|
|
|
|
|
message: "卡付金额不能大于套餐金额",
|
|
|
|
|
});
|
|
|
|
|
@ -660,7 +537,7 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.rowRecList.splice(index, 1, form);
|
|
|
|
|
this.list[index].collectionCashAmounts = this.list[index].amount - (form.discoutMoney + form.discoutGiftMoney)
|
|
|
|
|
this.list[this.editProIndex].collectionCashAmounts = this.list[this.editProIndex].amount - (form.discoutMoney + form.discoutGiftMoney)
|
|
|
|
|
//console.log(this.list)
|
|
|
|
|
//console.log('这是index'+index)
|
|
|
|
|
let num = 0;
|
|
|
|
|
@ -788,6 +665,7 @@ export default {
|
|
|
|
|
this.recForm = JSON.parse(JSON.stringify(row));
|
|
|
|
|
this.rowRecList = JSON.parse(JSON.stringify(row.rechargeAccountList));
|
|
|
|
|
this.editProIndex = row.index;
|
|
|
|
|
console.log( this.editProIndex)
|
|
|
|
|
},
|
|
|
|
|
recashData(v) {
|
|
|
|
|
this.list = v.list;
|
|
|
|
|
@ -1306,10 +1184,10 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
console.log(list)
|
|
|
|
|
|
|
|
|
|
list.forEach((item)=>{
|
|
|
|
|
item.collectionAmount=item.collectionAmounts
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
list.forEach((item) => {
|
|
|
|
|
item.collectionAmount = item.collectionAmounts
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
console.log(list)
|
|
|
|
|
this.formData.append("cashListRequestList", JSON.stringify(list));
|
|
|
|
|
@ -1318,7 +1196,7 @@ export default {
|
|
|
|
|
this.$message.success({
|
|
|
|
|
message: "验证成功 , 收银" + res.message,
|
|
|
|
|
});
|
|
|
|
|
this.formData =new FormData()
|
|
|
|
|
this.formData = new FormData()
|
|
|
|
|
this.notData();
|
|
|
|
|
} else {
|
|
|
|
|
this.payLists = this.payListsCopy;
|
|
|
|
|
@ -1332,14 +1210,20 @@ export default {
|
|
|
|
|
center: true,
|
|
|
|
|
callback: (action) => { },
|
|
|
|
|
});
|
|
|
|
|
this.formData = new FormData()
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
openStaffRatio(row, index, text) {
|
|
|
|
|
this.editIndex = index;
|
|
|
|
|
console.log(row)
|
|
|
|
|
this.$refs.staffratio.show(row, text);
|
|
|
|
|
this.$refs.staffratio.showdetele();
|
|
|
|
|
localStorage.setItem("row",JSON.stringify(row))
|
|
|
|
|
localStorage.setItem("text",text)
|
|
|
|
|
},
|
|
|
|
|
staffratioData(v) {
|
|
|
|
|
console.log(v)
|
|
|
|
|
let form = this.list[this.editIndex];
|
|
|
|
|
let texts = v.text + "s";
|
|
|
|
|
form[v.text] = v.list;
|
|
|
|
|
|