define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { var Controller = { index: function () { // 初始化表格参数配置 Table.api.init({ extend: { index_url: 'orders/configorder/index' + location.search, //add_url: 'orders/configorder/add', edit_url: 'orders/configorder/edit', // del_url: 'orders/configorder/del', multi_url: 'orders/configorder/multi', import_url: 'orders/configorder/import', table: 'order', } }); var table = $("#table"); // 初始化表格 table.bootstrapTable({ url: $.fn.bootstrapTable.defaults.extend.index_url, pk: 'id', sortName: 'id', fixedColumns: true, fixedRightNumber: 1, columns: [ [ {field: 'id', title: __('Id')}, {field: 'order_no', title: __('Order_no'), operate: '='}, // {field: 'customer', title: __('Customer'), operate: 'LIKE'}, //{field: 'tel', title: __('Tel'), operate: 'LIKE'}, //{field: 'dispatch.worker_name', title: __('Dispatch.worker_name'), operate: 'LIKE'}, //{field: 'dispatch.worker_tel', title: __('Dispatch.worker_tel'), operate: 'LIKE'}, {field: 'dispatch.admin_user', title: __('Dispatch.admin_user'), operate: '='}, {field: 'status', title: __('Status'), searchList: {"0":__('Status 0'),"10":__('Status 10'),"20":__('Status 20'),"30":__('Status 30'),"40":__('Status 40'),"50":__('Status 50'),"60":__('Status 60'),"-10":__('Status -10')}, formatter: Table.api.formatter.status}, // {field: 'address', title: __('Address'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, {field: 'source_shop', title: __('Source_shop'), operate: '='}, // {field: 'source', title: __('Source')}, // {field: 'source_uid', title: __('Source_uid'), operate: 'LIKE'}, {field: 'item_title', title: __('Item_title'), operate: false}, {field: 'total', title: __('Total'), operate:false}, {field: 'online_amount', title: __('Online_amount'), operate:false}, {field: 'online_amount_last', title: __('Online_amount_last'), operate:false}, {field: 'offline_amount', title: __('Offline_amount'), operate:false}, {field: 'offline_amount_type_text', title: __('Offline_amount_type'), operate:false}, {field: 'refund_amount', title: __('Refund_amount'), operate:false}, {field: 'real_amount', title: __('Real_amount'), operate:false}, {field: 'cost', title: __('Cost'), operate:false}, {field: 'performance', title: __('Performance'), operate:false}, // {field: 'dispatch_type', title: __('Dispatch_type')}, {field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false}, {field: 'update_time', title: __('Update_time'), operate:false, addclass:'datetimerange', autocomplete:false}, // {field: 'dispatch.finish_time', title: __('Dispatch.finish_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false}, {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate, buttons: [ { name: 'edit', text:"配置", title:"配置订单", icon: 'fa fa-pencil', //title: __('Edit'), extend: 'data-toggle="tooltip" data-container="body"', classname: 'btn btn-xs btn-success btn-editone', /*visible:function(row){ if(row.status == 50){ return true; } return false; }*/ } ], } ] ] }); // 为表格绑定事件 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; });