| | |
| | | function getCol() { |
| | | var cols = [ |
| | | {fixed: 'left', field: 'anfme', title: '数量(必填)', align: 'center', edit:'text', width: 120, style:'color: blue;font-weight: bold'}, |
| | | {field: 'batch', title: '批号(选填)', align: 'center', edit:'text', width: 200, style:'color: blue;font-weight: bold'} |
| | | {field: 'batch', title: '批号(选填)', align: 'center', edit:'text', width: 200, style:'color: block;font-weight: bold'} |
| | | ]; |
| | | cols.push.apply(cols, matCols); |
| | | cols.push({fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width: 80}) |
| | |
| | | toolbar: '#toolbar', |
| | | cols: [getCol()], |
| | | done: function (res, curr, count) { |
| | | $('td[data-field=anfme] div').html(initCountVal); |
| | | setMatCodeData(res.data); |
| | | limit(); |
| | | getInBound(); |
| | | } |
| | |
| | | } |
| | | }); |
| | | |
| | | function setMatCodeData(data) { |
| | | matCodeData = data; |
| | | for (var i=0;i<matCodeData.length;i++){ |
| | | matCodeData[i]["anfme"] = initCountVal; |
| | | } |
| | | } |
| | | |
| | | // 获取可用入库站点 |
| | | function getInBound() { |
| | | $.ajax({ |
| | |
| | | } |
| | | |
| | | // 添加表格数据 |
| | | function addTableData(data) { |
| | | for (var i=0;i<data.length;i++){ |
| | | let pass = false; |
| | | for (var j=0;j<matCodeData.length;j++){ |
| | | if (data[i].matNo === matCodeData[j].matNo) { |
| | | pass = true; |
| | | break; |
| | | } |
| | | } |
| | | if (pass) { |
| | | data.splice(i--, 1); |
| | | } else { |
| | | data[i]["count"] = initCountVal; |
| | | } |
| | | } |
| | | matCodeData.push.apply(matCodeData, data); |
| | | function addTableData(list) { |
| | | list.map(function (d) { |
| | | d['anfme'] = initCountVal; |
| | | }) |
| | | matCodeData.push.apply(matCodeData, list); |
| | | tableIns.reload({data: matCodeData}); |
| | | layer.close(matCodeLayerIdx); |
| | | } |