| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
- var Controller = {
- index: function () {
- // 初始化表格参数配置
- Table.api.init({
- extend: {
- index_url: 'service/card/packageorder/index' + location.search,
- multi_url: 'service/card/packageorder/multi',
- import_url: 'service/card/packageorder/import',
- table: 'service_package_order',
- }
- });
- 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: 'nickname', title: __('用户昵称'),operate: false},
- {field: 'package_card_id', title: __('Package_card_id')},
- {field: 'name', title: __('Name'), operate: 'LIKE'},
- {field: 'image', title: __('Image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
- {field: 'paytype', title: __('Paytype'), searchList: {"0":__('Paytype 0'),"1":__('Paytype 1'),"2":__('Paytype 2'),"3":__('Paytype 3'),"4":__('Paytype 4')}, formatter: Table.api.formatter.normal},
- {field: 'orderId', title: __('Orderid'), operate: 'LIKE'},
- {field: 'original_price', title: __('Original_price'), operate:'BETWEEN'},
- {field: 'price', title: __('Price'), operate:'BETWEEN'},
- {field: 'discount', title: __('Discount')},
- {field: 'coupon_id', title: __('Coupon_id')},
- {field: 'coupon_price', title: __('Coupon_price'), operate:'BETWEEN'},
- {field: 'payprice', title: __('Payprice'), operate:'BETWEEN'},
- {field: 'starttime', title: __('Starttime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
- {field: 'endtime', title: __('Endtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
- //{field: 'trade_no', title: __('Trade_no'), operate: 'LIKE'},
- //{field: 'is_update', title: __('Is_update'), searchList: {"0":__('Is_update 0'),"1":__('Is_update 1')}, formatter: Table.api.formatter.normal},
- {field: 'total_nums', title: __('Total_nums')},
- {field: 'use_nums', title: __('Use_nums')},
- {field: 'status', title: __('Status'), searchList: {"0":__('Status 0'),"1":__('Status 1'),"-1":__('Status -1'),"2":__('Status 2'),"-2":__('Status -2')}, formatter: Table.api.formatter.status},
- {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
- {field: 'paytime', title: __('Paytime'), 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,
- buttons: [
- {
- name: 'list',
- text: __('套餐卡内容'),
- title: __('套餐卡内容'),
- classname: 'btn btn-xs btn-info btn-dialog',
- icon: 'fa fa-list-ol',
- url: function(row){
- return 'service/card/packageorderdetail/index?package_order_id='+row.id;
- },
- },
- {
- name: 'list',
- text: __('订单列表'),
- title: __('订单列表'),
- classname: 'btn btn-xs btn-list btn-success btn-dialog',
- icon: 'fa fa-list-o',
- url: function(row){
- return 'service/order/order/index?ordertype=1&package_order_id='+row.id;
- },
- },
- ],
- 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;
- });
|