12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
- $('#c-pay_type').change(function(){
- if($(this).val()=='3'){ //银行收款
- $('#extendbankname').show();
- }else{
- $('#c-card_bank').val('');
- $('#extendbankname').hide();
- }
- });
- var Controller = {
- index: function () {
- // 初始化表格参数配置
- Table.api.init({
- extend: {
- index_url: 'invite/record/index',
- add_url: 'invite/record/add',
- edit_url: 'invite/record/edit',
- del_url: 'invite/record/del',
- multi_url: 'invite/record/multi',
- table: 'invite_record',
- },
- search: false,
- showExport: false,
- searchFormVisible: true,
- });
- var table = $("#table");
- // 初始化表格
- table.bootstrapTable({
- url: $.fn.bootstrapTable.defaults.extend.index_url,
- pk: 'id',
- sortName: 'id',
- columns: [
- [
- {checkbox: true},
- {field: 'id', title: __('Id'),operate:false},
- {field: 'username', title: __('Username'),operate:false},
- {field: 'nickname', title: __('Nickname'),operate:false},
- {field: 'r.username', title: __('Username'),visible:false,operate:'LIKE %...%'},
- {field: 'r.nickname', title: __('Nickname'),visible:false,operate:'LIKE %...%'},
- {field: 'email', title: __('Email'),operate:false},
- {field: 'phone', title: __('Phone'),operate:false},
- {field: 'pay_type', title: __('Pay_type'), visible:false, searchList: {"pay_type 1":__('Pay_type 1'),"pay_type 2":__('Pay_type 2')},operate:false},
- {field: 'pay_type_text', title: __('Pay_type'), operate:false},
- {field: 'name', title: __('Name'),operate:false},
- {field: 'account', title: __('Account'),operate:false},
- {field: 'anickname', title: __('邀请人'),operate:false},
- {field: 'a.nickname', title: __('邀请人'),visible:false,operate:'LIKE %...%'},
- {field: 'r.status', title: __('Status'), visible:false, searchList: {"0":__('Status 0'),"1":__('Status 1'),"2":__('Status 2')}},
- {field: 'status_text', title: __('审核状态'), operate:false},
- {field: 'invite_time', title: __('Invite_time'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime,operate:false},
- //{field: 'operate', title: __('Operate'),operate:false, formatter: Controller.api.gettype}
- {field: 'operate', title: __('激活'), table: table, events: Table.api.events.operate, formatter: function (value, row, index) {
- if(row.status == 1){
- return '-';
- }
- return Table.api.formatter.operate.call(this, value, row, index);
- }}
- ]
- ]
- });
- // 为表格绑定事件
- Table.api.bindevent(table);
- },
- add: function () {
- Controller.api.bindevent();
- },
- edit: function () {
- Controller.api.bindevent();
- },
- api: {
- bindevent: function () {
- Form.api.bindevent($("form[role=form]"));
- },
- gettype:function(value,row,index){
- if(row.status==1){
- return '-';
- }else{
- return "<a href='/admin/invite/record/edit/ids/"+row.id+"'>激活</a>";
- }
- }
- }
- };
- return Controller;
- });
|