6 changed files with 461 additions and 0 deletions
-
8src/main/java/com/heai/modules/app/controller/PageController.java
-
6src/main/java/com/heai/modules/app/controller/PdaOrderController.java
-
2src/main/java/com/heai/modules/app/service/InventoryStockService.java
-
7src/main/java/com/heai/modules/app/service/impl/InventoryStockServiceImpl.java
-
247src/main/resources/static/js/pdaOther/stockOtherOut.js
-
191src/main/resources/templates/pdaOther/stockOtherOut.ftl
@ -0,0 +1,247 @@ |
|||||
|
var userId = $("#current_id").val(); |
||||
|
var userName = $("#current_username").val(); |
||||
|
var site = $("#current_site").val(); |
||||
|
|
||||
|
var titleName = $("#current_titleName").val(); |
||||
|
|
||||
|
var currentData = null; |
||||
|
|
||||
|
|
||||
|
|
||||
|
var wareHouseId = ''; |
||||
|
|
||||
|
var partNoData = null; |
||||
|
|
||||
|
var inventoryData = null; |
||||
|
|
||||
|
var tableList = new Array(); |
||||
|
|
||||
|
//页面初始化
|
||||
|
$(function(){ |
||||
|
if(titleName != null && titleName != ""){ |
||||
|
$("#titleName").text(titleName); |
||||
|
}else { |
||||
|
window.location.href="/login"; |
||||
|
} |
||||
|
$("#remark").val("库存报废") |
||||
|
|
||||
|
$("#partNo_search").focus(); |
||||
|
|
||||
|
}); |
||||
|
|
||||
|
|
||||
|
|
||||
|
function changeTableList(){ |
||||
|
var qtyOut = $("#qtyOut").val(); |
||||
|
var tableData = { |
||||
|
site: inventoryData.site, |
||||
|
partNo : inventoryData.partNo, |
||||
|
qtyOut : qtyOut, |
||||
|
batchNo : inventoryData.batchNo, |
||||
|
locationId : inventoryData.locationId, |
||||
|
warehouseId : inventoryData.warehouseId, |
||||
|
} |
||||
|
tableList.push(tableData); |
||||
|
changeTable(); |
||||
|
} |
||||
|
|
||||
|
function changeTable(){ |
||||
|
var str = ''; |
||||
|
if(tableList.length > 0){ |
||||
|
$("#wareHouse").val(tableList[0].warehouseId + "-" + tableList[0].wareHouseName); |
||||
|
} |
||||
|
for (let i = 0; i < tableList.length; i++) { |
||||
|
str += '<tr id = '+tableList[i].partNo +'>' + |
||||
|
'<th class="" style="text-align:center;background-color: #ffff;width: 15%;">' + |
||||
|
'<span>'+tableList[i].partNo+'</span></th>' + |
||||
|
'<th class="" style="text-align:center;background-color: #ffff;width: 10%;">' + |
||||
|
'<span>'+tableList[i].qtyOut+'</span></th>' + |
||||
|
'<th class="" style="text-align:center;background-color: #ffff;width: 15%;">' + |
||||
|
'<span>'+tableList[i].batchNo+'</span></th>' + |
||||
|
'<th class="" style="text-align:center;background-color: #ffff;width: 15%;">' + |
||||
|
'<span>'+tableList[i].locationId+'</span></th>'+ |
||||
|
'</tr>'; |
||||
|
} |
||||
|
$("#issue_table").html("").append(str); |
||||
|
$("#issue_cancel").click(); |
||||
|
} |
||||
|
|
||||
|
$("#partNo_search").bind("keydown",function(event){ |
||||
|
if (event.keyCode == 13) { |
||||
|
queryPart(); |
||||
|
} |
||||
|
}); |
||||
|
|
||||
|
function queryPart(){ |
||||
|
var partNoSearch = $("#partNo_search").val(); |
||||
|
if(partNoSearch == null || partNoSearch === ""){ |
||||
|
layer.msg("请扫描物料标签!"); |
||||
|
return false |
||||
|
} |
||||
|
var strList = partNoSearch.split("|"); |
||||
|
partNoData = { |
||||
|
site : '', |
||||
|
partNo : '', |
||||
|
wareHouseId : '', |
||||
|
batchNo: '', |
||||
|
locationId : '', |
||||
|
} |
||||
|
if(strList.length < 5){ |
||||
|
layer.msg("物料标签错误!"); |
||||
|
return false |
||||
|
} |
||||
|
for (let i = 0; i < strList.length; i++) { |
||||
|
if(i == 0){ |
||||
|
partNoData.site = strList[i]; |
||||
|
}else if(i == 1){ |
||||
|
partNoData.partNo = strList[i]; |
||||
|
}else if(i == 2){ |
||||
|
partNoData.wareHouseId = strList[i]; |
||||
|
}else if(i == 3){ |
||||
|
partNoData.batchNo = strList[i]; |
||||
|
}else if(i == 4){ |
||||
|
partNoData.locationId = strList[i]; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
getInventoryData() |
||||
|
} |
||||
|
|
||||
|
function getInventoryData(){ |
||||
|
var wareHouse = $("#wareHouse").val(); |
||||
|
if(wareHouse != null && wareHouse != ""){ |
||||
|
if(tableList.length > 0 && tableList[0].warehouseId != partNoData.wareHouseId){ |
||||
|
layer.msg("仓库编码错误!"); |
||||
|
return false |
||||
|
} |
||||
|
} |
||||
|
var jsonData = { |
||||
|
site : partNoData.site, |
||||
|
warehouseId : partNoData.wareHouseId, |
||||
|
batchNo : partNoData.batchNo, |
||||
|
locationId : partNoData.locationId, |
||||
|
partNo : partNoData.partNo, |
||||
|
} |
||||
|
$.ajax({ |
||||
|
url: "/pdaOrder/getInventoryStockDataForOut", |
||||
|
contentType: 'application/json', |
||||
|
type:"POST", |
||||
|
data:JSON.stringify(jsonData),//你的formid
|
||||
|
dataType:"JSON", |
||||
|
async: true, |
||||
|
beforeSend: function(request) { |
||||
|
request.setRequestHeader("token", $.cookie("token")); |
||||
|
}, |
||||
|
success: function (data) { |
||||
|
if(data.code == 0){ |
||||
|
var row = data.row; |
||||
|
if(row != null && row.site != null){ |
||||
|
inventoryData = row; |
||||
|
wareHouseId = row.warehouseId; |
||||
|
initIssueModel(); |
||||
|
}else { |
||||
|
layer.msg("仓库无此物料信息!"); |
||||
|
} |
||||
|
}else { |
||||
|
layer.confirm(data.msg, { |
||||
|
btn: ['确定'] |
||||
|
}, function (index) { |
||||
|
layer.close(index); |
||||
|
}); |
||||
|
} |
||||
|
}, |
||||
|
error: function(data) { |
||||
|
var responseText = data.responseText; |
||||
|
var json_str = JSON.parse(responseText); |
||||
|
var status = json_str.status; |
||||
|
var message = json_str.message; |
||||
|
//判断是否是session超时
|
||||
|
if(403==status){ |
||||
|
layer.alert(message,function(){ |
||||
|
window.location.href="/login"; |
||||
|
}); |
||||
|
} |
||||
|
layer.closeAll('loading'); |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
function initIssueModel(){ |
||||
|
$("#qtyOut").val(inventoryData.qtyOnHand); |
||||
|
if(inventoryData.weightFactor!='-1'&&inventoryData.weightFactor!='0'&&inventoryData.weightFactor!=''&&inventoryData.weightFactor!=null){ |
||||
|
$("#qtyOutKG").val((inventoryData.qtyOnHand*inventoryData.weightFactor).toFixed(1)); |
||||
|
$("#qtyOutKG").removeAttr("disabled"); |
||||
|
}else { |
||||
|
$("#qtyOutKG").val(''); |
||||
|
$("#qtyOutKG").attr("disabled", "disabled"); |
||||
|
} |
||||
|
$("#issue_modal").modal(); |
||||
|
} |
||||
|
//失去焦点事件
|
||||
|
$('#qtyOutKG').blur(function () { |
||||
|
let qtyOutKG=$('#qtyOutKG').val(); |
||||
|
let weightFactor=inventoryData.weightFactor; |
||||
|
if(weightFactor!=0&&weightFactor!=-1&&qtyOutKG!=''){ |
||||
|
$('#qtyOut').val((qtyOutKG/weightFactor).toFixed(1)) |
||||
|
} |
||||
|
}) |
||||
|
|
||||
|
//失去焦点事件
|
||||
|
$('#qtyOut').blur(function () { |
||||
|
let qtyOut=$('#qtyOut').val(); |
||||
|
let weightFactor=inventoryData.weightFactor; |
||||
|
if(weightFactor!=0&&weightFactor!=-1&&qtyOut!=''){ |
||||
|
$('#qtyOutKG').val((qtyOut*weightFactor).toFixed(1)) |
||||
|
} |
||||
|
}) |
||||
|
//模态框显示触发
|
||||
|
$("#issue_modal").on("shown.bs.modal",function(){ |
||||
|
$("#qtyOut").focus(); |
||||
|
}); |
||||
|
|
||||
|
//模态框隐藏触发
|
||||
|
$("#issue_modal").on("hidden.bs.modal",function(){ |
||||
|
$("#partNo_search").val("").focus(); |
||||
|
}); |
||||
|
|
||||
|
$("#qtyOut").bind("keydown",function(event){ |
||||
|
if (event.keyCode == 13) { |
||||
|
saveTable(); |
||||
|
} |
||||
|
}); |
||||
|
|
||||
|
function saveTable(){ |
||||
|
var qtyOut = $("#qtyOut").val(); |
||||
|
if(qtyOut == null || qtyOut == "" || qtyOut <= 0){ |
||||
|
layer.msg("其他出库数量错误!"); |
||||
|
return false; |
||||
|
} |
||||
|
changeTableList(); |
||||
|
} |
||||
|
|
||||
|
//下级界面页面跳转
|
||||
|
function clearAll(){ |
||||
|
$("#wareHouse").val("") |
||||
|
$("#remark").val("库存报废") |
||||
|
$("#partNo_search").val("") |
||||
|
$("#qtyOut").val("") |
||||
|
$("#qtyOutKG").val("") |
||||
|
tableList= [] |
||||
|
changeTable(); |
||||
|
} |
||||
|
|
||||
|
//下级界面页面跳转
|
||||
|
function saveData(){ |
||||
|
clearAll() |
||||
|
} |
||||
|
|
||||
|
//初始化下拉框
|
||||
|
function selectInit(){ |
||||
|
$('.selectpicker').selectpicker({ |
||||
|
noneSelectedText: '', |
||||
|
noneResultsText: '', |
||||
|
liveSearch: true, |
||||
|
width:140, |
||||
|
size:5 //设置select高度,同时显示5个值
|
||||
|
}); |
||||
|
} |
||||
@ -0,0 +1,191 @@ |
|||||
|
<!DOCTYPE html> |
||||
|
<html lang="zh-CN"> |
||||
|
<head> |
||||
|
<meta charset="utf-8"> |
||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge"> |
||||
|
<meta name="viewport" content="width=device-width, initial-scale=1"> |
||||
|
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags --> |
||||
|
<meta name="description" content=""> |
||||
|
<meta name="author" content=""> |
||||
|
<link rel="icon" href="/favicon.ico"> |
||||
|
<title>${project_title!"赫艾Pda"}</title> |
||||
|
<!-- Bootstrap core CSS --> |
||||
|
<link rel="stylesheet" type="text/css" href="/js/bootstrap-3.3.7/css/bootstrap.css"> |
||||
|
<link rel="stylesheet" type="text/css" href="/js/bootstrap-3.3.7/css/bootstrap-select.css"> |
||||
|
|
||||
|
<!-- Custom styles for this template --> |
||||
|
<link href="/css/base1.css" rel="stylesheet"> |
||||
|
<link rel="stylesheet" type="text/css" href="/css/button.css"> |
||||
|
<link href="/js/layer/skin/layer.css" rel="stylesheet"> |
||||
|
<style type="text/css"> |
||||
|
.form-input-2 { |
||||
|
|
||||
|
width: 80%; |
||||
|
height: 25px; |
||||
|
padding: 3px 3px; |
||||
|
font-size: 12px; |
||||
|
line-height: 1.42857143; |
||||
|
color: #555; |
||||
|
background-image: none; |
||||
|
border: 1px solid #ccc; |
||||
|
border-radius: 4px; |
||||
|
text-align: left; |
||||
|
float: left; |
||||
|
margin-left: -11px; |
||||
|
} |
||||
|
.ivu-form-item { |
||||
|
margin-left: 30px; |
||||
|
margin-top: -16px; |
||||
|
} |
||||
|
#selectview button{ |
||||
|
width: 375px; |
||||
|
height:27px; |
||||
|
margin-left: -15px; |
||||
|
margin-top: -5px; |
||||
|
} |
||||
|
</style> |
||||
|
</head> |
||||
|
<div class="hideData" style="display: none;"> |
||||
|
<#if user ??> |
||||
|
<input id="current_id" value="${user.userId ! ''}"> |
||||
|
<input id="current_username" value="${user.username!'' }"> |
||||
|
<input id="current_email" value="${user.email!'' }"> |
||||
|
<input id="current_mobile" value="${user.mobile!'' }"> |
||||
|
<input id="current_site" value="${user.site!'' }"> |
||||
|
<input id="current_languageDefault" value="${user.languageDefault!'' }"> |
||||
|
<input id="menuId" value="${menuId!'' }"> |
||||
|
<input id="current_titleName" value="${titleName!'' }"> |
||||
|
<input id="menuId" value="${menuId!'' }"> |
||||
|
</#if> |
||||
|
</div> |
||||
|
<body> |
||||
|
|
||||
|
<div id="app"> |
||||
|
<header class="mint-header is-fixed"> |
||||
|
<div class="mint-header-button is-left"> |
||||
|
<div class="header-title"> |
||||
|
<#--<a href="/pda/publicMenu?menuId=${superiorId}&titleName=${superiorName}" class="go-back"><i class="mintui mintui-back"></i></a>--> |
||||
|
<a href="/pda/pdaBase" class="go-back"><i class="mintui mintui-back"></i></a> |
||||
|
<span id = "titleName"></span> |
||||
|
</div> |
||||
|
</div> |
||||
|
<h1 class="mint-header-title"></h1> |
||||
|
<div class="mint-header-button is-right"></div> |
||||
|
</header> |
||||
|
|
||||
|
<div autocomplete="off" style="margin-left: 15px;width: 120px;height: 24px;margin-top: -10px;"> |
||||
|
<label class="ivu-form-item-label" >请扫描物料标签</label> |
||||
|
</div> |
||||
|
|
||||
|
<div autocomplete="off" style="width: 260px;margin-left: 25px;height: 24px;margin-top: -5px;"> |
||||
|
<input id="partNo_search" type="text" class="form-input-2" > |
||||
|
</div> |
||||
|
<div autocomplete="off" style="margin-top: -24px;width: 48px;margin-left: 230px;"> |
||||
|
<button class="btn btn-primary" style="padding: 1px 8px;font-size: 12px;height: 24px;width: 44px;" data-toggle="modal" onclick="queryPart()">查询</button> |
||||
|
</div> |
||||
|
|
||||
|
<div autocomplete="off" style="margin-left: 27px;width: 48px;height: 24px;margin-top: 5px;"> |
||||
|
<label class="ivu-form-item-label" >发料仓库</label> |
||||
|
</div> |
||||
|
|
||||
|
<div autocomplete="off" style="width: 260px;margin-left: 25px;height: 24px;margin-top: -5px;"> |
||||
|
<input id="wareHouse" disabled type="text" class="form-input-2" > |
||||
|
</div> |
||||
|
<div autocomplete="off" style="margin-left: 27px;width: 48px;height: 24px;margin-top: 5px;"> |
||||
|
<label class="ivu-form-item-label" >备注</label> |
||||
|
</div> |
||||
|
|
||||
|
<div autocomplete="off" style="width: 260px;margin-left: 25px;height: 24px;margin-top: -5px;"> |
||||
|
<input id="remark" type="text" class="form-input-2" > |
||||
|
</div> |
||||
|
|
||||
|
<div class="ivu-row" style="margin-top: 10px;"> |
||||
|
<div class="ivu-table-wrapper"> |
||||
|
<div class="ivu-table" style="font-size: 11px;"> |
||||
|
<div class="ivu-table-header"> |
||||
|
<table style="width: 100%;" cellspacing="0" cellpadding="0" border="0" style="table-layout:fixed;"> |
||||
|
<thead> |
||||
|
<tr> |
||||
|
<th class="" style="text-align:center;width: 20%;"> |
||||
|
<span>物料编码</span> |
||||
|
</th> |
||||
|
<th class="" style="text-align:center;width: 20%;"> |
||||
|
<span>数量</span> |
||||
|
</th> |
||||
|
<th class="" style="text-align:center;width: 39%;"> |
||||
|
<span>批号</span> |
||||
|
</th> |
||||
|
<th class="" style="text-align:center;width: 20%;"> |
||||
|
<span>库位</span> |
||||
|
</th> |
||||
|
|
||||
|
</tr> |
||||
|
</thead> |
||||
|
</table> |
||||
|
</div> |
||||
|
<div class="ivu-table-body" style="overflow-y: visible"> |
||||
|
<table style="width: 100%;" cellspacing="0" cellpadding="0" border="0"> |
||||
|
<tbody class="ivu-table-tbody" style="" id = "issue_table" > |
||||
|
</tbody> |
||||
|
</table> |
||||
|
</div> |
||||
|
<div class="ivu-table-tip" style="display: none;"> |
||||
|
<table cellspacing="0" cellpadding="0" border="0"> |
||||
|
<tbody> |
||||
|
<tr> |
||||
|
<td><span>暂无筛选结果</span></td> |
||||
|
</tr> |
||||
|
</tbody> |
||||
|
</table> |
||||
|
</div> |
||||
|
</div> |
||||
|
<object style="display: block; position: absolute; top: 0px; left: 0px; width: 100%; height: 100%; border: medium none; padding: 0px; margin: 0px; opacity: 0; z-index: -1000; pointer-events: none;" tabindex="-1" type="text/html" data="about:blank"></object> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<div autocomplete="off" style="margin-top: 20px;width: 130px;margin-left: 90px;"> |
||||
|
<button class="btn btn-primary" style="padding: 1px 8px;font-size: 12px;height: 24px;width: 55px;" data-toggle="modal" onclick="clearAll()">清空</button> |
||||
|
<button class="btn btn-primary" style="padding: 1px 8px;font-size: 12px;height: 24px;width: 55px;margin-left: 10%" data-toggle="modal" onclick="saveData()">保存</button> |
||||
|
</div> |
||||
|
|
||||
|
<!-- 运单操作 --> |
||||
|
<div class="modal fade" id="issue_modal" aria-labelledby="myModalLabel" aria-hidden="true"> |
||||
|
<div class="modal-dialog" style="width:260px; margin: 40% auto;"> |
||||
|
<div class="modal-content" > |
||||
|
<div id="legend" style="background-color: #17b2a2;;color: #fff;"> |
||||
|
<legend style="font-size: 18px;">物料信息</legend> |
||||
|
</div> |
||||
|
<div class="modal-body" style="padding: 1px 1px;"> |
||||
|
<div class="ivu-form-item"> |
||||
|
<label class="ivu-form-item-label" style="width: 70px;margin-top: 12%;text-align: left;">发料数量:</label> |
||||
|
<div class="ivu-input-wrapper ivu-input-type" style="width: 150px;"> |
||||
|
<input id="qtyOut" type="number" class="form-input-2"> |
||||
|
</div> |
||||
|
<label class="ivu-form-item-label" style="width: 70px;margin-top: 12%;text-align: left;">公斤重量:</label> |
||||
|
<div class="ivu-input-wrapper ivu-input-type" style="width: 150px;"> |
||||
|
<input id="qtyOutKG" type="number" class="form-input-2"> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="modal-footer" style="TEXT-ALIGN: center; margin-top: 0px;padding: 5px 5px;"> |
||||
|
<div class="control-group" style="margin-left: 35px;"> |
||||
|
<div class="controls"> |
||||
|
<button class="btn btn-primary" id = "determine" style="padding: 1px 8px;font-size: 12px;height: 24px;width: 44px;margin-left: -10%" data-toggle="modal" onclick="saveTable()">确定</button> |
||||
|
<button class="btn btn-primary" id="issue_cancel" data-dismiss="modal" style="padding: 1px 8px;font-size: 12px;height: 24px;width: 44px;margin-left: 10%" data-toggle="modal">取消</button> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
</div> |
||||
|
|
||||
|
</body> |
||||
|
<script type="text/javascript" src="/js/jquery/jquery-2.1.4.js"></script> |
||||
|
<script type="text/javascript" src="/js/jquery/jquery.cookie.js"></script> |
||||
|
<script type="text/javascript" src="/js/bootstrap-3.3.7/js/bootstrap.js"></script> |
||||
|
<script type="text/javascript" src="/js/bootstrap-3.3.7/js/bootstrap-select.js"></script> |
||||
|
<script type="text/javascript" src="/js/layer/layer.js"></script> |
||||
|
<script type="text/javascript" src="/js/pdaOther/stockOtherOut.js"></script> |
||||
|
</html> |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue