|
@@ -4,24 +4,24 @@
|
|
|
<div class="left">
|
|
|
<div class="headItem">
|
|
|
<p>账户余额:<span>{{ dataInfo.balance }}</span></p>
|
|
|
- <el-button type="text" v-permission="'userCashAccount/transferCourseBalanceToBalance'" @click="rechargeVisible=true">充值</el-button>
|
|
|
+ <el-button type="text" v-permission="'userCashAccount/transferCourseBalanceToBalance'" @click="onMoneyOperation('recharge')">充值</el-button>
|
|
|
</div>
|
|
|
<div class="headItem">
|
|
|
- <p v-if="amountStatus">课程余额:<span>{{ dataInfo.courseBalance }}</span></p>
|
|
|
- <p v-else>课程余额:<span>
|
|
|
+ <!-- v-if="amountStatus" -->
|
|
|
+ <p>课程余额:<span>{{ dataInfo.courseBalance }}</span></p>
|
|
|
+ <!-- <p v-else>课程余额:<span>
|
|
|
<el-input style="width: 130px;"
|
|
|
v-model.trim="dataInfo.courseBalance"
|
|
|
placeholder="课程余额"></el-input>
|
|
|
- </span></p>
|
|
|
+ </span></p> -->
|
|
|
|
|
|
- <el-button v-if="amountStatus"
|
|
|
- v-permission="'userCashAccount/updateCourseBalance'"
|
|
|
- @click="amountStatus = false"
|
|
|
+ <el-button v-permission="'userCashAccount/updateCourseBalance'"
|
|
|
+ @click="onMoneyOperation('account')"
|
|
|
type="text">修改</el-button>
|
|
|
- <el-button style="top:0;"
|
|
|
+ <!-- <el-button style="top:0;"
|
|
|
@click="onUpdateCourse"
|
|
|
v-else
|
|
|
- type="text">保存</el-button>
|
|
|
+ type="text">保存</el-button> -->
|
|
|
</div>
|
|
|
<div class="headItem">
|
|
|
<p>银行卡:<span>{{ dataInfo.cardNo }}</span></p>
|
|
@@ -128,12 +128,31 @@
|
|
|
:page-sizes="pageInfo.page_size"
|
|
|
@pagination="getList" />
|
|
|
</div>
|
|
|
+ <el-dialog :title="moneyForm.title" width="450px" @close="onFormClose('moneyForm')" :visible.sync="moneyVisible">
|
|
|
+ <el-form ref="moneyForm" :rules="moneyRule" :model="moneyForm" label-width="80px">
|
|
|
+ <el-form-item label="操作选择" prop="type">
|
|
|
+ <el-radio-group v-model="moneyForm.type">
|
|
|
+ <el-radio :label="1">充值</el-radio>
|
|
|
+ <el-radio :label="2">扣除</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="金额" prop="money">
|
|
|
+ <el-input type="number" @mousewheel.native.prevent v-model.trim="moneyForm.money"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="备注" prop="remark">
|
|
|
+ <el-input type="textarea" v-model="moneyForm.remark"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="moneyVisible = false">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="submitMoney('moneyForm')">确 定</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
<!-- 充值弹窗 -->
|
|
|
- <el-dialog
|
|
|
+ <!-- <el-dialog
|
|
|
title="课程余额转账户余额"
|
|
|
width="400px"
|
|
|
- :visible.sync="rechargeVisible"
|
|
|
- >
|
|
|
+ :visible.sync="rechargeVisible">
|
|
|
<el-form
|
|
|
:model="rechargeForm"
|
|
|
ref="rechargeForm"
|
|
@@ -152,14 +171,25 @@
|
|
|
<el-button @click="rechargeVisible = false">取 消</el-button>
|
|
|
<el-button type="primary" @click="submitRecharge">确 定</el-button>
|
|
|
</div>
|
|
|
- </el-dialog>
|
|
|
+ </el-dialog> -->
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
import pagination from '@/components/Pagination/index'
|
|
|
-import { studentPaymentOrderList, getUserCashAccountBaseInfo, updateCourseBalance,transferCourseBalanceToBalance } from '@/api/studentManager'
|
|
|
+import { studentPaymentOrderList, getUserCashAccountBaseInfo, updateCourseBalance,transferCourseBalanceToBalance, cashAccountDetail, updateBalance } from '@/api/studentManager'
|
|
|
import { orderStatus } from '@/utils/searchArray'
|
|
|
import store from '@/store'
|
|
|
+let validPrice = (rule, value, callback) => {
|
|
|
+ if (value == '' && typeof value == 'string' || value == null) {
|
|
|
+ callback(new Error('请输入金额'))
|
|
|
+ } else if (value < 0) {
|
|
|
+ callback(new Error('输入金额必须大于或等于0'))
|
|
|
+ } else if (value >= 100000) {
|
|
|
+ callback(new Error('输入金额必须小于100000'))
|
|
|
+ } else {
|
|
|
+ callback()
|
|
|
+ }
|
|
|
+}
|
|
|
export default {
|
|
|
name: 'studentOrder',
|
|
|
components: { pagination },
|
|
@@ -188,6 +218,19 @@ export default {
|
|
|
amountStatus: true, // 账户余额状态
|
|
|
rechargeForm:{
|
|
|
money:null
|
|
|
+ },
|
|
|
+ moneyVisible: false, //
|
|
|
+ moneyForm: {
|
|
|
+ title: '账户余额修改',
|
|
|
+ titleType: 'recharge',
|
|
|
+ type: 1, //
|
|
|
+ money: null,
|
|
|
+ remark: null, //备注
|
|
|
+ },
|
|
|
+ moneyRule: {
|
|
|
+ type: [{ required: true, message: '请选择操作类型', trigger: 'change' }],
|
|
|
+ money: [{ required: true, validator: validPrice, trigger: 'blur' }],
|
|
|
+ remark: [{ required: true, message: '请输入备注', trigger: 'blur' }],
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -220,6 +263,29 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ onFormClose (formName) { // 关闭弹窗重置验证
|
|
|
+ this.$refs[formName].resetFields()
|
|
|
+ },
|
|
|
+ onMoneyOperation(type) {
|
|
|
+ let moneyForm = this.moneyForm
|
|
|
+ if(type == 'recharge') {
|
|
|
+ moneyForm.title = '账户余额修改'
|
|
|
+ moneyForm.titleType = 'recharge'
|
|
|
+ } else if(type == 'account') {
|
|
|
+ moneyForm.title = '课程余额修改'
|
|
|
+ moneyForm.titleType = 'account'
|
|
|
+ }
|
|
|
+ this.moneyVisible = true
|
|
|
+ },
|
|
|
+ submitMoney(formName) {
|
|
|
+ this.$refs[formName].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+
|
|
|
+ } else {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
onUpdateCourse () {
|
|
|
if (!this.dataInfo.courseBalance) {
|
|
|
this.$message.error('请输入课程余额')
|