zhaojs
2023-06-29 7ed108f71c66e74724c066843c4ae08c1050d4b9
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
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
 
    var Controller = {
        index: function () {
            // 初始化表格参数配置
            Table.api.init({
                extend: {
                    index_url: 'order/vip/index' + location.search,
                    add_url: 'order/vip/add',
                    edit_url: 'order/vip/edit',
                    del_url: 'order/vip/del',
                    multi_url: 'order/vip/multi',
                    import_url: 'order/vip/import',
                    table: 'order_vip',
                }
            });
 
            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: 'order_sn', title: __('Order_sn'), operate: 'LIKE'},
                        {field: 'goods_name', title: __('Goods_name'), operate: 'LIKE'},
                        {field: 'goods_thumb', title: __('Goods_thumb'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
                        {field: 'goods_final_price', title: __('Goods_final_price'), operate:'BETWEEN'},
                        {field: 'goods_count', title: __('Goods_count')},
                        {field: 'commission_total_cost', title: __('Commission_total_cost'), operate:'BETWEEN'},
                        {field: 'commission_rate', title: __('Commission_rate'), operate: false},
                        {field: 'commission', title: __('Commission'), operate:'BETWEEN'},
                        {field: 'status', title: __('Status'),searchList: {"0":__('不合格'),"1":__('待定'),"2":__('已完结')}, formatter: Table.api.formatter.status},
                        {field: 'order_sub_status_name', title: __('Order_sub_status_name'), operate: 'LIKE'},
                        {field: 'new_customer', title: __('New_customer'),searchList: {"0":__('待定'),"1":__('新客'),"2":__('老客')}, formatter: Table.api.formatter.status},
                        {field: 'order_time', title: __('Order_time'), operate:false, formatter: Table.api.formatter.datetime,dataTimeFormat:"YYYY-MM-DD HH:mm:ss"},
                        {field: 'sign_time', title: __('Sign_time'), operate:false, formatter: Table.api.formatter.datetime,dataTimeFormat:"YYYY-MM-DD HH:mm:ss"},
                        {field: 'settled_time', title: __('Settled_time'), operate:false, formatter: Table.api.formatter.datetime,dataTimeFormat:"YYYY-MM-DD HH:mm:ss"},
                        {field: 'order_source', title: __('Order_source'), 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;
});