| | |
| | | style: 'color: blue;font-weight: bold' |
| | | } |
| | | ]; |
| | | locNormalCols.map(function (item) { |
| | | if (item.field === 'supplier') { |
| | | item.edit = 'text'; |
| | | } |
| | | }) |
| | | cols.push.apply(cols, locNormalCols); |
| | | var locNormalColsSelf = [ |
| | | {field: 'mnemonic', align: 'center',title: '生产单号', edit: 'text'} |
| | | ,{field: 'supplier', align: 'center',title: '通知单号', edit: 'text'} |
| | | ,{field: 'matnr', align: 'center',title: '物料编码'} |
| | | ,{field: 'maktx', align: 'center',title: '物料名称', width: 400} |
| | | ,{field: 'lgnum', align: 'center',title: '规格'} |
| | | ,{field: 'type', align: 'center',title: '物料类别'} |
| | | ,{field: 'brand', align: 'center',title: '品牌', hide: true} |
| | | ,{field: 'altme', align: 'center',title: '单位', hide: true} |
| | | ]; |
| | | cols.push.apply(cols, locNormalColsSelf); |
| | | // cols.push({field: 'matStatus', title: '物料状态', align: 'center', width: 120, templet: '#matStatus'}); |
| | | cols.push({fixed: 'right', title: '操作', align: 'center', toolbar: '#operate', width: 80}); |
| | | return cols; |
| | |
| | | if (obj.field === 'anfme') { |
| | | updateMatCodeData(obj.data.matnr, Number(obj.value), obj.data.index); |
| | | } |
| | | if (obj.field === 'supplier' || obj.field === 'mnemonic') { |
| | | updateMatCodeData2(obj.data.matnr, obj.value, obj.data.index, obj.field); |
| | | } |
| | | }); |
| | | |
| | | // 监听头工具栏事件 |
| | |
| | | layer.msg("数量不能为零"); |
| | | return; |
| | | } |
| | | if (matCodeData[i].mnemonic == null || matCodeData[i].mnemonic == '' || matCodeData[i].mnemonic == undefined) { |
| | | layer.msg("请输入生产单号"); |
| | | return; |
| | | } |
| | | // if (matCodeData[i].supplier == null || matCodeData[i].supplier == '' || matCodeData[i].supplier == undefined) { |
| | | // layer.msg("请输入通知单号"); |
| | | // return; |
| | | // } |
| | | } |
| | | // 判断库区是否为空 |
| | | var warehouse = $('#putSiteSelect').val(); |
| | |
| | | }); |
| | | } |
| | | |
| | | function updateMatCodeData2(matnr, value, index, field) { |
| | | for (var i = 0; i < matCodeData.length; i++) { |
| | | if (matCodeData[i]["matnr"] === matnr && matCodeData[i]["index"] === index) { |
| | | matCodeData[i][field] = value; |
| | | } |
| | | } |
| | | |
| | | tableIns.reload({ |
| | | data: matCodeData, |
| | | }); |
| | | } |
| | | |
| | | // 获取可用入库站点 |
| | | function getInBound() { |
| | | // 获取仓库下拉 |
| | | $.ajax({ |
| | | url: baseUrl + "/locArea/queryAll/auth", |
| | | url: baseUrl + "/locArea/query/allArea", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'POST', |
| | | success: function (res) { |
| | |
| | | var html = ""; |
| | | if (res.data && res.data.length > 0) { |
| | | html += res.data.map(function (item) { |
| | | return "<Option value=" + item.id + ">" + item.name + "</Option>"; |
| | | return "<Option value=" + item.uuid + ">" + item.name + "</Option>"; |
| | | }); |
| | | } |
| | | $('#putSiteSelect').append(html); |