| | |
| | | public static class LocDetlAdjust { |
| | | |
| | | // 物料号 |
| | | private String matNo; |
| | | private String matnr; |
| | | |
| | | // 变更数量 |
| | | private Double count; |
| | | |
| | | public String getMatNo() { |
| | | return matNo; |
| | | public String getMatnr() { |
| | | return matnr; |
| | | } |
| | | |
| | | public void setMatNo(String matNo) { |
| | | this.matNo = matNo; |
| | | public void setMatnr(String matnr) { |
| | | this.matnr = matnr; |
| | | } |
| | | |
| | | public Double getCount() { |
| | |
| | | throw new CoolException("库位不存在"); |
| | | } |
| | | for (LocDetlAdjustParam.LocDetlAdjust adjust : param.getList()) { |
| | | if (Cools.isEmpty(adjust.getMatnr())) { |
| | | throw new CoolException(BaseRes.PARAM); |
| | | } |
| | | LocDetl sqlParam = new LocDetl(); |
| | | sqlParam.setLocNo(locMast.getLocNo()); |
| | | sqlParam.setMatnr(adjust.getMatNo()); |
| | | sqlParam.setMatnr(adjust.getMatnr()); |
| | | LocDetl one = locDetlService.selectOne(new EntityWrapper<>(sqlParam)); |
| | | // 保存新库存明细 |
| | | if (Cools.isEmpty(one)) { |
| | | MatCode matCode = matCodeService.selectById(adjust.getMatNo()); |
| | | if (adjust.getCount() == 0){ |
| | | continue; |
| | | } |
| | | MatCode matCode = matCodeService.selectById(adjust.getMatnr()); |
| | | LocDetl locDetl = new LocDetl(); |
| | | locDetl.setLocNo(locMast.getLocNo()); |
| | | locDetl.setMatnr(matCode.getMatNo()); |
| | |
| | | sqlParam1.setModiUser(userId); |
| | | if (!locDetlService.update(sqlParam1, new EntityWrapper<LocDetl>() |
| | | .eq("loc_no", locMast.getLocNo()) |
| | | .eq("matnr", adjust.getMatNo()))) { |
| | | .eq("matnr", adjust.getMatnr()))) { |
| | | throw new CoolException("修改库存明细失败"); |
| | | } |
| | | } |
| | |
| | | cols: [[ |
| | | {fixed: 'left', field: 'count', title: '实际数量', align: 'center', edit:'text', width: 120, style:'color: blue;font-weight: bold'} |
| | | ,{field: 'anfme', align: 'center',title: '数量'} |
| | | ,{field: 'locNo$', align: 'center',title: '库位号'} |
| | | ,{field: 'matnr', align: 'center',title: '物料'} |
| | | ,{field: 'lgnum', align: 'center',title: '仓库号'} |
| | | ,{field: 'tbnum', align: 'center',title: '转储请求编号'} |
| | |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | layer.msg(currLocNo + res.msg); |
| | | reset(); |
| | | init(currLocNo) |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | |
| | | layer.msg("请输入库位号"); |
| | | return; |
| | | } |
| | | init(locNo); |
| | | }); |
| | | |
| | | // 重置事件 |
| | | form.on('submit(reset)', function (data) { |
| | | reset(); |
| | | }); |
| | | |
| | | function init(locNo) { |
| | | http.post(baseUrl + "/locDetl/list/auth", {locNo: locNo,limit: 1000}, function (res) { |
| | | matCodeData = []; |
| | | let data = res.data.records; |
| | |
| | | locTips(true, locNo); |
| | | tableReload(); |
| | | }) |
| | | }); |
| | | |
| | | // 重置事件 |
| | | form.on('submit(reset)', function (data) { |
| | | reset(); |
| | | }); |
| | | } |
| | | |
| | | function reset() { |
| | | clearFormVal($('#search-box')); |
| | |
| | | count: initCountVal, |
| | | anfme: initAnfmeVal, |
| | | removeBtn: true, |
| | | matnr: data[i].matNo |
| | | matnr: data[i].matNo, |
| | | maktx: data[i].matName, |
| | | altme: data[i].str1, |
| | | }) |
| | | } |
| | | matCodeData.push.apply(matCodeData,applyData); |