60 lines
2.4 KiB
JavaScript
60 lines
2.4 KiB
JavaScript
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
|
|
|
var Controller = {
|
|
index: function () {
|
|
// 初始化表格参数配置
|
|
Table.api.init({
|
|
extend: {
|
|
index_url: 'orders/dispatchlog/index' + location.search,
|
|
// add_url: 'orders/dispatchlog/add',
|
|
// edit_url: 'orders/dispatchlog/edit',
|
|
// del_url: 'orders/dispatchlog/del',
|
|
multi_url: 'orders/dispatchlog/multi',
|
|
import_url: 'orders/dispatchlog/import',
|
|
table: 'order_dispatch_log',
|
|
}
|
|
});
|
|
|
|
var table = $("#table");
|
|
|
|
// 初始化表格
|
|
table.bootstrapTable({
|
|
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
|
pk: 'id',
|
|
sortName: 'id',
|
|
commonSearch:false,
|
|
search:false,
|
|
columns: [
|
|
[
|
|
// {checkbox: true},
|
|
{field: 'id', title: __('Id')},
|
|
// {field: 'dispatch_id', title: __('Dispatch_id')},
|
|
//{field: 'order_id', title: __('Order_id')},
|
|
//{field: 'worker_id', title: __('Worker_id')},
|
|
// {field: 'status', title: __('Status')},
|
|
{field: 'status_text', title: __('Status_text'), operate: 'LIKE'},
|
|
{field: 'remark', title: __('Remark'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
|
{field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
|
|
// {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;
|
|
});
|