define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { var Controller = { index: function () { // 初始化表格参数配置 Table.api.init({ extend: { index_url: 'orders/auditorder/index' + location.search, add_url: 'orders/auditorder/add', edit_url: 'orders/auditorder/edit', // del_url: 'orders/auditorder/del', multi_url: 'orders/auditorder/multi', import_url: 'orders/auditorder/import', table: '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: 'order_no', title: __('Order_no'), operate: 'LIKE'}, {field: 'customer', title: __('Customer'), operate: 'LIKE'}, {field: 'tel', title: __('Tel'), operate: 'LIKE'}, {field: 'status', title: __('Status'), searchList: {"10":__('Status 10'),"20":__('Status 20'),"30":__('Status 30'),"40":__('Status 40'),"41":__('Status 41'),"50":__('Status 50'),"60":__('Status 60'),"-10":__('Status -10')}, formatter: Table.api.formatter.status}, {field: 'area_id', title: __('Area_id')}, {field: 'address', title: __('Address'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, {field: 'lng', title: __('Lng'), operate:'BETWEEN'}, {field: 'lat', title: __('Lat'), operate:'BETWEEN'}, //{field: 'work_tel_id', title: __('Work_tel_id')}, {field: 'source_shop', title: __('Source_shop'), operate: 'LIKE'}, {field: 'source', title: __('Source')}, {field: 'source_uid', title: __('Source_uid'), operate: 'LIKE'}, {field: 'item_id', title: __('Item_id')}, {field: 'item_title', title: __('Item_title'), operate: 'LIKE'}, {field: 'detail', title: __('Detail'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, {field: 'remark', title: __('Remark'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, {field: 'images', title: __('Images'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.images}, {field: 'plan_time', title: __('Plan_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false}, {field: 'admin_id', title: __('Admin_id')}, {field: 'total', title: __('Total'), operate:'BETWEEN'}, {field: 'cost', title: __('Cost'), operate:'BETWEEN'}, {field: 'performance', title: __('Performance'), operate:'BETWEEN'}, // {field: 'cancel_reason_id', title: __('Cancel_reason_id')}, //{field: 'cancel_detail', title: __('Cancel_detail'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, // {field: 'audit_admin_id', title: __('Audit_admin_id')}, {field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false}, {field: 'update_time', title: __('Update_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false}, //{field: 'auditadmin.username', title: __('Admin.username'), operate: 'LIKE'}, {field: 'auditadmin.nickname', title: __('Admin.nickname'), operate: 'LIKE'}, {field: 'audit_remark', title: __('Audit_remark'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, {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; });