213 行
8.7 KiB
HTML
可执行文件
213 行
8.7 KiB
HTML
可执行文件
<!--[1.7.90]-->
|
|
<div id="cashManagerApp" v-cloak>
|
|
<div class="table-top-card-box">
|
|
<div class="table-top-card">
|
|
<div class="table-top-card-header">余额</div>
|
|
<div class="table-top-card-body primary">{{balance}}</div>
|
|
</div>
|
|
<div class="table-top-card">
|
|
<div class="table-top-card-header">待审核金额</div>
|
|
<div class="table-top-card-body success">{{loadMoney}}</div>
|
|
</div>
|
|
<div class="table-top-card">
|
|
<div class="table-top-card-header">已审核金额</div>
|
|
<div class="table-top-card-body danger">{{settledMoney}}</div>
|
|
</div>
|
|
</div>
|
|
|
|
<el-form size="small" :inline="true">
|
|
<el-form-item v-if="operate.toCash">
|
|
<el-button @click="showCashBox=true" type="primary">提现</el-button>
|
|
</el-form-item>
|
|
<br>
|
|
<el-form-item>
|
|
<el-date-picker
|
|
@change="handleCurrentChange(1)"
|
|
v-model="selectDate"
|
|
type="daterange"
|
|
range-separator="至"
|
|
start-placeholder="开始日期"
|
|
end-placeholder="结束日期"
|
|
value-format="yyyy-MM-dd"
|
|
:picker-options="pickerOptions">
|
|
</el-date-picker>
|
|
</el-form-item>
|
|
<el-form-item>
|
|
<el-radio-group v-model="selectType" size="mini" @change="handleCurrentChange(1)">
|
|
<el-radio-button :label="1">待审核</el-radio-button>
|
|
<el-radio-button :label="2">已通过</el-radio-button>
|
|
<el-radio-button :label="3">已驳回</el-radio-button>
|
|
</el-radio-group>
|
|
</el-form-item>
|
|
</el-form>
|
|
<div>
|
|
<el-table border :data="orderList" style="width: 100%;" size="small"
|
|
:header-cell-style="{background:'#F5F7FA',color:'#606266'}">
|
|
<el-table-column align="center" type="index" label="序号" width="60"></el-table-column>
|
|
<el-table-column align="center" prop="withdrawal_amount" label="提现金额"
|
|
show-overflow-tooltip></el-table-column>
|
|
<el-table-column align="center" prop="add_time" label="提交时间" show-overflow-tooltip></el-table-column>
|
|
<el-table-column align="center" prop="state" label="状态" show-overflow-tooltip>
|
|
<template slot-scope="scope">
|
|
<span v-if="scope.row.state==1" class="wait">待审核</span>
|
|
<span v-else-if="scope.row.state==2" class="pass">已通过</span>
|
|
<span v-else-if="scope.row.state==3" class="reject">已驳回</span>
|
|
</template>
|
|
</el-table-column>
|
|
<template v-if="selectType==2||selectType==3">
|
|
<el-table-column align="center" prop="settled_time" label="审核时间" show-overflow-tooltip>
|
|
<template slot-scope="scope">
|
|
<span v-text="scope.row.settled_time"></span>
|
|
</template>
|
|
</el-table-column>
|
|
</template>
|
|
<template v-if="selectType==3">
|
|
<el-table-column align="center" prop="reason" label="原因" show-overflow-tooltip>
|
|
<template slot-scope="scope">
|
|
<span v-text="scope.row.reason"></span>
|
|
</template>
|
|
</el-table-column>
|
|
</template>
|
|
</el-table>
|
|
<el-pagination
|
|
@size-change="handleSizeChange"
|
|
@current-change="handleCurrentChange"
|
|
:current-page="currentPage"
|
|
:page-sizes="[10, 15, 20, 25, 30, 35, 40, 45, 50]"
|
|
:page-size="100"
|
|
layout="total, sizes, prev, pager, next, jumper"
|
|
:total="len">
|
|
</el-pagination>
|
|
</div>
|
|
<el-dialog title="提现" :append-to-body="true" :visible.sync="showCashBox" :width="'500px'">
|
|
<div class="cash-big-box">
|
|
<div class="flex">
|
|
<span class="flex-span">提现金额</span>
|
|
<input class="el-input__inner" v-model="cashMoney" type="text" :placeholder="'可提现金额:'+balance"/>
|
|
</div>
|
|
</div>
|
|
<span slot="footer" class="dialog-footer">
|
|
<el-button @click="showCashBox = false" size="mini">取 消</el-button>
|
|
<el-button type="primary" @click="toCash" size="mini">确 定</el-button>
|
|
</span>
|
|
</el-dialog>
|
|
</div>
|
|
<script type="text/javascript">
|
|
var cashManagerApp = new Vue({
|
|
el: '#cashManagerApp',
|
|
data() {
|
|
return {
|
|
operate: {},
|
|
cashMoney: '',
|
|
showCashBox: false,
|
|
balance: 0,
|
|
loadMoney: 0,
|
|
settledMoney: 0,
|
|
orderList: [],
|
|
len: 0,
|
|
currentPage: 1,
|
|
currentLimit: 10,
|
|
selectType: 1,
|
|
selectDate: '',
|
|
pickerOptions: {
|
|
disabledDate(time) {
|
|
return time.getTime() > Date.now();
|
|
}
|
|
}
|
|
}
|
|
},
|
|
methods: {
|
|
toCash() {
|
|
this.$confirm('确定提现' + this.cashMoney + '元?', '提示', {
|
|
confirmButtonText: '确定',
|
|
cancelButtonText: '取消',
|
|
type: 'info'
|
|
}).then(() => {
|
|
this.sendRequest('Agent/Continentflow/toCash', {
|
|
data: {
|
|
money: this.cashMoney
|
|
},
|
|
success: (res) => {
|
|
if (res.status == 1) {
|
|
this.$message.success(res.message);
|
|
this.balance = res.balance;
|
|
this.cashMoney = '';
|
|
this.showCashBox = false;
|
|
this.getData();
|
|
} else {
|
|
this.$message.warning(res.message);
|
|
}
|
|
}
|
|
})
|
|
});
|
|
},
|
|
handleSizeChange(val) {
|
|
this.currentLimit = val;//切换每页数量
|
|
this.handleCurrentChange(1);
|
|
},
|
|
handleCurrentChange(val) {
|
|
this.currentPage = val;
|
|
this.getData();//切换页数
|
|
},
|
|
getData() {
|
|
this.sendRequest('Agent/Continentflow/getCashOrder', {
|
|
data: {
|
|
page: this.currentPage,
|
|
limit: this.currentLimit,
|
|
agent_id: this.selectAgent,
|
|
selectType: this.selectType,
|
|
selectDate: this.selectDate
|
|
},
|
|
success: (res) => {
|
|
if (res.status == 1) {
|
|
this.orderList = [];
|
|
this.orderList = res.data;
|
|
this.len = res.count;
|
|
this.balance = res.balance;
|
|
this.loadMoney = res.loadMoney;
|
|
this.settledMoney = res.settledMoney;
|
|
this.currentPage = res.page;
|
|
|
|
} else {
|
|
this.$confirm(res.msg, '提示', {
|
|
confirmButtonText: '确定',
|
|
type: 'warning'
|
|
});
|
|
}
|
|
}
|
|
},)
|
|
}
|
|
},
|
|
created() {
|
|
this.getData();
|
|
this.checkOperateAuth({
|
|
toCash: '/index.php/Agent/Continentflow/toCash',
|
|
}, (data) => {
|
|
this.operate = data;
|
|
})
|
|
},
|
|
watch: {
|
|
cashMoney(n, o) {
|
|
var reg = /[0-9]*[.]{0,1}/;
|
|
if (!reg.test(n)) {
|
|
this.cashMoney = o;
|
|
} else {
|
|
var count = 0;
|
|
for (var i in n) {
|
|
if (n[i] == '.') {
|
|
count++;
|
|
}
|
|
}
|
|
if (count > 1) {
|
|
this.cashMoney = o;
|
|
} else if (n.indexOf('.') > -1 && n.indexOf('.') < n.length - 3) {
|
|
this.cashMoney = o;
|
|
} else if (this.balance < n) {
|
|
this.cashMoney = o;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
})
|
|
</script>
|