define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { var Controller = { index: function () { $('#lager').click(function () { $('#iframe1').contentWindow.location.reload('lager.html'); }); Controller.api.bindevent(); }, lager: function () { // 初始化表格参数配置 Table.api.init(); this.table.first(); this.table.second(); Controller.api.bindevent(); }, table:{ first:function (){ var table = $("#table"); // 初始化表格 table.bootstrapTable({ url: 'deliver/lager', pk: 'id', height:300, sortName: 'id', toolbar:'#toolbar', searchFormVisible:true, search:false, showToggle:false, showColumns:false, showExport:false, columns: [ [ {checkbox: true}, {field: 'id', title: 'ID', visible:false,operate: false}, {field: 'bach', title: __('批次号'),operate: "LIKE"}, {field: 'l_flow', title: __('托盘号'), operate: false}, {field: 'matter_name', title: __('辅料名称'), operate: 'LIKE',searchList: $.getJSON("deliver/matterName")}, {field: 'manufacture_date', title: '生产日期', operate: 'RANGE', addclass: 'datetimerange',datetimeFormat:'YYYY-MM-DD', formatter: Table.api.formatter.datetime}, {field: 'code', title: __('大件编码'), operate: false}, {field: 'small_num', title: __('小件数'),operate: false}, ] ] }); //导出发货按钮 $('.btn-print').on('click',function () { var ids = Table.api.selectedids(table); if (ids.length === 0){ alert('至少选择一个大件'); } var lager = ids.toString(); Fast.api.ajax({ url:'deliver/print', data:{lager_id:lager}, },function (data,res) { return false; },function (data) { return false; }) }) // 为表格绑定事件 Table.api.bindevent(table); //去掉时间区间记忆 table.on('post-body.bs.table',function (e,settings,json,xhr) { $('.datetimerange').each(function () { $(this).attr('autocomplete','off'); }) }); //复选框全选事件 table.on('check-all.bs.table',function (e,rows){ var lagerlist = ''; for (i=0;i