| | |
| | | width: 70px; |
| | | } |
| | | |
| | | /* layer */ |
| | | .layui-layer-title { |
| | | font-size: 11px; |
| | | height: 20px; |
| | | line-height: 20px; |
| | | } |
| | | |
| | | /* 主体 */ |
| | | .layui-table, .layui-table-view { |
| | | margin: 0; |
| | |
| | | .layui-table-cell { |
| | | padding: 0; |
| | | } |
| | | |
| | | .layui-table-grid-down { |
| | | display: none; |
| | | } |
| | | /* 尾部 */ |
| | | footer { |
| | | position: absolute; |
| | |
| | | </footer> |
| | | </body> |
| | | <script> |
| | | var tableIns; |
| | | layui.use(['table','laydate', 'form'], function() { |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var layDate = layui.laydate; |
| | | var form = layui.form; |
| | | |
| | | tableIns = table.render({ |
| | |
| | | limit: 500, |
| | | cellMinWidth: 50, |
| | | cols: [[ |
| | | {fixed: 'left', field: 'count', title: '数量', align: 'center', edit:'text', style:'color: blue;font-weight: bold', width:50}, |
| | | {field: 'matNo', align: 'center', title: '物料编码'}, |
| | | {field: 'matName', align: 'center', title: '物料名称'} |
| | | {field: 'matName', align: 'center', title: '物料名称'}, |
| | | {fixed: 'left', field: 'count', title: '数量', align: 'center', style:'color: blue', width:40} |
| | | ]], |
| | | done: function (res, curr, count) { |
| | | } |
| | |
| | | |
| | | }); |
| | | |
| | | window.onload = function(){document.getElementById("code").focus();} |
| | | |
| | | var matCodeLayerIdx; |
| | | function getMat() { |
| | | matCodeLayerIdx = layer.open({ |
| | | type: 2, |
| | | title: '提取物料', |
| | | maxmin: true, |
| | | area: [top.detailWidth, top.detailHeight], |
| | | shadeClose: true, |
| | | content: '../pakStore/matQuery.html', |
| | | title: '物料', |
| | | shade: [0.3,'#000'], |
| | | area: ['90%', '90%'], |
| | | content: 'matQuery.html', |
| | | success: function(layero, index){ |
| | | $('.layui-layer-title').css('height', '20px').css('line-height', '20px').css('font-size', '12px').css('padding-left', '10px') |
| | | $('.layui-layer-setwin').css("top", '2px').css('right', '3px') |
| | | } |
| | | }); |
| | | } |
| | | |
| | | // 添加表格数据 |
| | | var matData = []; |
| | | function addTableData(data) { |
| | | let toPush = true; |
| | | for (var j=0;j<matData.length;j++){ |
| | | if (data.matNo === matData[j].matNo) { |
| | | matData[j].count = Number(matData[j].count) + Number(data.count); |
| | | toPush = false; |
| | | } |
| | | } |
| | | if (toPush) { |
| | | matData.push(data); |
| | | } |
| | | tableIns.reload({data: matData}); |
| | | } |
| | | </script> |
| | | </html> |