| | |
| | | /*组托 |
| | | * |
| | | * */ |
| | | @RequestMapping(value = "/barcodeMatnr/add1/auth") |
| | | @RequestMapping(value = "/barcodeMatnr/comb/auth") |
| | | @ManagerAuth |
| | | public R comb(WaitPakin waitPakin) { |
| | | Mat mat = matService.selectById(waitPakin.getModiUser()); |
| | |
| | | /*并板 |
| | | * |
| | | * */ |
| | | @RequestMapping(value = "/barcodeMatnr/add2/auth") |
| | | // @RequestMapping(value = "/barcodeMatnr/clamp/auth") |
| | | @ManagerAuth |
| | | public R clamp(WaitPakin waitPakin) { |
| | | if (Cools.isEmpty(waitPakin.getBarcode())||Cools.isEmpty(waitPakin.getModiUser())||Cools.isEmpty(waitPakin.getAnfme())){ |
| | | if (Cools.isEmpty(waitPakin.getBarcode())||Cools.isEmpty(waitPakin.getModiUser())){ |
| | | return R.error(BaseRes.PARAM); |
| | | } |
| | | Mat mat = matService.selectById(waitPakin.getModiUser()); |
| | |
| | | mobileService.adjustNew(combParam, Boolean.TRUE, getUserId()); |
| | | return R.ok("并板成功"); |
| | | } |
| | | |
| | | /*批量并板*/ |
| | | @RequestMapping(value = "/barcodeMatnr/clamp/auth") |
| | | @ManagerAuth |
| | | public R clamp2(@RequestBody List<MatBarcode> list){ |
| | | if (Cools.isEmpty(list)){ |
| | | return R.error(BaseRes.PARAM); |
| | | } |
| | | for (MatBarcode matBarcode : list) { |
| | | MobileAdjustParam combParam=new MobileAdjustParam(); |
| | | ArrayList<CombParam.CombMat> combMats=new ArrayList<>(); |
| | | CombParam.CombMat combMat=new CombParam.CombMat(); |
| | | combMat.setMatnr(matBarcode.getMatnr()); |
| | | combMat.setMaktx(matBarcode.getMaktx()); |
| | | combMat.setAnfme(1.0); |
| | | combMats.add(combMat); |
| | | combParam.setBarcode(matBarcode.getZpallet()); |
| | | combParam.setCombMats(combMats); |
| | | mobileService.adjustNew(combParam, Boolean.TRUE, getUserId()); |
| | | } |
| | | return R.ok("并板成功"); |
| | | } |
| | | } |
| | |
| | | }); |
| | | } |
| | | break; |
| | | // case 'clampData': |
| | | // layer.open({ |
| | | // type: 2, |
| | | // title: '并板', |
| | | // maxmin: true, |
| | | // area: [top.detailWidth, top.detailHeight], |
| | | // content: 'barcodeMatnr_clamp.html', |
| | | // success: function(layero, index){ |
| | | // layer.getChildFrame('#data-detail-submit-edit', index).hide(); |
| | | // clearFormVal(layer.getChildFrame('#detail', index)); |
| | | // layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"}); |
| | | // } |
| | | // }); |
| | | // break; |
| | | case 'clampData': |
| | | layer.open({ |
| | | type: 2, |
| | | title: '并板', |
| | | maxmin: true, |
| | | area: [top.detailWidth, top.detailHeight], |
| | | content: 'barcodeMatnr_clamp.html', |
| | | success: function(layero, index){ |
| | | layer.getChildFrame('#data-detail-submit-edit', index).hide(); |
| | | clearFormVal(layer.getChildFrame('#detail', index)); |
| | | layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"}); |
| | | if (checkStatus.data.length === 0){ |
| | | layer.msg('请至少选择一条数据', {icon: 2}); |
| | | } else { |
| | | layer.confirm('确定并板吗', function(){ |
| | | $.ajax({ |
| | | url: baseUrl+"/barcodeMatnr/clamp/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify(checkStatus.data), |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | traditional:true, |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | layer.closeAll(); |
| | | tableReload(false); |
| | | layer.msg(res.msg, {icon: 1}) |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}) |
| | | } |
| | | } |
| | | }) |
| | | }); |
| | | } |
| | | break; |
| | | case 'exportData': |
| | | layer.confirm('确定导出Excel吗', {shadeClose: true}, function(){ |
| | |
| | | method("add"); |
| | | }); |
| | | |
| | | form.on('submit(save1)', function () { |
| | | form.on('submit(comb)', function () { |
| | | if (banMsg != null){ |
| | | layer.msg(banMsg); |
| | | return; |
| | | } |
| | | method("add1"); |
| | | method("comb"); |
| | | }); |
| | | |
| | | form.on('submit(save2)', function () { |
| | | form.on('submit(clamp)', function () { |
| | | if (banMsg != null){ |
| | | layer.msg(banMsg); |
| | | return; |
| | | } |
| | | method("add2"); |
| | | method("clamp"); |
| | | }); |
| | | |
| | | // 数据修改动作 |
| | |
| | | // var html = "<img src='http://127.0.0.1:8080/czkhasrs/previewImage?maktx=" +row.maktx+"'/>"; |
| | | // return html; |
| | | // }} |
| | | ,{fixed: 'right', align: 'center', title: '简图', templet: function(row){ |
| | | var html = "<a href='http://127.0.0.1:8080/czkhasrs/previewImage?maktx=" + row.maktx + "' target='_blank' rel='noopener noreferrer'>查看简图</a>"; |
| | | return html; |
| | | }} |
| | | |
| | | |
| | | |
| | | // ,{fixed: 'right', align: 'center', title: '简图', templet: function(row){ |
| | | // var html = "<a href='http://127.0.0.1:8080/czkhasrs/previewImage?maktx=" + row.maktx + "' target='_blank' rel='noopener noreferrer'>查看简图</a>"; |
| | | // return html; |
| | | // }} |
| | | |
| | | |
| | | ,{field: 'units', align: 'center',title: '单位量', hide: true} |
| | | ,{field: 'barcode', align: 'center',title: '条码', hide: true} |
| | | ,{field: 'origin', align: 'center',title: '产地', hide: true} |
| | |
| | | } |
| | | break; |
| | | // 查看简图 |
| | | case 'showPic': |
| | | let imgHtml = '<div style="height:100%;display: flex;justify-content: space-around;align-items: center;flex-wrap: wrap;">'; |
| | | $.ajax({ |
| | | url: baseUrl+"/previewImage", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: { |
| | | maktx: data.maktx |
| | | }, |
| | | method: 'GET', |
| | | traditional:true, |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | res.data.forEach((item) => { |
| | | let maktx = item.maktx; |
| | | let pics = item.pics; |
| | | pics.forEach((pic) => { |
| | | let tmp = '<div><div><img width="600" src="' + pic + '" /></div><div>' + maktx + '</div></div>'; |
| | | imgHtml += tmp; |
| | | }) |
| | | }) |
| | | imgHtml += "</div>"; |
| | | |
| | | layer.open({ |
| | | type: 1, |
| | | title: '查看简图', |
| | | area: [top.detailWidth, top.detailHeight], |
| | | shadeClose: true, |
| | | content: imgHtml, |
| | | success: function(layero, index){ |
| | | } |
| | | }); |
| | | |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }); |
| | | console.log(imgHtml) |
| | | break; |
| | | // case 'showPic': |
| | | // let imgHtml = '<div style="height:100%;display: flex;justify-content: space-around;align-items: center;flex-wrap: wrap;">'; |
| | | // $.ajax({ |
| | | // url: baseUrl+"/previewImage", |
| | | // headers: {'token': localStorage.getItem('token')}, |
| | | // data: { |
| | | // maktx: data.maktx |
| | | // }, |
| | | // method: 'GET', |
| | | // traditional:true, |
| | | // success: function (res) { |
| | | // if (res.code === 200){ |
| | | // res.data.forEach((item) => { |
| | | // let maktx = item.maktx; |
| | | // let pics = item.pics; |
| | | // pics.forEach((pic) => { |
| | | // let tmp = '<div><div><img width="600" src="' + pic + '" /></div><div>' + maktx + '</div></div>'; |
| | | // imgHtml += tmp; |
| | | // }) |
| | | // }) |
| | | // imgHtml += "</div>"; |
| | | // |
| | | // layer.open({ |
| | | // type: 1, |
| | | // title: '查看简图', |
| | | // area: [top.detailWidth, top.detailHeight], |
| | | // shadeClose: true, |
| | | // content: imgHtml, |
| | | // success: function(layero, index){ |
| | | // } |
| | | // }); |
| | | // |
| | | // } else if (res.code === 403){ |
| | | // top.location.href = baseUrl+"/"; |
| | | // } else { |
| | | // layer.msg(res.msg) |
| | | // } |
| | | // } |
| | | // }); |
| | | // console.log(imgHtml) |
| | | // break; |
| | | |
| | | } |
| | | }); |
| | |
| | | <hr class="layui-bg-gray"> |
| | | |
| | | <div id="data-detail-btn" class="layui-btn-container layui-form-item"> |
| | | <div id="data-detail-submit-save" type="button" class="layui-btn layui-btn-normal" lay-submit lay-filter="save2">保存</div> |
| | | <div id="data-detail-submit-save" type="button" class="layui-btn layui-btn-normal" lay-submit lay-filter="clamp">保存</div> |
| | | <div id="data-detail-submit-edit" type="button" class="layui-btn layui-btn-normal" lay-submit lay-filter="edit">修改</div> |
| | | <div id="data-detail-close" type="button" class="layui-btn" lay-submit lay-filter="close">关闭</div> |
| | | </div> |
| | |
| | | <hr class="layui-bg-gray"> |
| | | |
| | | <div id="data-detail-btn" class="layui-btn-container layui-form-item"> |
| | | <div id="data-detail-submit-save" type="button" class="layui-btn layui-btn-normal" lay-submit lay-filter="save1">保存</div> |
| | | <div id="data-detail-submit-save" type="button" class="layui-btn layui-btn-normal" lay-submit lay-filter="comb">保存</div> |
| | | <div id="data-detail-submit-edit" type="button" class="layui-btn layui-btn-normal" lay-submit lay-filter="edit">修改</div> |
| | | <div id="data-detail-close" type="button" class="layui-btn" lay-submit lay-filter="close">关闭</div> |
| | | </div> |
| | |
| | | <script type="text/html" id="operate"> |
| | | <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">详情</a> |
| | | </script> |
| | | <script type="text/html" id="operate1"> |
| | | <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="showPic" >查看简图</a> |
| | | </script> |
| | | <!--<script type="text/html" id="operate1">--> |
| | | <!-- <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="showPic" >查看简图</a>--> |
| | | <!--</script>--> |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | |
| | | <button class="layui-btn layui-btn-sm" id="btn-print-batch" lay-event="btnPrintBatch">批量打印</button> |
| | | <button class="layui-btn layui-btn-sm layui-btn-normal" id="btn-add" lay-event="addData">新增</button> |
| | | <button class="layui-btn layui-btn-sm layui-btn-danger" id="btn-delete" lay-event="deleteData">删除</button> |
| | | <button class="layui-btn layui-btn-sm layui-btn-danger"><a onclick="importImage()" style="font-size: 15px"><i class="layui-icon layui-icon-upload"></i>上传简图</a></button> |
| | | <li style="display: none"><input id="importImage" type="file" onchange="uploadImage(this)" ></li> |
| | | <!-- <button class="layui-btn layui-btn-sm layui-btn-danger"><a onclick="importImage()" style="font-size: 15px"><i class="layui-icon layui-icon-upload"></i>上传简图</a></button>--> |
| | | <!-- <li style="display: none"><input id="importImage" type="file" onchange="uploadImage(this)" ></li>--> |
| | | <!-- 商品/物料 数据中心 --> |
| | | <div class="dropdown-menu" style="float: right"> |
| | | <button class="layui-btn layui-btn-primary layui-border-black icon-btn layui-btn-sm"> 数据同步 <i class="layui-icon layui-icon-drop"></i></button> |