|
|
@ -1059,6 +1059,53 @@ |
|
|
} |
|
|
} |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
form.on('select()', function (data) { |
|
|
|
|
|
var id = data.elem.id; |
|
|
|
|
|
if(id.includes("place")){ |
|
|
|
|
|
|
|
|
|
|
|
}else if(id.includes("unit"){ |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
/*var mcode = $("#code" + id).val(); // 获取到当前输入的物料编码 |
|
|
|
|
|
var unit = $("#unit" + id).val(); |
|
|
|
|
|
if (mcode === "" || mcode === undefined || mcode === null) { |
|
|
|
|
|
layer.msg("请输入物料的正确编码!", {icon: 0, time: 500}, function () { |
|
|
|
|
|
$("#quantity" + id).val("") |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
else { |
|
|
|
|
|
let val = $("#quantity" + id).val(); |
|
|
|
|
|
if (val !== null && val !== undefined && val !== '') { |
|
|
|
|
|
var req = {}; |
|
|
|
|
|
req.mcode = mcode; |
|
|
|
|
|
req.quantity = val; |
|
|
|
|
|
req.unit = unit; |
|
|
|
|
|
req.placeId = $("#place"+id).val(); |
|
|
|
|
|
let loading2 = layer.open({type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); |
|
|
|
|
|
$.ajax({ |
|
|
|
|
|
url: "/material/MaterialQuantityIsTrue", |
|
|
|
|
|
type: "post", |
|
|
|
|
|
data: JSON.stringify(req), |
|
|
|
|
|
dataType: 'json', |
|
|
|
|
|
contentType: "application/json;charset=utf-8", |
|
|
|
|
|
success: function (res) { |
|
|
|
|
|
var flag = res.data; |
|
|
|
|
|
if (!flag) { // 如果当前数目不合适 |
|
|
|
|
|
layer.msg("当前单个仓库中物料数量不足", {icon: 0, time: 500}, function () { |
|
|
|
|
|
layer.close(loading2); |
|
|
|
|
|
$("#quantity" + id).val(""); |
|
|
|
|
|
}, |
|
|
|
|
|
); |
|
|
|
|
|
} else { |
|
|
|
|
|
layer.close(loading2) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
}*/ |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
}) |
|
|
</script> |
|
|
</script> |
|
|
|