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

📄 semiproductlist.aspx

📁 尚洋仓库管理系统,对仓库
💻 ASPX
📖 第 1 页 / 共 5 页
字号:
        document.all("txtNewStuffNo").value="";
        document.all("txtNewStuffName").value="";
        document.all("txtNewSpecification").value="";
        //document.all("txtNewStuffType").value="";
        //document.all("txtNewUnit").value="";
        document.all("txtNewPrice").value="0";
        document.all("txtNewStock").value="0";
        document.all("txtNewNote").value="";
        linkage(document.all("sltNewSort"),document.all("sltNewCategory"));
        showDiv(div);
    }
    function delRecord()
    {
        userOperate="del";
        if(currentTR==null)
        {
            alert("请先选择要修改的");
            return;
        }
        if(confirm("记录删除后将不能恢复,确定删除记录吗?"))
        {
            document.all("txtId").value=vbTrim(currentTR.cells[0].outerText);
            
            save2(document.all("tb1"));
        }
    }
</script>
<script language=vbscript>
    titleResize
 function checkNumeric(value)
	     checkNumeric=isnumeric(value)
    end function
   '剪切函数
   function vbTrim(str)
      vbTrim=trim(str)
   end function
   sub validate(byval retValue,byref isAvailable,byref msg)
        tmp=split(retValue,"|")
        isAvailable=tmp(0)
        msg=tmp(1)
    end sub
    
