$.post("${ctx}/service/store/codeShelf/codeIn", {cid: '${show}', code: codeValue}, function (data) {
showMsg(data);
if(data.indexOf("x") == 0){
//弹框,添加=7x8=尺寸信息后重新请求
$("#sizeConfirm").modal("show");
}
});
});
$(".psizeBox").click(function(){
$("#sizeConfirm").modal("hide");
var codeValue = $("#scan-code").attr("placeholder");
var sizeStr = $(this).text();
if(codeValue){
var newCodeStr = "="+sizeStr+"="+codeValue;
$.post("${ctx}/service/store/codeShelf/codeIn", {cid: '${show}', code: newCodeStr}, function (data) {
showMsg(data);
});
}
});
setInterval(function(){
if($('#allPartNumbers').is(':visible')) {
$("#searchPn").focus();
}else{
$("#scan-code").focus();
}
}, 1000);
//页码从0开始
var pageIndex = 0;
var partNumberItems = [];
var itemPerPage = 12;
var bgColors = ["bg-blue-madison","bg-green-haze","bg-purple-plum","bg-red-intense","bg-green","bg-yellow","bg-blue","bg-red","bg-purple","bg-blue-ebonyclay","bg-red-sunglo","bg-yellow-crusta"];
showPartNumbers = function(type){
var findAndOutHref = '${ctx}/component/storagePosFind.html';
$("#findAndOut").attr("href",findAndOutHref);
$("#searchPn").val("");
$.post("${ctx}/service/store/codeShelf/inventory", {}, function (data) {
pageIndex = -1;
partNumberItems = data;
nextPage();
});
}
nextPage=function(){
pageIndex ++ ;
pageShow();
}
lastPage = function(){
pageIndex -- ;
pageShow();
}
disableBtn = function(){
$("#lastPage").show();
$("#nextPage").show();
$("#footerBtn").show();
//上一页不可用
if(pageIndex <= 0){
$("#lastPage").addClass("disabled");
}else{
$("#lastPage").removeClass("disabled");
}
var totalPage = Math.ceil(partNumberItems.length/itemPerPage);
if(pageIndex + 1 >= totalPage - 1){
$("#nextPage").addClass("disabled");
}else{
$("#nextPage").removeClass("disabled");
}
if(totalPage <= 1){
$("#lastPage").hide();
$("#nextPage").hide();
}
}
pageShow = function(){
var itemStr = "";
var endIndex = itemPerPage * (pageIndex+1);
if(endIndex > partNumberItems.length){
endIndex = partNumberItems.length;
}
for(var index = itemPerPage * pageIndex;index<endIndex;index++){