layui.use(['table'], function () { var $ = layui.jquery; var table = layui.table; /** * 物料信息管理 */ var MaterialInfo = { tableId: "materialInfoTable" }; var salesOrderCode = parent.salesOrderCode; console.log(salesOrderCode) $('#serch').click(function(){ var queryData = {}; queryData['salesOrderCode'] = salesOrderCode; table.reload(MaterialInfo.tableId, { where: queryData, page: {curr: 1} }); }); /** * 缺料报警初始化表格的列 */ MaterialInfo.initColumn = function () { return [[ {field: 'id', hide: true, title: '主键id'}, {field: 'salesOrderCode', sort: true, title: '订单编号',width: 160}, {field: 'productCode', sort: true, title: '产品编号',width: 160}, {field: 'productName', sort: true, title: '产品名称',width: 160}, {field: 'lineCode', sort: true, title: '产线编码',width: 120}, {field: 'planNumber', sort: true, title: '计划数量',width: 120}, {field: 'customerNo', sort: true, title: '客户编号',width: 120}, {field: 'cargoNo', sort: true, title: '货号',width: 160}, {field: 'planStartTime', sort: true, title: '计划开始时间',width: 160}, {field: 'planEndTime', sort: true, title: '计划结束时间',width: 160}, {field: 'deliveryTime', sort: true, title: '交货时间',width: 160}, {field: 'createUser', sort: true, title: '创建用户',width: 160}, {field: 'createTime', sort: true, title: '创建时间',width: 160}, ]]; }; table = $.extend(table, {config: {checkName: 'checked'}}); var queryData = {}; queryData['salesOrderCode'] = salesOrderCode; var tableResult = table.render({ elem: '#' + MaterialInfo.tableId, url: Feng.ctxPath + '/salesOrderChild/list', page: true, where:queryData, cellMinWidth: 80, cols: MaterialInfo.initColumn() }); $('#reset').click(function(){ clearType(); Msg = ""; window.localStorage.clear(); }); function clearType(){ parent.materialType=""; } });