12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
- var Controller = {
- index: function () {
- // 初始化表格参数配置
- Table.api.init({
- extend: {
- index_url: 'payorder/index' + location.search,
- // add_url: 'payorder/add',
- // edit_url: 'payorder/edit',
- // del_url: 'payorder/del',
- // multi_url: 'payorder/multi',
- // import_url: 'payorder/import',
- table: 'pay_order',
- }
- });
- 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_id', title: __('用户ID')},
- {field: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'},
- {field: 'user.mobile', title: __('User.mobile'), operate: 'LIKE'},
- {field: 'pay_no', title: __('Pay_no'), operate: 'LIKE'},
- {field: 'money', title: __('Money'), operate:'BETWEEN'},
- {field: 'status', title: __('Status'), searchList: {"1":__('支付成功')}, formatter: Table.api.formatter.normal, operate: false},
- {field: 'payment_class', title: __('Payment_class'), operate: 'LIKE'},
- // {field: 'username', title: __('Username'), operate: 'LIKE'},
- // {field: 'payment', title: __('Payment'), operate: 'LIKE'},
- {field: 'memo', title: __('Memo'), operate: 'LIKE'},
- {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
- // {field: 'type', title: __('Type'), operate: 'LIKE'},
- // {field: 'pay_type', title: __('Pay_type'), operate: 'LIKE'},
- // {field: 'ext_info', title: __('Ext_info')},
- // {field: 'queried', title: __('Queried')},
- // {field: 'query_info', title: __('Query_info')},
- // {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
- ]
- ]
- });
- //这里我们手动设置底部的值
- table.on('load-success.bs.table', function (e, data) {
- $("#today_recharge").text(data.extend.today_recharge);
- $("#yesterday_recharge").text(data.extend.yesterday_recharge);
- $("#total_recharge").text(data.extend.total_recharge);
- });
- // 为表格绑定事件
- 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;
- });
|