You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
61 lines
2.8 KiB
61 lines
2.8 KiB
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
|
|
|
var Controller = {
|
|
index: function () {
|
|
// 初始化表格参数配置
|
|
Table.api.init({
|
|
extend: {
|
|
index_url: 'income/expend/index' + location.search,
|
|
add_url: 'income/expend/add',
|
|
edit_url: 'income/expend/edit',
|
|
del_url: 'income/expend/del',
|
|
multi_url: 'income/expend/multi',
|
|
import_url: 'income/expend/import',
|
|
table: 'income_expend',
|
|
}
|
|
});
|
|
|
|
var table = $("#table");
|
|
|
|
// 初始化表格
|
|
table.bootstrapTable({
|
|
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
|
pk: 'id',
|
|
sortName: 'id',
|
|
columns: [
|
|
[
|
|
{checkbox: true},
|
|
{field: 'id', title: __('Id')},
|
|
{field: 'date', title: __('日期')},
|
|
{field: 'user1.nickname', title: __('收款人'),operate: 'LIKE'},
|
|
{field: 'user1.mobile', title: __('收款人电话'),operate: 'LIKE'},
|
|
{field: 'amount', title: __('Amount'), operate:'BETWEEN'},
|
|
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
|
{field: 'pay_voucher', title: __('Pay_voucher'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
|
|
{field: 'status', title: __('Status'),formatter: Table.api.formatter.status, searchList: Config.statusList},
|
|
{field: 'user.nickname', title: __('付款人'),operate: 'LIKE'},
|
|
{field: 'user.mobile', title: __('付款人电话'),operate: 'LIKE'},
|
|
{field: 'is_delete', title: __('是否删除'),formatter: Table.api.formatter.status, searchList: {1: __('是'), 0: __('否')}},
|
|
|
|
{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;
|
|
});
|
|
|