|
|
|
@ -468,9 +468,8 @@
|
|
|
|
v-focus
|
|
|
|
v-focus
|
|
|
|
type="number"
|
|
|
|
type="number"
|
|
|
|
size="samll"
|
|
|
|
size="samll"
|
|
|
|
onkeyup="value=value.replace(/[^\d]/g,' ')"
|
|
|
|
|
|
|
|
class="form-input-width"
|
|
|
|
class="form-input-width"
|
|
|
|
@blur="endEditcard(scope.row, scope.$index,props.$index)"
|
|
|
|
@blur="endEditcard(scope.row, scope.$index)"
|
|
|
|
v-model="scope.row.spendMoney"
|
|
|
|
v-model="scope.row.spendMoney"
|
|
|
|
></el-input>
|
|
|
|
></el-input>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
@ -923,6 +922,9 @@ export default {
|
|
|
|
collectionRechargeAmount = collectionRechargeAmount.toFixed(2)*1
|
|
|
|
collectionRechargeAmount = collectionRechargeAmount.toFixed(2)*1
|
|
|
|
collectionAmounts = collectionAmounts.toFixed(2)*1
|
|
|
|
collectionAmounts = collectionAmounts.toFixed(2)*1
|
|
|
|
this.$set(this.list[this.projectIndex],'collectionRechargeAmount',collectionRechargeAmount)
|
|
|
|
this.$set(this.list[this.projectIndex],'collectionRechargeAmount',collectionRechargeAmount)
|
|
|
|
|
|
|
|
if(this.list[this.projectIndex].collectionRechargeAmount>=this.list[this.projectIndex].transactionPrice ){
|
|
|
|
|
|
|
|
this.list[this.projectIndex].collectionRechargeAmount = (this.list[this.projectIndex].transactionPrice).toFixed(2)*1
|
|
|
|
|
|
|
|
} //误差
|
|
|
|
this.$set(this.list[this.projectIndex],'collectionAmounts',collectionAmounts)
|
|
|
|
this.$set(this.list[this.projectIndex],'collectionAmounts',collectionAmounts)
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
|
// 不能打折的计算
|
|
|
|
// 不能打折的计算
|
|
|
|
@ -934,6 +936,9 @@ export default {
|
|
|
|
collectionAmounts = collectionAmounts.toFixed(2)*1
|
|
|
|
collectionAmounts = collectionAmounts.toFixed(2)*1
|
|
|
|
this.$set(this.list[this.projectIndex],'collectionRechargeAmount',collectionRechargeAmount)
|
|
|
|
this.$set(this.list[this.projectIndex],'collectionRechargeAmount',collectionRechargeAmount)
|
|
|
|
this.$set(this.list[this.projectIndex],'collectionAmounts',collectionAmounts)
|
|
|
|
this.$set(this.list[this.projectIndex],'collectionAmounts',collectionAmounts)
|
|
|
|
|
|
|
|
if(this.list[this.projectIndex].collectionRechargeAmount>=this.list[this.projectIndex].transactionPrice ){
|
|
|
|
|
|
|
|
this.list[this.projectIndex].collectionRechargeAmount = (this.list[this.projectIndex].transactionPrice).toFixed(2)*1
|
|
|
|
|
|
|
|
} //误差
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
//修改卡付金额
|
|
|
|
//修改卡付金额
|
|
|
|
@ -944,11 +949,11 @@ export default {
|
|
|
|
// 卡付抵扣金额collectionAmounts 卡付金额collectionRechargeAmount
|
|
|
|
// 卡付抵扣金额collectionAmounts 卡付金额collectionRechargeAmount
|
|
|
|
// 本次支付spendMoney 可用金额cardConsumeMoney 可用余额cardOvers 可用折扣discount 赠送折扣discountFreeAmount 赠送支付giftSpendMoney 赠送剩余cardGiftOvers
|
|
|
|
// 本次支付spendMoney 可用金额cardConsumeMoney 可用余额cardOvers 可用折扣discount 赠送折扣discountFreeAmount 赠送支付giftSpendMoney 赠送剩余cardGiftOvers
|
|
|
|
// type:0折扣卡 1赠送卡 2活动卡 noDiscount 0 能打折 1 不打折 appearPrice当前需要支付多少
|
|
|
|
// type:0折扣卡 1赠送卡 2活动卡 noDiscount 0 能打折 1 不打折 appearPrice当前需要支付多少
|
|
|
|
if( row.spendMoney){
|
|
|
|
if( row.spendMoney ){
|
|
|
|
// 要修改
|
|
|
|
// 要修改
|
|
|
|
row.spendMoney = 0
|
|
|
|
row.spendMoney = 0
|
|
|
|
row.cardOvers = row.CardCurrentUse
|
|
|
|
row.cardOvers = row.CardCurrentUse
|
|
|
|
row.cardGiftOvers = row.cardGiftOvers +(row.giftSpendMoney?row.giftSpendMoney*1:0)
|
|
|
|
row.cardGiftOvers = (row.cardGiftOvers +(row.giftSpendMoney?row.giftSpendMoney*1:0)).toFixed(2)*1
|
|
|
|
row.giftSpendMoney = 0
|
|
|
|
row.giftSpendMoney = 0
|
|
|
|
this.list.push({})
|
|
|
|
this.list.push({})
|
|
|
|
this.list.pop()
|
|
|
|
this.list.pop()
|
|
|
|
@ -956,7 +961,7 @@ export default {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(this.useRecharge !== 1 && row.cardOvers ==0 && row.giftSpendMoney){ //可用余额不存在并且门店参数不等于1并且赠送支付存在触发
|
|
|
|
if(this.useRecharge !== 1 && row.cardOvers ==0 && row.giftSpendMoney){ //可用余额不存在并且门店参数不等于1并且赠送支付存在触发
|
|
|
|
row.spendMoney = 0
|
|
|
|
row.spendMoney = 0
|
|
|
|
row.cardGiftOvers = (row.cardGiftOvers?row.cardGiftOvers*1:0) + (row.giftSpendMoney?row.giftSpendMoney*1:0)
|
|
|
|
row.cardGiftOvers = ((row.cardGiftOvers?row.cardGiftOvers*1:0) + (row.giftSpendMoney?row.giftSpendMoney*1:0)).toFixed(2)*1
|
|
|
|
row.giftSpendMoney = 0
|
|
|
|
row.giftSpendMoney = 0
|
|
|
|
// 不知名错误,别删
|
|
|
|
// 不知名错误,别删
|
|
|
|
this.$set(this.list[this.projectIndex],'popover',false)
|
|
|
|
this.$set(this.list[this.projectIndex],'popover',false)
|
|
|
|
@ -1018,7 +1023,7 @@ export default {
|
|
|
|
giveProportion = giveProportion.toFixed(2)*1
|
|
|
|
giveProportion = giveProportion.toFixed(2)*1
|
|
|
|
row.spendMoney = (appearPrice*balanceProportion).toFixed(2)*1
|
|
|
|
row.spendMoney = (appearPrice*balanceProportion).toFixed(2)*1
|
|
|
|
row.giftSpendMoney = (appearPrice*giveProportion).toFixed(2)*1
|
|
|
|
row.giftSpendMoney = (appearPrice*giveProportion).toFixed(2)*1
|
|
|
|
row.cardGiftOvers = row.cardGiftOvers - row.giftSpendMoney
|
|
|
|
row.cardGiftOvers = (row.cardGiftOvers - row.giftSpendMoney).toFixed(2)*1
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
|
row.spendMoney = row.cardOvers
|
|
|
|
row.spendMoney = row.cardOvers
|
|
|
|
row.giftSpendMoney = row.cardGiftOvers
|
|
|
|
row.giftSpendMoney = row.cardGiftOvers
|
|
|
|
@ -1026,6 +1031,7 @@ export default {
|
|
|
|
// this.updataList()
|
|
|
|
// this.updataList()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
this.spendMoney = row.spendMoney
|
|
|
|
}else{ //先用实冲,再用赠送
|
|
|
|
}else{ //先用实冲,再用赠送
|
|
|
|
console.log('来到了门店参数2--->')
|
|
|
|
console.log('来到了门店参数2--->')
|
|
|
|
//做法 扣除本次支付/赠送支付/赠送剩余
|
|
|
|
//做法 扣除本次支付/赠送支付/赠送剩余
|
|
|
|
@ -1039,7 +1045,7 @@ export default {
|
|
|
|
if(total>appearPrice){ //当前赠送够支付
|
|
|
|
if(total>appearPrice){ //当前赠送够支付
|
|
|
|
row.giftSpendMoney = (appearPrice*(row.discountFreeAmount?(row.discountFreeAmount*1)/100:1)).toFixed(2)*1
|
|
|
|
row.giftSpendMoney = (appearPrice*(row.discountFreeAmount?(row.discountFreeAmount*1)/100:1)).toFixed(2)*1
|
|
|
|
row.spendMoney = row.giftSpendMoney
|
|
|
|
row.spendMoney = row.giftSpendMoney
|
|
|
|
row.cardGiftOvers = row.cardGiftOvers - row.giftSpendMoney
|
|
|
|
row.cardGiftOvers = (row.cardGiftOvers - row.giftSpendMoney).toFixed(2)*1
|
|
|
|
}else{ //当前卡不够支付
|
|
|
|
}else{ //当前卡不够支付
|
|
|
|
row.spendMoney = row.cardGiftOvers
|
|
|
|
row.spendMoney = row.cardGiftOvers
|
|
|
|
row.giftSpendMoney = row.cardGiftOvers
|
|
|
|
row.giftSpendMoney = row.cardGiftOvers
|
|
|
|
@ -1055,7 +1061,7 @@ export default {
|
|
|
|
let remainderCsee = appearPrice - ((row.spendMoney/row.discount)*100) //剩余支付
|
|
|
|
let remainderCsee = appearPrice - ((row.spendMoney/row.discount)*100) //剩余支付
|
|
|
|
console.log('还需要支付多少--->',remainderCsee)
|
|
|
|
console.log('还需要支付多少--->',remainderCsee)
|
|
|
|
row.giftSpendMoney = remainderCsee*(row.discountFreeAmount?(row.discountFreeAmount*1)/100:1) //算出还需支付多少
|
|
|
|
row.giftSpendMoney = remainderCsee*(row.discountFreeAmount?(row.discountFreeAmount*1)/100:1) //算出还需支付多少
|
|
|
|
row.cardGiftOvers = row.cardGiftOvers - row.giftSpendMoney
|
|
|
|
row.cardGiftOvers = (row.cardGiftOvers - row.giftSpendMoney).toFixed(2)*1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}else{ //折后金额总和不够支付项目金额,直接扣除
|
|
|
|
}else{ //折后金额总和不够支付项目金额,直接扣除
|
|
|
|
row.spendMoney = row.cardOvers // 支付金额 直接赋值支付金额
|
|
|
|
row.spendMoney = row.cardOvers // 支付金额 直接赋值支付金额
|
|
|
|
@ -1069,7 +1075,7 @@ export default {
|
|
|
|
if( total>appearPrice ){ //当前卡够支付
|
|
|
|
if( total>appearPrice ){ //当前卡够支付
|
|
|
|
row.spendMoney = appearPrice
|
|
|
|
row.spendMoney = appearPrice
|
|
|
|
row.giftSpendMoney = appearPrice
|
|
|
|
row.giftSpendMoney = appearPrice
|
|
|
|
row.cardGiftOvers = row.cardGiftOvers - appearPrice
|
|
|
|
row.cardGiftOvers = (row.cardGiftOvers - appearPrice).toFixed(2)*1
|
|
|
|
}else{ //当前卡剩余余额不够支付
|
|
|
|
}else{ //当前卡剩余余额不够支付
|
|
|
|
row.spendMoney = row.cardGiftOvers
|
|
|
|
row.spendMoney = row.cardGiftOvers
|
|
|
|
row.giftSpendMoney = row.cardGiftOvers
|
|
|
|
row.giftSpendMoney = row.cardGiftOvers
|
|
|
|
@ -1084,7 +1090,7 @@ export default {
|
|
|
|
let remainderCsee = appearPrice - row.cardOvers //赠送还要补充多少
|
|
|
|
let remainderCsee = appearPrice - row.cardOvers //赠送还要补充多少
|
|
|
|
row.spendMoney = row.cardOvers
|
|
|
|
row.spendMoney = row.cardOvers
|
|
|
|
row.giftSpendMoney = remainderCsee
|
|
|
|
row.giftSpendMoney = remainderCsee
|
|
|
|
row.cardGiftOvers = row.cardGiftOvers - remainderCsee
|
|
|
|
row.cardGiftOvers = (row.cardGiftOvers - remainderCsee).toFixed(2)*1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}else{ //当前卡不够支付项目金额
|
|
|
|
}else{ //当前卡不够支付项目金额
|
|
|
|
row.spendMoney = row.cardOvers
|
|
|
|
row.spendMoney = row.cardOvers
|
|
|
|
@ -1098,14 +1104,29 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
endEditcard(row, index) { //看不懂别乱改!!!!!!
|
|
|
|
endEditcard(row, index) { //看不懂别乱改!!!!!!
|
|
|
|
console.log('测试---二进制--->>>',0.1+0.2)
|
|
|
|
|
|
|
|
// 卡付抵扣金额collectionAmounts 卡付金额collectionRechargeAmount
|
|
|
|
// 卡付抵扣金额collectionAmounts 卡付金额collectionRechargeAmount
|
|
|
|
// 本次支付spendMoney 可用金额cardConsumeMoney 可用余额cardOvers 可用折扣discount 赠送折扣discountFreeAmount 赠送支付giftSpendMoney 赠送剩余cardGiftOvers
|
|
|
|
// 本次支付spendMoney 可用金额cardConsumeMoney 可用余额cardOvers 可用折扣discount 赠送折扣discountFreeAmount 赠送支付giftSpendMoney 赠送剩余cardGiftOvers
|
|
|
|
// type:0折扣卡 1赠送卡 2活动卡 noDiscount 0 能打折 1 不打折
|
|
|
|
// type:0折扣卡 1赠送卡 2活动卡 noDiscount 0 能打折 1 不打折
|
|
|
|
this.recIndex = -1
|
|
|
|
this.recIndex = -1
|
|
|
|
if(row.spendMoney === 0)return
|
|
|
|
if((row.spendMoney*1) === 0){
|
|
|
|
|
|
|
|
row.cardGiftOvers = (row.cardGiftOvers*1 + row.giftSpendMoney*1).toFixed(2)*1
|
|
|
|
|
|
|
|
row.giftSpendMoney = 0
|
|
|
|
|
|
|
|
this.spendMoney = ''
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
let appearPrice = this.list[this.projectIndex].transactionPrice - (this.list[this.projectIndex].collectionAmounts?this.list[this.projectIndex].collectionAmounts*1:0) //本次需要支付的钱
|
|
|
|
let appearPrice = this.list[this.projectIndex].transactionPrice - (this.list[this.projectIndex].collectionAmounts?this.list[this.projectIndex].collectionAmounts*1:0) //本次需要支付的钱
|
|
|
|
if(this.useRecharge == 1){ //门店参数 按比例支付
|
|
|
|
if(this.useRecharge == 1){ //门店参数 按比例支付
|
|
|
|
|
|
|
|
// 上一次输入的没变
|
|
|
|
|
|
|
|
if((this.spendMoney*1) === row.spendMoney*1){
|
|
|
|
|
|
|
|
console.log('我会到这里呀!!!!')
|
|
|
|
|
|
|
|
// 上一次没改变
|
|
|
|
|
|
|
|
row.cardOvers = (row.cardOvers - (row.spendMoney*1)).toFixed(2)*1
|
|
|
|
|
|
|
|
this.updataList()
|
|
|
|
|
|
|
|
this.list.push({})
|
|
|
|
|
|
|
|
this.list.pop()
|
|
|
|
|
|
|
|
this.spendMoney = ''
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
if(this.list[this.projectIndex].noDiscount == 0){ //可以打折 0
|
|
|
|
if(this.list[this.projectIndex].noDiscount == 0){ //可以打折 0
|
|
|
|
row.spendMoney = row.spendMoney*1 //转化
|
|
|
|
row.spendMoney = row.spendMoney*1 //转化
|
|
|
|
if(row.spendMoney>row.cardOvers){ //如果输入的大于本身余额
|
|
|
|
if(row.spendMoney>row.cardOvers){ //如果输入的大于本身余额
|
|
|
|
@ -1141,7 +1162,7 @@ export default {
|
|
|
|
}else{ // 输入的值不大于本卡金额
|
|
|
|
}else{ // 输入的值不大于本卡金额
|
|
|
|
// 输入的金额也要做判断,判断是否大于支付金额,如果大于支付金额,就拿支付金额按比例付款,小于则按输入金额付款
|
|
|
|
// 输入的金额也要做判断,判断是否大于支付金额,如果大于支付金额,就拿支付金额按比例付款,小于则按输入金额付款
|
|
|
|
// !!!这里也需要还原之前的赠送!!!
|
|
|
|
// !!!这里也需要还原之前的赠送!!!
|
|
|
|
row.cardGiftOvers = (row.cardGiftOvers?row.cardGiftOvers*1:0) + (row.giftSpendMoney?row.giftSpendMoney*1:0) //还原之前赠送金额
|
|
|
|
row.cardGiftOvers = ((row.cardGiftOvers?row.cardGiftOvers*1:0) + (row.giftSpendMoney?row.giftSpendMoney*1:0)).toFixed(2)*1 //还原之前赠送金额
|
|
|
|
row.giftSpendMoney = 0 //还原赠送支付
|
|
|
|
row.giftSpendMoney = 0 //还原赠送支付
|
|
|
|
let balanceProportion = row.cardOvers/(row.cardOvers + (row.cardGiftOvers?row.cardGiftOvers*1:0)) // 可用金额比例
|
|
|
|
let balanceProportion = row.cardOvers/(row.cardOvers + (row.cardGiftOvers?row.cardGiftOvers*1:0)) // 可用金额比例
|
|
|
|
let giveProportion = (row.cardGiftOvers?row.cardGiftOvers*1:0)/(row.cardOvers + (row.cardGiftOvers?row.cardGiftOvers*1:0)) // 可用赠送比例
|
|
|
|
let giveProportion = (row.cardGiftOvers?row.cardGiftOvers*1:0)/(row.cardOvers + (row.cardGiftOvers?row.cardGiftOvers*1:0)) // 可用赠送比例
|
|
|
|
@ -1219,7 +1240,7 @@ export default {
|
|
|
|
let giveProportion = (row.cardGiftOvers*1 + (row.giftSpendMoney?row.giftSpendMoney*1:0))/(row.cardOvers*1+( (row.giftSpendMoney?row.giftSpendMoney*1:0) + row.cardGiftOvers*1 ))//赠送金额比例
|
|
|
|
let giveProportion = (row.cardGiftOvers*1 + (row.giftSpendMoney?row.giftSpendMoney*1:0))/(row.cardOvers*1+( (row.giftSpendMoney?row.giftSpendMoney*1:0) + row.cardGiftOvers*1 ))//赠送金额比例
|
|
|
|
balanceProportion = balanceProportion.toFixed(4)*1
|
|
|
|
balanceProportion = balanceProportion.toFixed(4)*1
|
|
|
|
giveProportion = giveProportion.toFixed(4)*1
|
|
|
|
giveProportion = giveProportion.toFixed(4)*1
|
|
|
|
row.cardGiftOvers = (row.giftSpendMoney?row.giftSpendMoney*1:0) + row.cardGiftOvers*1 //还原赠送支付
|
|
|
|
row.cardGiftOvers = ((row.giftSpendMoney?row.giftSpendMoney*1:0) + row.cardGiftOvers*1).toFixed(2)*1 //还原赠送支付
|
|
|
|
row.giftSpendMoney = 0 //清空赠送支付
|
|
|
|
row.giftSpendMoney = 0 //清空赠送支付
|
|
|
|
console.log('现在的赠送余额是多少----->',row.cardGiftOvers,'比例是多少--->',balanceProportion,'另外一个比例---->',giveProportion)
|
|
|
|
console.log('现在的赠送余额是多少----->',row.cardGiftOvers,'比例是多少--->',balanceProportion,'另外一个比例---->',giveProportion)
|
|
|
|
if(row.spendMoney > row.cardOvers){ // 当输入的金额大于自身可用金额时
|
|
|
|
if(row.spendMoney > row.cardOvers){ // 当输入的金额大于自身可用金额时
|
|
|
|
@ -1252,9 +1273,10 @@ export default {
|
|
|
|
this.updataList()
|
|
|
|
this.updataList()
|
|
|
|
}else{ //输入的金额不大于项目金额
|
|
|
|
}else{ //输入的金额不大于项目金额
|
|
|
|
// 需要判断比例总和是否大于项目金额
|
|
|
|
// 需要判断比例总和是否大于项目金额
|
|
|
|
let giveCase = ((row.spendMoney/balanceProportion)*giveProportion)*1 //按比例算出的赠送支付
|
|
|
|
let giveCase = ((row.spendMoney/balanceProportion)*giveProportion).toFixed(2)*1 //按比例算出的赠送支付
|
|
|
|
if(((row.spendMoney*1 + giveCase)*1) > appearPrice){
|
|
|
|
if(((row.spendMoney*1 + giveCase)*1) > appearPrice){
|
|
|
|
// 如果按比例之和大于项目金额,大于的情况一定是够支付的!!!
|
|
|
|
// 如果按比例之和大于项目金额,大于的情况一定是够支付的!!!
|
|
|
|
|
|
|
|
console.log((((row.spendMoney*1 + giveCase)*1) - appearPrice),'---<为多少')
|
|
|
|
if((((row.spendMoney*1 + giveCase)*1) - appearPrice)>=this.balance*1)this.$message.warning({ message: "按比例支付总和大于成交金额" }); //判断误差
|
|
|
|
if((((row.spendMoney*1 + giveCase)*1) - appearPrice)>=this.balance*1)this.$message.warning({ message: "按比例支付总和大于成交金额" }); //判断误差
|
|
|
|
// 自动计算
|
|
|
|
// 自动计算
|
|
|
|
console.log('是多少-->',row.spendMoney,'总额-->',row.cardOvers)
|
|
|
|
console.log('是多少-->',row.spendMoney,'总额-->',row.cardOvers)
|
|
|
|
@ -1276,17 +1298,18 @@ export default {
|
|
|
|
this.list.push({})
|
|
|
|
this.list.push({})
|
|
|
|
this.list.pop()
|
|
|
|
this.list.pop()
|
|
|
|
}else{ //先用实充,再用赠送
|
|
|
|
}else{ //先用实充,再用赠送
|
|
|
|
if(row.spendMoney === this.spendMoney){ //上一次的值没有改变
|
|
|
|
if((row.spendMoney*1) === this.spendMoney){ //上一次的值没有改变
|
|
|
|
console.log('现在只执行这里---->!!!')
|
|
|
|
console.log('现在只执行这里---->!!!')
|
|
|
|
row.cardOvers = (row.cardOvers - row.spendMoney).toFixed(2)*1
|
|
|
|
row.cardOvers = (row.cardOvers - row.spendMoney).toFixed(2)*1
|
|
|
|
this.updataList()
|
|
|
|
this.updataList()
|
|
|
|
this.list.push({})
|
|
|
|
this.list.push({})
|
|
|
|
this.list.pop()
|
|
|
|
this.list.pop()
|
|
|
|
|
|
|
|
this.spendMoney = ''
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(this.list[this.projectIndex].noDiscount == 0){ //可以打折
|
|
|
|
if(this.list[this.projectIndex].noDiscount == 0){ //可以打折
|
|
|
|
// 还原原先赠送以及赠送支付
|
|
|
|
// 还原原先赠送以及赠送支付
|
|
|
|
row.cardGiftOvers = row.cardGiftOvers + row.giftSpendMoney //还原赠送剩余
|
|
|
|
row.cardGiftOvers = (row.cardGiftOvers + row.giftSpendMoney).toFixed(2)*1 //还原赠送剩余
|
|
|
|
row.giftSpendMoney = 0 //还原赠送支付
|
|
|
|
row.giftSpendMoney = 0 //还原赠送支付
|
|
|
|
// 只有可用余额为0并且赠送金额存在时触发
|
|
|
|
// 只有可用余额为0并且赠送金额存在时触发
|
|
|
|
if(row.cardOvers === 0 && row.cardGiftOvers){ //当可用余额为0时,扣除赠送支付
|
|
|
|
if(row.cardOvers === 0 && row.cardGiftOvers){ //当可用余额为0时,扣除赠送支付
|
|
|
|
@ -1351,7 +1374,7 @@ export default {
|
|
|
|
if(paymentAmount>appearPrice){ //当前卡够支付
|
|
|
|
if(paymentAmount>appearPrice){ //当前卡够支付
|
|
|
|
this.$message.warning({ message: "赠送金额大于项目金额" });
|
|
|
|
this.$message.warning({ message: "赠送金额大于项目金额" });
|
|
|
|
row.giftSpendMoney = (appearPrice*(row.discountFreeAmount?(row.discountFreeAmount*1)/100:1)).toFixed(2)*1
|
|
|
|
row.giftSpendMoney = (appearPrice*(row.discountFreeAmount?(row.discountFreeAmount*1)/100:1)).toFixed(2)*1
|
|
|
|
row.cardGiftOvers = row.cardGiftOvers - row.giftSpendMoney
|
|
|
|
row.cardGiftOvers = (row.cardGiftOvers - row.giftSpendMoney).toFixed(2)*1
|
|
|
|
row.spendMoney = 0
|
|
|
|
row.spendMoney = 0
|
|
|
|
row.cardOvers = 0
|
|
|
|
row.cardOvers = 0
|
|
|
|
// 不知名错误,未展示扣除,需要关闭再打开
|
|
|
|
// 不知名错误,未展示扣除,需要关闭再打开
|
|
|
|
@ -1362,7 +1385,7 @@ export default {
|
|
|
|
return this.updataList()
|
|
|
|
return this.updataList()
|
|
|
|
}else{ //当前输入的值大大于项目金额
|
|
|
|
}else{ //当前输入的值大大于项目金额
|
|
|
|
row.giftSpendMoney = row.spendMoney
|
|
|
|
row.giftSpendMoney = row.spendMoney
|
|
|
|
row.cardGiftOvers = row.cardGiftOvers - row.giftSpendMoney
|
|
|
|
row.cardGiftOvers = (row.cardGiftOvers - row.giftSpendMoney).toFixed(2)*1
|
|
|
|
row.spendMoney = 0
|
|
|
|
row.spendMoney = 0
|
|
|
|
row.cardOvers = 0
|
|
|
|
row.cardOvers = 0
|
|
|
|
// 不知名错误,未展示扣除,需要关闭再打开
|
|
|
|
// 不知名错误,未展示扣除,需要关闭再打开
|
|
|
|
@ -1392,7 +1415,7 @@ export default {
|
|
|
|
row.cardOvers = 0
|
|
|
|
row.cardOvers = 0
|
|
|
|
let remainderCsee = appearPrice - ((row.spendMoney/row.discount)*100) //剩余支付
|
|
|
|
let remainderCsee = appearPrice - ((row.spendMoney/row.discount)*100) //剩余支付
|
|
|
|
row.giftSpendMoney = remainderCsee*(row.discountFreeAmount?(row.discountFreeAmount*1)/100:1) //算出还需支付多少
|
|
|
|
row.giftSpendMoney = remainderCsee*(row.discountFreeAmount?(row.discountFreeAmount*1)/100:1) //算出还需支付多少
|
|
|
|
row.cardGiftOvers = row.cardGiftOvers - row.giftSpendMoney //赠送剩余
|
|
|
|
row.cardGiftOvers = (row.cardGiftOvers - row.giftSpendMoney).toFixed(2)*1 //赠送剩余
|
|
|
|
this.updataList()
|
|
|
|
this.updataList()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}else{ //两个折扣价格不够支付
|
|
|
|
}else{ //两个折扣价格不够支付
|
|
|
|
@ -1421,7 +1444,7 @@ export default {
|
|
|
|
row.cardOvers = 0
|
|
|
|
row.cardOvers = 0
|
|
|
|
let remainderCsee = appearPrice - ((row.spendMoney/row.discount)*100) //剩余支付
|
|
|
|
let remainderCsee = appearPrice - ((row.spendMoney/row.discount)*100) //剩余支付
|
|
|
|
row.giftSpendMoney = remainderCsee*(row.discountFreeAmount?(row.discountFreeAmount*1)/100:1) //算出还需支付多少
|
|
|
|
row.giftSpendMoney = remainderCsee*(row.discountFreeAmount?(row.discountFreeAmount*1)/100:1) //算出还需支付多少
|
|
|
|
row.cardGiftOvers = row.cardGiftOvers - row.giftSpendMoney //赠送剩余
|
|
|
|
row.cardGiftOvers = (row.cardGiftOvers - row.giftSpendMoney).toFixed(2)*1 //赠送剩余
|
|
|
|
this.updataList()
|
|
|
|
this.updataList()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}else{ //两个折扣价格不够支付
|
|
|
|
}else{ //两个折扣价格不够支付
|
|
|
|
@ -1447,7 +1470,7 @@ export default {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}else{ //不能打折
|
|
|
|
}else{ //不能打折
|
|
|
|
row.cardGiftOvers = row.cardGiftOvers + row.giftSpendMoney //还原赠送剩余
|
|
|
|
row.cardGiftOvers = (row.cardGiftOvers + row.giftSpendMoney).toFixed(2)*1 //还原赠送剩余
|
|
|
|
row.giftSpendMoney = 0 //还原赠送支付
|
|
|
|
row.giftSpendMoney = 0 //还原赠送支付
|
|
|
|
let total = row.cardOvers + row.cardGiftOvers
|
|
|
|
let total = row.cardOvers + row.cardGiftOvers
|
|
|
|
|
|
|
|
|
|
|
|
@ -1458,7 +1481,7 @@ export default {
|
|
|
|
if(row.cardGiftOvers>appearPrice){ //当前赠送够支付项目金额
|
|
|
|
if(row.cardGiftOvers>appearPrice){ //当前赠送够支付项目金额
|
|
|
|
row.spendMoney = 0
|
|
|
|
row.spendMoney = 0
|
|
|
|
row.giftSpendMoney = appearPrice
|
|
|
|
row.giftSpendMoney = appearPrice
|
|
|
|
row.cardGiftOvers = row.cardGiftOvers - appearPrice
|
|
|
|
row.cardGiftOvers = (row.cardGiftOvers - appearPrice).toFixed(2)*1
|
|
|
|
// 不知名错误,未展示扣除,需要关闭再打开
|
|
|
|
// 不知名错误,未展示扣除,需要关闭再打开
|
|
|
|
this.$set(this.list[this.projectIndex],'popover',false)
|
|
|
|
this.$set(this.list[this.projectIndex],'popover',false)
|
|
|
|
this.$set(this.list[this.projectIndex],'popover',true)
|
|
|
|
this.$set(this.list[this.projectIndex],'popover',true)
|
|
|
|
@ -1479,7 +1502,7 @@ export default {
|
|
|
|
if(row.cardGiftOvers>appearPrice){ //当前赠送够支付项目金额
|
|
|
|
if(row.cardGiftOvers>appearPrice){ //当前赠送够支付项目金额
|
|
|
|
row.spendMoney = 0
|
|
|
|
row.spendMoney = 0
|
|
|
|
row.giftSpendMoney = appearPrice
|
|
|
|
row.giftSpendMoney = appearPrice
|
|
|
|
row.cardGiftOvers = row.cardGiftOvers - appearPrice
|
|
|
|
row.cardGiftOvers = (row.cardGiftOvers - appearPrice).toFixed(2)*1
|
|
|
|
// 不知名错误,未展示扣除,需要关闭再打开
|
|
|
|
// 不知名错误,未展示扣除,需要关闭再打开
|
|
|
|
this.$set(this.list[this.projectIndex],'popover',false)
|
|
|
|
this.$set(this.list[this.projectIndex],'popover',false)
|
|
|
|
this.$set(this.list[this.projectIndex],'popover',true)
|
|
|
|
this.$set(this.list[this.projectIndex],'popover',true)
|
|
|
|
@ -1495,7 +1518,7 @@ export default {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}else{ //输入金额不大于项目金额
|
|
|
|
}else{ //输入金额不大于项目金额
|
|
|
|
row.giftSpendMoney = row.spendMoney*1
|
|
|
|
row.giftSpendMoney = row.spendMoney*1
|
|
|
|
row.cardGiftOvers = row.cardGiftOvers - row.giftSpendMoney
|
|
|
|
row.cardGiftOvers = (row.cardGiftOvers - row.giftSpendMoney).toFixed(2)*1
|
|
|
|
row.spendMoney = 0
|
|
|
|
row.spendMoney = 0
|
|
|
|
// 不知名错误,未展示扣除,需要关闭再打开
|
|
|
|
// 不知名错误,未展示扣除,需要关闭再打开
|
|
|
|
this.$set(this.list[this.projectIndex],'popover',false)
|
|
|
|
this.$set(this.list[this.projectIndex],'popover',false)
|
|
|
|
@ -1518,7 +1541,7 @@ export default {
|
|
|
|
row.spendMoney = row.cardOvers
|
|
|
|
row.spendMoney = row.cardOvers
|
|
|
|
row.cardOvers = 0
|
|
|
|
row.cardOvers = 0
|
|
|
|
row.giftSpendMoney = appearPrice - row.spendMoney
|
|
|
|
row.giftSpendMoney = appearPrice - row.spendMoney
|
|
|
|
row.cardGiftOvers = row.giftSpendMoney
|
|
|
|
row.cardGiftOvers = (row.giftSpendMoney).toFixed(2)*1
|
|
|
|
this.updataList()
|
|
|
|
this.updataList()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
|
@ -1542,7 +1565,7 @@ export default {
|
|
|
|
row.spendMoney = row.cardOvers
|
|
|
|
row.spendMoney = row.cardOvers
|
|
|
|
row.cardOvers = 0
|
|
|
|
row.cardOvers = 0
|
|
|
|
row.giftSpendMoney = appearPrice - row.spendMoney
|
|
|
|
row.giftSpendMoney = appearPrice - row.spendMoney
|
|
|
|
row.cardGiftOvers = row.giftSpendMoney
|
|
|
|
row.cardGiftOvers = (row.giftSpendMoney).topPrice(2)*1
|
|
|
|
this.updataList()
|
|
|
|
this.updataList()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
|
@ -1854,7 +1877,7 @@ export default {
|
|
|
|
this.$refs.project.show(this.memberForm);
|
|
|
|
this.$refs.project.show(this.memberForm);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
projectData(v) {
|
|
|
|
projectData(v) {
|
|
|
|
console.log('是这里没错了--->')
|
|
|
|
console.log('是这里没错了--->',v)
|
|
|
|
if (!v.courseAccountId) {
|
|
|
|
if (!v.courseAccountId) {
|
|
|
|
v.courseAccountId = null;
|
|
|
|
v.courseAccountId = null;
|
|
|
|
v.courseProjectId = v.id;
|
|
|
|
v.courseProjectId = v.id;
|
|
|
|
@ -1862,6 +1885,7 @@ export default {
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
v.courseMoney = v.courseConsumePrice;
|
|
|
|
v.courseMoney = v.courseConsumePrice;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
this.list.splice(this.proIndex,1,[])
|
|
|
|
this.setProOne(v);
|
|
|
|
this.setProOne(v);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// cashAmount
|
|
|
|
// cashAmount
|
|
|
|
@ -1870,11 +1894,6 @@ export default {
|
|
|
|
row.courseMoney = 0;
|
|
|
|
row.courseMoney = 0;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
row.courseMoney = row.courseConsumePrice;
|
|
|
|
row.courseMoney = row.courseConsumePrice;
|
|
|
|
// row.collectionAmounts=row.transactionPrice
|
|
|
|
|
|
|
|
console.log(
|
|
|
|
|
|
|
|
"🚀 ~ file: service.vue ~ line 1466 ~ setProOne ~ row.transactionPrice",
|
|
|
|
|
|
|
|
row
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
let form = {};
|
|
|
|
let form = {};
|
|
|
|
proOne({
|
|
|
|
proOne({
|
|
|
|
@ -1908,7 +1927,7 @@ export default {
|
|
|
|
projectName: res.data.projectName,
|
|
|
|
projectName: res.data.projectName,
|
|
|
|
projectNum: res.data.projectNum,
|
|
|
|
projectNum: res.data.projectNum,
|
|
|
|
courseAccountId: row.courseAccountId,
|
|
|
|
courseAccountId: row.courseAccountId,
|
|
|
|
courseMoney: row.courseMoney,
|
|
|
|
courseMoney:row.courseAccountId?row.price:0,
|
|
|
|
noDiscount: res.data.noDiscount,
|
|
|
|
noDiscount: res.data.noDiscount,
|
|
|
|
isCardPay: res.data.isCardPay,
|
|
|
|
isCardPay: res.data.isCardPay,
|
|
|
|
amount: res.data.transactionPrice,
|
|
|
|
amount: res.data.transactionPrice,
|
|
|
|
@ -1920,7 +1939,6 @@ export default {
|
|
|
|
collectionIntegralAmount: 0,
|
|
|
|
collectionIntegralAmount: 0,
|
|
|
|
collectionAmount: 0,
|
|
|
|
collectionAmount: 0,
|
|
|
|
projectId: res.data.id,
|
|
|
|
projectId: res.data.id,
|
|
|
|
// cashNum: res.data.cashNum,
|
|
|
|
|
|
|
|
storeId: res.data.storeId,
|
|
|
|
storeId: res.data.storeId,
|
|
|
|
storeName: res.data.storeName,
|
|
|
|
storeName: res.data.storeName,
|
|
|
|
price: res.data.price,
|
|
|
|
price: res.data.price,
|
|
|
|
@ -2057,6 +2075,28 @@ export default {
|
|
|
|
callback: action => {}
|
|
|
|
callback: action => {}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
let total = eval(this.$refs.payment.payLists.map(item=>{return item.payMoney?item.payMoney*1:0}).join("+")) //现金支付总和
|
|
|
|
|
|
|
|
if(this.appearPrices*1 || total){
|
|
|
|
|
|
|
|
if(total>this.appearPrices*1){
|
|
|
|
|
|
|
|
this.formData = new FormData();
|
|
|
|
|
|
|
|
return this.$alert(`金额多出${total-this.appearPrices*1}元`, "提示", {
|
|
|
|
|
|
|
|
confirmButtonText: "确定",
|
|
|
|
|
|
|
|
confirmButtonClass: "confirmbtnFalses",
|
|
|
|
|
|
|
|
type: "warning",
|
|
|
|
|
|
|
|
center: true,
|
|
|
|
|
|
|
|
callback: action => {}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}else if(total<this.appearPrices*1){
|
|
|
|
|
|
|
|
this.formData = new FormData();
|
|
|
|
|
|
|
|
return this.$alert(`金额还需支付${this.appearPrices*1 - total}`, "提示", {
|
|
|
|
|
|
|
|
confirmButtonText: "确定",
|
|
|
|
|
|
|
|
confirmButtonClass: "confirmbtnFalses",
|
|
|
|
|
|
|
|
type: "warning",
|
|
|
|
|
|
|
|
center: true,
|
|
|
|
|
|
|
|
callback: action => {}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
if (flag) {
|
|
|
|
if (flag) {
|
|
|
|
let passShow = false;
|
|
|
|
let passShow = false;
|
|
|
|
this.list.forEach((item, index) => {
|
|
|
|
this.list.forEach((item, index) => {
|
|
|
|
@ -2093,7 +2133,7 @@ export default {
|
|
|
|
if (item.courseAccountId == null) {
|
|
|
|
if (item.courseAccountId == null) {
|
|
|
|
item.collectionCashAmount =
|
|
|
|
item.collectionCashAmount =
|
|
|
|
(
|
|
|
|
(
|
|
|
|
item.amount - item.collectionAmounts
|
|
|
|
item.amount - (item.collectionAmounts?item.collectionAmounts*1:0)
|
|
|
|
).toFixed(2) * 1;
|
|
|
|
).toFixed(2) * 1;
|
|
|
|
item.cashAmount =
|
|
|
|
item.cashAmount =
|
|
|
|
(
|
|
|
|
(
|
|
|
|
@ -2155,28 +2195,6 @@ export default {
|
|
|
|
collectionAmountsum+=(item.collectionAmount*1+collectionAmountsum*1);
|
|
|
|
collectionAmountsum+=(item.collectionAmount*1+collectionAmountsum*1);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
this.formData.append("cashListRequestList", JSON.stringify(list));
|
|
|
|
this.formData.append("cashListRequestList", JSON.stringify(list));
|
|
|
|
let total = eval(this.$refs.payment.payLists.map(item=>{return item.payMoney?item.payMoney*1:0}).join("+")) //现金支付总和
|
|
|
|
|
|
|
|
if(this.appearPrices*1 || total){
|
|
|
|
|
|
|
|
if(total>this.appearPrices*1){
|
|
|
|
|
|
|
|
this.formData = new FormData();
|
|
|
|
|
|
|
|
return this.$alert(`金额多出${total-this.appearPrices*1}元`, "提示", {
|
|
|
|
|
|
|
|
confirmButtonText: "确定",
|
|
|
|
|
|
|
|
confirmButtonClass: "confirmbtnFalses",
|
|
|
|
|
|
|
|
type: "warning",
|
|
|
|
|
|
|
|
center: true,
|
|
|
|
|
|
|
|
callback: action => {}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}else if(total<this.appearPrices*1){
|
|
|
|
|
|
|
|
this.formData = new FormData();
|
|
|
|
|
|
|
|
return this.$alert(`金额还需支付${this.appearPrices*1 - total}`, "提示", {
|
|
|
|
|
|
|
|
confirmButtonText: "确定",
|
|
|
|
|
|
|
|
confirmButtonClass: "confirmbtnFalses",
|
|
|
|
|
|
|
|
type: "warning",
|
|
|
|
|
|
|
|
center: true,
|
|
|
|
|
|
|
|
callback: action => {}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
addCash(this.formData).then(res => {
|
|
|
|
addCash(this.formData).then(res => {
|
|
|
|
if (res.code == "000000") {
|
|
|
|
if (res.code == "000000") {
|
|
|
|
this.$message.success({
|
|
|
|
this.$message.success({
|
|
|
|
@ -2266,12 +2284,13 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
reccardData(v) {},
|
|
|
|
reccardData(v) {},
|
|
|
|
courseData(v) {
|
|
|
|
courseData(v) {
|
|
|
|
|
|
|
|
console.log('这个v--->',v)
|
|
|
|
if (!v.courseAccountId) {
|
|
|
|
if (!v.courseAccountId) {
|
|
|
|
v.courseAccountId = null;
|
|
|
|
v.courseAccountId = null;
|
|
|
|
v.courseProjectId = v.id;
|
|
|
|
v.courseProjectId = v.id;
|
|
|
|
v.courseMoney = 0;
|
|
|
|
v.courseMoney = 0;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
v.courseMoney = v.courseConsumePrice;
|
|
|
|
v.courseMoney = v.price;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.setProOne(v);
|
|
|
|
this.setProOne(v);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
@ -2850,7 +2869,9 @@ export default {
|
|
|
|
activated() {
|
|
|
|
activated() {
|
|
|
|
this.setPage();
|
|
|
|
this.setPage();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
created() {}
|
|
|
|
created() {
|
|
|
|
|
|
|
|
this.notData()
|
|
|
|
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|