zhaojs
2023-06-09 cd2a498ce30204cec358d337257745914a266917
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
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
 
    var Controller = {
        index: function () {
            // 初始化表格参数配置
            Table.api.init({
                extend: {
                    index_url: 'order/taobao/index' + location.search,
                    add_url: 'order/taobao/add',
                    edit_url: 'order/taobao/edit',
                    del_url: 'order/taobao/del',
                    multi_url: 'order/taobao/multi',
                    import_url: 'order/taobao/import',
                    table: 'order_taobao',
                }
            });
 
            var table = $("#table");
 
            // 初始化表格
            table.bootstrapTable({
                url: $.fn.bootstrapTable.defaults.extend.index_url,
                pk: 'id',
                sortName: 'id',
                fixedColumns: true,
                fixedRightNumber: 1,
                columns: [
                    [
                        {checkbox: true},
                        {field: 'id', title: __('Id')},
                        {field: 'trade_parent_id', title: __('Trade_parent_id'), operate: 'LIKE'},
                        {field: 'trade_id', title: __('Trade_id'), operate: 'LIKE'},
                        {field: 'item_title', title: __('Item_title'), operate: 'LIKE'},
                        {field: 'item_img', title: __('Item_img'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
                        {field: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'},
                        {field: 'user.mobile', title: __('User.mobile'), operate: 'LIKE'},
                        {field: 'item_price', title: __('Item_price'), operate:'BETWEEN'},
                        {field: 'alipay_total_price', title: __('Pay_price'), operate:'BETWEEN'},
                        {field: 'total_commission_rate', title: __('Total_commission_rate'), operate: 'LIKE'},
                        {field: 'pub_share_pre_fee', title: __('Pub_share_pre_fee'), operate:'BETWEEN'},
                        {field: 'tk_status', title: __('Tk_status'), searchList: {"3":__('订单结算'),"12":__('订单付款'),"13":"订单失效","14":"订单成功"}, formatter: Table.api.formatter.status},
                        // {field: 'tb_paid_time', title: __('Tb_paid_time'), operate: 'LIKE'},
                        {field: 'tb_paid_time', title: __('Tb_paid_time'), operate: 'BETWEEN', addclass: 'datetimepicker', data: 'data-date-format="YYYY-MM-DD"'},
 
                        {field: 'item_num', title: __('Item_num')},
                        {field: 'flow_source', title: __('Flow_source'), operate: 'LIKE'},
                        {field: 'adzone_name', title: __('Adzone_name'), operate: 'LIKE'},
                        {field: 'relation_id', title: __('Relation_id'), operate: 'LIKE'},
                    ]
                ]
            });
 
            // 为表格绑定事件
            Table.api.bindevent(table);
        },
        add: function () {
            Controller.api.bindevent();
        },
        edit: function () {
            Controller.api.bindevent();
        },
        api: {
            bindevent: function () {
                Form.api.bindevent($("form[role=form]"));
            }
        }
    };
    return Controller;
});