| | |
| | | style: 'color: blue;font-weight: bold' |
| | | } |
| | | ]; |
| | | matCols.map(function (item) { |
| | | if (item.field === 'str6' || item.field === 'str5') { |
| | | item.edit = 'text'; |
| | | item.style = 'color: blue;font-weight: bold'; |
| | | } |
| | | }) |
| | | cols.push.apply(cols, matCols); |
| | | var matColsSelf = [ |
| | | {field: 'str5', align: 'center',title: '生产单号', edit: 'text'} |
| | | ,{field: 'matNo', align: 'center',title: '物料编码'} |
| | | ,{field: 'barcode', align: 'center',title: '条形码', hide: true} |
| | | ,{field: 'matName', align: 'center',title: '物料名称', width: 500} |
| | | ,{field: 'str2', align: 'center',title: '物料类别'} |
| | | ,{field: 'str3', align: 'center',title: '规格型号'} |
| | | ,{field: 'str1', align: 'center',title: '基本单位', hide: true} |
| | | ,{field: 'str4', align: 'center',title: '状态', hide: true} |
| | | ,{field: 'str6', align: 'center',title: '通知单号', edit: 'text'} |
| | | ,{field: 'str7', align: 'center',title: '默认仓库', hide: true} |
| | | ,{field: 'str17', align: 'center',title: '可采购', hide: true} |
| | | ,{field: 'str18', align: 'center',title: '可为子件', hide: true} |
| | | ,{field: 'str21', align: 'center',title: '成本计算方法', hide: true} |
| | | ,{field: 'str22', align: 'center',title: '采购单位', hide: true} |
| | | ,{field: 'str23', align: 'center',title: '销售单位', hide: true} |
| | | ]; |
| | | cols.push.apply(cols, matColsSelf); |
| | | 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 === 'count') { |
| | | updateMatCodeData(obj.data.matNo, Number(obj.value)); |
| | | } |
| | | if (obj.field === 'str5' || obj.field === 'str6') { |
| | | updateMatCodeData2(obj.data.matnr, obj.value, obj.data.index, obj.field); |
| | | } |
| | | }); |
| | | |
| | | // 监听头工具栏事件 |
| | |
| | | } |
| | | if (matCodeData[i].count === 0) { |
| | | layer.msg("数量不能为零"); |
| | | return; |
| | | } |
| | | if (matCodeData[i].str5 == null || matCodeData[i].str5 == '' || matCodeData[i].str5 == undefined) { |
| | | layer.msg("请输入生产单号"); |
| | | return; |
| | | } |
| | | } |
| | |
| | | }); |
| | | } |
| | | |
| | | 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({ |