define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { var Controller = { index: function () { // 初始化表格参数配置 Table.api.init({ extend: { index_url: 'order_hotel/index' + location.search, add_url: 'order_hotel/add', edit_url: 'order_hotel/edit', del_url: 'order_hotel/del', multi_url: 'order_hotel/multi', import_url: 'order_hotel/import', table: 'order_hotel', } }); var table = $("#table"); // 初始化表格 table.bootstrapTable({ url: $.fn.bootstrapTable.defaults.extend.index_url, pk: 'id', sortName: 'id', columns: [ [ {checkbox: true}, {field: 'id', title: __('Id')}, {field: 'order_id', title: __('Order_id')}, {field: 'hotel_id', title: __('Hotel_id')}, {field: 'hotel_name', title: __('Hotel_name'), operate: 'LIKE'}, {field: 'hotel_phone', title: __('Hotel_phone'), operate: 'LIKE'}, {field: 'country_name', title: __('Country_name'), operate: 'LIKE'}, {field: 'province_name', title: __('Province_name'), operate: 'LIKE'}, {field: 'city_name', title: __('City_name'), operate: 'LIKE'}, {field: 'detail_address', title: __('Detail_address'), operate: 'LIKE'}, {field: 'room_id', title: __('Room_id')}, {field: 'room_name', title: __('Room_name'), operate: 'LIKE'}, {field: 'room_memo', title: __('Room_memo'), operate: 'LIKE'}, {field: 'plan_id', title: __('Plan_id')}, {field: 'plan_name', title: __('Plan_name'), operate: 'LIKE'}, {field: 'plan_memo', title: __('Plan_memo'), operate: 'LIKE'}, {field: 'check_in_date', title: __('Check_in_date'), operate:'RANGE', addclass:'datetimerange', autocomplete:false}, {field: 'check_out_date', title: __('Check_out_date'), operate:'RANGE', addclass:'datetimerange', autocomplete:false}, {field: 'prod_num', title: __('Prod_num')}, {field: 'total_price', title: __('Total_price'), operate:'BETWEEN'}, {field: 'total_cost', title: __('Total_cost'), operate:'BETWEEN'}, {field: 'profit', title: __('Profit'), operate:'BETWEEN'}, {field: 'log', title: __('Log'), operate: 'LIKE'}, {field: 'del_flag', title: __('Del_flag'), formatter: Table.api.formatter.flag}, {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: 'confirm_status', title: __('Confirm_status')}, {field: 'confirm_no', title: __('Confirm_no'), operate: 'LIKE'}, {field: 'operate', title: __('Operate'), table: table, 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; });