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

📄 entercode.jsp

📁 运输模块代码
💻 JSP
字号:
<%@ include file="/IncludeBeginMD.jsp" %>
<%@ page import="com.hexiesoft.utils.StringUtils" %>
<%
    String PG_TITLE = (String) Configure.getConfigure(sIe_Language, "PromiseInquiry").get("TITLE");
    String sdateLable = (String) Configure.getConfigure(sIe_Language, "PromiseInquiry").get("LABLE_1");
    String edateLable = (String) Configure.getConfigure(sIe_Language, "PromiseInquiry").get("LABLE_2");
    String sAccount = (String) Configure.getConfigure(sIe_Language, "PromiseInquiry").get("LABLE_3");
    String sSubacct = (String) Configure.getConfigure(sIe_Language, "PromiseInquiry").get("LABLE_4");
    String buttonLable = (String) Configure.getConfigure(sIe_Language, "Common").get("SUBMIT");
    String alertDate1 = (String) Configure.getConfigure(sIe_Language, "PromiseInquiry").get("ALERT_DATE_1");
    String alertDate2 = (String) Configure.getConfigure(sIe_Language, "PromiseInquiry").get("ALERT_DATE_2");
    String alertDate3 = (String) Configure.getConfigure(sIe_Language, "PromiseInquiry").get("ALERT_DATE_3");
    String sNoRecords = (String) Configure.getConfigure(sIe_Language, "PromiseInquiry").get("ALERT_NORECORDS");
%>
<script language="javascript" src="<%=sResourcesPath%>/keyevent.js"></script>
<script language="javascript">
function IsDate(DateString, Dilimeter)
{
    if (DateString == null)  return  false;
    if (Dilimeter == '' || Dilimeter == null)  Dilimeter = '-';
    var tempy = '';
    var tempm = '';
    var tempd = '';
    var tempArray;
    if (DateString.length < 8 || DateString.length > 10)  return  false;

    tempArray = DateString.split(Dilimeter);
    if (tempArray.length != 3)  return  false;

    tempy = tempArray[0];
    tempd = tempArray[2];

    tempm = tempArray[1];
    var tDateString = tempy + '/' + tempm + '/' + tempd;

    var tempDate = new  Date(tDateString);
    if (isNaN(tempDate))  return  false;
if (tempDate.getFullYear() > 2050 || tempDate.getFullYear() < 1950)  
{
   alert('年份必须大于1950年,小于2050年');
   return false;
}

    if (((tempDate.getFullYear()).toString() == tempy) && (tempDate.getMonth() == myparseInt(tempm) - 1) && (tempDate.getDate() == myparseInt(tempd)))
    {

        return  true;
    }
    else
    {
        return  false;
    }
}

//去掉月份或日期前的0,比如2003-02-04  ->2003-2-4
function myparseInt(num)
{
    var tempnum = num + "";
    while (tempnum.substr(0, 1) == "0") {
        tempnum = tempnum.substr(1);
    }
    return(parseInt(tempnum));
}
//function IsDate() End

//Function DateDiff
function DateDiff(sDate2, sDate1) {    //sDate1和sDate2是2002-12-18格式
    var aDate,  oDate1,  oDate2,  iDays
    aDate = sDate1.split("-")
    oDate1 = new  Date(aDate[1] + '-' + aDate[2] + '-' + aDate[0])    //转换为12-18-2002格式
    aDate = sDate2.split("-")
    oDate2 = new  Date(aDate[1] + '-' + aDate[2] + '-' + aDate[0])
    iDays = parseInt(oDate2 - oDate1)    //把相差的毫秒数转换为天数
    return  iDays
}

//Function DateDiff end

