Ver código fonte

添加提现记录页面

chengjunhui 6 dias atrás
pai
commit
d88380de37

+ 143 - 0
renren-admin/src/main/resources/statics/js/modules/qyh/withdraw.js

@@ -0,0 +1,143 @@
+$(function () {
+    $("#jqGrid").jqGrid({
+        url: baseURL + 'qyh/withdraw/page',
+        datatype: "json",
+        colModel: [
+            { label: 'ID', name: 'id', index: "id", hidden: true, key: true },
+            { label: '申请单号', name: 'businessCode', width: 160 },
+            { label: '用户', name: 'userName', width: 100 },
+            { label: '手机号', name: 'phone', width: 120 },
+            { label: '提现金额', name: 'money', width: 100, formatter: function(value){
+                return '¥' + (value || 0).toFixed(2);
+            }},
+            { label: '申请时间', name: 'applyTime', width: 150 },
+            { label: '状态', name: 'auditState', width: 80, formatter: function(value){
+                if(value === 1) return '<span class="label label-warning">待审核</span>';
+                if(value === 2) return '<span class="label label-success">已通过</span>';
+                if(value === 3) return '<span class="label label-danger">已拒绝</span>';
+                if(value === 4) return '<span class="label label-primary">已打款</span>';
+                return '';
+            }},
+            { label: '操作', name: 'opt', width: 100, formatter: function(value, options, row){
+                if(row.auditState === 1){
+                    return '<a class="btn btn-xs btn-primary" onclick="vm.showAudit(' + row.id + ')">审核</a>';
+                } else {
+                    return '<a class="btn btn-xs btn-info" onclick="vm.showAudit(' + row.id + ')">详情</a>';
+                }
+            }}
+        ],
+        viewrecords: true,
+        height: 385,
+        rowNum: 10,
+        rowList: [10, 30, 50],
+        rownumbers: true,
+        rownumWidth: 35,
+        autowidth: true,
+        multiselect: false,
+        pager: "#jqGridPager",
+        jsonReader: {
+            root: "page.list",
+            page: "page.currPage",
+            total: "page.totalPage",
+            records: "page.totalCount"
+        },
+        prmNames: {
+            page: "page",
+            rows: "limit",
+            order: "order"
+        },
+        gridComplete: function () {
+            //隐藏grid底部滚动条
+            $("#jqGrid").closest(".ui-jqgrid-bdiv").css({ "overflow-x": "hidden" });
+        }
+    });
+
+    vm.getStatistics();
+});
+
+var vm = new Vue({
+    el: '#rrapp',
+    data: {
+        q: {
+            businessCode: null,
+            phone: null,
+            minAmount: null,
+            maxAmount: null,
+            auditState: ""
+        },
+        showList: true,
+        title: null,
+        withdraw: {},
+        statistics: {
+            successAmount: 0,
+            pendingAmount: 0
+        }
+    },
+    methods: {
+        query: function () {
+            vm.reload(1);
+            vm.getStatistics();
+        },
+        reset: function () {
+            vm.q = {
+                businessCode: null,
+                phone: null,
+                minAmount: null,
+                maxAmount: null,
+                auditState: ""
+            };
+            vm.query();
+        },
+        getStatistics: function () {
+            $.get(baseURL + "qyh/withdraw/statistics", vm.q, function (r) {
+                if (r.code === 0) {
+                    vm.statistics = r.data;
+                }
+            });
+        },
+        showAudit: function (id) {
+            vm.showList = false;
+            vm.title = "提现审核";
+            $.get(baseURL + "qyh/withdraw/info/" + id, function (r) {
+                vm.withdraw = r.data;
+            });
+        },
+        pass: function () {
+            vm.withdraw.auditState = 2;
+            vm.audit();
+        },
+        reject: function () {
+            if (!vm.withdraw.auditExplain) {
+                layer.msg("请输入驳回原因");
+                return;
+            }
+            vm.withdraw.auditState = 3;
+            vm.audit();
+        },
+        audit: function () {
+            $.ajax({
+                type: "POST",
+                url: baseURL + "qyh/withdraw/audit",
+                contentType: "application/json",
+                data: JSON.stringify(vm.withdraw),
+                success: function (r) {
+                    if (r.code === 0) {
+                        layer.msg("操作成功", { icon: 1 });
+                        vm.reload();
+                    } else {
+                        layer.alert(r.msg);
+                    }
+                }
+            });
+        },
+        reload: function (page) {
+            vm.showList = true;
+            var currPage = page || $("#jqGrid").jqGrid('getGridParam', 'page');
+            $("#jqGrid").jqGrid('setGridParam', {
+                postData: vm.q,
+                page: currPage
+            }).trigger("reloadGrid");
+            vm.getStatistics();
+        }
+    }
+});

+ 130 - 0
renren-admin/src/main/resources/templates/modules/qyh/withdraw.html

