| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
- var Controller = {
- index: function () {
- // 初始化表格参数配置
- Table.api.init({
- extend: {
- index_url: 'offline/order/index' + location.search,
- multi_url: 'offline/order/multi',
- import_url: 'offline/order/import',
- dragsort_url: "",
- table: 'product_order',
- }
- });
- var table = $("#table");
- // 初始化表格
- table.bootstrapTable({
- url: $.fn.bootstrapTable.defaults.extend.index_url,
- pk: 'id',
- sortName: 'weigh',
- fixedColumns: true,
- fixedRightNumber: 1,
- columns: [
- [
- {checkbox: true},
- {field: 'id', title: __('Id'), operate: false},
- {field: 'users.address', title: __('User_id'),operate:'LIKE'},
- {field: 'order_no', title: __('订单号')},
- {field: 'order_id', title: __('Order_id'), operate: false},
- {field: 'products.zh_name', title: __('Product_id'),operate:'LIKE'},
- {field: 'areas.address', title: __('Area_id')},
- {field: 'type_id', title: __('Type_id'), searchList: {0:__('热销'), 1:__('转让')}, formatter: Table.api.formatter.status},
- {field: 'price', title: __('Price'), operate:false},
- {field: 'status', title: __('Status'), searchList: {0:__('已下单'), 1:__('支付'), 2:__('转让'), 3:__('发货'), 4:__('取消'), 5:__('完成')}, formatter: Table.api.formatter.status},
- {field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
- {field: 'update_time', title: __('Update_time'), 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);
- },
- api: {
- bindevent: function () {
- Form.api.bindevent($("form[role=form]"));
- }
- }
- };
- return Controller;
- });
|