| | |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | pageCurr=curr; |
| | | tableX.merges('custOrder', [1, 11]); |
| | | limit(); |
| | | form.on('checkbox(tableCheckbox)', function (data) { |
| | | var _index = $(data.elem).attr('table-index')||0; |
| | |
| | | ,title: false |
| | | ,closeBtn: false |
| | | ,offset: '100px' |
| | | ,area: '300px;' |
| | | // ,area: ['800px','450px'] |
| | | ,area: '1000px' |
| | | ,shade: 0.5 |
| | | ,shadeClose: true |
| | | ,id: 'LAY_layuipro' |
| | | ,btn: ['马上拣货', '稍后处理'] |
| | | ,btn: ['立即生成', '稍后处理'] |
| | | ,btnAlign: 'c' |
| | | ,moveType: 1 //拖拽模式,0或者1 |
| | | ,content: '<div style="padding: 50px; line-height: 22px; background-color: #393D49; color: #fff; font-weight: 300;">你知道吗?亲!<br>layer ≠ layui<br><br>layer只是作为Layui的一个弹层模块,由于其用户基数较大,所以常常会有人以为layui是layerui<br><br>layer虽然已被 Layui 收编为内置的弹层模块,但仍然会作为一个独立组件全力维护、升级。<br><br>我们此后的征途是星辰大海 ^_^</div>' |
| | | ,success: function(layero){ |
| | | var btn = layero.find('.layui-layer-btn'); |
| | | btn.find('.layui-layer-btn0').attr({ |
| | | href: 'http://www.layui.com/' |
| | | ,target: '_blank' |
| | | ,content: $('#stoukOutPreview') |
| | | ,success: function(layero, index){ |
| | | table.render({ |
| | | elem: '#stoPreTab', |
| | | data: res.data, |
| | | page: true, |
| | | cellMinWidth: 100, |
| | | // ,width: admin.screen() > 1 ? 892 : '' |
| | | height: 432, |
| | | cols: [[ |
| | | {field: 'title', title: '商品', align: 'center'}, |
| | | {field: 'anfme', title: '总数量', align: 'center', style: 'font-weight: bold', width: 90}, |
| | | {field: 'type', title: '仓库', align: 'center', templet: '#typeTpl', width: 90}, |
| | | {field: 'locNo', title: '货位', align: 'center'}, |
| | | {field: 'prior$', title: '推荐货位', align: 'center', width: 100}, |
| | | {field: 'reduce', title: '数量', align: 'center', width: 90, style: 'font-weight: bold'}, |
| | | // {field: 'remQty', title: '余量', align: 'center', width: 80}, |
| | | {field: 'total', title: '总量', align: 'center', width: 90}, |
| | | ]], |
| | | done: function () { |
| | | tableX.merges('stoPreTab', [0,1,2]); |
| | | $('.layui-table-body.layui-table-main').css("overflow", "auto") |
| | | } |
| | | }); |
| | | |
| | | } |
| | | ,yes: function(index, layero){ |
| | | //按钮【马上拣货】的回调 |
| | | stockOut(data.number); |
| | | } |
| | | ,btn2: function(index, layero){ |
| | | //按钮【稍后处理】的回调 |
| | | //return false 开启该代码可禁止点击该按钮关闭 |
| | | } |
| | | }); |
| | | // 缺料 |
| | |
| | | , area: ['400px'] |
| | | , btn: ['库存调拨', '取消'] |
| | | }, function() { |
| | | // todo 库存调拨 |
| | | // 库存调拨 |
| | | stockTransfer(data.number); |
| | | layer.closeAll(); |
| | | }, function() { |
| | | // printPakouts(data.number); |
| | |
| | | } |
| | | } |
| | | }) |
| | | |
| | | |
| | | // layer.confirm(data.number + ' 订单开始拣货?', {shadeClose: true}, function(){ |
| | | // layer.closeAll(); |
| | | // $.ajax({ |
| | | // url: baseUrl+"/work/stock/out", |
| | | // headers: {'token': localStorage.getItem('token')}, |
| | | // contentType:'application/json;charset=UTF-8', |
| | | // data: JSON.stringify({ |
| | | // number: data.number |
| | | // }), |
| | | // method: 'POST', |
| | | // success: function (res) { |
| | | // // 成功 |
| | | // if (res.code === 200){ |
| | | // layer.confirm(res.msg, { |
| | | // shadeClose: true |
| | | // , btn: ['打印拣货单'] |
| | | // }, function() { |
| | | // layer.closeAll(); |
| | | // printPakouts(data.number); |
| | | // } |
| | | // ) |
| | | // // 缺料 |
| | | // } else if (res.code === 20001) { |
| | | // layer.confirm(res.msg, { |
| | | // shadeClose: true |
| | | // , btn: ['库存调拨', '取消'] |
| | | // }, function() { |
| | | // // todo 库存调拨 |
| | | // layer.closeAll(); |
| | | // }, function() { |
| | | // // printPakouts(data.number); |
| | | // layer.closeAll(); |
| | | // } |
| | | // ) |
| | | // } else if (res.code === 403){ |
| | | // top.location.href = baseUrl+"/"; |
| | | // } else { |
| | | // layer.msg(res.msg) |
| | | // } |
| | | // $(".layui-laypage-btn")[0].click(); |
| | | // } |
| | | // }) |
| | | // }); |
| | | break; |
| | | // 打印 |
| | | case 'print': |
| | |
| | | |
| | | } |
| | | }); |
| | | |
| | | // 开始拣货 |
| | | function stockOut(number) { |
| | | // layer.confirm(number + ' 订单开始拣货?', {shadeClose: true}, function(){ |
| | | layer.closeAll(); |
| | | $.ajax({ |
| | | url: baseUrl+"/work/stock/out", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | contentType:'application/json;charset=UTF-8', |
| | | data: JSON.stringify({ |
| | | number: number |
| | | }), |
| | | method: 'POST', |
| | | success: function (res) { |
| | | // 成功 |
| | | if (res.code === 200){ |
| | | layer.confirm(res.msg, { |
| | | shadeClose: true |
| | | , btn: ['打印拣货单'] |
| | | }, function() { |
| | | layer.closeAll(); |
| | | printPakouts(number); |
| | | } |
| | | ) |
| | | // 缺料 |
| | | } else if (res.code === 20001) { |
| | | layer.confirm(res.msg, { |
| | | shadeClose: true |
| | | , btn: ['库存调拨', '取消'] |
| | | }, function() { |
| | | // 库存调拨 |
| | | layer.closeAll(); |
| | | }, function() { |
| | | alert(number) |
| | | layer.closeAll(); |
| | | } |
| | | ) |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | $(".layui-laypage-btn")[0].click(); |
| | | } |
| | | }) |
| | | // }); |
| | | } |
| | | |
| | | // 库存调拨 |
| | | function stockTransfer(number) { |
| | | |
| | | $.ajax({ |
| | | url: baseUrl + "/work/stock/transfer", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: { |
| | | number: number |
| | | }, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | layer.msg(res.msg, {icon: 1}) |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}) |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | // 打印拣货单 |
| | | function printPakouts(docNumber) { |
| | |
| | | page: { |
| | | curr: pageCurr |
| | | }, |
| | | done: function (res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | pageCurr=curr; |
| | | if (res.data.length === 0 && count !== 0) { |
| | | tableIns.reload({ |
| | | where: searchData, |
| | | page: { |
| | | curr: pageCurr-1 |
| | | } |
| | | }); |
| | | pageCurr -= 1; |
| | | } |
| | | limit(child); |
| | | } |
| | | // done: function (res, curr, count) { |
| | | // if (res.code === 403) { |
| | | // top.location.href = baseUrl+"/"; |
| | | // } |
| | | // pageCurr=curr; |
| | | // if (res.data.length === 0 && count !== 0) { |
| | | // tableIns.reload({ |
| | | // where: searchData, |
| | | // page: { |
| | | // curr: pageCurr-1 |
| | | // } |
| | | // }); |
| | | // pageCurr -= 1; |
| | | // } |
| | | // limit(child); |
| | | // } |
| | | }); |
| | | } |
| | | |