@@ -0,0 +1,130 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <title>提现审核</title>
+    <#include "/header.html">
+    <style>
+        .statistics-row {
+            padding: 10px 15px;
+            background: #fff;
+            margin-bottom: 10px;
+            border-radius: 4px;
+        }
+        .stat-item {
+            margin-right: 30px;
+            font-size: 14px;
+            font-weight: bold;
+            color: #ff8c00;
+        }
+    </style>
+</head>
+<body>
+<div id="rrapp" v-cloak>
+    <div v-show="showList">
+        <div class="grid-btn">
+            <div class="form-group col-sm-12 div-Gay">
+                <div class="col-sm-2" style="padding-left: 0; width: auto;">
+                    <label class="control-label" style="display: inline-block; vertical-align: middle; margin-bottom: 0;">申请单号</label>
+                    <input type="text" class="form-control" style="width: 150px; display: inline-block;" v-model="q.businessCode" @keyup.enter="query" placeholder="申请单号">
+                </div>
+                <div class="col-sm-2" style="width: auto;">
+                    <label class="control-label" style="display: inline-block; vertical-align: middle; margin-bottom: 0;">手机号</label>
+                    <input type="text" class="form-control" style="width: 130px; display: inline-block;" v-model="q.phone" @keyup.enter="query" placeholder="手机号">
+                </div>
+                <div class="col-sm-3" style="width: auto;">
+                    <label class="control-label" style="display: inline-block; vertical-align: middle; margin-bottom: 0;">金额范围</label>
+                    <input type="text" class="form-control" style="width: 80px; display: inline-block;" v-model="q.minAmount" placeholder="最小">
+                    <span>-</span>
+                    <input type="text" class="form-control" style="width: 80px; display: inline-block;" v-model="q.maxAmount" placeholder="最大">
+                </div>
+                <div class="col-sm-2" style="width: auto;">
+                    <label class="control-label" style="display: inline-block; vertical-align: middle; margin-bottom: 0;">状态</label>
+                    <select class="form-control" style="width: 100px; display: inline-block;" v-model="q.auditState">
+                        <option value="">全部</option>
+                        <option value="1">待审核</option>
+                        <option value="2">已通过</option>
+                        <option value="3">已拒绝</option>
+                        <option value="4">已打款</option>
+                    </select>
+                </div>
+                <a class="btn btn-query" @click="query"><i class="fa fa-search"></i>&nbsp;查询</a>
+                <a class="btn btn-success" @click="reset"><i class="fa fa-refresh"></i>&nbsp;刷新</a>
+            </div>
+        </div>
+
+        <div class="statistics-row">
+            <span class="stat-item">累计已提现成功:¥{{statistics.successAmount || '0.00'}}</span>
+            <span class="stat-item">待审核提现总额:¥{{statistics.pendingAmount || '0.00'}}</span>
+        </div>
+
+        <table id="jqGrid"></table>
+        <div id="jqGridPager"></div>
+    </div>
+
+    <div v-show="!showList" class="panel panel-default">
+        <div class="panel-heading" style="border-bottom: none; font-weight: bold; font-size: 16px;">{{title}}</div>
+        <form class="form-horizontal" style="width: 100%; padding: 0 20px;">
+            <div class="form-group">
+                <label class="col-sm-2 control-label" style="text-align: left; width: 120px;">申请单号:</label>
+                <div class="col-sm-10">
+                    <p class="form-control-static">{{withdraw.businessCode}}</p>
+                </div>
+            </div>
+            <div class="form-group">
+                <label class="col-sm-2 control-label" style="text-align: left; width: 120px;">申请人:</label>
+                <div class="col-sm-10">
+                    <p class="form-control-static">{{withdraw.userName}} ({{withdraw.phone}})</p>
+                </div>
+            </div>
+            <div class="form-group">
+                <label class="col-sm-2 control-label" style="text-align: left; width: 120px;">提现金额:</label>
+                <div class="col-sm-10">
+                    <p class="form-control-static">¥{{withdraw.money || '0.00'}}</p>
+                </div>
+            </div>
+            <div class="form-group">
+                <label class="col-sm-2 control-label" style="text-align: left; width: 120px;">当前可提余额:</label>
+                <div class="col-sm-10">
+                    <p class="form-control-static">¥{{withdraw.availableAmount || '0.00'}}</p>
+                </div>
+            </div>
+
+            <div v-if="withdraw.auditState != 1">
+                <div class="form-group">
+                    <label class="col-sm-2 control-label" style="text-align: left; width: 120px;">审核时间:</label>
+                    <div class="col-sm-10">
+                        <p class="form-control-static">{{withdraw.auditTime || '-'}}</p>
+                    </div>
+                </div>
+                <div class="form-group" v-if="withdraw.auditState == 4">
+                    <label class="col-sm-2 control-label" style="text-align: left; width: 120px;">打款时间:</label>
+                    <div class="col-sm-10">
+                        <p class="form-control-static">{{withdraw.remitTime || '-'}}</p>
+                    </div>
+                </div>
+            </div>
+
+            <div style="margin-top: 20px;">
+                <label style="display: block; margin-bottom: 10px; font-weight: bold;">操作备注/驳回原因</label>
+                <textarea class="form-control" rows="6" v-model="withdraw.auditExplain" :readonly="withdraw.auditState != 1" placeholder="请输入"></textarea>
+            </div>
+
+            <div class="form-group" style="margin-top: 30px; margin-bottom: 30px;">
+                <div class="col-sm-12" style="padding-left: 0;">
+                    <template v-if="withdraw.auditState == 1">
+                        <button type="button" class="btn btn-danger" @click="reject" style="width: 120px; margin-right: 15px;">驳回</button>
+                        <button type="button" class="btn btn-primary" @click="pass" style="width: 120px; margin-right: 15px;">通过</button>
+                        <button type="button" class="btn btn-default" @click="reload" style="width: 120px; border: 1px solid #ccc;">取消</button>
+                    </template>
+                    <template v-else>
+                        <button type="button" class="btn btn-default" @click="reload" style="width: 120px; border: 1px solid #ccc;">返回</button>
+                    </template>
+                </div>
+            </div>
+        </form>
+    </div>
+</div>
+
+<script src="${request.contextPath}/statics/js/modules/qyh/withdraw.js?_${.now?long}"></script>
+</body>
+</html>