| | |
| | | <option value="">请选择站点</option> |
| | | </select> |
| | | </div> |
| | | <button class="layui-btn layui-btn-sm" style="display: inline-block" id="btn-outbound" lay-event="outbound" |
| | | onclick="outbound()">启动出库 |
| | | </button> |
| | | <!-- <button class="layui-btn layui-btn-sm" style="display: inline-block" id="btn-outbound" lay-event="outbound"--> |
| | | <!-- onclick="outbound()">启动出库--> |
| | | <!-- </button>--> |
| | | </div> |
| | | <table class="layui-hide" id="stockOut" lay-filter="stockOut"></table> |
| | | </div> |
| | | |
| | | <script type="text/html" id="toolbar"> |
| | | <div class="layui-btn-container"> |
| | | <button class="layui-btn" id="btn-confirm" lay-event="outbound" style="">启动出库</button> |
| | | </div> |
| | | </script> |
| | | |
| | | <script type="text/template" id="takeSiteSelectTemplate"> |
| | | {{#each data}} |
| | |
| | | |
| | | function getCol() { |
| | | var cols = [ |
| | | {field: '', align: 'center', title: '', width: 50, type: 'numbers'} |
| | | , {field: 'locNo$', align: 'center', title: '库位号'} |
| | | , {field: 'matnr', align: 'center',title: '物料编码'} |
| | | {type: 'checkbox'} |
| | | ,{field: '', align: 'center', title: '', width: 50, type: 'numbers'} |
| | | ,{field: 'locNo$', align: 'center', title: '库位号'} |
| | | ,{field: 'matnr', align: 'center',title: '物料编码'} |
| | | ,{field: 'maktx', align: 'center',title: '物料名称', width: 500} |
| | | ,{field: 'lgnum', align: 'center',title: '规格'} |
| | | ,{field: 'type', align: 'center',title: '物料类别'} |
| | |
| | | limit: 9999, |
| | | limits: [9999], |
| | | even: true, |
| | | toolbar: '#toolbar', |
| | | // cellMinWidth: 50, |
| | | cols: [getCol()], |
| | | request: { |
| | |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } |
| | | locData = res.data; |
| | | // locData = res.data; |
| | | } |
| | | }); |
| | | |
| | |
| | | } |
| | | } |
| | | }); |
| | | |
| | | // 监听头工具栏事件 |
| | | table.on('toolbar(stockOut)', function (obj) { |
| | | var checkStatus = table.checkStatus(obj.config.id); |
| | | locData = checkStatus.data; |
| | | switch(obj.event) { |
| | | case 'outbound': |
| | | if (locData.length === 0){ |
| | | layer.msg("请选择数据"); |
| | | return; |
| | | } |
| | | debugger; |
| | | var staNo = $("#staNoSelect").val(); |
| | | if (staNo === "" || staNo === null){ |
| | | layer.msg("请选择出库口"); |
| | | return; |
| | | } |
| | | var locDetls = []; |
| | | locData.forEach(function(elem) { |
| | | if (elem.anfme > 0) { |
| | | locDetls.push({locNo: elem.locNo, matnr: elem.matnr, count: elem.anfme}); |
| | | } |
| | | }); |
| | | let param = { |
| | | outSite: staNo, |
| | | locDetls: locDetls, |
| | | fbillNo: orderData.fbillNo, |
| | | } |
| | | // 调用出库接口 |
| | | $.ajax({ |
| | | url: baseUrl+"/plate/outStock/start", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify(param), |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | parent.closeDetail(res.msg); |
| | | parent.tableReload(); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | }); |
| | | |
| | | /* 启动出库 */ |