|
@@ -4,7 +4,7 @@
|
|
|
<div class="left">
|
|
|
<div class="headItem">
|
|
|
<p>账户余额:<span>{{ dataInfo.balance }}</span></p>
|
|
|
- <el-button type="text">充值</el-button>
|
|
|
+ <el-button type="text" @click="rechargeVisible=true">充值</el-button>
|
|
|
</div>
|
|
|
<div class="headItem">
|
|
|
<p v-if="amountStatus">课程余额:<span>{{ dataInfo.courseBalance }}</span></p>
|
|
@@ -125,11 +125,36 @@
|
|
|
:page-sizes="pageInfo.page_size"
|
|
|
@pagination="getList" />
|
|
|
</div>
|
|
|
+ <!-- 充值弹窗 -->
|
|
|
+ <el-dialog
|
|
|
+ title="课程余额转账户余额"
|
|
|
+ width="400px"
|
|
|
+ :visible.sync="rechargeVisible"
|
|
|
+ >
|
|
|
+ <el-form
|
|
|
+ :model="rechargeForm"
|
|
|
+ ref="rechargeForm"
|
|
|
+ label-position="right"
|
|
|
+ label-width="80px;"
|
|
|
+ :inline="true"
|
|
|
+ >
|
|
|
+ <el-form-item label="课程余额" >
|
|
|
+ ¥{{ dataInfo.courseBalance}}
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="本次充值" prop="money">
|
|
|
+ <el-input type="number" @mousewheel.native.prevent v-model.trim="rechargeForm.money"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="rechargeVisible = false">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="submitRecharge">确 定</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
import pagination from '@/components/Pagination/index'
|
|
|
-import { studentPaymentOrderList, getUserCashAccountBaseInfo, updateCourseBalance } from '@/api/studentManager'
|
|
|
+import { studentPaymentOrderList, getUserCashAccountBaseInfo, updateCourseBalance,transferCourseBalanceToBalance } from '@/api/studentManager'
|
|
|
import { orderStatus } from '@/utils/searchArray'
|
|
|
import store from '@/store'
|
|
|
export default {
|
|
@@ -137,6 +162,7 @@ export default {
|
|
|
components: { pagination },
|
|
|
data () {
|
|
|
return {
|
|
|
+ rechargeVisible:false,
|
|
|
organId: null,
|
|
|
orderDate: null,
|
|
|
searchForm: {
|
|
@@ -157,6 +183,9 @@ export default {
|
|
|
tableList: [],
|
|
|
dataInfo: {},
|
|
|
amountStatus: true, // 账户余额状态
|
|
|
+ rechargeForm:{
|
|
|
+ money:null
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
mounted () {
|
|
@@ -253,6 +282,24 @@ export default {
|
|
|
remark: null
|
|
|
}
|
|
|
},
|
|
|
+ submitRecharge(){
|
|
|
+ let money = parseFloat(this.dataInfo.courseBalance-this.rechargeForm.money).toFixed(2);
|
|
|
+ if(money<0){
|
|
|
+ this.$message.error('余额不足')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if(!this.rechargeForm.money){
|
|
|
+ this.$message.error('请输入金额')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ transferCourseBalanceToBalance({userId:this.searchForm.studentId,money:this.rechargeForm.money}).then(res=>{
|
|
|
+ if(res.code == 200){
|
|
|
+ this.$message.success('充值成功')
|
|
|
+ this.rechargeVisible = false;
|
|
|
+ this.__init();
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</script>
|