YM
2025-04-14 8f45b3d3afcd0acebe80c663da0dc255c3decea3
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
{extend name="../../base/view/common/base" /}
<!-- 主体 -->
{block name="body"}
<div class="p-page">
    <form class="layui-form gg-form-bar border-x border-t" id="barsearchform">
        <div class="layui-input-inline" style="width:175px;">
            <input type="text" class="layui-input" id="diff_time" placeholder="选择付款时间区间" readonly name="diff_time">
        </div>
        <div class="layui-input-inline" style="width:150px">
            <input type="hidden" name="tab" value="0"/>
            <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="table-search"><i class="layui-icon layui-icon-search mr-1"></i>搜索</button>
            <button type="reset" class="layui-btn layui-btn-reset" lay-filter="table-reset">清空</button>
        </div>
    </form>
    <table class="layui-hide" id="test" lay-filter="test"></table>
</div>
<script type="text/html" id="toolbarDemo">
<div class="layui-btn-container">
    <h3 class="h3-title" style="height:32px;">付款列表</h3>
</div>
</script>
{/block}
<!-- /主体 -->
 
<!-- 脚本 -->
{block name="script"}
<script>
    const moduleInit = ['tool','tablePlus','laydatePlus'];
    function gouguInit() {
        var table = layui.tablePlus, tool = layui.tool, laydatePlus = layui.laydatePlus, element = layui.element;
        //tab切换
        element.on('tab(tab)', function(data){
            $('[name="tab"]').val(data.index);
            $("#barsearchform")[0].reset();
            layui.pageTable.reload({where:{tab:data.index},page:{curr:1}});
            return false;
        });
        
        //日期范围
        var diff_time = new laydatePlus({'target':'diff_time'});
        layui.pageTable = table.render({
            elem: "#test"
            ,toolbar: "#toolbarDemo"
            ,url: "/finance/payment/record"
            ,page: true
            ,limit: 20
            ,cellMinWidth: 80
            ,height: 'full-112'
            ,cellMinWidth: 80        
            ,page: true //开启分页
            ,limit: 20
            ,totalRow: true
            ,cols: [
                [
                    {
                        field: 'id',
                        title: 'ID号',
                        align: 'center',
                        width: 80,
                        totalRowText: '<div style="text-align:right">合计</div>'
                    },{
                        field: 'amount',
                        title: '付款金额(元)',
                        style: 'color:#16b777',
                        align: 'right',
                        width: 120,
                        totalRow: function (d) {return d.TOTAL_ROW.amount}
                    },{
                        field: 'pay_time',
                        title: '付款时间',
                        align: 'center',
                        width: 110
                    },{
                        field: 'remarks',
                        title: '付款备注'
                    },{
                        field: 'admin_name',
                        title: '登记人',
                        align: 'center',
                        width: 90
                    },{
                        field: 'create_time',
                        title: '登记时间',
                        align: 'center',
                        width: 150
                    },{
                        field: 'code',
                        title: '关联发票号',
                        align: 'center',
                        width: 150
                    },{
                        field: 'right',
                        fixed: 'right',
                        title: '操作',
                        width: 90,
                        align: 'center',
                        templet:function(d){
                            var html='<span class="layui-btn layui-btn-normal layui-btn-xs" lay-event="view">付款详情</span>';
                            return html;
                        }
                    }
                ]
            ]
        });
 
        //监听行工具事件
        table.on('tool(test)', function(obj) {
            var data = obj.data;
            if (obj.event === 'view') {
                tool.side("/finance/payment/view?id="+data.ticket_id);
                return;
            }
        });
    }
</script>
{/block}
<!-- /脚本 -->