|
|
|
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
|
|
|
|
|
|
|
var Controller = {
|
|
|
|
index: function () {
|
|
|
|
// 初始化表格参数配置
|
|
|
|
Table.api.init({
|
|
|
|
extend: {
|
|
|
|
index_url: 'user/withdraw/index' + location.search,
|
|
|
|
add_url: 'user/withdraw/add',
|
|
|
|
edit_url: 'user/withdraw/edit',
|
|
|
|
del_url: 'user/withdraw/del',
|
|
|
|
multi_url: 'user/withdraw/multi',
|
|
|
|
import_url: 'user/withdraw/import',
|
|
|
|
table: 'user_withdraw',
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
var table = $("#table");
|
|
|
|
|
|
|
|
// 初始化表格
|
|
|
|
table.bootstrapTable({
|
|
|
|
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
|
|
|
pk: 'id',
|
|
|
|
sortName: 'id',
|
|
|
|
columns: [
|
|
|
|
[
|
|
|
|
{checkbox: true},
|
|
|
|
{field: 'id', title: __('Id')},
|
|
|
|
{field: 'user.nickname', title: __('用户')},
|
|
|
|
{field: 'method', title: __('支付方式'), formatter: Table.api.formatter.status, searchList: {'bank': __('银联'), 'wechat': __('微信'), 'alipay': __('支付宝')}},
|
|
|
|
{field: 'amount', title: __('Amount'), operate:'BETWEEN'},
|
|
|
|
{field: 'status', title: __('状态'), formatter: Table.api.formatter.status, searchList: {'1': __('审核通过'), '0': __('待审核'), 'alipay': __('审核不通过')}},
|
|
|
|
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, 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;
|
|
|
|
});
|