|
|
|
|
@ -156,42 +156,55 @@
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column v-if="radioAccount==1" label="剩余次数" align="center" width="160">
|
|
|
|
|
<template slot-scope='scope'>
|
|
|
|
|
<el-input @change="changeInput(scope.row,scope.$index )" @blur="scope.row.courseRestCountNew==''?scope.row.courseRestCountNew=0:scope.row.courseRestCountNew" oninput="this.value=this.value.replace(/[^\-?\d.]/g,'')" v-if="scope.$index==1" v-model="scope.row.courseRestCountModify"></el-input>
|
|
|
|
|
<el-input @change="changeInput(scope.row,4 )" @blur="scope.row.courseRestCountNew==''?scope.row.courseRestCountNew=0:scope.row.courseRestCountNew" oninput="this.value=this.value.replace(/[^\-?\d.]/g,'')" v-if="scope.$index==1" v-model="scope.row.courseRestCountModify"></el-input>
|
|
|
|
|
<span v-else>{{scope.$index==0?scope.row.courseRestCount:scope.row.courseRestCountNew}}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column v-if="radioAccount==1" label="可用次数" align="center" width="160">
|
|
|
|
|
<template slot-scope='scope'>
|
|
|
|
|
<el-input oninput="this.value=this.value.replace(/[^\-?\d.]/g,'')" @change="changeInput(scope.row,scope.$index )" v-if="scope.$index==1" v-model="scope.row.courseConsumeCountModify"></el-input>
|
|
|
|
|
<el-input oninput="this.value=this.value.replace(/[^\-?\d.]/g,'')" @change="changeInput(scope.row,5 )" v-if="scope.$index==1" v-model="scope.row.courseConsumeCountModify"></el-input>
|
|
|
|
|
<span v-else>{{scope.$index==0?scope.row.courseConsumeCount:scope.row.courseConsumeCountNew}}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column prop="tradeMoney" v-if="radioAccount==0" label="剩余金额" align="center" min-width="80">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-input @change="changeInput(scope.row,scope.$index )" v-if="scope.$index==1" v-model="scope.row.cardRestMoneyModify"></el-input>
|
|
|
|
|
<el-input oninput="this.value=this.value.replace(/[^\-?\d.]/g,'')" @change="changeInput(scope.row,0 )" v-if="scope.$index==1" v-model="scope.row.cardRestMoneyModify"></el-input>
|
|
|
|
|
<span v-else>{{scope.$index==0?scope.row.cardRestMoney:scope.row.cardRestMoneyNew}}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column prop="tradeMoney" v-if="radioAccount==0" label="可用金额" align="center" min-width="80">
|
|
|
|
|
<template slot-scope='scope'>
|
|
|
|
|
<el-input @change="changeInput(scope.row,scope.$index )" v-if="scope.$index==1" v-model="scope.row.cardConsumeMoneyModify"></el-input>
|
|
|
|
|
<el-input oninput="this.value=this.value.replace(/[^\-?\d.]/g,'')" @change="changeInput(scope.row,1 )" v-if="scope.$index==1" v-model="scope.row.cardConsumeMoneyModify"></el-input>
|
|
|
|
|
<span v-else>{{scope.$index==0?scope.row.cardConsumeMoney:scope.row.cardConsumeMoneyNew}}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column prop="tradeMoney" v-if="radioAccount==0" label="赠送剩余金额" align="center" min-width="80">
|
|
|
|
|
<template slot-scope='scope'>
|
|
|
|
|
<el-input @change="changeInput(scope.row,scope.$index )" v-if="scope.$index==1&&scope.row.type==0" v-model="scope.row.cardGiftMoneyModify">
|
|
|
|
|
<el-input @change="changeInput(scope.row,2 )" v-if="scope.$index==1&&scope.row.type==0" v-model="scope.row.cardGiftMoneyModify">
|
|
|
|
|
</el-input>
|
|
|
|
|
<span v-else>{{scope.$index==0?scope.row.cardGiftMoney:scope.row.cardGiftMoneyNew}}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column prop="giftConsumeMoney" v-if="radioAccount==0" label="赠送可用金额" align="center" min-width="80">
|
|
|
|
|
<template slot-scope='scope'>
|
|
|
|
|
<el-input @change="changeInput(scope.row,scope.$index )" v-if="scope.$index==1&&scope.row.type==0" v-model="scope.row.giftConsumeMoneyModify">
|
|
|
|
|
<el-input @change="changeInput(scope.row,3 )" v-if="scope.$index==1&&scope.row.type==0" v-model="scope.row.giftConsumeMoneyModify">
|
|
|
|
|
</el-input>
|
|
|
|
|
<span v-else>{{scope.$index==0?scope.row.giftConsumeMoney:scope.row.giftConsumeMoneyNew}}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column align="center" label="异常说明" min-width="150" v-if="radioAccount==0||radioAccount==1">
|
|
|
|
|
<template slot-scope='scope'>
|
|
|
|
|
<div style="width:250px">
|
|
|
|
|
<el-input
|
|
|
|
|
type="textarea"
|
|
|
|
|
maxlength="100"
|
|
|
|
|
show-word-limit
|
|
|
|
|
:autosize="{ minRows: 2, maxRows: 4}"
|
|
|
|
|
placeholder="请输入内容"
|
|
|
|
|
v-model="scope.row.textarea"/>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
|
<el-button size="mini" type="primary" plain @click="handleClose">取 消</el-button>
|
|
|
|
|
@ -300,10 +313,138 @@ export default {
|
|
|
|
|
console.log("value", value);
|
|
|
|
|
console.log("index", index);
|
|
|
|
|
},
|
|
|
|
|
changeInput(row, index) {
|
|
|
|
|
console.log(row);
|
|
|
|
|
changeInput(row,index){
|
|
|
|
|
console.log(row)
|
|
|
|
|
// 0剩余金额 1可用金额 2赠送金额 3赠送可用金额 4剩余次数 5可用次数
|
|
|
|
|
// courseRestCountModify剩余次数 courseConsumeCountModify可用次数 cardRestMoneyModify剩余金额 cardConsumeMoneyModify可用金额 cardGiftMoneyModify赠送剩余金额 giftConsumeMoneyModify赠送可用金额
|
|
|
|
|
// courseRestCountNew新账户剩余次数 courseConsumeCountNew新账户可用次数 cardRestMoneyNew新账户剩余金额 cardConsumeMoneyNew新账户可用金额 cardGiftMoneyNew新账户赠送剩余金额 giftConsumeMoneyNew新账户赠送可用金额
|
|
|
|
|
switch (index) {
|
|
|
|
|
case 0:
|
|
|
|
|
if(row.cardRestMoneyModify*1||row.cardRestMoneyModify*1===0){
|
|
|
|
|
// 修改了剩余金额
|
|
|
|
|
let total = row.cardRestMoneyModify*1
|
|
|
|
|
// 剩余金额小于可用金额时
|
|
|
|
|
if(total < row.cardConsumeMoneyModify*1){
|
|
|
|
|
row.cardRestMoneyModify = 0
|
|
|
|
|
this.accountList[2].cardRestMoneyNew = 0
|
|
|
|
|
this.$alert("剩余金额不能小于可用金额", "提示", {
|
|
|
|
|
confirmButtonText: "确定",
|
|
|
|
|
confirmButtonClass: "confirmbtnFalses",
|
|
|
|
|
type: "warning",
|
|
|
|
|
center: true,
|
|
|
|
|
callback: (action) => {},
|
|
|
|
|
});
|
|
|
|
|
}else{
|
|
|
|
|
this.$set(this.accountList[2],'cardRestMoneyNew',total)
|
|
|
|
|
// this.accountList[2].cardRestMoneyNew = total
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 1:
|
|
|
|
|
if(row.cardConsumeMoneyModify*1||row.cardConsumeMoneyModify*1===0){
|
|
|
|
|
// 修改了可用金额
|
|
|
|
|
let total = row.cardConsumeMoneyModify*1
|
|
|
|
|
// 输入的可用金额大于剩余金额时
|
|
|
|
|
if( total>row.cardRestMoneyModify*1 ){
|
|
|
|
|
row.cardConsumeMoneyModify = 0
|
|
|
|
|
this.accountList[2].cardConsumeMoneyNew = 0
|
|
|
|
|
this.$alert("可用金额不能大于剩余金额", "提示", {
|
|
|
|
|
confirmButtonText: "确定",
|
|
|
|
|
confirmButtonClass: "confirmbtnFalses",
|
|
|
|
|
type: "warning",
|
|
|
|
|
center: true,
|
|
|
|
|
callback: (action) => {},
|
|
|
|
|
});
|
|
|
|
|
}else{
|
|
|
|
|
// this.accountList[2].cardConsumeMoneyNew = total
|
|
|
|
|
this.$set(this.accountList[2],'cardConsumeMoneyNew',total)
|
|
|
|
|
console.log(this.accountList[2])
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
if(row.cardGiftMoneyModify*1||row.cardGiftMoneyModify*1===0){
|
|
|
|
|
// 操作了赠送剩余金额
|
|
|
|
|
let total = row.cardGiftMoneyModify*1
|
|
|
|
|
// 赠送剩余金额小于赠送可用金额时
|
|
|
|
|
if(total < row.giftConsumeMoneyModify*1){
|
|
|
|
|
row.cardGiftMoneyModify = 0
|
|
|
|
|
this.accountList[2].cardGiftMoneyNew = 0
|
|
|
|
|
this.$alert("赠送剩余金额不能小于赠送可用金额", "提示", {
|
|
|
|
|
confirmButtonText: "确定",
|
|
|
|
|
confirmButtonClass: "confirmbtnFalses",
|
|
|
|
|
type: "warning",
|
|
|
|
|
center: true,
|
|
|
|
|
callback: (action) => {},
|
|
|
|
|
});
|
|
|
|
|
}else{
|
|
|
|
|
this.accountList[2].cardGiftMoneyNew = total
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 3:
|
|
|
|
|
if(row.giftConsumeMoneyModify*1||row.giftConsumeMoneyModify*1===0){
|
|
|
|
|
// 操作了赠送可用金额
|
|
|
|
|
let total = row.giftConsumeMoneyModify*1
|
|
|
|
|
// 赠送可用金额大于赠送金额时
|
|
|
|
|
if(total>row.cardGiftMoneyModify*1){
|
|
|
|
|
row.giftConsumeMoneyModify = 0
|
|
|
|
|
this.accountList[2].giftConsumeMoneyNew = 0
|
|
|
|
|
this.$alert("赠送可用金额不能大于赠送剩余金额", "提示", {
|
|
|
|
|
confirmButtonText: "确定",
|
|
|
|
|
confirmButtonClass: "confirmbtnFalses",
|
|
|
|
|
type: "warning",
|
|
|
|
|
center: true,
|
|
|
|
|
callback: (action) => {},
|
|
|
|
|
});
|
|
|
|
|
}else{
|
|
|
|
|
this.accountList[2].giftConsumeMoneyNew = total
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 4:
|
|
|
|
|
if(row.courseRestCountModify*1||row.courseRestCountModify*1===0){
|
|
|
|
|
// 修改了剩余次数
|
|
|
|
|
let total = row.courseRestCountModify*1
|
|
|
|
|
// 剩余次数小于可用次数时
|
|
|
|
|
if(total<row.courseConsumeCountModify*1){
|
|
|
|
|
row.courseRestCountModify = 0
|
|
|
|
|
this.accountList[2].courseRestCountNew = 0
|
|
|
|
|
this.$alert("剩余次数不能小于可用次数", "提示", {
|
|
|
|
|
confirmButtonText: "确定",
|
|
|
|
|
confirmButtonClass: "confirmbtnFalses",
|
|
|
|
|
type: "warning",
|
|
|
|
|
center: true,
|
|
|
|
|
callback: (action) => {},
|
|
|
|
|
});
|
|
|
|
|
}else{
|
|
|
|
|
this.accountList[2].courseRestCountNew = total
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 5:
|
|
|
|
|
if(row.courseConsumeCountModify*1||row.courseConsumeCountModify*1===0){
|
|
|
|
|
// 修改了可用次数
|
|
|
|
|
let total = row.courseConsumeCountModify*1
|
|
|
|
|
if(total > row.courseRestCountModify*1){
|
|
|
|
|
row.courseConsumeCountModify = 0
|
|
|
|
|
this.accountList[2].courseConsumeCountNew = 0
|
|
|
|
|
this.$alert("可用次数不能大于剩余次数", "提示", {
|
|
|
|
|
confirmButtonText: "确定",
|
|
|
|
|
confirmButtonClass: "confirmbtnFalses",
|
|
|
|
|
type: "warning",
|
|
|
|
|
center: true,
|
|
|
|
|
callback: (action) => {},
|
|
|
|
|
});
|
|
|
|
|
}else{
|
|
|
|
|
this.accountList[2].courseConsumeCountNew = total
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
changeInputActive(row, index) {
|
|
|
|
|
let list = [...this.accountList];
|
|
|
|
|
|
|
|
|
|
if (list[2].courseRestCountNew != undefined) {
|
|
|
|
|
list[2].courseRestCountNew =
|
|
|
|
|
list[0].courseRestCount + list[1].courseRestCountModify * 1;
|
|
|
|
|
@ -319,19 +460,20 @@ export default {
|
|
|
|
|
center: true,
|
|
|
|
|
callback: (action) => {},
|
|
|
|
|
});
|
|
|
|
|
this.accountList[1].courseConsumeCountModify = 0
|
|
|
|
|
this.changeInput(row)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (list[2].cardRestMoneyNew != undefined) {
|
|
|
|
|
if (list[2].cardRestMoneyNew) {
|
|
|
|
|
list[2].cardRestMoneyNew =
|
|
|
|
|
list[0].cardRestMoney + list[1].cardRestMoneyModify * 1;
|
|
|
|
|
}
|
|
|
|
|
if (list[2].cardGiftMoneyNew != undefined) {
|
|
|
|
|
if (list[2].cardGiftMoneyNew) {
|
|
|
|
|
list[2].cardGiftMoneyNew =
|
|
|
|
|
list[0].cardGiftMoney + list[1].cardGiftMoneyModify * 1;
|
|
|
|
|
}
|
|
|
|
|
if (list[2].cardConsumeMoneyNew != undefined) {
|
|
|
|
|
list[2].cardConsumeMoneyNew =
|
|
|
|
|
list[0].cardConsumeMoney + list[1].cardConsumeMoneyModify * 1;
|
|
|
|
|
if (list[2].cardConsumeMoneyNew) {
|
|
|
|
|
list[2].cardConsumeMoneyNew = list[0].cardConsumeMoney + list[1].cardConsumeMoneyModify * 1;
|
|
|
|
|
if (list[2].cardConsumeMoneyNew > list[2].cardRestMoneyNew) {
|
|
|
|
|
this.$alert("可用金额不能大于剩余金额", "提示", {
|
|
|
|
|
confirmButtonText: "确定",
|
|
|
|
|
@ -340,9 +482,11 @@ export default {
|
|
|
|
|
center: true,
|
|
|
|
|
callback: (action) => {},
|
|
|
|
|
});
|
|
|
|
|
this.accountList[1].cardConsumeMoneyModify = 0
|
|
|
|
|
this.changeInput(row)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (list[2].giftConsumeMoneyNew != undefined) {
|
|
|
|
|
if (list[2].giftConsumeMoneyNew) {
|
|
|
|
|
list[2].giftConsumeMoneyNew =
|
|
|
|
|
list[0].giftConsumeMoney + list[1].giftConsumeMoneyModify * 1;
|
|
|
|
|
if (list[2].giftConsumeMoneyNew > list[2].cardGiftMoneyNew) {
|
|
|
|
|
@ -353,13 +497,10 @@ export default {
|
|
|
|
|
center: true,
|
|
|
|
|
callback: (action) => {},
|
|
|
|
|
});
|
|
|
|
|
this.accountList[1].giftConsumeMoneyModify = 0
|
|
|
|
|
this.changeInput(row)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
console.log(list);
|
|
|
|
|
list.forEach((item) => {
|
|
|
|
|
console.log(item);
|
|
|
|
|
});
|
|
|
|
|
this.accountList = [...list];
|
|
|
|
|
},
|
|
|
|
|
//确定返回方法
|
|
|
|
|
|