1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
- var Controller = {
- index: function () {
- // 初始化表格参数配置
- Table.api.init({
- extend: {
- index_url: 'activerefund/index' + location.search,
- // add_url: 'activerefund/add',
- edit_url: 'activerefund/edit',
- // del_url: 'activerefund/del',
- multi_url: 'activerefund/multi',
- // import_url: 'activerefund/import',
- table: 'active_refund',
- }
- });
- var table = $("#table");
- // 初始化表格
- table.bootstrapTable({
- url: $.fn.bootstrapTable.defaults.extend.index_url,
- pk: 'id',
- sortName: 'id',
- fixedColumns: true,
- fixedRightNumber: 1,
- columns: [
- [
- {checkbox: true},
- {field: 'id', title: __('Id')},
- {field: 'user_id', title: __('User_id')},
- {field: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'},
- {field: 'user.mobile', title: __('User.mobile'), operate: 'LIKE'},
- {field: 'active_id', title: __('Active_id')},
- {field: 'active.title', title: __('Active.title'), operate: 'LIKE'},
- {field: 'active.desc', title: __('Active.desc'), operate: 'LIKE'},
- {field: 'order_id', title: __('Order_id')},
- {field: 'activeorder.order_sn', title: __('Order.order_sn'), operate: 'LIKE'},
- {field: 'paytype', title: __('支付方式'), searchList: {"0":__('余额'),"1":__('微信')}, formatter: Table.api.formatter.status},
- {field: 'price', title: __('Price'), operate: 'LIKE'},
- {field: 'number', title: __('Number')},
- {field: 'status', title: __('Status'), searchList: {"0":__('Status 0'),"1":__('Status 1'),"2":__('Status 2')}, formatter: Table.api.formatter.status},
- {field: 'transaction_id', title: __('Transaction_id'), operate: 'LIKE'},
- {field: 'refund_no', title: __('Refund_no'), operate: 'LIKE'},
- {field: 'refundstatus', title: __('Refundstatus'), searchList: {"0":__('Refundstatus 0'),"1":__('Refundstatus 1'),"2":__('Refundstatus 2')}, formatter: Table.api.formatter.status},
- {field: 'refundprice', title: __('Refundprice'), operate: 'LIKE'},
- {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
- {field: 'updatetime', title: __('Updatetime'), 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;
- });
|