| | |
| | | } |
| | | |
| | | } |
| | | ,yes: function(index, layero){ |
| | | //按钮【立即出库】的回调 |
| | | pakout(tableCache, index); |
| | | ,yes: function(layerIndex, layero){ |
| | | // 立即出库按钮点击 → 先请求下拉列表 |
| | | let loadIndex = layer.load(10); |
| | | $.ajax({ |
| | | url: baseUrl + "/getMesOrder/auth", // 你提供的接口 |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'POST', |
| | | success: function(res){ |
| | | layer.close(loadIndex); |
| | | if(res.code === 200){ |
| | | // 弹出二次确认框 |
| | | layer.open({ |
| | | type: 1, |
| | | title: '请选择组货单号', |
| | | area: ['400px','200px'], |
| | | content: $('#staBatchSelectDialog').html(), |
| | | success: function(layero2, index2){ |
| | | // 渲染下拉框 |
| | | let select = $(layero2).find('select[name="batchSta"]'); |
| | | res.data.forEach(item => { |
| | | select.append(`<option value="${item}">${item}</option>`); |
| | | }); |
| | | layui.form.render('select'); |
| | | |
| | | // 确认按钮 |
| | | form.on('submit(staBatchSelectConfirm)', function(obj){ |
| | | let selectedValue = obj.field.batchSta; |
| | | console.log(selectedValue) |
| | | layer.close(index2); |
| | | // 调用原来的出库函数,同时传下拉值 |
| | | pakout(tableCache, layerIndex, selectedValue); |
| | | return false; |
| | | }); |
| | | } |
| | | }); |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | ,btn2: function(index, layero){ |
| | | //按钮【稍后处理】的回调 |
| | | layer.close(index) |
| | |
| | | }) |
| | | } |
| | | |
| | | function pakout(tableCache, layerIndex) { |
| | | // let loadIndex = layer.load(2); |
| | | function pakout(tableCache, layerIndex, optionValue) { |
| | | // 可以把 optionValue 传给接口 |
| | | notice.msg('正在生成出库任务......', {icon: 4}); |
| | | $.ajax({ |
| | | url: baseUrl + "/out/pakout/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | contentType: 'application/json;charset=UTF-8', |
| | | data: JSON.stringify(tableCache), |
| | | data: JSON.stringify({tableCache,optionValue}), |
| | | method: 'POST', |
| | | success: function (res) { |
| | | notice.destroy(); |
| | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /* 删除订单 */ |
| | | function doDelSensor(obj) { |
| | | layer.confirm('确定要删除选中数据吗?', { |