1 Star 0 Fork 1

yihoc/WEBWMS

forked from gujiejing/WEBWMS 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
slsoform.js 4.56 KB
一键复制 编辑 原始数据 按行查看 历史
wisdom 提交于 2017-11-03 23:31 . upupup new alll
window.onload=initPage;
var aID1 = "";
function initPage(){
document.getElementById("allocate").onclick=allocateSO;
document.getElementById("allocateDetail").onclick=allocateDetailSO;
document.getElementById("pickreport").onclick=pickreportPrint;
document.getElementById("cancelallocate").onclick=cancelallocateSO;
$("#finishOrder").click(function(){
console.log("finish");
$("#dialog1").text("确定是否要结束此单");
$("#dialog1").dialog({
resizable: false,
height:140,
modal: true,
buttons:{
Ok:function(){
$(this).dialog("close");
console.log("do something");
sendFinish();
},
Cancel:function(){
$(this).dialog("close");
}
}
});
});
}
function sendFinish(){
var id1=escape(document.getElementById("ID").value);
$.post("slsoformf.php",{
id: id1,
type: "finish"
},function(data,status){
//alert("Data: "+data+"\nStatus:"+status);
var respTxt=jQuery.parseJSON(data);
if(respTxt.result==1){
$("td#SOState11").text("FINISH");
}
});
}
function pickreportPrint(){
var id1=escape(document.getElementById("ID").value);
window.open("pickreport.php?id="+id1);
}
function cancelallocateSO(){
console.log("cancelallocateSO");
var SState= $("td#SOState11").text();
if(SState=="ALLOCATE"){}else{
alert("不是分配状态,不可取消分配");
return;
}
console.log(SState);
var id2 = escape(document.getElementById("ID").value);
var url="allocate.php?ID="+id2+"&cancelType=1";
aID1 = id2;
cancelallocateSORequest=createRequest();
if(cancelallocateSORequest==null){
alert("Unable to create request");
}else{
cancelallocateSORequest.onreadystatechange=showCAllocateDetailSO1
cancelallocateSORequest.open('GET',url,true);
cancelallocateSORequest.send(null);
}
}
function showCAllocateDetailSO1(){
if(cancelallocateSORequest.readyState == 4){
if(cancelallocateSORequest.status == 200){
console.log("responseText->"+cancelallocateSORequest.responseText);
var respTxt=eval("("+cancelallocateSORequest.responseText+")");
if(respTxt.result==1){
$("td#SOState11").text("CREATE");
$("div#showAllocateDetail").text("");
var id1=escape(document.getElementById("ID").value);
alert("取消分配成功!");
window.location.href="slsoform.php?ID="+id1;
}
}
}
}
function allocateDetailSO(){
console.log("allocateDetailSO");
var aa2= $("td#SOState11").text();
if(aa2=="ALLOCATE"){}else{
alert("不是分配状态,不可显示分配明细");
return;
}
console.log(aa2);
allocateDetailSORequest=createRequest();
if(allocateDetailSORequest==null){
alert("Unable to create request");
}else{
var url="showallocdetail.php?ID="+escape(document.getElementById("ID").value);
allocateDetailSORequest.onreadystatechange=showAllocateDetailSO
allocateDetailSORequest.open('GET',url,true);
allocateDetailSORequest.send(null);
}
}
function showAllocateDetailSO(){
console.log("showAllocateDetailSO");
if(allocateDetailSORequest.readyState == 4){
if(allocateDetailSORequest.status == 200){
console.log("allocateDetailSORequest->"+allocateDetailSORequest.responseText);
var respTxt=eval("("+allocateDetailSORequest.responseText+")");
if(respTxt.result==1){
$("div#showAllocateDetail").html(respTxt.table);
alert("responseText->"+respTxt.respText);
}
}
}
}
function allocateSO(){
console.log("allocateSO");
var aa1= $("td#SOState11").text();
if(aa1=="CREATE"){
}else{
alert("不是创建状态,不可分配出库单");
return;
}
console.log(aa1);
allocateSORequest=createRequest();
if(allocateSORequest==null){
alert("Unable to create request");
}else{
var url = "allocate.php?ID="+escape(document.getElementById("ID").value);
console.log(url);
allocateSORequest.onreadystatechange=showAllocateSO
allocateSORequest.open('GET',url,true);
allocateSORequest.send(null);
}
}
function showAllocateSO(){
console.log("showAllocateSO");
if(allocateSORequest.readyState == 4){
if(allocateSORequest.status == 200){
console.log("allocateSORequest->"+allocateSORequest.responseText);
var respTxt = eval("("+allocateSORequest.responseText+")");
console.log("respTxt.result->"+respTxt.result);
if(respTxt.result==0){
alert("responseText->"+respTxt.respText);
}else if(respTxt.result==1){
$("td#SOState11").text("ALLOCATE");
alert("responseText->"+respTxt.respText);
var id1 = escape(document.getElementById("ID").value);
window.location.href="slsoform.php?ID="+id1;
}
}
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/yihoc/WEBWMS.git
git@gitee.com:yihoc/WEBWMS.git
yihoc
WEBWMS
WEBWMS
master

搜索帮助