zhaojs
2023-07-13 17c1a0a1fc1efc8d722915ecf520f9a522412a60
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
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
 
    var Controller = {
        index: function () {
            // 初始化表格参数配置
            Table.api.init({
                extend: {
                    index_url: 'order/douyin/index' + location.search,
                    add_url: 'order/douyin/add',
                    edit_url: 'order/douyin/edit',
                    del_url: 'order/douyin/del',
                    multi_url: 'order/douyin/multi',
                    import_url: 'order/douyin/import',
                    table: 'order_douyin',
                }
            });
 
            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: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'},
                        {field: 'user.mobile', title: __('User.mobile'), operate: 'LIKE'},
                        {field: 'shop_name', title: __('Shop_name'), 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: 'paid_time', title: __('Paid_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
                        {field: 'trade_id', title: __('Trade_id'), operate: 'LIKE'},
                        {field: 'trade_parent_id', title: __('Trade_parent_id'), operate: 'LIKE'},
                        {field: 'refund_time', title: __('Refund_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
                        {field: 'settled_status', title: __('Settled_status'),searchList: {"0":__('待结算'),"1":__('已结算'),'2':__('订单无效')}, formatter: Table.api.formatter.normal},
                        {field: 'pay_price', title: __('Pay_price'), operate:'BETWEEN'},
                        {field: 'predict_money', title: __('Predict_money'), operate:'BETWEEN'},
                        {field: 'actual_money', title: __('Actual_money'), operate:'BETWEEN'},
                        {field: 'media_type', title: __('Media_type'),searchList: {"1":__('物料商品'),'2':__('直播商品')}, formatter: Table.api.formatter.normal},
                        {field: 'channel_code', title: __('Channel_code'), operate: 'LIKE'},
                        {field: 'item_num', title: __('Item_num')},
                        {field: 'product_id', title: __('Product_id'), operate: 'LIKE'},
                        {field: 'order_status', title: __('Order_status'),searchList: {"1":__('已付款'),"2":__('已结算'),'3':__('已退款')}, formatter: Table.api.formatter.normal},
                        {field: 'earning_time', title: __('Earning_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
                    ]
                ]
            });
 
            // 为表格绑定事件
            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;
});