| | |
| | | <option value="4">不合格品出库</option> |
| | | <option value="5">中间品出库</option> |
| | | <option value="6">代储出库</option> |
| | | <option value="7">其他出库</option> |
| | | <option value="7">其它出库</option> |
| | | <option value="8">寄存出库</option> |
| | | <!-- 09 --> |
| | | <!-- <option value="0">成品出库</option> |
| | |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">客户名称</label> |
| | | <label class="layui-form-label" id="CustomerNamep">客户名称</label> |
| | | <div class="layui-input-inline"> |
| | | <select name="CustomerNo" id="CustomerNo" lay-search> |
| | | <option value=""></option> |
| | |
| | | console.log(soNo); |
| | | console.log(id); |
| | | // getWareHouseList(); |
| | | getCustomerList(); |
| | | getLogisticsInfoList(); |
| | | getData(); |
| | | |
| | | getData();//获取入库单类型 |
| | | var arr = []; |
| | | window.success = function(data) { |
| | | refreshTable(data); |
| | |
| | | } |
| | | var DataList = []; |
| | | console.log(infoOptions.data); |
| | | var reg = /(^[1-9]([0-9]+)?(\.[0-9]{1,4})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/; |
| | | for (var i in infoOptions.data) { |
| | | var exQty = infoOptions.data[i].ExQty+""; |
| | | console.log(exQty); |
| | |
| | | return; |
| | | } |
| | | |
| | | if(exQty.indexOf('.')>=0){ |
| | | layer.msg("出库数量必须是大于0的整数", { |
| | | if (!reg.test(exQty)) { |
| | | layer.msg("出库数量必须大于0(可保留4位小数)", { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }, function() {}); |
| | | }); |
| | | isrun = 0; |
| | | return; |
| | | return ; |
| | | } |
| | | if(exQty.indexOf('-')>=0){ |
| | | layer.msg("出库数量必须是大于0的整数", { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }, function() {}); |
| | | isrun = 0; |
| | | return; |
| | | } |
| | | if(exQty.charAt(0)=='0'){ |
| | | layer.msg("出库数量必须是大于0的整数", { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }, function() {}); |
| | | isrun = 0; |
| | | return; |
| | | } |
| | | // if(exQty.indexOf('.')>=0){ |
| | | // layer.msg("出库数量必须是大于0的整数", { |
| | | // icon: 2, |
| | | // time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | // }, function() {}); |
| | | // isrun = 0; |
| | | // return; |
| | | // } |
| | | // if(exQty.indexOf('-')>=0){ |
| | | // layer.msg("出库数量必须是大于0的整数", { |
| | | // icon: 2, |
| | | // time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | // }, function() {}); |
| | | // isrun = 0; |
| | | // return; |
| | | // } |
| | | // if(exQty.charAt(0)=='0'){ |
| | | // layer.msg("出库数量必须是大于0的整数", { |
| | | // icon: 2, |
| | | // time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | // }, function() {}); |
| | | // isrun = 0; |
| | | // return; |
| | | // } |
| | | |
| | | if (exQty <= 0) { |
| | | layer.msg("出库数量必须大于0!", { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }, function() {}); |
| | | isrun = 0; |
| | | return; |
| | | } |
| | | // if (exQty <= 0) { |
| | | // layer.msg("出库数量必须大于0!", { |
| | | // icon: 2, |
| | | // time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | // }, function() {}); |
| | | // isrun = 0; |
| | | // return; |
| | | // } |
| | | if (exQty > infoOptions.data[i].Qty) { |
| | | layer.msg("出库数量不能大于库存数量!", { |
| | | icon: 2, |
| | |
| | | var item = { |
| | | SkuNo: infoOptions.data[i].SkuNo, |
| | | LotNo: infoOptions.data[i].LotNo, |
| | | Qty: parseInt(exQty), |
| | | Qty: parseFloat(exQty), |
| | | IsBale:infoOptions.data[i].IsBale, |
| | | IsBelt:infoOptions.data[i].IsBelt, |
| | | }; |
| | |
| | | if(res.code == 0){ |
| | | console.log(res.data); |
| | | $("#Type option[value='"+ res.data.Type+"']").attr("selected", "selected") |
| | | $("#CustomerNo option[value='"+ res.data.CustomerNo+"']").attr("selected", "selected") |
| | | $("#LogisticsId option[value='"+ res.data.LogisticsId+"']").attr("selected", "selected") |
| | | |
| | | |
| | | |
| | | form.render('select'); |
| | | refreshTable(res.data.Detail); |
| | | |
| | | //获取客户/货主 |
| | | getCustomerList(res.data.CustomerNo); |
| | | //获取供应商 |
| | | getLogisticsInfoList(res.data.LogisticsId); |
| | | } |
| | | else{ |
| | | layer.msg(res.msg, { |
| | |
| | | // }); |
| | | // } |
| | | //获取客户下拉框信息 |
| | | function getCustomerList() { |
| | | function getCustomerList(customerNo) { |
| | | sendData(IP + "/Basis/GetCustomerSelect", {}, 'get', function(res) { |
| | | if (res.code == 0) { //成功 |
| | | var TypeNum = 0; |
| | | |
| | | switch($("#Type").val()) |
| | | { |
| | | case "0": //成品出库 |
| | | TypeNum = 0; |
| | | console.log(TypeNum) |
| | | break; |
| | | case "1": //领料出库 |
| | | case "2": //抽检出库 |
| | | case "3": //物料取样出库 |
| | | case "4": //不合格品出库 |
| | | case "5": //中间品出库 |
| | | case "6": //代储出库 |
| | | case "7": //其他出库 |
| | | case "8": //寄存出库 |
| | | TypeNum = 2; |
| | | console.log('TypeNum:'+ TypeNum) |
| | | break; |
| | | } |
| | | $("#CustomerNo").empty(); |
| | | $("#CustomerNo").append('<option value =""></option>'); |
| | | for (var i = 0; i < res.data.length; i++) { |
| | | var TypeNum = 0; |
| | | |
| | | switch($("#Type").val()) |
| | | { |
| | | case "0": //成品出库 |
| | | TypeNum = 0; |
| | | console.log(TypeNum) |
| | | break; |
| | | case "1": //领料出库 |
| | | case "2": //抽检出库 |
| | | case "3": //物料取样出库 |
| | | case "4": //不合格品出库 |
| | | case "5": //中间品出库 |
| | | case "6": //代储出库 |
| | | case "7": //其他出库 |
| | | case "8": //寄存出库 |
| | | TypeNum = 2; |
| | | console.log(TypeNum) |
| | | break; |
| | | } |
| | | for (var i = 0; i < res.data.length; i++) { |
| | | //判断单据类型 |
| | | if (TypeNum == 0) |
| | | { |
| | |
| | | } |
| | | } |
| | | } |
| | | $("#CustomerNo option[value='"+ customerNo +"']").attr("selected", "selected") |
| | | form.render('select'); |
| | | } else { //不成功 |
| | | layer.msg(res.msg, { |
| | |
| | | }); |
| | | } |
| | | //获取物流承运商下拉框信息 |
| | | function getLogisticsInfoList() { |
| | | function getLogisticsInfoList(logisticsId) { |
| | | sendData(IP + "/Basis/GetLogisticsInfoSelect", {}, 'get', function(res) { |
| | | if (res.code == 0) { //成功 |
| | | $("#LogisticsId").empty(); |
| | |
| | | $("#LogisticsId").append('<option value =' + res.data[i].Id + '>' + |
| | | res.data[i].CarrierName + '</option>'); |
| | | } |
| | | $("#LogisticsId option[value='"+logisticsId +"']").attr("selected", "selected") |
| | | form.render('select'); |
| | | } else { //不成功 |
| | | layer.msg(res.msg, { |