| | |
| | | .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, |
| | |
| | | } |
| | | }); |
| | | } |
| | | |
| | | // 添加表格数据 |
| | | 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> |