⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 purchaseorderquery.aspx

📁 尚洋仓库管理系统,对仓库
💻 ASPX
📖 第 1 页 / 共 4 页
字号:
		on error resume next
		span3.style.left=span1.offsetLeft
		span3.style.top=span1.offsetTop+1
		span3.style.width=span1.offsetWidth-(span1.offsetWidth-span1.clientWidth)
		
		for iii=0 to document.all("tb2").Rows(0).cells.length-1
			document.all("tb2").Rows(0).cells(iii).style.width=tb1.rows(0).cells(iii).offsetwidth
		next
		span3.scrollLeft=span1.scrollLeft
		'if err.number<>0 then msgbox "err"
'		window.status=err.Description
	end sub' VBScript 文件

    
    
    
function VBparseInt(p)
    VBparseInt=cint(replace(p,"px",""))
end function

 dim Login_Win_Down_Flag,Login_Win_Down_orgX,Login_Win_Down_orgY

   Login_Win_Down_Flag=false
    '================================================================================
    '按下鼠标
    '================================================================================
   Sub Login_Win_Down(DivObj)
        DivObj.setCapture
        Login_Win_Down_Flag=true
        Login_Win_Down_orgX=VBparseInt(window.event.offsetX)        
        Login_Win_Down_orgY=VBparseInt(window.event.offsetY)
        
   End Sub
       '================================================================================
    '移动鼠标
    '================================================================================
   Sub Login_Win_Move(DiVObj)
        if Login_Win_Down_Flag then
            DivObj.style.cursor="move"
            DivObj.style.left=window.event.x-Login_Win_Down_orgX
            
            DivObj.style.top=window.event.y-Login_Win_Down_orgY
        end if
   End Sub
   
   Sub Login_Win_Up(DivObj)
    DivObj.style.cursor="default"
    Login_Win_Down_Flag=false
    DivObj.releaseCapture
   
   End Sub
   
   sub divAlignCenter(div)
    
    div.style.left=(document.body.offsetWidth-VBparseInt(div.style.width))/2
    div.style.top=(document.body.offsetHeight-VBparseInt(div.style.height))/2
    
   end sub
   
   sub showDiv(div)
        
        divAlignCenter div
        div.style.display="block"
   end sub
   
   sub hideDiv(div)
        div.style.display="none"
   
   end sub
   function CheckNumber(val)
        if IsNumeric(val)  then
            CheckNumber=true
        else
            CheckNumber=false
        end if
   end function
   
</script>


