define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { var Controller = { index: function () { // 初始化表格参数配置 Table.api.init({ extend: { index_url: 'report/index' + location.search, add_url: 'report/add', } }); var table = $("#table"); // 初始化表格 table.bootstrapTable({ url: $.fn.bootstrapTable.defaults.extend.index_url, pk: 'id', sortName: 'id', columns: [ [ {field: 'order_number', title: '批次号',operate: 'LIKE'}, {field: 'product_name', title: '产品名称'}, {field: 'color', title: '专墨颜色'}, {field: 'collarWeight', title: '领用重量(kg)'}, {field: 'backWeight', title: '退回重量(kg)'}, {field: 'consume', title: '消耗重量(kg)'}, ] ], showToggle:false, showColumns:false, showExport:false, searchFormVisible:false, commonSearch:false, // search:false, }); // 为表格绑定事件 Table.api.bindevent(table); }, bach: function(){ // 初始化表格参数配置 Table.api.init({ extend: { index_url: 'report/bach' + location.search, } }); var table = $("#table"); // 初始化表格 table.bootstrapTable({ url: $.fn.bootstrapTable.defaults.extend.index_url, pk: 'id', sortName: 'id', columns: [ [ {field: 'id', title: '序号'}, {field: 'bach_number', title: '批次号'}, {field: 'order_number', title: '工单批次号'}, {field: 'product_name', title: '产品名称'}, {field: 'ink_status', title: '油墨类别'}, {field: 'color', title: '颜色'}, {field: 'weight', title: '重量(KG)'}, {field: 'create', title: '入库时间'}, ] ] }); // 为表格绑定事件 Table.api.bindevent(table); }, mouth: function(){ // 初始化表格参数配置 Table.api.init({ extend: { index_url: 'report/mouth' + location.search, } }); var table = $("#table"); // 初始化表格 table.bootstrapTable({ url: $.fn.bootstrapTable.defaults.extend.index_url, pk: 'id', sortName: 'id', columns: [ [ {field: 'id', title: '序号'}, {field: 'order_number', title: '生产批次号', operate: 'LIKE'}, {field: 'product_name', title: '产品名称'}, {field: 'status', title: '状态'}, {field: 'weight', title: '重量(KG)'}, {field: 'ink_status', title: '油墨类别'}, {field: 'color', title: '颜色'}, {field: 'machine_number', title: '机台号'}, {field: 'create', title: '时间'}, ] ], }); // 为表格绑定事件 Table.api.bindevent(table); }, matter: function(){ // 初始化表格参数配置 Table.api.init({ extend: { index_url: 'report/matter' + location.search, ink_url: 'report/ink' + location.search, } }); var ink = $("#ink"); // 初始化表格 ink.bootstrapTable({ url: $.fn.bootstrapTable.defaults.extend.ink_url, pk: 'order_number', sortName: 'order_number', columns: [ [ {field: 'order_number', title: '生产批次号'}, {field: 'ink_name', title: '油墨名称'}, {field: 'out_weight', title: '领用油墨重量(kg)'}, {field: 'back_weight', title:'退回油墨重量(kg)'}, {field: 'weight', title:'消耗油墨重量(kg)'}, ] ], showToggle:false, showColumns:false, showExport:false, searchFormVisible:false, commonSearch:false, // search:false, }); var table = $("#table"); // 初始化表格 table.bootstrapTable({ url: $.fn.bootstrapTable.defaults.extend.index_url, pk: 'id', sortName: 'id', columns: [ [ {field: 'id', title: '序号'}, {field: 'order_number', title: '生产批次号'}, {field: 'ink_name', title: '油墨名称'}, {field: 'machine_number', title: '机台号'}, {field: 'out_weight', title: '领用重量(KG)'}, {field: 'back_weight', title: '退回重量(KG)'}, {field: 'create', title: '时间'}, ] ], showToggle:false, showColumns:false, showExport:false, searchFormVisible:false, commonSearch:false, }); // 为表格绑定事件 Table.api.bindevent(ink); Table.api.bindevent(table); }, edit: function () { Controller.api.bindevent(); }, api: { bindevent: function () { Form.api.bindevent($("form[role=form]")); } } }; return Controller; });