| | |
| | | console.log(data); |
| | | Id = data.Id; |
| | | SoNo = data.SONo; |
| | | var orderType=data.Type//单据类型 |
| | | if (obj.event === 'delete') {//删除 |
| | | layer.confirm('确定删除此单据吗?', function(index) { |
| | | var param = { |
| | |
| | | }); |
| | | }else if(obj.event === 'outKu'){ |
| | | $("#UnstackWay option[value='0']").attr("selected","selected"); |
| | | $("#LoadingArea option[value='']").attr("selected","selected"); |
| | | $("#PickingArea option[value='']").attr("selected","selected"); |
| | | form.render('select'); |
| | | $("#UnstackWay").attr("disabled",false); |
| | | var param = { |
| | | soNo: SoNo |
| | | }; |
| | | // 判断是否需要拆箱,需要拆箱就需要选择出库口 |
| | | sendData(IP + "/BllSo/IsNeedUnpack", param, 'get', function(res) { |
| | | if (res.code == 0) { //成功 |
| | | if(res.data=="1"){ |
| | | isNeedUnpack='1' |
| | | $('.DivPickingArea2').show()//.attr("style", "display:block") |
| | | }else{ |
| | | isNeedUnpack='0' |
| | | $('.DivPickingArea2').hide()//.attr("style", "display:none") |
| | | } |
| | | if($('#UnstackWay').val()=='1'){ |
| | | $('.DivPickingArea2').show()//.attr("style", "display:block") |
| | | } |
| | | } else { //不成功 |
| | | layer.msg(res.msg, { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }, function() { |
| | | return; |
| | | }); |
| | | } |
| | | }); |
| | | layer.open({ |
| | | type: 1, |
| | | title: '确认出库口', |
| | | content: $('#divPickingArea'), |
| | | maxmin: true, |
| | | area: ['350px','285px'], |
| | | btn: ['确定', '取消'], |
| | | yes: function(index, layero) { |
| | | var pa = $('#PickingArea').val(); |
| | | console.log(pa) |
| | | if (isChongFu== true) { |
| | | isChongFu= false; |
| | | if(pa == null) |
| | | { |
| | | layer.msg("请勿重复点击", { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }); |
| | | return; |
| | | } |
| | | if($('#UnstackWay').val()=='0'){ |
| | | if($('#LoadingArea').val()==''){ |
| | | layer.msg("请选择装车口", { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }); |
| | | return; |
| | | } |
| | | if(isNeedUnpack=='1'){ |
| | | if(pa==''){ |
| | | layer.msg("请选择出库口", { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }); |
| | | return; |
| | | } |
| | | } |
| | | if(orderType=="0"){ |
| | | // 判断是否需要拆箱,需要拆箱就需要选择出库口 |
| | | sendData(IP + "/BllSo/IsNeedUnpack", param, 'get', function(res) { |
| | | if (res.code == 0) { //成功 |
| | | if(res.data=="1"){ |
| | | isNeedUnpack='1' |
| | | $('.DivPickingArea2').show() |
| | | }else{ |
| | | if(pa==''){ |
| | | layer.msg("请选择出库口", { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }); |
| | | return; |
| | | } |
| | | } |
| | | var param = { |
| | | soNo: data.SONo, |
| | | unstackingMode:$('#UnstackWay').val(), |
| | | outMode: pa, |
| | | loadingAddre:$('#LoadingArea').val() |
| | | }; |
| | | console.log(param); |
| | | sendData(IP + "/DownApi/IssueOutHouse", param, 'get', function(res) { |
| | | console.log(res); |
| | | if (res.code == 0) { //成功 |
| | | layer.msg(res.msg, { |
| | | icon: 1, |
| | | time: 3000 //1秒关闭(如果不配置,默认是3秒) |
| | | }, function() { |
| | | refreshTable(); |
| | | isChongFu= true; |
| | | }); |
| | | } else { //不成功 |
| | | layer.msg(res.msg, { |
| | | icon: 2, |
| | | time: 3000 //2秒关闭(如果不配置,默认是3秒) |
| | | }, function() { |
| | | refreshTable(); |
| | | isChongFu= true; |
| | | }); |
| | | } |
| | | layer.close(index); |
| | | }); |
| | | }else{ |
| | | layer.msg("请勿重复点击", { |
| | | isNeedUnpack='0' |
| | | $('.DivPickingArea2').hide() |
| | | } |
| | | if($('#UnstackWay').val()=='1'){ |
| | | $('.DivPickingArea2').show() |
| | | } |
| | | |
| | | form.render('select'); |
| | | outFunction() |
| | | } else { //不成功 |
| | | layer.msg(res.msg, { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }, function() { |
| | | return; |
| | | }); |
| | | } |
| | | |
| | | } |
| | | }); |
| | | }); |
| | | }else{ |
| | | $("#UnstackWay option[value='1']").attr("selected","selected"); |
| | | $("#UnstackWay").attr("disabled",true); |
| | | form.render('select'); |
| | | |
| | | $('.DivLoadingArea').hide() |
| | | |
| | | outFunction() |
| | | } |
| | | |
| | | |
| | | }else if(obj.event === 'xml'){//编辑 |
| | | layer.confirm('确定要将选中的单据上传吗?', function() { |
| | | if (isChongFu== true) { |
| | |
| | | } |
| | | }); |
| | | |
| | | //选择出库口弹窗方法 |
| | | function outFunction(){ |
| | | layer.open({ |
| | | type: 1, |
| | | title: '确认出库口', |
| | | content: $('#divPickingArea'), |
| | | maxmin: true, |
| | | area: ['350px','285px'], |
| | | btn: ['确定', '取消'], |
| | | yes: function(index, layero) { |
| | | var pa = $('#PickingArea').val(); |
| | | console.log(pa) |
| | | if (isChongFu== true) { |
| | | isChongFu= false; |
| | | if(pa == null) |
| | | { |
| | | layer.msg("请勿重复点击", { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }); |
| | | return; |
| | | } |
| | | if($('#UnstackWay').val()=='0'){ |
| | | if($('#LoadingArea').val()==''){ |
| | | layer.msg("请选择装车口", { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }); |
| | | return; |
| | | } |
| | | if(isNeedUnpack=='1'){ |
| | | if(pa==''){ |
| | | layer.msg("请选择出库口", { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }); |
| | | return; |
| | | } |
| | | } |
| | | }else{ |
| | | if(pa==''){ |
| | | layer.msg("请选择出库口", { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }); |
| | | return; |
| | | } |
| | | } |
| | | var param = { |
| | | soNo: data.SONo, |
| | | unstackingMode:$('#UnstackWay').val(), |
| | | outMode: pa, |
| | | loadingAddre:$('#LoadingArea').val() |
| | | }; |
| | | console.log(param); |
| | | sendData(IP + "/DownApi/IssueOutHouse", param, 'get', function(res) { |
| | | console.log(res); |
| | | if (res.code == 0) { //成功 |
| | | layer.msg(res.msg, { |
| | | icon: 1, |
| | | time: 3000 //1秒关闭(如果不配置,默认是3秒) |
| | | }, function() { |
| | | refreshTable(); |
| | | isChongFu= true; |
| | | }); |
| | | } else { //不成功 |
| | | layer.msg(res.msg, { |
| | | icon: 2, |
| | | time: 3000 //2秒关闭(如果不配置,默认是3秒) |
| | | }, function() { |
| | | refreshTable(); |
| | | isChongFu= true; |
| | | }); |
| | | } |
| | | layer.close(index); |
| | | }); |
| | | }else{ |
| | | layer.msg("请勿重复点击", { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }); |
| | | } |
| | | |
| | | } |
| | | }); |
| | | } |
| | | |
| | | table.on('tool(LAY-app-content-list2)', function(obj) { |
| | | var data = obj.data; |
| | | var id = data.Id; |