77 lines
3.7 KiB
JavaScript
77 lines
3.7 KiB
JavaScript
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
|
|
|
var Controller = {
|
|
index: function () {
|
|
// 初始化表格参数配置
|
|
Table.api.init({
|
|
extend: {
|
|
index_url: 'orders/configorder/index' + location.search,
|
|
//add_url: 'orders/configorder/add',
|
|
edit_url: 'orders/configorder/edit',
|
|
// del_url: 'orders/configorder/del',
|
|
multi_url: 'orders/configorder/multi',
|
|
import_url: 'orders/configorder/import',
|
|
table: 'order',
|
|
}
|
|
});
|
|
|
|
var table = $("#table");
|
|
|
|
// 初始化表格
|
|
table.bootstrapTable({
|
|
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
|
pk: 'id',
|
|
sortName: 'id',
|
|
fixedColumns: true,
|
|
fixedRightNumber: 1,
|
|
columns: [
|
|
[
|
|
{field: 'id', title: __('Id')},
|
|
{field: 'order_no', title: __('Order_no'), operate: 'LIKE'},
|
|
{field: 'customer', title: __('Customer'), operate: 'LIKE'},
|
|
{field: 'tel', title: __('Tel'), operate: 'LIKE'},
|
|
{field: 'status', title: __('Status'), searchList: {"0":__('Status 0'),"10":__('Status 10'),"20":__('Status 20'),"30":__('Status 30'),"40":__('Status 40'),"50":__('Status 50'),"60":__('Status 60'),"-10":__('Status -10')}, formatter: Table.api.formatter.status},
|
|
|
|
{field: 'address', title: __('Address'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
|
|
|
{field: 'source_shop', title: __('Source_shop'), operate: 'LIKE'},
|
|
{field: 'source', title: __('Source')},
|
|
{field: 'source_uid', title: __('Source_uid'), operate: 'LIKE'},
|
|
{field: 'item_title', title: __('Item_title'), operate: 'LIKE'},
|
|
|
|
|
|
{field: 'total', title: __('Total'), operate:'BETWEEN'},
|
|
{field: 'online_amount', title: __('Online_amount'), operate:'BETWEEN'},
|
|
{field: 'offline_amount', title: __('Offline_amount'), operate:'BETWEEN'},
|
|
|
|
{field: 'dispatch_type', title: __('Dispatch_type')},
|
|
{field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
|
|
{field: 'update_time', title: __('Update_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
|
|
|
|
{field: 'dispatch.worker_name', title: __('Dispatch.worker_name'), operate: 'LIKE'},
|
|
{field: 'dispatch.worker_tel', title: __('Dispatch.worker_tel'), operate: 'LIKE'},
|
|
|
|
{field: 'dispatch.finish_time', title: __('Dispatch.finish_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;
|
|
});
|