KKSU
2024-06-21 b3b3baf9a3b0147ca38476450ca1823c291abd20
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
<div class="layui-fluid layui-anim febs-anim" id="febs-member-withDraw" lay-title="提现列表">
    <div class="layui-row febs-container">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-body febs-table-full">
                    <form class="layui-form layui-table-form" lay-filter="user-table-form">
                        <div class="layui-row">
                            <div class="layui-col-md10">
                                <div class="layui-form-item">
<!--                                    <div class="layui-inline">-->
<!--                                        <label class="layui-form-label layui-form-label-sm">操作类型</label>-->
<!--                                        <div class="layui-input-inline">-->
<!--                                            <select name="isInsideOption">-->
<!--                                                <option value=""></option>-->
<!--                                                <option value="Y">内部转账</option>-->
<!--                                                <option value="N">提现</option>-->
<!--                                            </select>-->
<!--                                        </div>-->
<!--                                    </div>-->
 
                                    <div class="layui-inline">
                                        <label class="layui-form-label layui-form-label-sm">地址</label>
                                        <div class="layui-input-inline">
                                            <input type="text" name="address" autocomplete="off" class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label layui-form-label-sm">状态</label>
                                        <div class="layui-input-inline">
                                            <select name="statusOption">
                                                <option value="0"></option>
                                                <option value="1">等待审核</option>
                                                <option value="2">同意</option>
                                                <option value="3">拒绝</option>
                                            </select>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="layui-col-md2 layui-col-sm12 layui-col-xs12 table-action-area">
                                <div class="layui-btn layui-btn-sm layui-btn-primary febs-button-blue-plain table-action" id="query">
                                    <i class="layui-icon">&#xe848;</i>
                                </div>
                                <div class="layui-btn layui-btn-sm layui-btn-primary febs-button-green-plain table-action" id="reset">
                                    <i class="layui-icon">&#xe79b;</i>
                                </div>
                            </div>
                        </div>
                    </form>
                    <table lay-filter="withdrawTable" lay-data="{id: 'withdrawTable'}"></table>
                </div>
            </div>
        </div>
    </div>
</div>
<style>
    .layui-table-cell {
        height: auto !important;
    }
</style>
<script data-th-inline="none" type="text/javascript">
    layui.use(['dropdown', 'jquery', 'laydate', 'form', 'table', 'febs', 'treeSelect'], function () {
        var $ = layui.jquery,
            laydate = layui.laydate,
            febs = layui.febs,
            form = layui.form,
            table = layui.table,
            dropdown = layui.dropdown,
            $view = $('#febs-member-withDraw'),
            $query = $view.find('#query'),
            $reset = $view.find('#reset'),
            $searchForm = $view.find('form'),
            sortObject = {field: 'createTime', type: null},
            tableIns;
 
        form.render();
 
        initTable();
 
        table.on('tool(withdrawTable)', function (obj) {
            var data = obj.data,
                layEvent = obj.event;
            if (layEvent === 'agree') {
                febs.modal.confirm('同意', '是否同意操作?', function () {
                    agree(data.id);
                });
            }
            if (layEvent === 'disagree') {
                febs.modal.confirm('拒绝', '是否拒绝操作?', function () {
                    disagree(data.id);
                });
            }
        });
 
        function agree(id) {
            febs.get(ctx + 'admin/walletCoin/agreeWithdraw/' + id, null, function () {
                febs.alert.success('操作成功');
                $query.click();
            });
        }
        function disagree(id) {
            febs.get(ctx + 'admin/walletCoin/disagreeWithdraw/' + id, null, function () {
                febs.alert.success('操作成功');
                $query.click();
            });
        }
 
        $query.on('click', function () {
            var params = $.extend(getQueryParams(), {field: sortObject.field, order: sortObject.type});
            tableIns.reload({where: params, page: {curr: 1}});
        });
 
        $reset.on('click', function () {
            $searchForm[0].reset();
            tableIns.reload({where: getQueryParams(), page: {curr: 1}});
        });
 
        function initTable() {
            tableIns = febs.table.init({
                elem: $view.find('table'),
                id: 'withdrawTable',
                url: ctx + 'admin/walletCoin/findWithdrawInPage',
                totalRow: true,
                cols: [[
                    {field: 'address', title: '提币地址',
                        templet: function (d) {
                            if (d.isInside === 'Y') {
                                return ''
                            } else if (d.isInside === 'N') {
                                return '<span>'+d.address+'</span>'
                            }else{
                                return ''
                            }
                        }, minWidth: 300, align: 'center'},
                    {field: 'isInside', title: '类型',
                        templet: function (d) {
                            if (d.isInside === 'Y') {
                                return '<span>内部转账</span>'
                            } else if (d.isInside === 'N') {
                                return '<span>提现</span>'
                            }else{
                                return
                            }
                        }, minWidth: 100, align: 'center'},
                    {field: 'symbol', title: '币种', minWidth: 100, align: 'center'},
                    {field: 'amount', title: '提币数量', minWidth: 120, align: 'center', totalRow: true},
                    {field: 'feeAmount', title: '手续费', minWidth: 120, align: 'center', totalRow: true},
                    // {field: 'realAmount', title: '到账数量', minWidth: 120, align: 'center', totalRow: true},
                    {field: 'status', title: '状态',
                        templet: function (d) {
                            if (d.status === 1) {
                                return '<span>进行中</span>'
                            } else if (d.status === 2) {
                                return '<span>同意</span>'
                            }else if (d.status === 3) {
                                return '<span>拒绝</span>'
                            }else{
                                return ''
                            }
                        }, minWidth: 120, align: 'center', totalRow: true},
                    {field: 'createTime', title: '提币时间', minWidth: 180, align: 'center'},
                    {title: '操作',
                        templet: function (d) {
                            if(d.status === 1){
                                return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="agree" shiro:hasPermission="user:update">同意</button>'
                                    +'<button class="layui-btn layui-btn-danger layui-btn-xs layui-btn-danger" lay-event="disagree" shiro:hasPermission="user:update">拒绝</button>'
                            }else{
                                return ''
                            }
 
 
                        },minWidth: 120,align:'center'}
                ]]
            });
        }
 
        function getQueryParams() {
            return {
                status: $searchForm.find("select[name='statusOption']").val(),
                address: $searchForm.find('input[name="address"]').val().trim(),
                // isInside: $searchForm.find("select[name='isInsideOption']").val()
            };
        }
 
    })
</script>