jh-admin/app/shop/view/account/withdraw.html

324 lines
11 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{extend name="app/shop/view/base.html"/}
{block name="resources"}
<link rel="stylesheet" href="__STATIC__/element-ui/index.css">
<script src="STATIC_JS/vue.js"></script>
<script src="__STATIC__/element-ui/index.js"></script>
<style>
.pagination{
text-align: right!important;
padding-top: 20px!important;
}
.cell{
padding: 0!important;
}
.user-content{
width: 100%;
display: inline-flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: center;
align-items: center;
}
.user-content .user-avatar{
height: 65px;
width: 65px;
display: inline-flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: center;
align-items: center;
}
.user-content .user-avatar img{
height: 80%!important;
width: 80%!important;
border-radius: 50% !important;
}
.user-content .user-info{
width: calc(100% - 70px) !important;
display: inline-flex;
flex-direction: column;
flex-wrap: nowrap;
justify-content: center;
align-items: flex-start;
}
.user-content .user-info .nickname{
font-size: 15px;
font-weight: bold;
height: 30px;
line-height: 30px;
width: 100%;
text-align: left;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.user-content .user-info .user-id{
font-size: 13px;
height: 25px;
line-height: 25px;
width: 100%;
text-align: left;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.rate-num{
margin-top: 5px!important;
}
.selWidth {
width: 350px !important;
margin-bottom: 5px;
}
</style>
{/block}
{block name="main"}
<div id="vueContent">
<el-card class="box-card">
<!--顶部搜索栏-->
<div slot="header" class="clearfix">
<div class="container">
<el-form inline size="small" label-width="80px">
<el-form-item label="搜索">
<el-input v-model="tableFrom.member_id" placeholder="请输入用户ID" class="selWidth" clearable>
<el-button slot="append" icon="el-icon-search" class="el-button-solt" @click="getList(1)"></el-button>
</el-input>
</el-form-item>
</el-form>
</div>
</div>
<!--表格信息-->
<el-table v-loading="listLoading" :data="tableData.data" style="width: 100%">
<el-table-column label="ID" prop="id" min-width="80" align="center"></el-table-column>
<el-table-column label="申请用户" min-width="200" align="left" v-if="!is_admin">
<template slot-scope="scope">
<div class="user-content">
<div class="user-avatar">
<img :src="scope.row.headimg || '/public/static/img/default_img/head.png'" />
</div>
<div class="user-info">
<div class="nickname">{{ scope.row.nickname || scope.row.username }}</div>
<div class="user-id">UID{{ scope.row.member_id }}</div>
</div>
</div>
</template>
</el-table-column>
<el-table-column label="申请店铺" min-width="200" align="left" v-if="is_admin">
<template slot-scope="scope">
<div class="user-content">
<div class="user-avatar">
<img :src="scope.row.site_logo || '/public/static/img/default_img/head.png'" />
</div>
<div class="user-info">
<div class="nickname">{{ scope.row.site_name || scope.row.site_username }}</div>
<div class="user-id">ID{{ scope.row.site_id }}</div>
</div>
</div>
</template>
</el-table-column>
<el-table-column label="收款账户" min-width="150" align="center">
<template slot-scope="scope">
<!--账户类型card=银行卡,wechat=微信零钱,alipay=支付宝,balance=余额,threeStaff=第三方打款(灵活用工)-->
<template v-if="scope.row.account_type === 'card'">
银行卡<br />
{{ scope.row.card_num }}
</template>
<template v-else-if="scope.row.account_type === 'wechat'">微信零钱</template>
<template v-else-if="scope.row.account_type === 'alipay'">
支付宝<br />
{{ scope.row.alipay_account }}
</template>
<template v-else-if="scope.row.account_type === 'balance'">余额</template>
<template v-else-if="scope.row.account_type === 'threeStaff'">第三方(灵活用工)</template>
</template>
</el-table-column>
<el-table-column label="收益类型" min-width="100" align="center">
<template slot-scope="scope">
<span v-if="scope.row.income_type === 'commission'">收入提现</span>
<span v-if="scope.row.income_type === 'shop_legumes_integral'">店铺积分收益提现</span>
</template>
</el-table-column>
<el-table-column label="提现金额" prop="apply_money" min-width="80" align="center"></el-table-column>
<el-table-column label="手续费比例(%)" prop="handling_fees_rate" min-width="100" align="center"></el-table-column>
<el-table-column label="手续费金额" prop="handling_fees_money" min-width="80" align="center"></el-table-column>
<el-table-column label="实际到账" prop="money" min-width="80" align="center"></el-table-column>
<el-table-column label="状态" min-width="80" align="center">
<template slot-scope="scope">
<el-tag v-if="scope.row.status == 0" type="info" effect="dark">待审核</el-tag>
<el-tag v-else-if="scope.row.status == 1" effect="dark">待打款</el-tag>
<el-tag v-else-if="scope.row.status == 2" type="success" effect="dark">已打款</el-tag>
<el-tag v-else type="danger" effect="dark">已驳回</el-tag>
</template>
</el-table-column>
<el-table-column label="申请时间" prop="create_time" min-width="150" align="center"></el-table-column>
<el-table-column label="操作" min-width="150" align="center">
<template slot-scope="scope">
<!--状态0=待审核1=待打款2=已打款3=已驳回-->
<!--待审核操作按钮-->
<template v-if="scope.row.status == 0">
<el-button type="success" @click="auditing(scope.row.id, 'adopt')" size="small">通过</el-button>
<el-button type="danger" @click="auditing(scope.row.id, 'reject')" size="small">驳回</el-button>
</template>
<!--已通过操作按钮-->
<template v-if="scope.row.status == 1">
<template v-if="['wechat','threeStaff','balance'].includes(String(scope.row.account_type))">
<el-button type="success" @click="payment(scope.row.id, 'auto')" size="small">自动打款</el-button>
</template>
<el-button @click="payment(scope.row.id, 'manual')" size="small">线下打款</el-button>
</template>
</template>
</el-table-column>
</el-table>
<!--分页-->
<div class="pagination">
<el-pagination :current-page="tableFrom.page" hide-on-single-page :total="tableData.total" @current-change="pageChange"></el-pagination>
</div>
</el-card>
</div>
{/block}
{block name="script"}
<script>
new Vue({
el:'#vueContent',
data(){
return {
is_admin: "{$is_admin}",
listLoading: true,
tableData: {
data: [],
total: 0,
},
tableFrom: {
page: 1,
member_id: '',
},
};
},
mounted(){
this.getList('');
},
methods: {
// 获取列表
getList(num) {
let _this = this;
_this.listLoading = true;
_this.tableFrom.page = num ? num : this.tableFrom.page;
$.ajax({
url: ns.url("shop/account/withdraw"),
data: _this.tableFrom,
dataType: 'JSON',
type: 'POST',
success: function(res) {
if(Number(res.code) === 0){
let data = res.data || {};
_this.tableData.data = data.list || {};
_this.tableData.total = data.count || 0;
_this.listLoading = false;
}
}
});
},
pageChange(page) {
this.tableFrom.page = page;
this.getList('');
},
// 审核 - 询问
auditing(id, type){
let _this = this;
let tip = '确认通过审核?';
if(type === 'reject') tip = '确认驳回审核?';
let params = {
id: id,
type: type,
reason: '',
};
// 提示
this.$confirm(tip, '提示', {
confirmButtonText: type === 'reject' ? '驳回' : '通过',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
// 判断:是否是驳回操作;如果是驳回,需要输入驳回原因
if(type === 'reject'){
// 驳回
_this.$prompt('请输入驳回原因', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputErrorMessage: '请输入180字以内的驳回原因',
inputType: 'textarea',
inputPlaceholder: '请输入180字以内的驳回原因',
inputValidator: (value) => {
if (!value) {
return '请输入180字以内的驳回原因'
}
}
}).then(({value}) => {
params.reason = value || '';
_this.submitAuditing(params);
}).catch((error) => {
console.log("驳回原因输入错误", error)
})
}else{
// 通过
_this.submitAuditing(params);
}
}).catch((error) => {
console.log("审核请求失败", error)
});
},
// 审核 - 提交
submitAuditing(params){
let _this = this;
$.ajax({
url: ns.url("shop/account/auditing"),
data: params,
dataType: 'JSON',
type: 'POST',
success: function(res) {
if(Number(res.code) === 0){
_this.getList();
}
}
});
},
// 打款 - 询问
payment(id, type){
let _this = this;
let tip = '确认打款?';
if(type === 'manual') tip = '线下打款仅修改申请状态,不进行任何打款操作,是否为线下打款?';
let params = {
id: id,
type: type,
};
// 提示
this.$confirm(tip, '提示', {
confirmButtonText: type === 'manual' ? '手动打款' : '自动打款',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let _this = this;
$.ajax({
url: ns.url("shop/account/paymentOperation"),
data: params,
dataType: 'JSON',
type: 'POST',
success: function(res) {
if(Number(res.code) === 0){
_this.getList();
}
}
});
}).catch((error) => {
console.log("审核请求失败", error)
});
}
}
});
</script>
{/block}