baoxiudan.js
5.3 KB
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
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
var Controller = {
index: function () {
// 初始化表格参数配置
Table.api.init({
extend: {
index_url: 'baoxiudan/index' + location.search,
add_url: 'baoxiudan/add',
edit_url: 'baoxiudan/edit',
del_url: 'baoxiudan/del',
multi_url: 'baoxiudan/multi',
table: 'baoxiudan',
import_url: 'baoxiudan/import',
}
});
var table = $("#table");
// 初始化表格
table.bootstrapTable({
url: $.fn.bootstrapTable.defaults.extend.index_url,
pk: 'id',
sortName: 'id',
columns: [
[
{checkbox: true},
{field: 'id', title: __('Id'),operate:false},
{field: 'order_sn', title: __('Order_sn'),operate:false},
// {field: 'user_id', title: __('User_id')}
{field: 'user.name', title: __('User.name'),operate:false},
{field: 'title', title: __('Title'),operate:false},
{field: 'address', title: __('Address'),operate:'LIKE'},
// {field: 'zhandian_id', title: __('Zhandian_id')},
{field: 'zhandian.zhandian', title: __('Zhandian.zhandian'),operate:'LIKE'},
{field: 'colum', title: __('Colum'),operate:'LIKE'},
// {field: 'system', title: __('System')},
{field: 'xitong.xitong', title: __('Xitong.xitong'),operate:'LIKE'},
{field: 'time', title: __('Time'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime},
{field: 'people_name', title: __('People_name'),operate:false},
{field: 'colum_con', title: __('Colum_con'),operate:false},
{field: 'images', title: __('Images'), events: Table.api.events.image, formatter: Table.api.formatter.images,operate:false},
{field: 'type', title: __('Type'), searchList: {"1":__('Type 1'),"2":__('Type 2')}, formatter: Table.api.formatter.normal},
{field: 'repair_type', title: __('Repair_type'), searchList: {"0":__('Repair_type 0'),"1":__('Repair_type 1'),"2":__('Repair_type 2')}, formatter: Table.api.formatter.normal},
{field: 'is_genghuan', title: __('Is_genghuan'), searchList: {"1":__('Is_genghuan 1'),"2":__('Is_genghuan 2')}, formatter: Table.api.formatter.normal,operate:false},
{field: 'price', title: __('Price'), searchList: {"0":__('Price 0'),"1":__('Price 1'),"2":__('Price 2'),"3":__('Price 3')}, formatter: Table.api.formatter.normal},
{field: 'status', title: __('Status'), searchList: {"0":__('Status 0'),"1":__('Status 1'),"2":__('Status 2'),"3":__('Status 3')}, formatter: Table.api.formatter.status},
// {field: 'redio_user_id', title: __('Redio_user_id')},
{field: 'redio_time', title: __('Redio_time'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime,operate:false},
{field: 'redio_con', title: __('Redio_con'),operate:false},
{field: 'ok_time', title: __('Ok_time'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime},
{field: 'weixiu', title: __('Weixiu'),operate:false},
{field: 'jidian', title: __('Jidian'),operate:false},
{field: 'holder', title: __('Holder'),operate:false},
{field: 'fuwu', title: __('Fuwu'), searchList: {"1":__('Fuwu 1'),"2":__('Fuwu 2'),"3":__('Fuwu 3'),"4":__('Fuwu 4'),"5":__('Fuwu 5')}, formatter: Table.api.formatter.normal,operate:false},
{field: 'taiudu', title: __('Taiudu'), searchList: {"1":__('Taiudu 1'),"2":__('Taiudu 2'),"3":__('Taiudu 3'),"4":__('Taiudu 4'),"5":__('Taiudu 5')}, formatter: Table.api.formatter.normal,operate:false},
{field: 'talk_up', title: __('Talk_up'),operate:false},
{field: 'talk_con', title: __('Talk_con'),operate:false},
{field: 'createtime', title: __('Createtime'), operate:false, addclass:'datetimerange', formatter: Table.api.formatter.datetime},
{field: 'updatetime', title: __('Updatetime'), operate:false, addclass:'datetimerange', formatter: Table.api.formatter.datetime},
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
]
]
});
// 为表格绑定事件
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;
});