You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
80 lines
2.3 KiB
80 lines
2.3 KiB
<#import "../master.ftl" as master>
|
|
<@master.layout>
|
|
|
|
<div class="page-header">
|
|
<h3>Receive by Normal Box</h3>
|
|
</div>
|
|
|
|
<div class="row" id="app">
|
|
<div class="col-md-4">
|
|
|
|
<p><input id="locationNo" name="locationNo" type="text" class="form-control" style="text-transform:uppercase;" placeholder="Please scan location no" /></p>
|
|
<p><input id="boxNo" name="boxNo" type="text" class="form-control" style="text-transform:uppercase;" placeholder="Scaning Box No" /></p>
|
|
<table id="tblInfo" class="table">
|
|
</table>
|
|
</div>
|
|
<div class="col-md-1">
|
|
<p><button class="btn btn-default" id="btnFinishBox" onclick="">Receive</button></p>
|
|
</div>
|
|
<div class="col-md-2" style="margin-top:10px">
|
|
<p style="font-size:14px">Receive Qty this Time<span id = "boxQty" style="color:#00f"></span></p>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
var boxQty=0
|
|
$(function(){
|
|
$("#locationNo").focus()
|
|
|
|
boxQty=0
|
|
$("#boxQty").html(" : "+boxQty)
|
|
});
|
|
|
|
$("#locationNo").on("keydown", function(){
|
|
if (event.keyCode === 13) {
|
|
$(this).val($(this).val().trim().toUpperCase());
|
|
if ($(this).val() == '') {
|
|
alert("The scanned location is wrong !");
|
|
return false
|
|
}
|
|
$("#boxNo").focus()
|
|
}
|
|
|
|
})
|
|
|
|
|
|
$("#boxNo").on("keydown", function(){
|
|
if (event.keyCode === 13) {
|
|
let boxNo=$("#boxNo").val().toUpperCase()
|
|
let locationNo=$("#locationNo").val().toUpperCase()
|
|
if (boxNo == '') {
|
|
alert("The scanned Box No is wrong !");
|
|
return false
|
|
}
|
|
if ($("#locationNo").val() == '') {
|
|
alert("The scanned location is wrong !");
|
|
return false
|
|
}
|
|
$.post("/receive/stockBox", {boxNo:boxNo , locationNo:locationNo } , function(data){
|
|
|
|
if (data.success){
|
|
|
|
$("#tblInfo").append("<p>" + boxNo + "</a> => Received</p>");
|
|
boxQty=Number(boxQty)+1
|
|
$("#boxQty").html(" : "+boxQty)
|
|
$("#boxNo").val("").focus();
|
|
}else{
|
|
$("#tblInfo").append("<p>"+ boxNo + " <span style='color:red'>" + data.errorMsg+"</span></p>");
|
|
$("#boxNo").val("").focus();
|
|
}
|
|
});
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
</script>
|
|
|
|
</@master.layout>
|
|
|