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.
ymww_backend/public/assets/js/backend/user/recharge.js

57 lines
2.5 KiB

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