function checkForm() {
    //    alert("1");
    var sDate = null;
    var eDate = null;
    var sdate = document.all.sdate.value;
    var edate = document.all.edate.value;
    var account = document.all.account.value;
    var subacct = document.all.subacct.value;

    if (sdate != null && sdate.length > 0)
    {  //如果sdate不为空,可以进行下一步判断

        if (edate == null || edate.length == 0)
        {   //如果edate为空,提示出错
            alert('<%=alertDate1%>');
            return;
        } else {
            //都不为空的时候,先转换成日期格式,然后比较
            if (IsDate(sdate, "-")) {   //如果sDate是日期格式,进行转换

                sDate = Date.parse(sdate);

            } else {        //否则提示错误
                alert('<%=alertDate2%>');
                return;
            }
            //if sdate is date
            if (IsDate(edate, "-")) {   //如果sDate是日期格式,进行转换
                eDate = Date.parse(edate);

            } else {        //否则提示错误
                alert('<%=alertDate3%>');
            }
            //if edate is date

            if (DateDiff(edate, sdate) < 0) {
                alert('<%=alertDate1%>');
            }

        }
    }
    sReturn = PopPage("/ShippingManager/ShippingList/promiseInquiry/check.jsp?sdate=" + sdate + "&edate=" + edate + "&account=" + account + "&subacct=" + subacct + "&rand=" + randomNumber(), "", "");
    if (sReturn == "false")
    {
        OpenComp("PromiseInquiry", "/ShippingManager/ShippingList/promiseInquiry/Inquiry.jsp", "sdate=" + sdate + "&edate=" + edate + "&account=" + account + "&subacct=" + subacct + "&rand=" + randomNumber(), "right", "");
        self.returnValue = "OK";
        self.close();
        return;
    }
    else
    {
        alert('<%=sNoRecords%>');
        document.all.account.focus();
        return;
    }

}
</script>
<%
     String dstart = "2001-11-26";
    String dend = "2001-12-30";
    ASResultSet dateRs = Sqlca.getASResultSet("select top 1 dstart,dend from fiscal order by dstart DESC");
    if (dateRs.next()) {
        dstart = StringUtils.to_Date(dateRs.getString("dstart"));
        dend = StringUtils.to_Date(dateRs.getString("dend"));
    }
%>
<title><%= PG_TITLE %></title>
  <body bgcolor="#DCDCDC">
<table border="1" width=100% align="center" bordercolor='#999999' bordercolordark='#FFFFFF'>
    <TR>
        <TD colspan="2"><font size="5"><%= PG_TITLE %></font></TD>

    </TR>
    <TR>
        <TD colspan="2"></TD>

    </TR>
    <TR>
        <TD bgcolor="#D8D8AF" width="35%"><%= sdateLable %></TD>
        <TD bgcolor="#F0F1DE"><INPUT TYPE="text" NAME="sdate" value="<%=dstart%>" size="10" maxlength="10" onkeydown="DateInput()"></TD>
    </TR>
    <TR>
        <TD bgcolor="#D8D8AF"><%= edateLable %></TD>
        <TD bgcolor="#F0F1DE"><INPUT TYPE="text" NAME="edate" value="<%=dend%>" size="10" maxlength="10" onkeydown="DateInput()"></TD>
    </TR>
    <tr>
        <td bgcolor="#D8D8AF"><%=sAccount%></td>
        <td bgcolor="#F0F1DE"><INPUT TYPE="text" NAME="account" value="" size="6" maxlength="6"></td>
    </tr>
    <tr>
        <td bgcolor="#D8D8AF"><%=sSubacct%></td>
        <td bgcolor="#F0F1DE"><INPUT TYPE="text" NAME="subacct" value="" size="4" maxlength="4"></td>
    </tr>
    <TR>
     <TD colspan="2"><input type="button" name="next"
                               value="<%=(String)Configure.getConfigure(sIe_Language,"Common").get("SUBMIT")%>"
                               onClick="javascript:checkForm()"
                               style="font-size:9pt;padding-top:3;padding-left:5;padding-right:5;background-image:url(../../../Resources/functionbg.gif); border: #DCDCDC;  border-style: outset; border-top-width: 1px; border-right-width: 1px;  border-bottom-width: 1px; border-left-width: 1px"
                               border='1'>
            <input type="button" name="Cancel"
                   value="<%=(String)Configure.getConfigure(sIe_Language,"Common").get("CANCEL")%>"
                   onClick="javascript:self.returnValue='_none_';self.close()"
                   style="font-size:9pt;padding-top:3;padding-left:5;padding-right:5;background-image:url(../../../Resources/functionbg.gif); border: #DCDCDC;  border-style: outset; border-top-width: 1px; border-right-width: 1px;  border-bottom-width: 1px; border-left-width: 1px"
                   border='1'>
        </TD>
    </TR>
</TABLE>
</body>
<%@ include file="/IncludeEnd.jsp" %>


⌨️ 快捷键说明

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