Commit 99078f07 authored by 王's avatar

提现列表

parent 028d86f2
...@@ -88,41 +88,50 @@ ...@@ -88,41 +88,50 @@
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="操作" label="操作"
min-width="250" min-width="80"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-popover
v-if="scope.row.is_pay == 1" placement="top"
@click="onRefund(scope.row.pay_id, scope.row.money)" width="280">
type="warning" <div style="text-align: center">
plain <el-button
size="mini"> v-if="scope.row.is_pay == 1"
退款 @click="onRefund(scope.row.pay_id, scope.row.money)"
</el-button> type="warning"
<el-button plain
@click="editComment(scope.row.pay_id, scope.row.desc)" size="mini">
type="warning" 退款
plain </el-button>
size="mini"> <el-button
编辑备注 @click="editComment(scope.row.pay_id, scope.row.desc)"
</el-button> type="warning"
<el-button plain
@click="editAddress(scope.row)" size="mini">
plain 编辑备注
type="warning" </el-button>
size="mini"> <el-button
编辑收货地址 @click="editAddress(scope.row)"
</el-button> plain
type="warning"
size="mini">
编辑收货地址
</el-button>
</div>
<el-button slot="reference" size="mini" type="text" >操作</el-button>
</el-popover>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<address-dialog v-if="dialogObj.show" :dialogObj="dialogObj" @reflash="onUpdateAddress"></address-dialog> <address-dialog v-if="dialogObj.show" :dialogObj="dialogObj" @reflash="onUpdateAddress"></address-dialog>
<refund-dialog :dialogObj="refundDialogObj" @reflash="onAfterRefund" @changeShow="changeShow"></refund-dialog> <refund-dialog :dialogObj="refundDialogObj" @reflash="onAfterRefund" @changeShow="changeShow"></refund-dialog>
<page :nowPage="nowPage" :total="total"/>
</div> </div>
</template> </template>
<script> <script>
import {getOrderListApi} from "../../service/api"; import {getOrderListApi,editOrderDescApi} from "../../service/api";
import page from '../framework/page'
import addressDialog from './dialog' import addressDialog from './dialog'
import refundDialog from './refundDialog' import refundDialog from './refundDialog'
import AddressArray from '../framework/address-picker/addr' import AddressArray from '../framework/address-picker/addr'
...@@ -130,6 +139,8 @@ ...@@ -130,6 +139,8 @@
name: 'index', name: 'index',
data(){ data(){
return { return {
nowPage: 1,
total: 0,
tableData: [ tableData: [
{ {
"pay_id": 269, "pay_id": 269,
...@@ -217,9 +228,15 @@ ...@@ -217,9 +228,15 @@
cancelButtonText: '取消', cancelButtonText: '取消',
inputValue: desc inputValue: desc
}).then(({ value }) => { }).then(({ value }) => {
this.$message({ editOrderDescApi(id,'refund',{desc: value}).then(res=>{
type: 'success', if( res.data.result === 'success' ){
message: '你的备注是: ' + value this.$message({
type: 'success',
message: '编辑备注成功'
});
}else{
this.$message.error( res.data.message );
}
}); });
}).catch(() => { }).catch(() => {
this.$message({ this.$message({
...@@ -295,7 +312,8 @@ ...@@ -295,7 +312,8 @@
}, },
components: { components: {
addressDialog, addressDialog,
refundDialog refundDialog,
page
}, },
mounted(){ mounted(){
this.getOrderList(); this.getOrderList();
......
<template>
<div>
<el-dialog
:title="dialogObj.title"
:visible.sync="show"
>
<el-form ref="saveuser" :model="nowObj" label-width="70px">
<el-form-item label="订单状态" v-if="!showDesc">
<template>
<el-radio-group v-model="nowObj.status">
<el-radio :label="1">提现成功</el-radio>
<el-radio :label="2">提现失败</el-radio>
</el-radio-group>
</template>
</el-form-item>
<el-form-item label="失败理由" v-if="nowObj.status === 2 && !showDesc">
<el-input type="textarea" rows="3" v-model="nowObj.reason" auto-complete="off"></el-input>
</el-form-item>
<el-form-item label="备注信息" v-if="showDesc">
<el-input type="textarea" rows="3" v-model="nowObj.desc" auto-complete="off"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="onSave(showDesc)">保 存</el-button>
<el-button @click="dialogObj.show = false">取 消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
props:[
'dialogObj'
],
data(){
return{
show: false,
nowObj: {},
showDesc: false
}
},
methods:{
initPage(){
this.show = this.dialogObj.show;
},
onConfirm(){
this.$emit("reflash",this.currentRow);
},
onSave(){
}
},
mounted(){
this.initPage()
},
watch:{
'dialogObj'(value){
console.log('dialogObj value', value)
this.initPage()
}
}
}
</script>
<style scoped>
</style>
<template> <template>
<div>
<el-form :inline="true" :model="search" class="demo-form-inline" label-width="80px">
<el-form-item label="关键字">
<el-input v-model="search.key" placeholder="用户名/手机号"></el-input>
</el-form-item>
<el-form-item label="订单状态">
<el-select v-model="search.status" placeholder="用户名/手机/课程名称">
<el-option
v-for="item in liStatus"
:key="item.status"
:label="item.label"
:value="item.status">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="">
<el-button type="primary" @click="onSearch">查询</el-button>
</el-form-item>
</el-form>
<el-table
:data="tableData"
border
style="width: 100%">
<el-table-column
prop="username"
label="用户名"
>
</el-table-column>
<el-table-column
prop="mobile"
label="手机号"
>
</el-table-column>
<el-table-column
label="已获得总额"
>
<template slot-scope="scope">
{{ scope.row.getSumMoney | moneyYuan }}
</template>
</el-table-column>
<el-table-column
label="已提金额"
>
<template slot-scope="scope">
{{ scope.row.alreadyMoney | moneyYuan}}
</template>
</el-table-column>
<el-table-column
label="可提余额"
>
<template slot-scope="scope">
{{ scope.row.resMoney | moneyYuan}}
</template>
</el-table-column>
<el-table-column
label="提现金额"
>
<template slot-scope="scope">
{{ scope.row.money | moneyYuan}}
</template>
</el-table-column>
<el-table-column
label="提现状态"
>
<template slot-scope="scope">
<span :class="{status:true,red:scope.row.status === 2,green:scope.row.status === 1}">
{{ scope.row.status | filterStatus}}
</span>
</template>
</el-table-column>
<el-table-column
label="同意提现时间"
>
<template slot-scope="scope">
{{ scope.row.pay_at }}
</template>
</el-table-column>
<el-table-column
prop="reason"
label="失败原因"
>
</el-table-column>
<el-table-column
prop="desc"
label="备注"
>
</el-table-column>
<el-table-column
label="操作"
>
<template slot-scope="scope">
<el-button
v-if="scope.row.status === 0"
@click="checkMoney(scope.row.id, scope.row.desc)"
type="text"
size="small">
审核
</el-button>
<el-button
@click="addDesc(scope.row.id, scope.row.desc)"
type="text"
size="small">
添加备注
</el-button>
</template>
</el-table-column>
</el-table>
<page :nowPage="nowPage" :total="total"/>
<el-dialog :title="dialogTitle" v-if="showDialog" :visible.sync="showDialog">
<el-form ref="saveuser" :model="nowObj" label-width="70px">
<el-form-item label="订单状态" v-if="!showDesc">
<template>
<el-radio-group v-model="nowObj.status">
<el-radio :label="1">提现成功</el-radio>
<el-radio :label="2">提现失败</el-radio>
</el-radio-group>
</template>
</el-form-item>
<el-form-item label="失败理由" v-if="nowObj.status === 2 && !showDesc">
<el-input type="textarea" rows="3" v-model="nowObj.reason" auto-complete="off"></el-input>
</el-form-item>
<el-form-item label="备注信息" v-if="showDesc">
<el-input type="textarea" rows="3" v-model="nowObj.desc" auto-complete="off"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="onSave(showDesc)">保 存</el-button>
<el-button @click="showDialog = false">取 消</el-button>
</div>
</el-dialog>
</div>
</template> </template>
<script> <script>
export default { import {getWithdrawListApi,editOrderDescApi,withdrawApi} from "../../service/api";
name: "index" import page from '../framework/page'
export default {
name: "orderMoney",
data(){
return {
nowPage: 1,
total: 0,
search:{
key:'',
status:0
},
liStatus:[
{
label: '全部',
status: ''
},
{
label: '申请中',
status: 0
},{
label: '提现成功',
status: 1
},{
label: '提现失败',
status: 2
}
],
tableData:[],
showDialog:false,
showDesc:false,
dialogTitle:'审核',
nowObj:{
id:'',
status:1,
reason:'',
desc:""
},
page:{
current:1,
pageSize:100,
total:0
},
}
},
components:{
page
},
filters:{
moneyYuan:function (value) {
return value = (value/100).toFixed(2) + '元';
},
filterStatus:function (value) {
let msg = '';
if(value === 0){
msg = '审核中'
}else if(value === 1){
msg = '提现成功'
}else if(value === 2){
msg = '提现失败'
}
return msg;
}
},
mounted:function(){
this.getList()
},
methods:{
//获取列表
getList:function () {
let data = {
key : this.search.key,
page : this.page.current,
per_page : this.page.pageSize,
status : this.search.status
};
getWithdrawListApi( data ).then(res=>{
if( res.data.result === 'success' ){
this.tableData = res.data.data.data;
this.total = res.data.data.total;
}else{
this.$message.error( res.data.message );
}
})
},
// 查询按钮
onSearch(){
this.page.current = 1;
//调用查询接口
this.getList();
},
//点击审核
checkMoney(id){
this.nowObj.id = id;
this.showDesc = false;
this.showDialog=true;
},
//点击备注
addDesc(id,desc){
this.nowObj.id = id;
this.nowObj.desc = desc;
this.showDesc = true;
this.showDialog=true;
},
//分页切换
onPageChange(current){
this.page.current=current;
this.getList();
},
// 弹框请求回调
doCallback:function(){
this.nowObj.id = '';
this.nowObj.status = 1;
this.nowObj.reason = '';
this.nowObj.desc = '';
this.page.current = 1;
this.showDialog = false;
this.getList();
this.$message({
message: '提交成功',
type: 'success'
});
},
// 弹框保存按钮
onSave:function ( desc ) {
// 添加备注
if(desc){
let data = {
desc:this.nowObj.desc,
};
if(data.desc === '' || data.desc == null){
this.$message.error( '请填写备注' );
return false
}
editOrderDescApi(this.nowObj.id,'withdraw',data).then(res=>{
if( res.data.result === 'success' ){
this.doCallback()
}else{
this.$message.error( res.data.message );
}
});
// 审核
}else{
let data = {
reason:this.nowObj.reason,
status:this.nowObj.status,
};
if((data.reason === '' || data.reason == null) && data.status === 2){
this.$message.error( '请填写失败理由' );
return false
}else {
data.reason = '';
}
withdrawApi(this.nowObj.id, data ).then(res=>{
if( res.data.result === 'success' ){
this.doCallback()
}else{
this.$message.error( res.data.message );
}
})
}
}
} }
}
</script> </script>
<style scoped> <style scoped>
.status{
color: #e9a038;
}
.status.red{
color: #c30005;
}
.status.green{
color: #00ac00;
}
</style> </style>
<template> <template>
<div class="refund">
<el-table
:data="list"
style="width: 100%">
<el-table-column
prop="out_trade_no"
label="out_trade_no">
</el-table-column>
<el-table-column
prop="refund_no"
label="退款编号">
</el-table-column>
<el-table-column
prop="user_id"
label="用户ID">
</el-table-column>
<el-table-column
prop="order_money"
label="订单金额">
<template slot-scope="scope">
{{parseFloat(scope.row.order_money / 100)}}
</template>
</el-table-column>
<el-table-column
prop="refund_money"
label="退款金额">
<template slot-scope="scope">
{{parseFloat(scope.row.refund_money / 100)}}
</template>
</el-table-column>
<el-table-column
prop="desc"
label="退款原因">
</el-table-column>
<el-table-column
prop="callback"
label="微信回调">
</el-table-column>
<el-table-column
label="退款状态">
<template slot-scope="scope">
{{scope.row.status|filterStatus}}
</template>
</el-table-column>
<el-table-column
prop="success_at"
label="退款成功时间">
</el-table-column>
<el-table-column
label="操作"
min-width="80"
>
<template slot-scope="scope">
<el-button
@click="editComment(scope.row.out_trade_no, scope.row.desc)"
type="warning"
plain
size="mini">
备注
</el-button>
</template>
</el-table-column>
</el-table>
<page :nowPage="nowPage" :total="total"/>
</div>
</template> </template>
<script> <script>
export default { import {getRefundListApi,editOrderDescApi} from "../../service/api";
name: "index" import page from '../framework/page'
export default {
name: "index",
components:{
page
},
data(){
return {
nowPage: 1,
total: 0,
list: [
{
out_trade_no: '111',
refund_no: '111',
user_id: '1',
order_money: 100,
refund_money: 100,
desc: 'sdfaf',
callback: 'ewewew',
status: 1,
success_at: '2018-09-01'
}
]
}
},
filters:{
filterStatus:function (value) {
let msg = '';
if(value === 0){
msg = '退款中'
}else if(value === 1){
msg = '退款成功'
}else if(value === 2){
msg = '退款失败'
}
return msg;
}
},
mounted(){
this.getRefundList()
},
methods: {
editComment(id, desc) {
this.$prompt('编辑备注', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputValue: desc
}).then(({ value }) => {
editOrderDescApi(id,'refund',{desc: value}).then(res=>{
if( res.data.result === 'success' ){
this.$message({
type: 'success',
message: '编辑备注成功'
});
}else{
this.$message.error( res.data.message );
}
});
}).catch(() => {
this.$message({
type: 'info',
message: '取消编辑备注'
});
});
},
getRefundList(){
getRefundListApi().then((res)=>{
this.total = res.total;
})
}
} }
}
</script> </script>
<style scoped> <style scoped>
.refund{
margin: 10px;
}
</style> </style>
...@@ -434,8 +434,8 @@ export const getOrderListApi = function () { ...@@ -434,8 +434,8 @@ export const getOrderListApi = function () {
}; };
// 修改订单备注 // 修改订单备注
const editOrderDescUrl = `${_baseUrl}api/admin/order/desc/`; const editOrderDescUrl = `${_baseUrl}api/admin/order/desc/`;
export const editOrderDescApi = function (orderId, type) { export const editOrderDescApi = function (orderId, type, json) {
return Vue.prototype.$put(`${editOrderDescUrl}${orderId}/${type}`) return Vue.prototype.$put(`${editOrderDescUrl}${orderId}/${type}`, json)
}; };
// 给用户退款 // 给用户退款
const refundUrl = `${_baseUrl}api/admin/bill/refund/`; const refundUrl = `${_baseUrl}api/admin/bill/refund/`;
...@@ -449,8 +449,8 @@ export const editAddressApi = function (id) { ...@@ -449,8 +449,8 @@ export const editAddressApi = function (id) {
}; };
// 提现审核 // 提现审核
const withdrawUrl = `${_baseUrl}/api/admin/order/withdraw/`; const withdrawUrl = `${_baseUrl}/api/admin/order/withdraw/`;
export const withdrawApi = function (json) { export const withdrawApi = function (id,json) {
return Vue.prototype.$post(`${withdrawUrl}`,json) return Vue.prototype.$post(`${withdrawUrl}${id}`,json)
}; };
// 退款列表 // 退款列表
const getRefundListUrl = `${_baseUrl}api/admin/order/refund/list`; const getRefundListUrl = `${_baseUrl}api/admin/order/refund/list`;
......
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