123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
- var Controller = {
- index: function () {
- // 初始化表格参数配置
- Table.api.init({
- extend: {
- index_url: 'shop_user/index' + location.search,
- add_url: 'shop_user/add',
- edit_url: 'shop_user/edit',
- multi_url: 'shop_user/multi',
- table: 'shop_user',
- }
- });
- var table = $("#table");
- // 初始化表格
- table.bootstrapTable({
- url: $.fn.bootstrapTable.defaults.extend.index_url,
- pk: 'id',
- sortName: 'id',
- height: $(window).height() - 100,
- search:false,
- showToggle: false,
- showColumns: false,
- visible: false,
- showExport: false,
- commonSearch: false,
- columns: [
- [
- {checkbox: true},
- {field: 'id', title: __('Id')},
- {field: 'member.nickname', title: __('会员昵称')},
- {field: 'shopname', title: __('Shopname')},
- {field: 'name', title: __('Name')},
- {field: 'phone', title: __('Phone')},
- {field: 'description', title: __('Description')},
- {field: 'image', title: __('Image'), events: Table.api.events.image, formatter: Table.api.formatter.image},
- {field: 'balance', title: __('Balance'), operate:'BETWEEN'},
- {field: 'order_price', title: __('Order_price'), operate:'BETWEEN'},
- {field: 'order_num', title: __('Order_num')},
- {field: 'effect_city', title: __('管理城市')},
- {field: 'is_recommend', title: __('是否推荐'), searchList: {"1":__('Yes'),"0":__('No')}, formatter: Table.api.formatter.toggle},
- {field: 'status', title: __('状态'), searchList: {"0":__('Status 0'),"1":__('Status 1'),"2":__('Status 2'),"4":__('资料修改'),"5":__('修改驳回')}, formatter: Table.api.formatter.normal},
- {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime},
- {
- field: 'operate', title: __('Operate'), table: table,
- buttons: [
- {
- name: 'detail',
- text: '订单查看',
- title: function (row) {
- return row.shopname+'的订单';
- },
- classname: 'btn btn-xs btn-success btn-addtabs',
- icon: 'fa fa-list',
- dropdown:'更多操作',
- url: function (row) {
- return 'shop_order/index?suser_id='+ row.id;
- }
- },
- {
- name: 'detail',
- text: '提现查看',
- title: function (row) {
- return row.shopname+'的提现';
- },
- classname: 'btn btn-xs btn-warning btn-addtabs',
- icon: 'fa fa-list',
- dropdown:'更多操作',
- url: function (row) {
- return 'member_extract/index?suser_id='+ row.id;
- }
- }
- ],
- 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;
- });
|