1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
- var Controller = {
- index: function () {
- // 初始化表格参数配置
- Table.api.init({
- extend: {
- index_url: 'activepeoplemodify/index' + location.search,
- // add_url: 'activepeoplemodify/add',
- edit_url: 'activepeoplemodify/edit',
- // del_url: 'activepeoplemodify/del',
- multi_url: 'activepeoplemodify/multi',
- // import_url: 'activepeoplemodify/import',
- table: 'active_people_modify',
- }
- });
- 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: 'people_id', title: __('报名记录ID')},
- {field: 'activepeople.name', title: '原'+__('People.name'), operate: 'LIKE'},
- {field: 'activepeople.idcard', title: '原'+__('People.idcard'), operate: 'LIKE'},
- {field: 'activepeople.mobile', title: '原'+__('People.mobile'), operate: 'LIKE'},
- {field: 'activepeople.emergencycontact', title: '原'+__('People.emergencycontact'), operate: 'LIKE'},
- {field: 'activepeople.contactmobile', title: '原'+__('People.contactmobile'), operate: 'LIKE'},
- {field: 'collectionplace', title: __('集合地点'), operate: 'LIKE'},
- {field: 'name', title: __('Name'), operate: 'LIKE'},
- {field: 'credtype', title: __('Credtype'), operate: 'LIKE'},
- {field: 'idcard', title: __('Idcard'), operate: 'LIKE'},
- {field: 'mobile', title: __('Mobile'), operate: 'LIKE'},
- {field: 'emergencycontact', title: __('Emergencycontact'), operate: 'LIKE'},
- {field: 'contactmobile', title: __('Contactmobile'), operate: 'LIKE'},
- // {field: 'insurance', title: __('Insurance'), operate: 'LIKE'},
- // {field: 'originalprice', title: __('Originalprice'), operate: 'LIKE'},
- // {field: 'vipprice', title: __('Vipprice'), operate: 'LIKE'},
- // {field: 'coupon_id', title: __('Coupon_id')},
- // {field: 'coupontype', title: __('Coupontype'), searchList: {"1":__('Coupontype 1'),"2":__('Coupontype 2')}, formatter: Table.api.formatter.normal},
- // {field: 'couponprice', title: __('Couponprice'), operate: 'LIKE'},
- // {field: 'is_free', title: __('Is_free'), searchList: {"0":__('Is_free 0'),"1":__('Is_free 1')}, formatter: Table.api.formatter.normal},
- // {field: 'price', title: __('Price'), operate: 'LIKE'},
- {field: 'is_self', title: __('Is_self'), searchList: {"0":__('Is_self 0'),"1":__('Is_self 1')}, formatter: Table.api.formatter.normal},
- {field: 'status', title: __('Status'), searchList: {"0":__('Status 0'),"1":__('Status 1'),"2":__('Status 2')}, formatter: Table.api.formatter.status},
- {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;
- });
|