第一次提交
This commit is contained in:
220
tomcat/webapps/sm/script/zk.js
Normal file
220
tomcat/webapps/sm/script/zk.js
Normal file
@@ -0,0 +1,220 @@
|
||||
function check(onstart)
|
||||
{
|
||||
var rkbjxx = document.forms[0];
|
||||
if(rkbjxx.barcode)
|
||||
{
|
||||
var barcode = rkbjxx.barcode.value;
|
||||
var jhs = rkbjxx.jhs.value;
|
||||
if (onstart || (barcode.length == 0 && jhs.length == 0))
|
||||
{
|
||||
focusInput(rkbjxx.barcode);
|
||||
if (onstart) rkbjxx.jhs.value = "";
|
||||
return onstart;
|
||||
}
|
||||
if (barcode.length > 0 && isInvalidCode(barcode))
|
||||
{
|
||||
focusInput(rkbjxx.barcode);
|
||||
return false;
|
||||
}
|
||||
//<2F><><EFBFBD><EFBFBD>ɨ<EFBFBD>뵽<EFBFBD><EBB5BD><EFBFBD><EFBFBD><EFBFBD>롣
|
||||
var boxID = rkbjxx.BoxID.value;
|
||||
if(isSalverCode(barcode))
|
||||
{//ɨ<><C9A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>룬<EFBFBD><EBA3AC><EFBFBD><EFBFBD>ɨ<EFBFBD><C9A8>
|
||||
zpwcqr(rkbjxx.zlbh.value, jhs, true, boxID, barcode);
|
||||
}
|
||||
else if (isBoxCode(barcode))
|
||||
{
|
||||
if (jhs.length > 2)
|
||||
{
|
||||
if (boxID.length == 0)
|
||||
{
|
||||
var err = confirm("֮ǰɨ<C7B0><C9A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƶ<EFBFBD>ǰû<C7B0><C3BB>ɨ<EFBFBD><C9A8><EFBFBD><EFBFBD><EFBFBD>ţ<EFBFBD><C5A3><EFBFBD>ɨ<EFBFBD><C9A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɨ<EFBFBD><C9A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?");
|
||||
if (err)
|
||||
{
|
||||
boxID = barcode;
|
||||
rkbjxx.BoxID.value = boxID;
|
||||
}
|
||||
}
|
||||
zpwcqr(rkbjxx.zlbh.value, jhs, false, boxID);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
rkbjxx.BoxID.value = barcode;
|
||||
zpwcqr(rkbjxx.zlbh.value, "", false, barcode);
|
||||
}
|
||||
}
|
||||
else if (barcode.length > 0 && jhs.indexOf("|" + barcode + "|") >= 0)
|
||||
{
|
||||
alert("<22>ظ<EFBFBD>ɨ<EFBFBD><C9A8><EFBFBD><EFBFBD><EFBFBD>룺" + barcode);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (barcode.length > 0)
|
||||
{
|
||||
rkbjxx.jh.value = barcode;
|
||||
rkbjxx.jhs.value = (jhs.length > 1?jhs:"|") + barcode + "|";
|
||||
var countInfo = document.getElementById("count");
|
||||
var oldCount = countInfo.getAttribute("total");
|
||||
var newCount = parseInt(oldCount) + 1;
|
||||
countInfo.setAttribute("total", newCount)
|
||||
countInfo.innerHTML = newCount + removeLastButtonElement;
|
||||
|
||||
countInfo = document.getElementById("countInBox");
|
||||
oldCount = countInfo.getAttribute("total");
|
||||
newCount = parseInt(oldCount) + 1;
|
||||
countInfo.setAttribute("total", newCount)
|
||||
countInfo.innerHTML = newCount;
|
||||
}
|
||||
if (rkbjxx.jhs.value.length > 0)
|
||||
{
|
||||
zpwcqr(rkbjxx.zlbh.value, rkbjxx.jhs.value, false, rkbjxx.BoxID.value);
|
||||
}
|
||||
}
|
||||
rkbjxx.barcode.value = "";
|
||||
focusInput(rkbjxx.barcode);
|
||||
return false;
|
||||
}
|
||||
var x = rkbjxx.kwbhAndTpbh;
|
||||
if(x)
|
||||
{
|
||||
focusInput(x);
|
||||
if (onstart) return true;
|
||||
if (getFieldValue(x).length == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
x = rkbjxx.zlbh;
|
||||
if(x)
|
||||
{
|
||||
focusInput(x);
|
||||
if (onstart) return true;
|
||||
if (getFieldValue(x).length == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//ȡ<><C8A1><EFBFBD>̲<EFBFBD><CCB2><EFBFBD>
|
||||
function qctp(ckkw, tpbh, statusField)
|
||||
{
|
||||
var rkbjxx = document.forms[0];
|
||||
var zlbh = rkbjxx.zlbh.value;
|
||||
var remark = "ȡ" + ("zctpQczt" == statusField?"ת<><D7AA><EFBFBD><EFBFBD>λ":"ת<><D7AA><EFBFBD><EFBFBD>λ") + "<22>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD><EFBFBD>"
|
||||
var argument = new Array("tpbh", tpbh, "ckkw", ckkw
|
||||
, "zlbh", zlbh, "field", statusField, "table", "zkzl"
|
||||
, "remark", remark);
|
||||
postRequest("qtp.jsp", argument, successQctp);
|
||||
}
|
||||
|
||||
//ȡ<><C8A1><EFBFBD>̲<EFBFBD><CCB2><EFBFBD> <20>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD>
|
||||
function successQctp(result)
|
||||
{
|
||||
finishProcess();
|
||||
|
||||
//alert("<22>ɹ<EFBFBD><C9B9>·<EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵָ<D2B5><D6B8>");
|
||||
focusInput(rkbjxx.barcode);
|
||||
var field = result.getAttribute("field");
|
||||
var button;
|
||||
if (field == "zctpQczt") button = document.getElementById("cmdQzctp");
|
||||
else button = document.getElementById("cmdQzrtp");
|
||||
if (button && button.style)
|
||||
{
|
||||
button.style.display = "none";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* װ<><D7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȷ<EFBFBD>ϲ<EFBFBD><CFB2><EFBFBD>
|
||||
* @param zlbh ָ<><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
* @param jhs |<7C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1|<7C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2|....|<7C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>n|
|
||||
* @param xh ת<><D7AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
* @param tpbh ת<><D7AA><EFBFBD><EFBFBD><EFBFBD>̺<EFBFBD>
|
||||
*/
|
||||
function zpwcqr(zlbh, jhs, end, xh, tpbh)
|
||||
{
|
||||
var rkbjxx = document.forms[0];
|
||||
var qxsm = rkbjxx.qxsm.checked?"1":"0";
|
||||
if (!tpbh) tpbh = "";
|
||||
if (!xh) xh = "";
|
||||
var argument = new Array("zlbh", zlbh, "jhs", jhs, "end", end?"1":"0", "xh", xh, "qxsm", qxsm, "tpbh", tpbh);
|
||||
postRequest("zkqr.jsp", argument, successZpwcqr);
|
||||
}
|
||||
|
||||
/**
|
||||
* <20><><EFBFBD><EFBFBD>ɨ<EFBFBD><C9A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
*/
|
||||
function end()
|
||||
{
|
||||
try
|
||||
{
|
||||
var rkbjxx = document.forms[0];
|
||||
var jhs = rkbjxx.jhs.value;
|
||||
zpwcqr(rkbjxx.zlbh.value, jhs, true, rkbjxx.BoxID.value);
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
alert("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" + e);
|
||||
}
|
||||
}
|
||||
|
||||
//װ<>̲<EFBFBD><CCB2><EFBFBD>ȷ<EFBFBD><C8B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD>
|
||||
function successZpwcqr(result)
|
||||
{
|
||||
finishProcess();
|
||||
|
||||
var rkbjxx = document.forms[0];
|
||||
rkbjxx.jhs.value = "";
|
||||
var countInfo = document.getElementById("count");
|
||||
var newCount = result.getAttribute("ysmsl");
|
||||
countInfo.setAttribute("total", newCount);
|
||||
countInfo.innerHTML = newCount;
|
||||
|
||||
countInfo = document.getElementById("countInBox");
|
||||
newCount = "0";
|
||||
countInfo.setAttribute("total", newCount);
|
||||
countInfo.innerHTML = newCount;
|
||||
|
||||
var wsmsl = result.getAttribute("wsmsl");
|
||||
if (parseInt(wsmsl) > 0)
|
||||
{
|
||||
var barcode = rkbjxx.barcode.value;
|
||||
if (isBoxCode(barcode))
|
||||
{
|
||||
if (barcode == rkbjxx.BoxID.value)
|
||||
{//<2F><><EFBFBD><EFBFBD>ɨ<EFBFBD><C9A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ŵ<EFBFBD><C5B5><EFBFBD><EFBFBD>Ѿ<EFBFBD>ɨ<EFBFBD><C9A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ţ<EFBFBD><C5A3><EFBFBD><EFBFBD><EFBFBD>
|
||||
if ("true" == result.getAttribute("boxOnStore"))
|
||||
{//<2F><><EFBFBD><EFBFBD>ɨ<EFBFBD><C9A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ת<EFBFBD><D7AA><EFBFBD><EFBFBD>λ<EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
rkbjxx.BoxID.value = "";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
rkbjxx.BoxID.value = barcode;
|
||||
}
|
||||
}
|
||||
rkbjxx.jh.value = "";
|
||||
rkbjxx.barcode.value = "";
|
||||
focusInput(rkbjxx.barcode);
|
||||
//history.go(-1);
|
||||
//window.location.href = ("zksm.jsp?zlbh=" + rkbjxx.zlbh.value);
|
||||
}
|
||||
else
|
||||
{
|
||||
rkbjxx.zlbh.value = "";
|
||||
if (parseInt(wsmsl) == 0)
|
||||
{
|
||||
history.go(-2);
|
||||
window.location.href = "zk.jsp";
|
||||
}
|
||||
else
|
||||
{
|
||||
history.go(-3);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user