</script>
<script language="javascript">
    //添加事件处理
    
    var userOperate;
    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(){chooseTr(obj);});
    }
    function addDblClickEvent(obj)
    {
        obj.attachEvent("ondblclick",function(){modifyRecord();});
        
    }
    function save2(tb1)
    {
        if(userOperate!="del")
        {
            if(e(document.all("txtNewStuffNo"),"[半成品编号]"))
                return;
            if(e(document.all("txtNewStuffName"),"[半成品名称]"))
                return;
            if(e(document.all("sltNewSort"),"[半成品大类]"))
                return;
            if(e(document.all("sltNewCategory"),"[半成品小类]"))
                return;
            if(vbTrim(document.all("txtNewSpecification").value).length==0)
            {
                if(!confirm("半成品规格为空,确定不需要吗?"))
                    return;
            }              
            if(e(document.all("sltNewUnit"),"[单位]"))
                return; 
            if(!checkNumeric(document.all("txtNewPrice").value))
            {
                alert("单价请输入数字类型!");
                return;
            }
            if(!checkNumeric(document.all("txtNewStock").value))
            {
                alert("库存请输入数字类型!");
                return;
            }
        }
        var param="";
        var IsAvailable,msg;
        var xmlHttp=new ActiveXObject("microsoft.XMLHTTP"); 
        
        if(userOperate=="del")
        {
            param="t=1&op=del&id="+document.all("txtId").value;
        }
        else if(userOperate=="modify")
        {
            param="t=1&op=modify&id="+document.all("txtId").value+"&sno="+document.all("txtNewStuffNo").value+"&sname="+document.all("txtNewStuffName").value+"&spec="+document.all("txtNewSpecification").value+"&unit="+document.all("sltNewUnit").options[document.all("sltNewUnit").selectedIndex].outerText+"&stype="+document.all("sltNewCategory").value+"&price="+document.all("txtNewPrice").value+"&stock="+document.all("txtNewStock").value+"&sort="+document.all("sltNewSort").value+"&remark="+document.all("txtNewNote").value+"";   
        }
        else
        {
            param="t=1&op=add&id="+document.all("txtId").value+"&sno="+document.all("txtNewStuffNo").value+"&sname="+document.all("txtNewStuffName").value+"&spec="+document.all("txtNewSpecification").value+"&unit="+document.all("sltNewUnit").options[document.all("sltNewUnit").selectedIndex].outerText+"&stype="+document.all("sltNewCategory").value+"&price="+document.all("txtNewPrice").value+"&stock="+document.all("txtNewStock").value+"&sort="+document.all("sltNewSort").value+"&remark="+document.all("txtNewNote").value+"";   
        }
        
        xmlHttp.open("POST","StuffHandle.aspx",false);
        xmlHttp.setRequestHeader("CONTENT-TYPE","application/x-www-form-urlencoded;");
        xmlHttp.send(param);
        
        var retValue=xmlHttp.responsetext;
        
        if(getState(retValue)=="1")//添加成功
        {
            if(userOperate=="add")//更新界面
            {
                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);
                addDblClickEvent(row);
                var cell=row.insertCell();
                cell.className="td1";
                cell.innerText=getMsg(retValue);

                cell=row.insertCell();
                cell.className="td1";                
                cell.innerText=document.all("txtNewStuffNo").value;
                
                cell=row.insertCell();
                cell.className="td1";
                cell.innerText=document.all("txtNewStuffName").value+" ";
                
                cell=row.insertCell();
                cell.className="td1";
                cell.innerText=document.all("txtNewSpecification").value+" ";
                
                cell=row.insertCell();
                cell.className="td1";
                cell.innerText=document.all("sltNewUnit").options[document.all("sltNewUnit").selectedIndex].outerText+" ";
                
                cell=row.insertCell();
                cell.className="td1";
                //cell.style.display="none";
                cell.style.width="0"
                cell.innerText=document.all("sltNewCategory").value+" ";
                
                cell=row.insertCell();
                cell.className="td1";
                cell.innerText=document.all("sltNewCategory").options[document.all("sltNewCategory").selectedIndex].outerText+" ";
                
                cell=row.insertCell();
                cell.className="td1";
                cell.innerText=document.all("txtNewPrice").value+" ";
                
                cell=row.insertCell();
                cell.className="td1";
                cell.innerText=document.all("txtNewStock").value+" ";
                
                cell=row.insertCell();
                cell.className="td1";
                //cell.style.display="none";
                cell.style.width="0";
                cell.innerText=document.all("sltNewSort").value+" ";
                
                cell=row.insertCell();
                cell.className="td1";
                cell.innerText=document.all("txtNewNote").value+" ";
                
                
                
                
                
                document.all("popDiv").style.display="none";
                alert("添加成功!");
                
            }
            else if(userOperate=="modify")
            {
                currentTR.cells[1].innerText=document.all("txtNewStuffNo").value;
                currentTR.cells[2].innerText=document.all("txtNewStuffName").value;
                currentTR.cells[3].innerText=document.all("txtNewSpecification").value;
                currentTR.cells[4].innerText=document.all("sltNewUnit").options[document.all("sltNewUnit").selectedIndex].outerText;
                currentTR.cells[5].innerText=document.all("sltNewCategory").value;
                currentTR.cells[6].innerText=document.all("sltNewCategory").options[document.all("sltNewCategory").selectedIndex].outerText+" "
                currentTR.cells[7].innerText=document.all("txtNewPrice").value;
                currentTR.cells[8].innerText=document.all("txtNewStock").value;
                currentTR.cells[9].innerText=document.all("sltNewSort").value;
                currentTR.cells[10].innerText=document.all("txtNewNote").value;
                document.all("popDiv").style.display="none";
                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);
                }
                alert("删除成功!");
            }
            document.all("popDiv").style.display="none";
        }
        else
        {
            alert(getMsg(retValue));
        }
    }
    function e(obj,msg)
    {
        if(vbTrim(obj.value).length==0)
        {
            alert(msg+"不能为空!");
            return true;
        }
    }
    function  save(op)
    {
        alert("abc");
        return;
        var param="";
        var IsAvailable,msg;
        var xmlHttp=new ActiveXObject("microsoft.XMLHTTP");
        if(op!="del")
        {
            if(document.all("txtId").value=="")
            {
                param="op=add&unit="+document.all("txtUnit").value+"&note="+document.all("txtNote").value;
            }
            else
            {
                param="op=modify&unit="+document.all("txtUnit").value+"&note="+document.all("txtNote").value+"&id="+document.all("txtId").value.toString();
            }
        }
        else
        {
            param="op=del&id="+document.all("txtId").value;
        }
        xmlHttp.open("POST","UnitHandle.aspx",false);

⌨️ 快捷键说明

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