define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { var Controller = { index: function () { // 初始化表格参数配置 Table.api.init({ extend: { index_url: 'user/invoice/apply/index' + location.search, add_url: 'user/invoice/apply/add', edit_url: 'user/invoice/apply/edit', del_url: 'user/invoice/apply/del', multi_url: 'user/invoice/apply/multi', import_url: 'user/invoice/apply/import', table: 'user_invoice_apply', } }); 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: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"2":__('Status 2')}, formatter: Table.api.formatter.status}, {field: 'apply_type', title: __('Apply_type'), searchList: {"1":__('Apply_type 1'),"2":__('Apply_type 2')}, formatter: Table.api.formatter.normal}, {field: 'price', title: __('Price'), operate:'BETWEEN'}, {field: 'head_type', title: __('Head_type'), searchList: {"personal":__('Head_type personal'),"corporate":__('Head_type corporate')}, formatter: Table.api.formatter.normal}, {field: 'invoice_type', title: __('Invoice_type'), searchList: {"ordinary":__('Invoice_type ordinary'),"special":__('Invoice_type special')}, formatter: Table.api.formatter.normal}, {field: 'invoice_header', title: __('Invoice_header'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, {field: 'tax_id', title: __('Tax_id'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, {field: 'bank_deposit', title: __('Bank_deposit'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, {field: 'bank_number', title: __('Bank_number'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, {field: 'enterprise_address', title: __('Enterprise_address'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, {field: 'enterprise_phone', title: __('Enterprise_phone'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, {field: 'invoice_reservation_phone', title: __('Invoice_reservation_phone'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, {field: 'invoice_reservation_email', title: __('Invoice_reservation_email'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, {field: 'invoicingtime', title: __('Invoicingtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, {field: 'createtime', title: __('Createtime'), 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: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'}, {field: 'user.mobile', title: __('User.mobile'), operate: 'LIKE'}, {field: 'user.avatar', title: __('User.avatar'), operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image}, {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; });