|
|
|
|
@ -297,21 +297,47 @@
|
|
|
|
|
label="折扣(%)"
|
|
|
|
|
></el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
v-if="useRecharge == 3"
|
|
|
|
|
align="center"
|
|
|
|
|
prop="spendMoney"
|
|
|
|
|
label="本次支付"
|
|
|
|
|
width="90"
|
|
|
|
|
>
|
|
|
|
|
<!-- 分开扣 -->
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<div
|
|
|
|
|
class="form-input-width"
|
|
|
|
|
v-if="recIndex != scope.$index"
|
|
|
|
|
@click="editcard(scope.row, scope.$index)"
|
|
|
|
|
@click="editPaycard(scope.row, scope.$index)">
|
|
|
|
|
{{ scope.row.spendMoney }}
|
|
|
|
|
<i class="text-cyan el-icon-edit"></i>
|
|
|
|
|
</div>
|
|
|
|
|
<el-input
|
|
|
|
|
v-else
|
|
|
|
|
v-focus
|
|
|
|
|
type="number"
|
|
|
|
|
size="samll"
|
|
|
|
|
class="form-input-width"
|
|
|
|
|
@blur="endEditPaycard(scope.row, scope.$index)"
|
|
|
|
|
v-model="scope.row.spendMoney"></el-input>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
v-else
|
|
|
|
|
align="center"
|
|
|
|
|
prop="spendMoney"
|
|
|
|
|
label="本次支付"
|
|
|
|
|
width="90"
|
|
|
|
|
>
|
|
|
|
|
<!-- 按照比例或者实冲扣 -->
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<div
|
|
|
|
|
class="form-input-width"
|
|
|
|
|
v-if="recIndex != scope.$index"
|
|
|
|
|
@click="editcard(scope.row, scope.$index)">
|
|
|
|
|
{{ scope.row.spendMoney }}
|
|
|
|
|
<i class="text-cyan el-icon-edit"></i>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- :disabled="scope.row.cardOvers == 0" -->
|
|
|
|
|
<el-input
|
|
|
|
|
v-else
|
|
|
|
|
v-focus
|
|
|
|
|
@ -319,8 +345,7 @@
|
|
|
|
|
size="samll"
|
|
|
|
|
class="form-input-width"
|
|
|
|
|
@blur="endEditcard(scope.row, scope.$index)"
|
|
|
|
|
v-model="scope.row.spendMoney"
|
|
|
|
|
></el-input>
|
|
|
|
|
v-model="scope.row.spendMoney"></el-input>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
@ -351,7 +376,30 @@
|
|
|
|
|
prop="giftSpendMoney"
|
|
|
|
|
label="赠送支付"
|
|
|
|
|
width="70"
|
|
|
|
|
></el-table-column>
|
|
|
|
|
>
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<div v-if="useRecharge == 3">
|
|
|
|
|
<div
|
|
|
|
|
class="form-input-width"
|
|
|
|
|
v-if="giveIndex != scope.$index"
|
|
|
|
|
@click="editGivecard(scope.row, scope.$index)">
|
|
|
|
|
{{ scope.row.giftSpendMoney }}
|
|
|
|
|
<i class="text-cyan el-icon-edit"></i>
|
|
|
|
|
</div>
|
|
|
|
|
<el-input
|
|
|
|
|
v-else
|
|
|
|
|
v-focus
|
|
|
|
|
type="number"
|
|
|
|
|
size="samll"
|
|
|
|
|
class="form-input-width"
|
|
|
|
|
@blur="endEditGivecard(scope.row, scope.$index)"
|
|
|
|
|
v-model="scope.row.giftSpendMoney"></el-input>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-else>
|
|
|
|
|
{{ scope.row.giftSpendMoney }}
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
align="center"
|
|
|
|
|
prop="cardGiftOvers"
|
|
|
|
|
@ -863,6 +911,7 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
giveIndex:null,
|
|
|
|
|
keyIndex:undefined,
|
|
|
|
|
refText:"",
|
|
|
|
|
numberTimes:1,
|
|
|
|
|
@ -929,6 +978,9 @@ export default {
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
computed: {
|
|
|
|
|
isApartDeduct(){
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
// 现付金额
|
|
|
|
|
appearPrices() {
|
|
|
|
|
/*
|
|
|
|
|
@ -1010,6 +1062,179 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
// 卡打折处理
|
|
|
|
|
editPaycard(row,index){
|
|
|
|
|
// 本次支付spendMoney 可用金额cardConsumeMoney 可用余额cardOvers 可用折扣discount 赠送折扣discountFreeAmount 赠送支付giftSpendMoney 赠送剩余cardGiftOvers
|
|
|
|
|
this.recIndex = index
|
|
|
|
|
let discount = row.discount?row.discount/100:1 //赠送折扣
|
|
|
|
|
let appearPrice = this.list[this.projectIndex].transactionPrice - (this.list[this.projectIndex].collectionAmounts?this.list[this.projectIndex].collectionAmounts*1:0)//本次需要支付多少
|
|
|
|
|
let total = (row.cardOvers/discount).toFixed(2)*1 //总价
|
|
|
|
|
if( row.spendMoney ){
|
|
|
|
|
row.cardOvers += row.spendMoney
|
|
|
|
|
row.spendMoney = 0
|
|
|
|
|
this.updataList()
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
if( this.list[this.projectIndex].noDiscount == 0 ){ // 可以打折
|
|
|
|
|
if(total>appearPrice){ //够支付够支付本次项目
|
|
|
|
|
row.spendMoney = (appearPrice *discount).toFixed(2)*1
|
|
|
|
|
}else{ //不够支付本次项目
|
|
|
|
|
row.spendMoney = row.cardOvers
|
|
|
|
|
}
|
|
|
|
|
}else{ // 不能打折
|
|
|
|
|
if(row.cardOvers > appearPrice){ //余额够支付,支付等于本次支付
|
|
|
|
|
row.spendMoney = appearPrice
|
|
|
|
|
}else{ //余额不够支付,直接扣除全部
|
|
|
|
|
row.spendMoney = row.cardOvers
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
endEditPaycard(row,index){
|
|
|
|
|
// 本次支付spendMoney 可用金额cardConsumeMoney 可用余额cardOvers 可用折扣discount 赠送折扣discountFreeAmount 赠送支付giftSpendMoney 赠送剩余cardGiftOvers
|
|
|
|
|
let appearPrice = this.list[this.projectIndex].transactionPrice - (this.list[this.projectIndex].collectionAmounts?this.list[this.projectIndex].collectionAmounts*1:0) //本次支付
|
|
|
|
|
let discount = row.discount?row.discount/100:1 //赠送折扣
|
|
|
|
|
if(this.list[this.projectIndex].noDiscount == 0){
|
|
|
|
|
if( row.spendMoney > row.cardOvers ){ //输入的值大于剩余,重新计算总额是否够支付本次项目
|
|
|
|
|
let total = (row.cardOvers/discount).toFixed(2)*1 //总价
|
|
|
|
|
this.$message.warning({ message: "支付金额超出剩余金额" });
|
|
|
|
|
if(total>appearPrice){ //余额够支付本次项目,扣除标价*赠送比例
|
|
|
|
|
row.spendMoney = (appearPrice *discount).toFixed(2)*1
|
|
|
|
|
row.cardOvers -= row.spendMoney
|
|
|
|
|
}else{ //不够支付本次项目,扣除掉自己所有剩余
|
|
|
|
|
row.spendMoney = row.cardOvers
|
|
|
|
|
row.cardOvers = 0
|
|
|
|
|
}
|
|
|
|
|
}else{ //不超出余额
|
|
|
|
|
let total = (row.spendMoney/discount).toFixed(2)*1 //支付总价
|
|
|
|
|
if( total>appearPrice){
|
|
|
|
|
this.$message.warning({ message: "本次支付大于项目金额" });
|
|
|
|
|
// 超出的情况下肯定够付
|
|
|
|
|
row.spendMoney = (appearPrice*discount).toFixed(2)*1
|
|
|
|
|
row.cardOvers -= row.spendMoney
|
|
|
|
|
}else{
|
|
|
|
|
// 算出本次支付总共多少钱,是否超出
|
|
|
|
|
let giveTotal = (row.spendMoney /discount).toFixed(2)*1
|
|
|
|
|
if(giveTotal>appearPrice){ //超出的情况帮忙重算
|
|
|
|
|
this.$message.warning({ message: "本次支付大于项目金额" });
|
|
|
|
|
// 超出的情况下肯定够付
|
|
|
|
|
row.spendMoney = (appearPrice*discount).toFixed(2)*1
|
|
|
|
|
row.cardOvers -= row.spendMoney
|
|
|
|
|
}else{
|
|
|
|
|
row.cardOvers -= row.spendMoney
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}else{ //项目不打折
|
|
|
|
|
// 首先判断输入的是否超过卡余额,其次判断输入的值是否大于项目金额
|
|
|
|
|
if(row.spendMoney > row.cardOvers){
|
|
|
|
|
this.$message.warning({ message: "支付金额超出剩余金额" });
|
|
|
|
|
if(row.cardOvers > appearPrice){ //够支付
|
|
|
|
|
row.spendMoney = appearPrice
|
|
|
|
|
row.cardOvers -= row.spendMoney
|
|
|
|
|
}else{ //不够支付
|
|
|
|
|
row.spendMoney = row.cardOvers
|
|
|
|
|
row.cardOvers =0
|
|
|
|
|
}
|
|
|
|
|
}else{ //输入的值不大于卡余额,继续判断是否超出本次支付
|
|
|
|
|
if(row.spendMoney > appearPrice){
|
|
|
|
|
this.$message.warning({ message: "本次支付大于项目金额" });
|
|
|
|
|
row.spendMoney = appearPrice
|
|
|
|
|
row.cardOvers -= row.spendMoney
|
|
|
|
|
}else{
|
|
|
|
|
row.cardOvers -= row.spendMoney
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.recIndex = null
|
|
|
|
|
this.updataList()
|
|
|
|
|
},
|
|
|
|
|
// 赠卡处理
|
|
|
|
|
editGivecard(row,index){
|
|
|
|
|
// 本次支付spendMoney 可用金额cardConsumeMoney 可用余额cardOvers 可用折扣discount 赠送折扣discountFreeAmount 赠送支付giftSpendMoney 赠送剩余cardGiftOvers
|
|
|
|
|
this.giveIndex = index
|
|
|
|
|
let discountFreeAmount = row.discountFreeAmount?row.discountFreeAmount/100:1 //赠送折扣
|
|
|
|
|
let appearPrice = this.list[this.projectIndex].transactionPrice - (this.list[this.projectIndex].collectionAmounts?this.list[this.projectIndex].collectionAmounts*1:0)//本次需要支付多少
|
|
|
|
|
let total = (row.cardGiftOvers/discountFreeAmount).toFixed(2)*1 //总价
|
|
|
|
|
if( row.giftSpendMoney ){
|
|
|
|
|
row.cardGiftOvers += row.giftSpendMoney
|
|
|
|
|
row.giftSpendMoney = 0
|
|
|
|
|
this.updataList()
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
if( this.list[this.projectIndex].noDiscount == 0 ){ // 可以打折
|
|
|
|
|
if(total>appearPrice){ //够支付够支付本次项目
|
|
|
|
|
row.giftSpendMoney = (appearPrice *discountFreeAmount).toFixed(2)*1
|
|
|
|
|
}else{ //不够支付本次项目
|
|
|
|
|
row.giftSpendMoney = row.cardGiftOvers
|
|
|
|
|
}
|
|
|
|
|
}else{ // 不能打折
|
|
|
|
|
if(row.cardGiftOvers > appearPrice){ //余额够支付,支付等于本次支付
|
|
|
|
|
row.giftSpendMoney = appearPrice
|
|
|
|
|
}else{ //余额不够支付,直接扣除全部
|
|
|
|
|
row.giftSpendMoney = row.cardGiftOvers
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
endEditGivecard(row,index){
|
|
|
|
|
let appearPrice = this.list[this.projectIndex].transactionPrice - (this.list[this.projectIndex].collectionAmounts?this.list[this.projectIndex].collectionAmounts*1:0) //本次支付
|
|
|
|
|
let discountFreeAmount = row.discountFreeAmount?row.discountFreeAmount/100:1 //赠送折扣
|
|
|
|
|
if(this.list[this.projectIndex].noDiscount == 0){
|
|
|
|
|
if( row.giftSpendMoney > row.cardGiftOvers ){ //输入的值大于剩余
|
|
|
|
|
let total = (row.cardGiftOvers/discountFreeAmount).toFixed(2)*1 //总价
|
|
|
|
|
this.$message.warning({ message: "赠送支付金额超出赠送剩余金额" });
|
|
|
|
|
if(total>appearPrice){ //够支付够支付本次项目
|
|
|
|
|
row.giftSpendMoney = (appearPrice *discountFreeAmount).toFixed(2)*1
|
|
|
|
|
row.cardGiftOvers -= row.giftSpendMoney
|
|
|
|
|
}else{ //不够支付本次项目
|
|
|
|
|
row.giftSpendMoney = row.cardGiftOvers
|
|
|
|
|
row.cardGiftOvers = 0
|
|
|
|
|
}
|
|
|
|
|
}else{ //不超出余额
|
|
|
|
|
let total = (row.giftSpendMoney/discountFreeAmount).toFixed(2)*1 //支付总价
|
|
|
|
|
if( total>appearPrice){
|
|
|
|
|
this.$message.warning({ message: "本次支付大于项目金额" });
|
|
|
|
|
// 超出的情况下肯定够付
|
|
|
|
|
row.giftSpendMoney = (appearPrice*discountFreeAmount).toFixed(2)*1
|
|
|
|
|
row.cardGiftOvers -= row.giftSpendMoney
|
|
|
|
|
}else{
|
|
|
|
|
// 算出本次支付总共多少钱,是否超出
|
|
|
|
|
let giveTotal = (row.giftSpendMoney /discountFreeAmount).toFixed(2)*1
|
|
|
|
|
if(giveTotal>appearPrice){ //超出的情况帮忙重算
|
|
|
|
|
this.$message.warning({ message: "本次支付大于项目金额" });
|
|
|
|
|
// 超出的情况下肯定够付
|
|
|
|
|
row.giftSpendMoney = (appearPrice*discountFreeAmount).toFixed(2)*1
|
|
|
|
|
row.cardGiftOvers -= row.giftSpendMoney
|
|
|
|
|
}else{
|
|
|
|
|
row.cardGiftOvers -= row.giftSpendMoney
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}else{ //项目不打折
|
|
|
|
|
// 首先判断输入的是否超过卡余额,其次判断输入的值是否大于项目金额
|
|
|
|
|
if(row.giftSpendMoney > row.cardGiftOvers){
|
|
|
|
|
this.$message.warning({ message: "赠送支付金额超出赠送剩余金额" });
|
|
|
|
|
if(row.cardGiftOvers > appearPrice){ //够支付
|
|
|
|
|
console.log( '总价为--->',appearPrice )
|
|
|
|
|
row.giftSpendMoney = appearPrice
|
|
|
|
|
row.cardGiftOvers -= row.giftSpendMoney
|
|
|
|
|
}else{ //不够支付
|
|
|
|
|
row.giftSpendMoney = row.cardGiftOvers
|
|
|
|
|
row.cardGiftOvers =0
|
|
|
|
|
}
|
|
|
|
|
}else{ //输入的值不大于卡余额,继续判断是否超出本次支付
|
|
|
|
|
if(row.giftSpendMoney > appearPrice){
|
|
|
|
|
this.$message.warning({ message: "本次支付大于项目金额" });
|
|
|
|
|
console.log('--->',appearPrice)
|
|
|
|
|
row.giftSpendMoney = appearPrice
|
|
|
|
|
row.cardGiftOvers -= row.giftSpendMoney
|
|
|
|
|
}else{
|
|
|
|
|
row.cardGiftOvers -= row.giftSpendMoney
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.giveIndex = null
|
|
|
|
|
this.updataList()
|
|
|
|
|
},
|
|
|
|
|
addUserConfirm(phone){
|
|
|
|
|
this.memberForm.mobilePhone = phone
|
|
|
|
|
this.inputMember()
|
|
|
|
|
@ -1186,7 +1411,6 @@ export default {
|
|
|
|
|
this.$set(item1,'numRemainder',(item1.cardRestMoney - item1.numCard).toFixed(2)*1) //卡付金额剩余
|
|
|
|
|
this.$set(item1,'giveRemainder',(item1.giftConsumeMoney - item1.cardGive).toFixed(2)*1) //卡付赠送剩余
|
|
|
|
|
})
|
|
|
|
|
this.updateNum()
|
|
|
|
|
// 过滤只要使用过的卡
|
|
|
|
|
this.cardList = this.cardList.filter(item=>{
|
|
|
|
|
return item.numConsume || item.giveConsume
|
|
|
|
|
@ -1257,6 +1481,8 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
this.cardListUpdata()
|
|
|
|
|
this.updataCollection()
|
|
|
|
|
this.list.push({})
|
|
|
|
|
this.list.pop()
|
|
|
|
|
},
|
|
|
|
|
//修改卡付金额
|
|
|
|
|
editcard(row, index) {
|
|
|
|
|
@ -1280,7 +1506,7 @@ export default {
|
|
|
|
|
row.spendMoney = 0
|
|
|
|
|
row.cardGiftOvers = ((row.cardGiftOvers?row.cardGiftOvers*1:0) + (row.giftSpendMoney?row.giftSpendMoney*1:0)).toFixed(2)*1
|
|
|
|
|
row.giftSpendMoney = 0
|
|
|
|
|
// 不知名错误,别删
|
|
|
|
|
// 未知错误
|
|
|
|
|
this.$set(this.list[this.projectIndex],'popover',false)
|
|
|
|
|
this.$set(this.list[this.projectIndex],'popover',true)
|
|
|
|
|
this.list.push({})
|
|
|
|
|
@ -1630,7 +1856,7 @@ export default {
|
|
|
|
|
row.cardGiftOvers = (row.cardGiftOvers - row.discountFreeAmount).toFixed(2)*1
|
|
|
|
|
row.spendMoney = 0
|
|
|
|
|
row.cardOvers = 0
|
|
|
|
|
// 不知名错误,未展示扣除,需要关闭再打开
|
|
|
|
|
// 未知错误,未展示扣除,需要关闭再打开
|
|
|
|
|
this.$set(this.list[this.projectIndex],'popover',false)
|
|
|
|
|
this.$set(this.list[this.projectIndex],'popover',true)
|
|
|
|
|
this.list.push({})
|
|
|
|
|
@ -1642,7 +1868,7 @@ export default {
|
|
|
|
|
row.cardGiftOvers = 0
|
|
|
|
|
row.spendMoney = 0
|
|
|
|
|
row.cardOvers = 0
|
|
|
|
|
// 不知名错误,未展示扣除,需要关闭再打开
|
|
|
|
|
// 未知错误,未展示扣除,需要关闭再打开
|
|
|
|
|
this.$set(this.list[this.projectIndex],'popover',false)
|
|
|
|
|
this.$set(this.list[this.projectIndex],'popover',true)
|
|
|
|
|
this.list.push({})
|
|
|
|
|
@ -1658,7 +1884,7 @@ export default {
|
|
|
|
|
row.cardGiftOvers = (row.cardGiftOvers - row.giftSpendMoney).toFixed(2)*1
|
|
|
|
|
row.spendMoney = 0
|
|
|
|
|
row.cardOvers = 0
|
|
|
|
|
// 不知名错误,未展示扣除,需要关闭再打开
|
|
|
|
|
// 未知错误,未展示扣除,需要关闭再打开
|
|
|
|
|
this.$set(this.list[this.projectIndex],'popover',false)
|
|
|
|
|
this.$set(this.list[this.projectIndex],'popover',true)
|
|
|
|
|
this.list.push({})
|
|
|
|
|
@ -1670,7 +1896,7 @@ export default {
|
|
|
|
|
row.cardGiftOvers = 0
|
|
|
|
|
row.spendMoney = 0
|
|
|
|
|
row.cardOvers = 0
|
|
|
|
|
// 不知名错误,未展示扣除,需要关闭再打开
|
|
|
|
|
// 未知错误,未展示扣除,需要关闭再打开
|
|
|
|
|
this.$set(this.list[this.projectIndex],'popover',false)
|
|
|
|
|
this.$set(this.list[this.projectIndex],'popover',true)
|
|
|
|
|
this.list.push({})
|
|
|
|
|
@ -1685,7 +1911,7 @@ export default {
|
|
|
|
|
row.cardGiftOvers = (row.cardGiftOvers - row.giftSpendMoney).toFixed(2)*1
|
|
|
|
|
row.spendMoney = 0
|
|
|
|
|
row.cardOvers = 0
|
|
|
|
|
// 不知名错误,未展示扣除,需要关闭再打开
|
|
|
|
|
// 未知错误,未展示扣除,需要关闭再打开
|
|
|
|
|
this.$set(this.list[this.projectIndex],'popover',false)
|
|
|
|
|
this.$set(this.list[this.projectIndex],'popover',true)
|
|
|
|
|
this.list.push({})
|
|
|
|
|
@ -1696,7 +1922,7 @@ export default {
|
|
|
|
|
row.cardGiftOvers = (row.cardGiftOvers - row.giftSpendMoney).toFixed(2)*1
|
|
|
|
|
row.spendMoney = 0
|
|
|
|
|
row.cardOvers = 0
|
|
|
|
|
// 不知名错误,未展示扣除,需要关闭再打开
|
|
|
|
|
// 未知错误,未展示扣除,需要关闭再打开
|
|
|
|
|
this.$set(this.list[this.projectIndex],'popover',false)
|
|
|
|
|
this.$set(this.list[this.projectIndex],'popover',true)
|
|
|
|
|
this.list.push({})
|
|
|
|
|
@ -1784,7 +2010,7 @@ export default {
|
|
|
|
|
row.spendMoney = 0
|
|
|
|
|
row.giftSpendMoney = appearPrice
|
|
|
|
|
row.cardGiftOvers = (row.cardGiftOvers - appearPrice).toFixed(2)*1
|
|
|
|
|
// 不知名错误,未展示扣除,需要关闭再打开
|
|
|
|
|
// 未知错误,未展示扣除,需要关闭再打开
|
|
|
|
|
this.$set(this.list[this.projectIndex],'popover',false)
|
|
|
|
|
this.$set(this.list[this.projectIndex],'popover',true)
|
|
|
|
|
return this.updataList()
|
|
|
|
|
@ -1792,7 +2018,7 @@ export default {
|
|
|
|
|
row.spendMoney = 0
|
|
|
|
|
row.giftSpendMoney = row.cardGiftOvers
|
|
|
|
|
row.cardGiftOvers = 0
|
|
|
|
|
// 不知名错误,未展示扣除,需要关闭再打开
|
|
|
|
|
// 未知错误,未展示扣除,需要关闭再打开
|
|
|
|
|
this.$set(this.list[this.projectIndex],'popover',false)
|
|
|
|
|
this.$set(this.list[this.projectIndex],'popover',true)
|
|
|
|
|
return this.updataList()
|
|
|
|
|
@ -1805,7 +2031,7 @@ export default {
|
|
|
|
|
row.spendMoney = 0
|
|
|
|
|
row.giftSpendMoney = appearPrice
|
|
|
|
|
row.cardGiftOvers = (row.cardGiftOvers - appearPrice).toFixed(2)*1
|
|
|
|
|
// 不知名错误,未展示扣除,需要关闭再打开
|
|
|
|
|
// 未知错误,未展示扣除,需要关闭再打开
|
|
|
|
|
this.$set(this.list[this.projectIndex],'popover',false)
|
|
|
|
|
this.$set(this.list[this.projectIndex],'popover',true)
|
|
|
|
|
return this.updataList()
|
|
|
|
|
@ -1813,7 +2039,7 @@ export default {
|
|
|
|
|
row.spendMoney = 0
|
|
|
|
|
row.giftSpendMoney = row.cardGiftOvers
|
|
|
|
|
row.cardGiftOvers = 0
|
|
|
|
|
// 不知名错误,未展示扣除,需要关闭再打开
|
|
|
|
|
// 未知错误,未展示扣除,需要关闭再打开
|
|
|
|
|
this.$set(this.list[this.projectIndex],'popover',false)
|
|
|
|
|
this.$set(this.list[this.projectIndex],'popover',true)
|
|
|
|
|
return this.updataList()
|
|
|
|
|
@ -1822,14 +2048,13 @@ export default {
|
|
|
|
|
row.giftSpendMoney = row.spendMoney*1
|
|
|
|
|
row.cardGiftOvers = (row.cardGiftOvers - row.giftSpendMoney).toFixed(2)*1
|
|
|
|
|
row.spendMoney = 0
|
|
|
|
|
// 不知名错误,未展示扣除,需要关闭再打开
|
|
|
|
|
// 未知错误,未展示扣除,需要关闭再打开
|
|
|
|
|
this.$set(this.list[this.projectIndex],'popover',false)
|
|
|
|
|
this.$set(this.list[this.projectIndex],'popover',true)
|
|
|
|
|
return this.updataList()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(row.spendMoney > row.cardOvers){ //输入金额大于卡付余额
|
|
|
|
|
this.$message.warning({ message: "支付金额大于卡付余额" });
|
|
|
|
|
//重新计算
|
|
|
|
|
@ -2423,9 +2648,12 @@ export default {
|
|
|
|
|
if (!item.cardGiftOvers) {
|
|
|
|
|
item.cardGiftOvers = item.giftConsumeMoney;
|
|
|
|
|
}
|
|
|
|
|
if (item.type == 0) {
|
|
|
|
|
item.discountFreeAmount = 100;
|
|
|
|
|
if(!item.discountFreeAmount){
|
|
|
|
|
item.discountFreeAmount = 100
|
|
|
|
|
}
|
|
|
|
|
// if (item.type == 0) {
|
|
|
|
|
// item.discountFreeAmount = 100;
|
|
|
|
|
// }
|
|
|
|
|
if (item.type != 1 && form.noDiscount == 0) {
|
|
|
|
|
item.offsetMoney =
|
|
|
|
|
(item.cardConsumeMoney / (item.discount / 100)).toFixed(2) * 1;
|
|
|
|
|
@ -2793,226 +3021,6 @@ export default {
|
|
|
|
|
save() {
|
|
|
|
|
this.close();
|
|
|
|
|
},
|
|
|
|
|
//获取数据
|
|
|
|
|
async getData() {
|
|
|
|
|
this.list.forEach(item => {
|
|
|
|
|
item.payLists = [...this.payLists];
|
|
|
|
|
item.rechargeAccountList = [];
|
|
|
|
|
});
|
|
|
|
|
//判断是否是会员
|
|
|
|
|
var itemForm = this.list[0];
|
|
|
|
|
this.notMemberForm = itemForm;
|
|
|
|
|
this.cashNumber = itemForm.cashNumber;
|
|
|
|
|
if (itemForm.cashNumber == 1) {
|
|
|
|
|
//会员
|
|
|
|
|
storeMemberOne({
|
|
|
|
|
mobilePhone: itemForm.mobilePhone,
|
|
|
|
|
storeId: sessionStorage.getItem("parentId")
|
|
|
|
|
}).then(res => {
|
|
|
|
|
if (res.code == "000000") {
|
|
|
|
|
this.memberForm = res.data;
|
|
|
|
|
this.$refs.reccard.show(this.memberForm);
|
|
|
|
|
this.$refs.course.show(this.memberForm);
|
|
|
|
|
var memberIds = {
|
|
|
|
|
memberId: itemForm.memberId
|
|
|
|
|
};
|
|
|
|
|
cashListByStore({
|
|
|
|
|
memberId: this.memberForm.id,
|
|
|
|
|
storeId: sessionStorage.getItem("storeId")
|
|
|
|
|
}).then(res => {
|
|
|
|
|
if (res.code == "000000") {
|
|
|
|
|
this.rechargeAccountList = res.rows;
|
|
|
|
|
this.list.forEach(item => {
|
|
|
|
|
item.rechargeAccountList = this.rechargeAccountList;
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
this.$alert(res.message, "查询会员卡包", {
|
|
|
|
|
confirmButtonText: "确定",
|
|
|
|
|
confirmButtonClass: "confirmbtnFalses",
|
|
|
|
|
type: "warning",
|
|
|
|
|
center: true,
|
|
|
|
|
callback: action => {}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
//查询当前会员下的所有项目疗程 如果有相对应的项目 就给courseAccountId赋值 没有的话 就是卡付现付
|
|
|
|
|
couAccountList(memberIds).then(res => {
|
|
|
|
|
if (res.code == "000000") {
|
|
|
|
|
if (res.rows.length != 0) {
|
|
|
|
|
this.list.forEach(items1 => {
|
|
|
|
|
res.rows.forEach(items => {
|
|
|
|
|
items.number = items.courseConsumeCount;
|
|
|
|
|
if (
|
|
|
|
|
items.courseProjectId == items1.projectId &&
|
|
|
|
|
items.number > 0
|
|
|
|
|
) {
|
|
|
|
|
if (items1.courseAccountId == null) {
|
|
|
|
|
items1.courseAccountId = items.id;
|
|
|
|
|
items.number = items.number * 1 - 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
this.$alert(res.message, "查询会员疗程", {
|
|
|
|
|
confirmButtonText: "确定",
|
|
|
|
|
confirmButtonClass: "confirmbtnFalses",
|
|
|
|
|
type: "warning",
|
|
|
|
|
center: true,
|
|
|
|
|
callback: action => {}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
let list = [];
|
|
|
|
|
this.list.forEach((itemList, index) => {
|
|
|
|
|
var itemLists = {
|
|
|
|
|
index: index,
|
|
|
|
|
id: itemList.id,
|
|
|
|
|
largeList: itemList.largeList,
|
|
|
|
|
zhonggongList: itemList.zhonggongList,
|
|
|
|
|
smallList: itemList.smallList,
|
|
|
|
|
technicianList: itemList.technicianList,
|
|
|
|
|
adminList: [],
|
|
|
|
|
managerList: [],
|
|
|
|
|
projectName: itemList.projectName,
|
|
|
|
|
payLists: itemList.payLists,
|
|
|
|
|
rechargeAccountList: this.setRecList(itemList),
|
|
|
|
|
courseAccountId: itemList.courseAccountId,
|
|
|
|
|
amount: itemList.transactionPrice,
|
|
|
|
|
noDiscount: itemList.noDiscount,
|
|
|
|
|
integral: 0,
|
|
|
|
|
integralMoney: 0,
|
|
|
|
|
payMoneys: 0,
|
|
|
|
|
spendMoneys: 0,
|
|
|
|
|
collectionRechargeAmount: 0,
|
|
|
|
|
collRecAmonnt: 0,
|
|
|
|
|
collectionCashAmount: 0,
|
|
|
|
|
collectionIntegralAmount: 0,
|
|
|
|
|
collectionAmount: 0,
|
|
|
|
|
projectId: itemList.projectId,
|
|
|
|
|
projectName: itemList.projectName,
|
|
|
|
|
memberName: itemList.memberName,
|
|
|
|
|
memberId: itemList.memberId,
|
|
|
|
|
cashNum: itemList.cashNum,
|
|
|
|
|
isCardPay: itemList.isCardPay,
|
|
|
|
|
storeName: itemList.storeName,
|
|
|
|
|
price: itemList.price,
|
|
|
|
|
priceMember: itemList.priceMember,
|
|
|
|
|
minumumPrice: itemList.minumumPrice,
|
|
|
|
|
minumumPriceMember: itemList.minumumPriceMember,
|
|
|
|
|
topPrice: itemList.topPrice,
|
|
|
|
|
topPriceMember: itemList.topPriceMember,
|
|
|
|
|
storeId: itemList.storeId,
|
|
|
|
|
transactionPrice: itemList.transactionPrice,
|
|
|
|
|
cashNumber: itemList.cashNumber,
|
|
|
|
|
numberTimes: 1,
|
|
|
|
|
mobilePhone: itemList.mobilePhone,
|
|
|
|
|
minumumTimes: itemList.minumumTimes,
|
|
|
|
|
commissionZhonggong: itemList.commissionZhonggong,
|
|
|
|
|
commissionTechnician: itemList.commissionTechnician,
|
|
|
|
|
commissionSmall: itemList.commissionSmall,
|
|
|
|
|
commissionLarge: itemList.commissionLarge,
|
|
|
|
|
cardCommissionZhonggong: itemList.cardCommissionZhonggong,
|
|
|
|
|
cardCommissionTechnician: itemList.cardCommissionTechnician,
|
|
|
|
|
cardCommissionSmall: itemList.cardCommissionSmall,
|
|
|
|
|
cardCommissionLarge: itemList.cardCommissionLarge,
|
|
|
|
|
achievementLarge: itemList.achievementLarge,
|
|
|
|
|
achievementSmall: itemList.achievementSmall,
|
|
|
|
|
achievementTechnician: itemList.achievementTechnician,
|
|
|
|
|
achievementZhonggong: itemList.achievementZhonggong,
|
|
|
|
|
cardAchievementLarge: itemList.cardAchievementLarge,
|
|
|
|
|
cardAchievementSmall: itemList.cardAchievementSmall,
|
|
|
|
|
cardAchievementTechnician:
|
|
|
|
|
itemList.cardAchievementTechnician,
|
|
|
|
|
cardAchievementZhonggong: itemList.cardAchievementZhonggong
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
if (itemLists.courseAccountId == null) {
|
|
|
|
|
itemLists.cashAmount = 0;
|
|
|
|
|
itemLists.collectionAmount = 0;
|
|
|
|
|
itemLists.courseMoney = 0;
|
|
|
|
|
} else {
|
|
|
|
|
itemLists.cashAmount = itemLists.amount;
|
|
|
|
|
itemLists.collectionAmount = itemLists.amount;
|
|
|
|
|
|
|
|
|
|
itemLists.courseMoney = itemLists.transactionPrice;
|
|
|
|
|
}
|
|
|
|
|
list.push(itemLists);
|
|
|
|
|
});
|
|
|
|
|
this.list = list;
|
|
|
|
|
this.setList();
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
//不是会员
|
|
|
|
|
let list = [];
|
|
|
|
|
this.list.forEach((itemList, index) => {
|
|
|
|
|
var itemLists = {
|
|
|
|
|
index: index,
|
|
|
|
|
id: itemList.id,
|
|
|
|
|
largeList: itemList.largeList,
|
|
|
|
|
zhonggongList: itemList.zhonggongList,
|
|
|
|
|
smallList: itemList.smallList,
|
|
|
|
|
technicianList: itemList.technicianList,
|
|
|
|
|
adminList: [],
|
|
|
|
|
managerList: [],
|
|
|
|
|
projectName: itemList.projectName,
|
|
|
|
|
payLists: itemList.payLists,
|
|
|
|
|
rechargeAccountList: this.rechargeAccountList,
|
|
|
|
|
courseAccountId: itemList.courseAccountId,
|
|
|
|
|
amount: itemList.transactionPrice,
|
|
|
|
|
integral: 0,
|
|
|
|
|
integralMoney: 0,
|
|
|
|
|
cashAmount: 0,
|
|
|
|
|
payMoneys: 0,
|
|
|
|
|
spendMoneys: 0,
|
|
|
|
|
noDiscount: itemList.noDiscount,
|
|
|
|
|
collectionRechargeAmount: 0,
|
|
|
|
|
collRecAmonnt: 0,
|
|
|
|
|
collectionCashAmount: 0,
|
|
|
|
|
collectionAmount: 0,
|
|
|
|
|
projectId: itemList.projectId,
|
|
|
|
|
isCardPay: itemList.isCardPay,
|
|
|
|
|
projectName: itemList.projectName,
|
|
|
|
|
memberName: itemList.memberName,
|
|
|
|
|
cashNum: itemList.cashNum,
|
|
|
|
|
storeName: itemList.storeName,
|
|
|
|
|
price: itemList.price,
|
|
|
|
|
priceMember: itemList.priceMember,
|
|
|
|
|
minumumPrice: itemList.minumumPrice,
|
|
|
|
|
minumumPriceMember: itemList.minumumPriceMember,
|
|
|
|
|
topPrice: itemList.topPrice,
|
|
|
|
|
topPriceMember: itemList.topPriceMember,
|
|
|
|
|
storeId: itemList.storeId,
|
|
|
|
|
transactionPrice: itemList.transactionPrice,
|
|
|
|
|
cashNumber: itemList.cashNumber,
|
|
|
|
|
numberTimes: 1,
|
|
|
|
|
mobilePhone: itemList.mobilePhone,
|
|
|
|
|
minumumTimes: itemList.minumumTimes,
|
|
|
|
|
commissionZhonggong: itemList.commissionZhonggong,
|
|
|
|
|
commissionTechnician: itemList.commissionTechnician,
|
|
|
|
|
commissionSmall: itemList.commissionSmall,
|
|
|
|
|
commissionLarge: itemList.commissionLarge,
|
|
|
|
|
cardCommissionZhonggong: itemList.cardCommissionZhonggong,
|
|
|
|
|
cardCommissionTechnician: itemList.cardCommissionTechnician,
|
|
|
|
|
cardCommissionSmall: itemList.cardCommissionSmall,
|
|
|
|
|
cardCommissionLarge: itemList.cardCommissionLarge,
|
|
|
|
|
achievementLarge: itemList.achievementLarge,
|
|
|
|
|
achievementSmall: itemList.achievementSmall,
|
|
|
|
|
achievementTechnician: itemList.achievementTechnician,
|
|
|
|
|
achievementZhonggong: itemList.achievementZhonggong,
|
|
|
|
|
cardAchievementLarge: itemList.cardAchievementLarge,
|
|
|
|
|
cardAchievementSmall: itemList.cardAchievementSmall,
|
|
|
|
|
cardAchievementTechnician: itemList.cardAchievementTechnician,
|
|
|
|
|
cardAchievementZhonggong: itemList.cardAchievementZhonggong
|
|
|
|
|
};
|
|
|
|
|
list.push(itemLists);
|
|
|
|
|
});
|
|
|
|
|
this.list = list;
|
|
|
|
|
this.setList();
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
setList() {
|
|
|
|
|
this.list.forEach(item => {
|
|
|
|
|
item.editNumber = 1;
|
|
|
|
|
@ -3085,14 +3093,14 @@ export default {
|
|
|
|
|
memberId: this.memberForm.id,
|
|
|
|
|
storeId: sessionStorage.getItem("storeId")
|
|
|
|
|
}).then(res => {
|
|
|
|
|
console.log('第一次')
|
|
|
|
|
if (res.code == "000000") {
|
|
|
|
|
this.rechargeAccountList = res.rows;
|
|
|
|
|
console.log( 'this.rechargeAccountList--->',this.rechargeAccountList )
|
|
|
|
|
this.recListCopy = JSON.parse(JSON.stringify(res.rows));
|
|
|
|
|
this.cardList = res.rows
|
|
|
|
|
this.cardListUpdata()
|
|
|
|
|
this.list.forEach(item => {
|
|
|
|
|
item.rechargeAccountList = this.rechargeAccountList;
|
|
|
|
|
item.rechargeAccountList = JSON.parse(JSON.stringify(this.rechargeAccountList));
|
|
|
|
|
});
|
|
|
|
|
this.addPro();
|
|
|
|
|
} else {
|
|
|
|
|
|