| | |
| | | function getCol() { |
| | | var cols = [ |
| | | {field: 'id', title: 'id', align: 'center',hide:true} |
| | | ,{type: 'checkbox'} |
| | | ,{type: 'checkbox',totalRow:true} |
| | | ,{field:'id', width:80, title: '', sort: true, totalRowText: '合计:',hide: true} |
| | | ,{field: 'pakinTime$', title: '入库时间', align: 'center' , sort:true} |
| | | ,{field: 'matnr', align: 'center',title: '存货编码',hide:true,edit:true} |
| | |
| | | ,{field: 'batch', align: 'center',title: '批号',edit:true, width: 150, sort:true} |
| | | ,{field: 'packageNo', align: 'center',title: '包装号',edit:true, sort:true} |
| | | ,{field: 'proDate', align: 'center',title: '生产日期',edit:true, width: 100} |
| | | ,{field: 'weight', align: 'center',title: '重量KG',edit:true} |
| | | ,{field: 'weight', align: 'center',title: '重量KG',edit:true,totalRow:true} |
| | | ,{field: 'packageType', align: 'center',title: '包装类型',edit:true} |
| | | ,{field: 'zpalletType', align: 'center',title: '托盘类型',edit:true} |
| | | ,{field: 'filmWrap', align: 'center',title: '缠膜',edit:true,hide:true} |
| | |
| | | even: true, |
| | | toolbar: '#toolbar', |
| | | cellMinWidth: 50, |
| | | cols: [getCol()], |
| | | cols: [function(){ |
| | | var arr = getCol(); |
| | | |
| | | // 初始化筛选状态 |
| | | var local = layui.data('table-filter-test'); // 获取对应的本地记录 |
| | | layui.each(arr, function(index, item){ |
| | | if(item.field in local){ |
| | | item.hide = local[item.field]; |
| | | } |
| | | }); |
| | | return arr; |
| | | }() ], |
| | | request: { |
| | | pageName: 'curr', |
| | | pageSize: 'limit' |
| | |
| | | statusCode: 200 |
| | | }, |
| | | done: function(res, curr, count) { |
| | | // 记录筛选状态 |
| | | var that = this; |
| | | that.elem.next().on('mousedown', 'input[lay-filter="LAY_TABLE_TOOL_COLS"]+', function(){ |
| | | var input = $(this).prev()[0]; |
| | | // 此处表名可任意定义 |
| | | layui.data('table-filter-test', { |
| | | key: input.name |
| | | ,value: input.checked |
| | | }) |
| | | }); |
| | | |
| | | //$(".lavui-table-grid-down").hide(); |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | // 复选框事件 |
| | | table.on('checkbox(plaDetl)', function(obj){ |
| | | // console.log(obj); // 查看对象所有成员 |
| | | // console.log(obj.checked); // 当前是否选中状态 |
| | | // console.log(obj.data); // 选中行的相关数据 |
| | | // console.log(obj.type); // 若触发的是全选,则为:all;若触发的是单选,则为:one |
| | | var checkStatus = table.checkStatus(obj.config.id) |
| | | var selectedNum = checkStatus.data.length; |
| | | var weightAll = 0; |
| | | var weightAnfmeAll = 0; |
| | | |
| | | for (var i in checkStatus.data){ |
| | | weightAll += checkStatus.data[i].weight; |
| | | weightAnfmeAll += checkStatus.data[i].weightAnfme; |
| | | } |
| | | |
| | | $('.layui-table-total').find('.laytable-cell-1-0-1').text(selectedNum); |
| | | $('.layui-table-total').find('.laytable-cell-1-0-9').text(weightAll); |
| | | $('.layui-table-total').find('.laytable-cell-1-0-41').text(weightAnfmeAll); |
| | | |
| | | }); |
| | | |
| | | // 行单击事件( 双击事件为: rowDouble ) |
| | | table.on('row(plaDetl)', function(obj){ |
| | | |
| | | }); |
| | | |
| | | table.on('tool(plaDetl)', function (obj) { |
| | |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | } |
| | | |
| | | }) |
| | | |
| | | // 监听头工具栏事件 |
| | |
| | | }); |
| | | } |
| | | |
| | | $(document).on('click','#updateZpallet',function (){ |
| | | debugger; |
| | | }) |
| | | $("[name='layTableCheckbox']").click(function(){ // 通过name属性选取元素,并添加点击事件 |
| | | alert("Hello World!"); // 在控制台输出提示信息 |
| | | debugger |
| | | }); |
| | | |
| | | |
| | | |
| | | $(document).on('click','#add', function () { |