1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
- var Controller = {
- index: function () {
- // 初始化表格参数配置
- Table.api.init({
- extend: {
- index_url: 'activepeople/index/active_id/'+ Config.active_id + location.search,
- // add_url: 'activepeople/add',
- // edit_url: 'activepeople/edit',
- // del_url: 'activepeople/del',
- // multi_url: 'activepeople/multi',
- // import_url: 'activepeople/import',
- table: 'active_people',
- }
- });
- 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: '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: 'user_id', title: __('User_id')},
- {field: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'},
- {field: 'user.mobile', title: __('User.mobile'), 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'),"3":__('Status 3')}, formatter: Table.api.formatter.status},
- {field: 'modifystatus', title: __('信息修改状态'), searchList: {"0":__('Modifystatus 0'),"1":__('Modifystatus 1')}, 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;
- });
|