<script language="javascript">
    var currentTR=null;
    function addToPurchaseOrder(tb1)
    {
        var isExist;
        if(dataValidate())
        {
            
            var row=tb1.insertRow(tb1.rows.length);
            
            row.style.height="22";
            row.style.whiteSpace="nowrap";
            row.style.backgroundColor="#ffffff";

            addMoveEvent(row);
            addOutEvent(row);
            addClickEvent(row);
            
            var cell=row.insertCell();
            cell.className="td1";
            cell.innerText=document.all("txtId").value;

            cell=row.insertCell();
            cell.className="td1";                
            cell.innerText=document.all("txtStuffNo").value;
            
            cell=row.insertCell();
            cell.className="td1";
            cell.innerText=document.all("txtStuffName").value+" ";
            
            cell=row.insertCell();
            cell.className="td1";
            cell.innerText=document.all("txtStuffSpec").value+" ";
              
              
            cell=row.insertCell();
            cell.className="td1";                
            cell.innerText=document.all("txtQuantity").value;
            
            cell=row.insertCell();
            cell.className="td1";
            cell.innerText=document.all("txtPrice").value+" ";
            
            cell=row.insertCell();
            cell.className="td1";
            cell.innerText=document.all("txtUnit").value+" ";
              
              
            cell=row.insertCell();
            cell.className="td1";
            cell.innerText=document.all("txtPrice").value*document.all("txtQuantity").value;
                
        }
    }
     function addMoveEvent(obj)
    {
        obj.attachEvent("onmouseover",function(){RowMouseOver(obj);});
    }
    function addOutEvent(obj)
    {
        obj.attachEvent("onmouseout",function(){RowMouseOut(obj);});
    }
    function addClickEvent(obj)
    {
        obj.attachEvent("onclick",function(){modifyRecord(obj);});
    }
    function addDblClickEvent(obj)
    {
        obj.attachEvent("ondblclick",function(){showList(obj);});
        
    }
    function modifyRecord(obj)
    {
        if(obj==null||obj=="undefined")
        {
            alert("请先选择要修改的物料");
            return;
        }
        window.event.cancelBubble=true;
        userOperate="modify";
        chooseTr(obj);
    }
    //是否数字,是否为空,是否为日期,下拉框是否被选中
    //数据验证
    
    function dataValidate()
    {
        if(document.all("txtId").value.length==0)
        {
            alert("请先选择一种物料,然后添加到采购订单!\n\n请单击[搜索]");
            return false;
        }
        if(document.all("txtQuantity").value.length==0||document.all("txtQuantity").value<"1")
        {
            alert("请输入该物料的采购数量!");
            return false;
        }
        if(!CheckNumber(document.all("txtQuantity").value))
        {
            alert("采购数量请输入数值类型!");
            return false;
        }
        if(!CheckNumber(document.all("txtPrice").value))
        {
            alert("物料单价请输入数值类型!");
            return false;
        }
        
        //重复记录验证
        for(var iTr=1;iTr<document.all("tb1").rows.length;iTr++)
        {
            if(vbTrim(document.all("tb1").rows[iTr].cells[0].outerText)==document.all("txtId").value)
            {
                //alert("物料[ "+document.all("tb1").rows[iTr].cells[2].outerText+" ]已添加到明细中!");
                document.all("tb1").rows[iTr].cells[4].innerText=document.all("txtQuantity").value;
                document.all("tb1").rows[iTr].cells[7].innerText=document.all("txtQuantity").value*document.all("txtPrice").value;
                alert("采购数量已更新!");
                return false;
            }
        }
        return true;
    }
    
    //删除明细项目
    function deleteDetails()
    {
        if(currentTR==null||currentTR=="undefined")
        {
            alert("请先选择要删除的物料");
        }
        else
        {
             var obj;
            var obj2=currentTR;
            if((obj=currentTR.nextSibling)!=null)
            {
                currentTR=obj;
            }
            else
            {
                if((obj=currentTR.previousSibling)!=null)
                {
                    currentTR=obj;
                }
                else
                {
                    currentTR=null;
                }
            }
            
            tb1.deleteRow(obj2.rowIndex);
            if(currentTR!=null)
            {
                chooseTr(currentTR);
            }
        }
    }
    //填充供应商名称
    setSupplier();
    function setSupplier()
    {
        document.all("sltSupplier").innerHTML="";
        var op=document.createElement("OPTION");
        op.value="";
        document.all("sltSupplier").appendChild(op);
        //改XML
        var supplier="<%=SupplierString %>";
        var supplierAry=supplier.split("|");
        for(var ii=0;ii<supplierAry.length;ii++)
        {
            var ary=supplierAry[ii].split("*");
            var op=document.createElement("OPTION");
            op.value=ary[0];
            op.innerText=ary[1];
            document.all("sltSupplier").appendChild(op);
            
        }
    }
    //提交服务器
    function PostToServer(op)
    {
        //
        try
        {
            var param;
            param="date1="+document.all("txtPOBeginDate").value+"&date2="+document.all("txtPOEndDate").value;
            param+="&date3="+document.all("txtExpectDate1").value+"&date4="+document.all("txtExpectDate2").value;
            param+="&finishState="+document.all("sltFinish").value+"&supplier="+document.all("sltSupplier").value;
            param+="&pono="+document.all("txtPoNo").value+"&ponocondition="+document.all("sltPOnoCondition").value;
            param+="&verifying="+document.all("sltVerifying").value;
            var xmlHttp=new ActiveXObject("microsoft.XMLHTTP");
            xmlHttp.open("POST","Query/POQuery.aspx",false);
            xmlHttp.setRequestHeader("CONTENT-TYPE","application/x-www-form-urlencoded;");
            xmlHttp.send(param);
            var xmlDom2=new ActiveXObject("msxml.DOMDocument");
            var xml=xmlHttp.responsetext;
            if(xml.indexOf("没有登录")!=-1)
            {
                alert("没有登录");
                return;
            }            
            if(xml!="false"&&xml.indexOf("没有权限")==-1)
            {
                xmlDom2.loadXML(xml);
                UpdateTable(xmlDom2,document.all("tb1"));
            }
            else
            {
                alert("没有权限!");
            }
        //删除现有行
        }
        catch(e)
        {
            alert("操作超时,请重新登录系统!");
            
        }
        
        
    }
    function UpdateTable(xml,table)
    {
        var len=table.rows.length;
        for(var i=len-1;i>0;i--)
        {            
            table.deleteRow(i);
        }
        for(var i=0;i<xml.documentElement.childNodes.length;i++)
        {
            //alert(xml.documentElement.xml);
            var node=xml.documentElement.childNodes[i];
            var row=table.insertRow();
            addTrStyle(row);
            addMoveEvent(row);
            addOutEvent(row);
            addClickEvent(row);
            //addDblClickEvent(row);
            
            for(var ii=0;ii<node.attributes.length;ii++)
            {
                var cell=row.insertCell();          
                
                cell.className="td1";
                if(ii==7) 
                {
                    

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -