185 lines
4.1 KiB
JavaScript
185 lines
4.1 KiB
JavaScript
|
|
function check(onstart)
|
|||
|
|
{
|
|||
|
|
var ckbjxx = document.forms["ckbjxx"];
|
|||
|
|
if(ckbjxx.barcode)
|
|||
|
|
{
|
|||
|
|
var barcode = ckbjxx.barcode.value;
|
|||
|
|
if (onstart || (barcode.length == 0 && ckbjxx.jhs.value.length == 0))
|
|||
|
|
{
|
|||
|
|
focusInput(ckbjxx.barcode);
|
|||
|
|
if (onstart) ckbjxx.jhs.value = "";
|
|||
|
|
return onstart;
|
|||
|
|
}
|
|||
|
|
if (barcode.length > 0 && isInvalidCode(barcode))
|
|||
|
|
{
|
|||
|
|
focusInput(ckbjxx.barcode);
|
|||
|
|
return false;
|
|||
|
|
}
|
|||
|
|
//<2F><><EFBFBD><EFBFBD>ɨ<EFBFBD>뵽<EFBFBD><EBB5BD><EFBFBD><EFBFBD><EFBFBD>롣
|
|||
|
|
var jhs = ckbjxx.jhs.value;
|
|||
|
|
if (jhs.indexOf("|" + barcode + "|") >= 0)
|
|||
|
|
{
|
|||
|
|
alert("<22>ظ<EFBFBD>ɨ<EFBFBD><C9A8><EFBFBD><EFBFBD><EFBFBD>룺" + barcode);
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{//<><D7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
var wsslInfo = document.getElementById("wssl");
|
|||
|
|
var newValue = parseInt(wsslInfo.innerHTML);
|
|||
|
|
if (newValue == 0)
|
|||
|
|
{
|
|||
|
|
alert("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|||
|
|
focusInput(ckbjxx.barcode);
|
|||
|
|
return false;
|
|||
|
|
}
|
|||
|
|
if (barcode.length > 0)
|
|||
|
|
{
|
|||
|
|
ckbjxx.jh.value = barcode;
|
|||
|
|
ckbjxx.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 = scanedCntTip + newCount + removeLastButtonElement;
|
|||
|
|
newValue = newValue - 1;
|
|||
|
|
wsslInfo.innerHTML = newValue;
|
|||
|
|
//ckbjxx.cmdSave.disabled = null;
|
|||
|
|
}
|
|||
|
|
//if (newValue == 0 || box || salver)//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>棬֮<E6A3AC><D6AE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƚ<EFBFBD><C8BD>鷳
|
|||
|
|
{//δɨ<CEB4><C9A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0<EFBFBD><30><EFBFBD><EFBFBD><EFBFBD>ύ<EFBFBD><E1BDBB><EFBFBD><EFBFBD>
|
|||
|
|
//ckbjxx.cmdSave.disabled = "true";
|
|||
|
|
smwcqr(ckbjxx.ckdh.value, ckbjxx.zlbhAndTpbh.value, ckbjxx.jhs.value);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
ckbjxx.barcode.value = "";
|
|||
|
|
focusInput(ckbjxx.barcode);
|
|||
|
|
return false;
|
|||
|
|
}
|
|||
|
|
var x;
|
|||
|
|
x = ckbjxx.zlbh;
|
|||
|
|
if(x)
|
|||
|
|
{
|
|||
|
|
focusInput(x);
|
|||
|
|
if (!onstart)
|
|||
|
|
{
|
|||
|
|
if (getFieldValue(x).length == 0)
|
|||
|
|
{
|
|||
|
|
return false;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
return true;
|
|||
|
|
}
|
|||
|
|
x = ckbjxx.ckdh;
|
|||
|
|
if(x)
|
|||
|
|
{
|
|||
|
|
focusInput(x);
|
|||
|
|
if (!onstart)
|
|||
|
|
{
|
|||
|
|
if (getFieldValue(x).length == 0)
|
|||
|
|
{
|
|||
|
|
return false;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
return true;
|
|||
|
|
}
|
|||
|
|
return false;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//ȡ<><C8A1><EFBFBD>̲<EFBFBD><CCB2><EFBFBD>
|
|||
|
|
function qctp(zlbh, ckkw, tpbh)
|
|||
|
|
{
|
|||
|
|
var argument = new Array("zlbh", zlbh, "tpbh", tpbh, "ckkw", ckkw, "remark", "<22><><EFBFBD>Ƴ<EFBFBD><C6B3><EFBFBD>", "table", "ckzl", "field", "qczt");
|
|||
|
|
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>");
|
|||
|
|
var ckbjxx = document.forms["ckbjxx"];
|
|||
|
|
focusInput(ckbjxx.barcode);
|
|||
|
|
var zlbhAndTpbh = ckbjxx.zlbhAndTpbh.value;
|
|||
|
|
var indexSeparator = zlbhAndTpbh.indexOf('|');
|
|||
|
|
var tpbh = zlbhAndTpbh.substring(1 + indexSeparator);
|
|||
|
|
var tpbhNode = document.getElementById("tpbh");
|
|||
|
|
tpbhNode.innerHTML = tpbh;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* ɨ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȷ<EFBFBD>ϲ<EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
* @param ckdh <EFBFBD><EFBFBD><EFBFBD>ⵥ<EFBFBD><EFBFBD>
|
|||
|
|
* @param zlbh <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
* @param jhs |<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1|<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2|....|<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>n|
|
|||
|
|
*/
|
|||
|
|
function smwcqr(ckdh, zlbh, jhs)
|
|||
|
|
{
|
|||
|
|
var ckbjxx = document.forms[0];
|
|||
|
|
var qxsm = ckbjxx.qxsm.checked?"1":"0";
|
|||
|
|
var argument = new Array("ckdh", ckdh, "zlbh", zlbh, "jhs", jhs, "qxsm", qxsm);
|
|||
|
|
postRequest("ckqr.jsp", argument, successSmwcqr);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* <EFBFBD>ύɨ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
*/
|
|||
|
|
function save()
|
|||
|
|
{
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
var ckbjxx = document.forms[0];
|
|||
|
|
var jhs = ckbjxx.jhs.value;
|
|||
|
|
var barcode = ckbjxx.barcode.value;
|
|||
|
|
if (barcode.length > 1 && !isInvalidCode(barcode))
|
|||
|
|
{
|
|||
|
|
check(false);
|
|||
|
|
jhs = ckbjxx.jhs.value;
|
|||
|
|
}
|
|||
|
|
if (jhs.length < 1)
|
|||
|
|
{
|
|||
|
|
alert("<22><><EFBFBD><EFBFBD>Ҫһ<D2AA><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|||
|
|
return false;
|
|||
|
|
}
|
|||
|
|
smwcqr(ckbjxx.ckdh.value, ckbjxx.zlbhAndTpbh.value, jhs);
|
|||
|
|
}
|
|||
|
|
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 successSmwcqr(result)
|
|||
|
|
{
|
|||
|
|
finishProcess();
|
|||
|
|
|
|||
|
|
var wsmsl = result.getAttribute("wsmsl");
|
|||
|
|
var sl = parseInt(wsmsl);
|
|||
|
|
var ckbjxx = document.forms[0];
|
|||
|
|
ckbjxx.jhs.value = "";
|
|||
|
|
if (sl >= 0)
|
|||
|
|
{
|
|||
|
|
var wsslInfo = document.getElementById("wssl");
|
|||
|
|
wsslInfo.innerHTML = sl;
|
|||
|
|
var countInfo = document.getElementById("count");
|
|||
|
|
var newCount = result.getAttribute("ysmsl");
|
|||
|
|
countInfo.innerHTML = scanedCntTip + newCount;
|
|||
|
|
ckbjxx.barcode.focus();
|
|||
|
|
}
|
|||
|
|
if (sl == 0)
|
|||
|
|
{//<2F><>Ӧ<EFBFBD><D3A6>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ⵥɨ<E2B5A5><C9A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ⵥ
|
|||
|
|
history.go("0" == zlbh?-2:-1);
|
|||
|
|
window.location.href = "0" == zlbh?"ck.jsp":("ck.jsp?ckdh=" + ckbjxx.ckdh.value);
|
|||
|
|
}
|
|||
|
|
else if (sl == -1)
|
|||
|
|
{//û<><C3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8>
|
|||
|
|
history.go(-2);
|
|||
|
|
window.location.href = "ck.jsp";
|
|||
|
|
}
|
|||
|
|
else if (sl == -2)
|
|||
|
|
{//û<><C3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ⵥ
|
|||
|
|
history.go(-2);
|
|||
|
|
window.location.href = "index.jsp";
|
|||
|
|
}
|
|||
|
|
}
|