66 lines
2.9 KiB
JavaScript
66 lines
2.9 KiB
JavaScript
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
|
|
|
var Controller = {
|
|
index: function () {
|
|
// 初始化表格参数配置
|
|
Table.api.init({
|
|
extend: {
|
|
index_url: 'orders/income/index' + location.search,
|
|
add_url: 'orders/income/add',
|
|
edit_url: 'orders/income/edit',
|
|
del_url: 'orders/income/del',
|
|
multi_url: 'orders/income/multi',
|
|
import_url: 'orders/income/import',
|
|
table: 'order_income',
|
|
}
|
|
});
|
|
|
|
var table = $("#table");
|
|
|
|
// 初始化表格
|
|
table.bootstrapTable({
|
|
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
|
pk: 'id',
|
|
sortName: 'id',
|
|
fixedColumns: true,
|
|
fixedRightNumber: 1,
|
|
commonSearch:true,
|
|
search:true,
|
|
columns: [
|
|
[
|
|
// {checkbox: true},
|
|
{field: 'id', title: __('Id'),operate: false},
|
|
// {field: 'order_id', title: __('Order_id')},
|
|
{field: 'order_no', title: __('Order_no'), operate: 'LIKE'},
|
|
{field: 'tel', title: __('Tel'), operate: 'LIKE'},
|
|
{field: 'item_type', title: __('Item_type'), searchList: {"1":__('Item_type 1'),"2":__('Item_type 2'),"3":__('Item_type 3'),"4":__('Item_type 4')}, formatter: Table.api.formatter.normal},
|
|
{field: 'amount', title: __('Amount'), operate:'BETWEEN'},
|
|
{field: 'income_type', title: __('Income_type'), searchList: {"1":__('Income_type 1'),"2":__('Income_type 2')}, formatter: Table.api.formatter.normal},
|
|
// {field: 'admin_id', title: __('Admin_id')},
|
|
{field: 'admin_user', title: __('Admin_user'), operate: 'LIKE'},
|
|
{field: 'payment_time', title: __('Payment_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
|
|
{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;
|
|
});
|