layui.define([ 'form', 'laydate', 'table' ], function(exports) { var form = layui.form; var laydate = layui.laydate; var table = layui.table; var xzxOrderBatchInfoDetailTable = null; var data = {}; laydate.render({ elem: '#date', format: 'yyyy-MM-dd HH:mm:ss' }); laydate.render({ elem: '#date1', format: 'yyyy-MM-dd HH:mm:ss' }); var view ={ init:function(d){ data = d; this.initTable(); this.initSearchForm(); /* window.dataReload = function(){ Lib.doSearchForm($("#searchForm"),xzxOrderBatchInfoDetailTable) }*/ }, initTable:function(){ xzxOrderBatchInfoDetailTable = table.render({ elem : '#xzxOrderBatchInfoDetailTable', height : Lib.getTableHeight(1), cellMinWidth: 100, method : 'post', url : Common.ctxPath + '/admin/xzxOrderBatchInfo/batchDetaillist.json' // 数据接口 ,page : Lib.tablePage // 开启分页 ,where: data ,limit : 10, cols : [ [ // 表头 { type : 'checkbox', fixed:'left', }, { field : 'createtime', title : '打卡时间', templet: function (d) { if(d.createtime == null){ return '--'; }else{ //return $.base64.atob(d.name, true); return d.createtime; } } }, { field : '', title : '打卡类型', templet: function (d) { if(d.orderid == 0){ return "空车"; }else{ return "载货"; } } }, { field : 'vweight', title : '实际重量' }, { field : 'weight', title : '打卡重量', templet: function (d) { if(d.cweight == null){ return d.bweight; }else{ return d.cweight; } } }, { field : 'weighterror', title : '重量误差', templet: function (d) { if(d.cweight == null){ return d.bweight-d.vweight; }else{ return d.cweight-d.vweight; } } }, { field : 'orderid', title : '入库订单号', templet: function (d) { if(d.orderid == 0){ return "--"; }else{ return d.orderid; } } } ] ] }); table.on('checkbox(xzxOrderBatchInfoTable)', function(obj){ var xzxOrderBatchInfoTable = obj.data; if(obj.checked){ //按钮逻辑Lib.buttonEnable() }else{ } }) }, initSearchForm:function(){ Lib.initSearchForm( $("#searchForm"),xzxOrderBatchInfoDetailTable,form); } } exports('batchInfoDetail',view); });