layui.define([ 'form', 'laydate', 'table' ], function(exports) { var form = layui.form; var laydate = layui.laydate; var table = layui.table; var orderStatisTodayMore = null; var data = null; laydate.render({ elem: '#date', format: 'yyyy-MM-dd HH:mm' }); laydate.render({ elem: '#date1', format: 'yyyy-MM-dd HH:mm' }); var view ={ init:function(d){ data = d; this.initTable(); }, initTable:function(){ orderStatisTodayMore = table.render({ elem : '#orderStatisTodayMore', // height : 'full-180', method : 'post', url : Common.ctxPath+ '/admin/order/statistics/detailList.json', //数据接口 where :data, page : {"layout":['count','prev', 'page', 'next']} //开启分页 ,limit : 20, parseData :function(res){ //res 即为原始返回的数据 if(res.data.length == 0){ Common.info('并没有数据'); } return res; }, cols : [ [ //表头 { field : 'name', title : '回收人', width : 120, templet: function (data) { if (data.name == null) { return '--'; } else { return data.name; } } },{ field : 'ordertotal', title : '完成回收订单', width : 150 },{ field : 'weight', title : '入库重量', width : 120, templet:function(d){ return d.weight.toFixed(2)+'kg'; } }, { field : 'xx', title : '误差', width : 120, templet:function(d){ return d.weightSub.toFixed(2)+'kg/'+d.moneySub.toFixed(2)+'元'; } }, { field : 'money', title : '金额', width : 120, templet:function(d){ return d.money.toFixed(2)+'元'; } },{ field : 'storageusername', title : '仓库员姓名', width : 120, templet: function (data) { if (data.storageusername == null) { return '--'; } else { return $.base64.atob(data.storageusername, true); } } }, { title : '操作', width : 120, templet:function(d){ console.log(d); return '更多'; }, sort : true } ] ] }); }, }; exports('orderStatisticsTodayMore',view); });