xiaoyong931011
2023-02-09 e92b00089d8d57899df380135d79864dade09837
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
<div class="layui-fluid layui-anim febs-anim" id="febs-money-total" 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="money-change-table-form">
                        <div class="layui-row">
                            <div class="layui-col-md10">
                                <div class="layui-form-item">
                                </div>
                            </div>
                            <div class="layui-col-md2 layui-col-sm12 layui-col-xs12 table-action-area">
                            </div>
                        </div>
                    </form>
                    <table lay-filter="moneyTotalTable" lay-data="{id: 'moneyTotalTable'}"></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-money-total'),
            $query = $view.find('#query'),
            $reset = $view.find('#reset'),
            $searchForm = $view.find('form'),
            sortObject = {field: 'createTime', type: null},
            tableIns;
 
        form.render();
 
        initTable();
 
        table.on('tool(moneyTotalTable)', function (obj) {
            var data = obj.data,
                layEvent = obj.event;
 
            if (layEvent === 'sheetIn') {
                febs.modal.open( '每日充值', 'dappView/amountFlow/' + data.createTime, {
                    maxmin: true,
                });
            }
 
            if (layEvent === 'sheetOut') {
                febs.modal.open( '每日提现', 'dappView/amountOutFlow/' + data.createTime, {
                    maxmin: true,
                });
            }
        });
 
        table.on('sort(moneyTotalTable)', function (obj) {
            sortObject = obj;
            tableIns.reload({
                initSort: obj,
                where: $.extend(getQueryParams(), {
                    field: obj.field,
                    order: obj.type
                })
            });
        });
 
        $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}, initSort: sortObject});
        });
 
        function initTable() {
            tableIns = febs.table.init({
                elem: $view.find('table'),
                id: 'moneyTotalTable',
                url: ctx + 'flow/moneyTotal',
                cols: [[
                    {field: 'createTime', title: '日期', minWidth: 100},
                    {field: 'totalCharge', title: '充值总额', minWidth: 100},
                    {title: '充值次数',
                        templet: function (d) {
                            if(d.sheetIn > 0){
                                return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="sheetIn" shiro:hasPermission="amountFlow:update">'+d.sheetIn+'次</button>'
                            }else{
                                return d.sheetIn;
                            }
                        },minWidth: 100,align:'center'},
                    {field: 'totalWithdraw', title: '提现总额', minWidth: 100},
                    {title: '提现次数',
                        templet: function (d) {
                            if(d.sheetOut > 0){
                                return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="sheetOut" shiro:hasPermission="amountOutFlow:update">'+d.sheetOut+'次</button>'
                            }else{
                                return d.sheetOut;
                            }
                        },minWidth: 100,align:'center'},
                ]]
            });
        }
 
        function getQueryParams() {
            // return {
            //     type: $searchForm.find("select[name='type']").val(),
            //     username: $searchForm.find('input[name="username"]').val().trim()
            // };
        }
 
    })
</script>