Commit 827c3708 authored by 赵茹林's avatar 赵茹林

提现列表 修改 提现时间筛选框精确到时分秒

parent 0deb1bae
<template> <template>
<div class="putForward"> <div class="putForward">
<el-form :model="search" class="demo-form-inline" inline label-width="80px"> <el-form :model="search" class="demo-form-inline" inline label-width="80px">
<el-form-item label="提现单号"> <el-form-item label="提现单号">
<el-input v-model="search.withdraw_no" placeholder="提现单号"></el-input> <el-input v-model="search.withdraw_no" placeholder="提现单号"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="订单号"> <el-form-item label="订单号">
<el-input v-model="search.out_trade_no" placeholder="订单号"></el-input> <el-input v-model="search.out_trade_no" placeholder="订单号"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="用户ID"> <el-form-item label="用户ID">
<el-input v-model="search.user_id" placeholder="用户ID"></el-input> <el-input v-model="search.user_id" placeholder="用户ID"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="提现金额"> <el-form-item label="提现金额">
<el-input v-model="search.money" placeholder="提现金额"></el-input> <el-input v-model="search.money" placeholder="提现金额"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="提现时间"> <el-form-item label="提现时间">
<el-date-picker <el-date-picker
type="daterange" type="datetimerange"
v-model="search.payTime" v-model="search.payTime"
range-separator="至" range-separator="至"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd HH:mm:ss"
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期" end-placeholder="结束日期"
:default-time="['00:00:00','23:59:59']" :default-time="['00:00:00','23:59:59']"
:picker-options="{shortcuts:[today,yesterday,last7Day,last30Day]}" :picker-options="{shortcuts:[today,yesterday,last7Day,last30Day]}">
> </el-date-picker>
</el-date-picker> </el-form-item>
</el-form-item> <el-form-item label="" v-if="$store.state.import">
<el-form-item label="" v-if="$store.state.import"> <el-upload
<el-upload :show-file-list="false"
:show-file-list="false" :onSuccess="fileSuccess"
:onSuccess="fileSuccess" :headers="uploadHeader"
:headers="uploadHeader" :data="{param_token:param_token}"
:data="{param_token:param_token}" action="/api/admin/pay/users/import ">
action="/api/admin/pay/users/import " <el-button type="primary" plain>批量提现</el-button>
> </el-upload>
<el-button type="primary" plain>批量提现</el-button> </el-form-item>
</el-upload> <el-form-item label="">
</el-form-item> <el-button type="primary" @click="onSearch">查询</el-button>
<el-form-item label=""> <el-button type="primary" @click="exportTable" v-if="$store.state.export">导出</el-button>
<el-button type="primary" @click="onSearch">查询</el-button> <el-button type="primary" v-if="$store.state.import" @click="manualPutForward">手动提现</el-button>
<el-button type="primary" @click="exportTable" v-if="$store.state.export">导出</el-button> </el-form-item>
<el-button type="primary" v-if="$store.state.import" @click="manualPutForward">手动提现</el-button>
</el-form-item>
</el-form> </el-form>
<el-tabs v-model="search.status" type="card" style="background: white;padding-top: 10px" @tab-click="onSearch"> <el-tabs v-model="search.status" type="card" style="background: white;padding-top: 10px" @tab-click="onSearch">
<el-tab-pane label="提现成功" name="1"/> <el-tab-pane label="提现成功" name="1"/>
...@@ -246,56 +244,64 @@ ...@@ -246,56 +244,64 @@
</template> </template>
<script> <script>
import {getWithdrawListApi,editOrderDescApi,withdrawApi,exportExcelApi,getUserListApi,payToUserApi} from "../../service/api"; import {
getWithdrawListApi,
editOrderDescApi,
withdrawApi,
exportExcelApi,
getUserListApi,
payToUserApi
} from "../../service/api";
import Cookie from '../../util/cookie' import Cookie from '../../util/cookie'
import page from '../framework/page' import page from '../framework/page'
import CommonJs from '../../util/common'; import CommonJs from '../../util/common';
import md5 from 'js-md5'; import md5 from 'js-md5';
let singjson = { let singjson = {
sing: "singsingenglish21000" sing: "singsingenglish21000"
}; };
export default { export default {
name: "putForward", name: "putForward",
data(){ data() {
return { return {
today:{ today: {
text:'今天', text: '今天',
onClick:(vm)=>{ onClick: (vm) => {
vm.$emit('pick', [this.formatTime(new Date())+' 00:00:00',this.formatTime(new Date())+' 23:59:59']) vm.$emit('pick', [this.formatTime(new Date()) + ' 00:00:00', this.formatTime(new Date()) + ' 23:59:59'])
} }
}, },
yesterday:{ yesterday: {
text:'昨天', text: '昨天',
onClick:(vm)=>{ onClick: (vm) => {
let preDate = this.formatTime(new Date(new Date().getTime() - 24*60*60*1000)); let preDate = this.formatTime(new Date(new Date().getTime() - 24 * 60 * 60 * 1000));
vm.$emit('pick', [preDate+' 00:00:00',preDate+' 23:59:59']) vm.$emit('pick', [preDate + ' 00:00:00', preDate + ' 23:59:59'])
} }
}, },
last30Day:{ last30Day: {
text:'过去30天', text: '过去30天',
onClick:(vm)=>{ onClick: (vm) => {
let preDate = this.formatTime(new Date(new Date().getTime() - 30*24*60*60*1000)); let preDate = this.formatTime(new Date(new Date().getTime() - 30 * 24 * 60 * 60 * 1000));
vm.$emit('pick', [preDate+' 00:00:00',this.formatTime(new Date())+' 23:59:59']); vm.$emit('pick', [preDate + ' 00:00:00', this.formatTime(new Date()) + ' 23:59:59']);
} }
}, },
last7Day:{ last7Day: {
text:'过去7天', text: '过去7天',
onClick:(vm)=>{ onClick: (vm) => {
let preDate = this.formatTime(new Date(new Date().getTime() - 7*24*60*60*1000)); let preDate = this.formatTime(new Date(new Date().getTime() - 7 * 24 * 60 * 60 * 1000));
vm.$emit('pick', [preDate+' 00:00:00',this.formatTime(new Date())+' 23:59:59']); vm.$emit('pick', [preDate + ' 00:00:00', this.formatTime(new Date()) + ' 23:59:59']);
} }
}, },
uploadHeader:{token:Cookie.get('cc_token')}, uploadHeader: {token: Cookie.get('cc_token')},
param_token:CommonJs.md5Code(), param_token: CommonJs.md5Code(),
nowPage: 1, nowPage: 1,
total: 0, total: 0,
limit: 10, limit: 10,
search:{ search: {
key:'', key: '',
status:'1', status: '1',
payTime:[] payTime: []
}, },
liStatus:[ liStatus: [
{ {
label: '全部', label: '全部',
status: '' status: ''
...@@ -303,28 +309,28 @@ ...@@ -303,28 +309,28 @@
{ {
label: '申请中', label: '申请中',
status: 0 status: 0
},{ }, {
label: '提现成功', label: '提现成功',
status: 1 status: 1
},{ }, {
label: '提现失败', label: '提现失败',
status: 2 status: 2
} }
], ],
tableData:[], tableData: [],
showDialog:false, showDialog: false,
showDesc:false, showDesc: false,
dialogTitle:'审核', dialogTitle: '审核',
nowObj:{ nowObj: {
id:'', id: '',
status:1, status: 1,
reason:'', reason: '',
desc:"" desc: ""
}, },
page:{ page: {
current:1, current: 1,
pageSize:100, pageSize: 100,
total:0 total: 0
}, },
putForwardDialog: { putForwardDialog: {
show: false, show: false,
...@@ -334,19 +340,19 @@ ...@@ -334,19 +340,19 @@
desc: '' desc: ''
}, },
userList: [], userList: [],
rules:{ rules: {
userLabel:[ userLabel: [
{ required: true, message: '请选择用户', trigger: 'change' } {required: true, message: '请选择用户', trigger: 'change'}
], ],
money:[ money: [
{ required: true, message: '请输入提现金额', trigger: 'change' } {required: true, message: '请输入提现金额', trigger: 'change'}
], ],
desc:[ desc: [
{ required: true, message: '请输入提现说明', trigger: 'change' } {required: true, message: '请输入提现说明', trigger: 'change'}
] ]
}, },
searchFrom:{}, searchFrom: {},
selectUserList:[], selectUserList: [],
userDialog: { userDialog: {
show: false, show: false,
nowPage: 1, nowPage: 1,
...@@ -355,24 +361,24 @@ ...@@ -355,24 +361,24 @@
} }
} }
}, },
components:{ components: {
page page
}, },
filters:{ filters: {
moneyYuan:function (value) { moneyYuan: function (value) {
if(!value){ if (!value) {
return 0 + '元'; return 0 + '元';
} }
return value = (value/100).toFixed(2) + '元'; return value = (value / 100).toFixed(2) + '元';
}, },
filterStatus:function (value) { filterStatus: function (value) {
let msg = ''; let msg = '';
if(value.status === 0){ if (value.status === 0) {
msg = '审核中' msg = '审核中'
}else if(value.status === 1){ } else if (value.status === 1) {
msg = '提现成功' msg = '提现成功'
}else if(value.status === 2){ } else if (value.status === 2) {
msg = '提现失败'+'('+value.reason+")" msg = '提现失败' + '(' + value.reason + ")"
} }
return msg; return msg;
}, },
...@@ -380,114 +386,114 @@ ...@@ -380,114 +386,114 @@
return `${val.nickname}[${val.user_id}]` return `${val.nickname}[${val.user_id}]`
} }
}, },
mounted:function(){ mounted: function () {
this.getList() this.getList()
}, },
methods:{ methods: {
fileSuccess(){ fileSuccess() {
this.$message({ this.$message({
message: '提交成功,请稍后刷新', message: '提交成功,请稍后刷新',
type: 'success' type: 'success'
}); });
}, },
formatTime(date){ formatTime(date) {
let year = date.getFullYear(); let year = date.getFullYear();
let Month = date.getMonth()+1; let Month = date.getMonth() + 1;
if(Month < 10){ if (Month < 10) {
Month = `0${Month}` Month = `0${Month}`
} }
let Day = date.getDate(); let Day = date.getDate();
if(Day<10)Day = `0${Day}`; if (Day < 10) Day = `0${Day}`;
return `${year}-${Month}-${Day}`; return `${year}-${Month}-${Day}`;
}, },
onSizeChange(val){ onSizeChange(val) {
this.nowPage = 1; this.nowPage = 1;
this.limit = val; this.limit = val;
this.getList() this.getList()
}, },
exportTable(){ exportTable() {
let json = {}; let json = {};
if(this.search.withdraw_no){ if (this.search.withdraw_no) {
json.withdraw_no = this.search.withdraw_no json.withdraw_no = this.search.withdraw_no
} }
if(this.search.out_trade_no){ if (this.search.out_trade_no) {
json.out_trade_no = this.search.out_trade_no json.out_trade_no = this.search.out_trade_no
} }
if(this.search.status || this.search.status === 0){ if (this.search.status || this.search.status === 0) {
json.status = this.search.status json.status = this.search.status
} }
if(this.search.user_id){ if (this.search.user_id) {
json.user_id = this.search.user_id json.user_id = this.search.user_id
} }
if(this.search.money){ if (this.search.money) {
json.money = parseFloat(this.search.money) * 100 json.money = parseFloat(this.search.money) * 100
} }
exportExcelApi('/api/admin/withdraw/export',json,'提现列表') exportExcelApi('/api/admin/withdraw/export', json, '提现列表')
}, },
//获取列表 //获取列表
getList:function () { getList: function () {
let json = { let json = {
limit: this.limit, limit: this.limit,
page: this.nowPage page: this.nowPage
}; };
if(this.search.withdraw_no){ if (this.search.withdraw_no) {
json.withdraw_no = this.search.withdraw_no json.withdraw_no = this.search.withdraw_no
} }
if(this.search.out_trade_no){ if (this.search.out_trade_no) {
json.out_trade_no = this.search.out_trade_no json.out_trade_no = this.search.out_trade_no
} }
if(this.search.status && this.search.status !== '-1'){ if (this.search.status && this.search.status !== '-1') {
json.status = this.search.status json.status = this.search.status
} }
if(this.search.user_id){ if (this.search.user_id) {
json.user_id = this.search.user_id json.user_id = this.search.user_id
} }
if (this.search.payTime && this.search.payTime.length > 0) { if (this.search.payTime && this.search.payTime.length > 0) {
json.success_start_at = this.search.payTime[0] json.success_start_at = this.search.payTime[0]
json.success_end_at = this.search.payTime[1] json.success_end_at = this.search.payTime[1]
} }
// if(this.search.success_start_at){ // if(this.search.success_start_at){
// json.success_start_at = this.search.success_start_at // json.success_start_at = this.search.success_start_at
// } // }
// if(this.search.success_end_at){ // if(this.search.success_end_at){
// json.success_end_at = this.search.success_end_at // json.success_end_at = this.search.success_end_at
// } // }
if(this.search.money){ if (this.search.money) {
json.money = parseFloat(this.search.money) * 100 json.money = parseFloat(this.search.money) * 100
} }
getWithdrawListApi(json).then(res=>{ getWithdrawListApi(json).then(res => {
this.tableData = res.list; this.tableData = res.list;
this.total = res.total; this.total = res.total;
}) })
}, },
// 查询按钮 // 查询按钮
onSearch(){ onSearch() {
this.nowPage = 1; this.nowPage = 1;
//调用查询接口 //调用查询接口
this.getList(); this.getList();
}, },
//点击审核 //点击审核
checkMoney(id){ checkMoney(id) {
this.nowObj.id = id; this.nowObj.id = id;
this.showDesc = false; this.showDesc = false;
this.showDialog=true; this.showDialog = true;
}, },
//点击备注 //点击备注
addDesc(id,desc){ addDesc(id, desc) {
this.nowObj.id = id; this.nowObj.id = id;
this.nowObj.desc = desc; this.nowObj.desc = desc;
this.showDesc = true; this.showDesc = true;
this.showDialog=true; this.showDialog = true;
}, },
//分页切换 //分页切换
onPageChange(current){ onPageChange(current) {
this.nowPage = current; this.nowPage = current;
this.page.current=current; this.page.current = current;
this.getList(); this.getList();
}, },
// 弹框请求回调 // 弹框请求回调
doCallback:function(){ doCallback: function () {
this.nowObj.id = ''; this.nowObj.id = '';
this.nowObj.status = 1; this.nowObj.status = 1;
this.nowObj.reason = ''; this.nowObj.reason = '';
...@@ -501,32 +507,32 @@ ...@@ -501,32 +507,32 @@
}); });
}, },
// 弹框保存按钮 // 弹框保存按钮
onSave:function ( desc ) { onSave: function (desc) {
// 添加备注 // 添加备注
if(desc){ if (desc) {
let data = { let data = {
desc:this.nowObj.desc, desc: this.nowObj.desc,
}; };
if(data.desc === '' || data.desc == null){ if (data.desc === '' || data.desc == null) {
this.$message.error( '请填写备注' ); this.$message.error('请填写备注');
return false return false
} }
editOrderDescApi(this.nowObj.id,'withdraw',data).then(res=>{ editOrderDescApi(this.nowObj.id, 'withdraw', data).then(res => {
this.doCallback() this.doCallback()
}); });
// 审核 // 审核
}else{ } else {
let data = { let data = {
reason:this.nowObj.reason, reason: this.nowObj.reason,
status:this.nowObj.status, status: this.nowObj.status,
}; };
if((data.reason === '' || data.reason == null) && data.status === 2){ if ((data.reason === '' || data.reason == null) && data.status === 2) {
this.$message.error( '请填写失败理由' ); this.$message.error('请填写失败理由');
return false return false
}else { } else {
data.reason = ''; data.reason = '';
} }
withdrawApi(this.nowObj.id, data ).then(res=>{ withdrawApi(this.nowObj.id, data).then(res => {
this.doCallback() this.doCallback()
}) })
} }
...@@ -539,7 +545,7 @@ ...@@ -539,7 +545,7 @@
this.putForwardDialog.desc = ''; this.putForwardDialog.desc = '';
this.getUserList(); this.getUserList();
}, },
getUserList(){ getUserList() {
let json = { let json = {
limit: this.userDialog.limit, limit: this.userDialog.limit,
page: this.userDialog.nowPage page: this.userDialog.nowPage
...@@ -553,12 +559,12 @@ ...@@ -553,12 +559,12 @@
if (this.searchFrom.mobile) { if (this.searchFrom.mobile) {
json.mobile = this.searchFrom.mobile json.mobile = this.searchFrom.mobile
} }
getUserListApi(json).then(res=>{ getUserListApi(json).then(res => {
this.userList = res.list; this.userList = res.list;
this.userDialog.total = res.total; this.userDialog.total = res.total;
}) })
}, },
confirmPutForward(){ confirmPutForward() {
let json = { let json = {
user_id: this.putForwardDialog.user_id, user_id: this.putForwardDialog.user_id,
money: this.putForwardDialog.money, money: this.putForwardDialog.money,
...@@ -570,8 +576,8 @@ ...@@ -570,8 +576,8 @@
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(()=>{ }).then(() => {
payToUserApi(json).then(res=>{ payToUserApi(json).then(res => {
this.$message({ this.$message({
type: 'success', type: 'success',
message: '保存成功' message: '保存成功'
...@@ -585,26 +591,26 @@ ...@@ -585,26 +591,26 @@
} }
}); });
}, },
handleSelectionChange(a){ handleSelectionChange(a) {
this.selectUserList = a this.selectUserList = a
}, },
onUserPageChange(val){ onUserPageChange(val) {
this.userDialog.nowPage = val this.userDialog.nowPage = val
this.getUserList() this.getUserList()
}, },
onUserSizeChange(val){ onUserSizeChange(val) {
this.userDialog.limit = val this.userDialog.limit = val
this.userDialog.nowPage = 1; this.userDialog.nowPage = 1;
this.getUserList() this.getUserList()
}, },
onAdd(){ onAdd() {
if(this.selectUserList.length === 0) { if (this.selectUserList.length === 0) {
this.$message({ this.$message({
type: 'error', type: 'error',
message: '请选择用户!' message: '请选择用户!'
}); });
return return
} else if (this.selectUserList.length !== 1){ } else if (this.selectUserList.length !== 1) {
this.$message({ this.$message({
type: 'error', type: 'error',
message: '只能选择一个用户!' message: '只能选择一个用户!'
...@@ -623,16 +629,20 @@ ...@@ -623,16 +629,20 @@
.putForward { .putForward {
padding: 20px 0; padding: 20px 0;
} }
.status{
.status {
color: #e9a038; color: #e9a038;
} }
.status.red{
.status.red {
color: #c30005; color: #c30005;
} }
.status.green{
.status.green {
color: #00ac00; color: #00ac00;
} }
.avatar{
.avatar {
width: 50px; width: 50px;
margin-right: 5px; margin-right: 5px;
border-radius: 50%; border-radius: 50%;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment