| | |
| | | */ |
| | | MaterialShortage.initColumn = function () { |
| | | return [[ |
| | | {type: 'numbers'}, |
| | | {type: 'checkbox', fixed: 'left'}, |
| | | {field: 'id', hide: true, title: 'ID'}, |
| | | {field: 'workOrderNo', sort: true, title: '工单号', width: 165}, |
| | | {field: 'workOrderNo', sort: true, title: '工单号', width: 150}, |
| | | // {field: 'loadingCode', sort: true, title: '上料工位', width: 105}, |
| | | {field: 'locationCode', sort: true, title: '工位编号', width: 105}, |
| | | {field: 'locationCode', sort: true, title: '工位编号', width: 100}, |
| | | //{field: 'loadingCode', sort: true, title: '扫码工位编号', width: 105}, |
| | | {field: 'materialCode', sort: true, title: '物料编码', width: 135}, |
| | | {field: 'materialCode', sort: true, title: '物料编码', width: 170}, |
| | | {field: 'spareField1', sort: true, title: '上料数量'}, |
| | | {field: 'spareField2', sort: true, title: '单位'}, |
| | | {field: 'loadingCode', sort: true, title: '物料批次'}, |
| | | {field: 'state', sort: true, title: '是否扫码', width: 105,templet: '#stateTpl'}, |
| | | {field: 'loadingCode', sort: true, title: '物料批次',width: 120}, |
| | | {field: 'state', sort: true, title: '是否上料', width: 105,templet: '#stateTpl'}, |
| | | // {field: 'orderStatus', sort: true, title: '状态',align:'center',width:80,templet: '#orderStatusTpl'}, |
| | | |
| | | ]]; |
| | |
| | | url: Feng.ctxPath + '/productionOrderBatchInfo/boardList', |
| | | // page: true, |
| | | height: 345, |
| | | toolbar: '#toolbarDemo', |
| | | cellMinWidth: 80, |
| | | where:queryData, |
| | | cols: MaterialShortage.initColumn() |
| | | }); |
| | | } |
| | | |
| | | // 工具栏事件 |
| | | table.on('toolbar(materialShortageTable)', function(obj){ |
| | | var id = obj.config.id; |
| | | var checkStatus = table.checkStatus(id); |
| | | switch(obj.event){ |
| | | case 'getCheckData': |
| | | var data = checkStatus.data; |
| | | console.log(data.length) |
| | | console.log(data) |
| | | if(data.length!==1){ |
| | | Feng.error("请正确选择一条数据") |
| | | return |
| | | } |
| | | resetting(data[0].id) |
| | | break; |
| | | }; |
| | | }); |
| | | |
| | | function resetting(data){ |
| | | var resetting = new $ax(Feng.ctxPath + "/productionOrderBatchInfo/resetting?id=" + data); |
| | | var resettingResult = resetting.start(); |
| | | initMaterialShortage() |
| | | Feng.success("重置成功") |
| | | } |
| | | |
| | | // 生产工单设置按钮点击事件 |
| | |
| | | Feng.error("请输入完整长度信息"); |
| | | return |
| | | } |
| | | var checkLocationCode = new $ax(Feng.ctxPath + "/productionOrderBatchInfo/checkLocationCode?materialCode=" + barCode.substring(0, 14) + "&workOrderNo="+ $('#workOrderNo').val()); |
| | | var checkLocationCodeResult = checkLocationCode.start(); |
| | | if(checkLocationCodeResult.data === 0){ |
| | | Feng.error("条码信息异常") |
| | | return |
| | | } |
| | | // var checkLocationCode = new $ax(Feng.ctxPath + "/productionOrderBatchInfo/checkLocationCode?materialCode=" + barCode.substring(0, 14) + "&workOrderNo="+ $('#workOrderNo').val()); |
| | | // var checkLocationCodeResult = checkLocationCode.start(); |
| | | // if(checkLocationCodeResult.data === 0){ |
| | | // Feng.error("条码信息异常") |
| | | // return |
| | | // } |
| | | var updateOrderBatchInfo = new $ax(Feng.ctxPath + "/productionOrderBatchInfo/updateOrderBatchInfo?materialCode=" + barCode.substring(0, 14) + "&workOrderNo="+ $('#workOrderNo').val()+ "&spareField1="+ number + "&loadingCode="+ batch); |
| | | var updateOrderBatchInfoResult = updateOrderBatchInfo.start(); |
| | | if(updateOrderBatchInfoResult.data === "0"){ |
| | | Feng.error("批次不同无法录入"); |
| | | return; |
| | | } |
| | | Feng.success("录入成功") |
| | | clean() |
| | | initMaterialShortage() |