码迷,mamicode.com
首页 > Web开发 > 详细

【131031】jsp学习实例 (2013-10-31 15:29:28)

时间:2016-06-14 13:39:24      阅读:274      评论:0      收藏:0      [点我收藏+]

标签:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="html" uri="/sys/sysTld/struts-html.tld"%>
<%@ taglib prefix="bean" uri="/sys/sysTld/struts-bean.tld"%>
<%@ taglib uri="/sys/sysTld/struts-nested.tld" prefix="nested"%>
<%@ taglib uri="/sys/sysTld/struts-logic.tld" prefix="logic"%>
<%@ taglib prefix="grd" uri="http://www.ziruk.com/taglib/gridlib" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions"  prefix="fn"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<html>
<head>
<title><bean:message key="P040BCT801" /></title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<LINK rel="stylesheet" type="text/css" href="sys/sysCss/menu/css.css">
<LINK rel=stylesheet type=text/css href="sys/sysCss/menu/style-custom.css">
<link href="sys/sysCss/menu/jquery.css" rel="stylesheet" type="text/css"
 media="screen">
 <style type="text/css">
  body {
   margin-left: 0px;
   margin-top: 0px;
   margin-right: 0px;
   margin-bottom: 0px;
   overflow-X: hidden;
  }
  .tableHeader
        {
            height: 25px;
            padding: 2px 1px 2px 1px;
            font-size:11pt;
            font-weight: bold;
        }
        .tableRow
        {
            padding: 2px 1px 2px 5px;
            font-size:11pt;
        }
  </style>
</head>
<script language="javascript" type="text/javascript"
 src="js/calendar/WdatePicker.js"></script>
<script type="text/javascript"
 src="<%=request.getContextPath()%>/sys/sysJs/iscFrameWorkUtility.js"></script>
<body>
 <html:form method="POST" action="bpf010801.do">
  <input type="hidden" value="" name="actionMethodId">
  <input type="hidden" name="screenId" value="${rcjglForm.screenId }">
  <html:hidden property="conditionMap(inparaList)" styleId="inparaList"  />
        <html:hidden property="conditionMap(saveFlag)" styleId="saveFlag"  />
       
  <table width="800px" border="0" cellspacing="0" cellpadding="0">
   <tr>
    <td height="27" class="Title style1"  colspan="2" >
     <bean:message key="P040BCT801" />
    </td>
   </tr>
   <tr >
    <!-- 检索条件区域 -->
    <td align="left" style="line-height: 20px" height="30" bgcolor="#f5f9ed"  >
     
     <table border="0">
      <tr align="left">
       <td bgcolor="#f5f9ed" style="line-height: 20px" align="right" nowrap="nowrap" >
        <bean:message key="P040BCT802" /><span style="color: red">*</span>
       </td>
       <td style="line-height: 20px" height="30" bgcolor="#f5f9ed" align="left">
        <html:text property="conditionMap(selYM)" styleId="selYM"  size="9" />
       </td>
       <td width="50PX" bgcolor="#f5f9ed" style="line-height: 20px" align="right" nowrap="nowrap" >
        <bean:message key="P040BCT803" />
       </td>
       <td width="80PX" style="line-height: 20px" height="30" bgcolor="#f5f9ed" align="left" >
        <html:text property="conditionMap(SubOrderNo)"  />
       </td>
      </tr>
      <tr align="left">
       
       <td width="50PX" bgcolor="#f5f9ed" style="line-height: 20px" align="right" nowrap="nowrap" >
        <bean:message key="P040BCT804" />
       </td>
       <td width="80PX" style="line-height: 20px" height="30" bgcolor="#f5f9ed" align="left" >
        <html:text property="conditionMap(SuppNo)"  />
       </td>
       <td width="50PX" bgcolor="#f5f9ed" style="line-height: 20px" align="right" nowrap="nowrap" >
        <bean:message key="P040BCT320" />
       </td>
       <td width="80PX" style="line-height: 20px" height="30" bgcolor="#f5f9ed" align="left" >
        <html:select property="conditionMap(dczt)" >
         <html:options name="defaultDto" property="values" labelName="defaultDto" labelProperty="labels"></html:options>
        </html:select>
       </td>
      </tr>
     </table>
    </td>
    <!-- 按钮区域 -->
    <td align="right" style="line-height: 20px" height="30" bgcolor="#f5f9ed" width="600px" >
     <table border="0">
      <tr>
       <td align="left">
        <input type="button"
         style= "background:url(‘images/btn_01.gif‘);border:0;height:25px;width:82px"
         value="<bean:message key="P040BCT005" />"
         name="search"
         onclick="doSearch();" >
        <input type="button"
         style= "background:url(‘images/btn_01.gif‘);border:0;height:25px;width:82px"
         value="<bean:message key="P040BCT805" />"
         name="search"
         onclick="doAction();">
       </td>
      </tr>
      <tr>
       <td align="left">
          <input type="button"
         style= "background:url(‘images/btn_01.gif‘);border:0;height:25px;width:82px"
         value="<bean:message key="P040BCT821" />"
         name="search"
         onclick=‘doSave("<bean:message key="P040BCI822" />" );‘>
        <input type="button"
         style= "background:url(‘images/btn_01.gif‘);border:0;height:25px;width:82px"
         value="<bean:message key="P040BCT006" />"
         name="search"
         onclick="doExport();">
        <input type="button"
         style= "background:url(‘images/btn_01.gif‘);border:0;height:25px;width:82px"
         value="<bean:message key="P040BCT890" />"
         name="search"
         onclick="doSelect();">
       </td>
      </tr>
     </table>
    </td>    
   </tr>
   <tr>
    <!-- 数据显示区域 -->
    <td colspan="2">
     <table  width="100%" bordercolor="#999999" style="border-collapse: collapse" 
                            border="1"  cellspacing="0" cellpadding="0" > 
      <tr>
       <td colspan="14" height="10" class="Title" >
        <bean:message key="P040BCT009" />
        <nested:write property="allCount" />
        <bean:message key="P040BCT010" />
       </td>
      </tr>
         <tr>
      <td align="left" style="line-height: 20px;" height="30" bgcolor="#f5f9ed" colspan="2">
       <div id="showDiv1" align="left" style="width:800px; overflow-x: scroll;clear:both;  ">
       <div style="width: 100%">
       
       <table id="titleTable" class="EOS_table" border=0 width="1620px" align=left>
           <tr bgcolor="#A4C7DD"  align="center" valign="middle">
            <th nowrap class="T2"><input type="checkbox" name="all" id="all" onclick="chooseAll(this)">
            <bean:message key="P040BCT807" /></th>
            <th nowrap class="T2" ><bean:message key="P040BCT808" /></th>
            <th  nowrap class="T2"><bean:message key="P040BCT809" /></th>
            <th nowrap class="T2" ><bean:message key="P040BCT810" /></th>
            <th nowrap class="T2" ><bean:message key="P040BCT811" /></th>
            
            <th nowrap class="T2" ><bean:message key="P040BCT933" /></th>
            
            <th width="80" nowrap class="T2"><bean:message key="P040BCT812" /></th>
            <th width="80" nowrap class="T2" ><bean:message key="P040BCT953" /></th>
            
            <th  nowrap class="T2" ><bean:message key="P040BCT934" /></th>
            
            <th  nowrap class="T2" ><bean:message key="P040BCT814" /></th>
            <th  nowrap class="T2"><bean:message key="P040BCT815" /></th>
                                 <th nowrap class="T2" ><bean:message key="P040BCT816" /></th>
            <th nowrap class="T2" ><bean:message key="P040BCT817" /></th>
            <th  nowrap class="T2"><bean:message key="P040BCT818" /></th>
            <th  nowrap class="T2"><bean:message key="P040BCT819" /></th>
            <th  nowrap class="T2"><bean:message key="P040BCT820" /></th>
                              </tr>
       </table>
       </div>
        <div id="showDiv" align="left" style="height:350px; overflow-y: scroll;">
        <table id="iscTab" class="EOS_table" border=0 width="1600px" align=left>
      <c:if test="${requestScope.rcjglForm.detail[0]!=null}" >
                       
                         </c:if>
                          <c:set var="rcjglFormNew" value="${requestScope.rcjglForm}"/>
                          <c:set var="len111" value="0"/>
                          <c:if test="${! empty rcjglFormNew.detail}">
                          <c:set var="len111" value="${fn:length(rcjglFormNew.detail)}"/>
                          </c:if>
                          <c:if test="${len111>0}">
                          <c:set var="cnt" value="0"/>
                          <c:set var="tmpInt" value="0"/> 
                          <c:set var="tmpStr" value=""/> 
                          <c:set var="sumNoAndsuppNo" value=""/>
                          <c:forEach begin="0" end="${len111-1}" var = "idx">
                                <c:set var="tmpStr" value="${rcjglFormNew.detail[idx].SUBORDERNO}${rcjglFormNew.detail[idx].SUPPNO}"/>
                                <c:choose>
                                <c:when test="${sumNoAndsuppNo != tmpStr}">
                                    <c:set var="sumNoAndsuppNo" value="${tmpStr}"/>
                                    <c:set var="tmpInt" value="${tmpInt+1}"/>
                                    <c:set var="cnt" value="${rcjglFormNew.detail[idx].ROWCNT}"/>
                                    <tr  class="tableRow">
               <td width="70" rowspan="${cnt}">
               <input type="hidden" value="${rcjglFormNew.detail[idx].ACOUNTERID}" name="acounterID" /> 
               <input type="hidden" value="${rcjglFormNew.detail[idx].SUPPNO}" name="supp_no" />
               <input type="checkbox" name="chklst" onclick="" id="${rcjglFormNew.detail[idx].SUBORDERNO}">${tmpInt}
               </td>
               <td rowspan="${cnt}">${rcjglFormNew.detail[idx].SUBORDERNO}</td>
               <td rowspan="${cnt}">${rcjglFormNew.detail[idx].SUPPNO}</td>
               <td rowspan="${cnt}">${rcjglFormNew.detail[idx].SUPPNAME}</td>
               <td >${rcjglFormNew.detail[idx].PRODUCTNAME}</td>
               <td width="80" rowspan="${cnt}">${rcjglFormNew.detail[idx].LCQF}</td>
               <td width="80" rowspan="${cnt}">${rcjglFormNew.detail[idx].ACOUNTDAY1}</td>
               <td align="right">
               <fmt:formatNumber value="${rcjglFormNew.detail[idx].SUMPRICEDIS}" pattern="#,##0.00#" type="number" var="money"/>
               <c:out value="${money}"/>
               </td>
               <td align="right">
               <fmt:formatNumber value="${rcjglFormNew.detail[idx].MOJU}" pattern="#,##0.00#" type="number" var="money2"/>
               <c:out value="${money2}"/>
               </td>
               <td rowspan="${cnt}"><input type="text" style="width:70px" name="acceptymd" value="${rcjglFormNew.detail[idx].ACCEPTYMD}"/></td>
               <td rowspan="${cnt}"><select name="status">
                   <c:if test="${rcjglFormNew.detail[idx].SHEETACCEPT == 1}">
                      <option value="1" selected><bean:message key="P040BCT854" /></option>
                      <option value="0" ><bean:message key="P040BCT855" /></option>
                   </c:if>
                   <c:if test="${rcjglFormNew.detail[idx].SHEETACCEPT != 1}">
                        <option value="1" ><bean:message key="P040BCT854" /></option>
                      <option value="0" selected ><bean:message key="P040BCT855" /></option>
                   </c:if>
               </select>
               </td>
                <td width="100" rowspan="${cnt}">
                                      <html:link   href="#" onclick="javascript:doSearchInvoice(‘${rcjglFormNew.detail[idx].SUBORDERNO}‘)" >
                                         ${rcjglFormNew.detail[idx].INVOICECNT}
                                      </html:link>
                                      
                                     </td>
               <td width="100" rowspan="${cnt}" align="center">${rcjglFormNew.detail[idx].ACOUNTDAY2}</td>
               <td width="100" rowspan="${cnt}">${rcjglFormNew.detail[idx].ACOUNTERID}</td>
               <td width="100" rowspan="${cnt}" align="center">${rcjglFormNew.detail[idx].PULLOUTDAY}</td>
               <td width="100" rowspan="${cnt}">${rcjglFormNew.detail[idx].PULLOUTID}</td>
               </tr>
                                 </c:when>
                                <c:otherwise>
                                    <tr  class="tableRow">
                                 <td >${rcjglFormNew.detail[idx].PRODUCTNAME}</td>
               <td align="right">
               <fmt:formatNumber value="${rcjglFormNew.detail[idx].SUMPRICEDIS}" pattern="#,##0.00#" type="number" var="money"/>
               <c:out value="${money}"/>
               </td>
               </tr>
                                </c:otherwise>
                                </c:choose>
                          </c:forEach>
                         </c:if>                   
     </table>
     </div>
     </div>
    </td>  
   </tr>
  </table>
  </td>  
   </tr>
  </table>  
 </html:form>
 
 <script type="text/javascript" language="Javascript">
 
     showCalendar(‘selYM‘,‘yyyy-MM‘);
  
  function doSearch() {
   objFrm = document.forms[0];
      if(objFrm.selYM.value=="")
      {
          alert(‘<bean:message key="P040BCI836"/>‘);
          return false;
      }

      objFrm.actionMethodId.value = "runPageSearch";
   objFrm.submit();
  }
  
  function doAction() {
     objFrm = document.forms[0];
     var acounterID = "-1";
     var orders = "";
     var chkBoxs = document.getElementsByName("chklst");
     var acounterList = document.getElementsByName("acounterID");
     var suppnoList = document.getElementsByName("supp_no");
     var rodia = document.getElementsByName("status");
        var len = chkBoxs.length;
        var cnt = 0;
        for (var i = 0; i < len; i++) {
              if(chkBoxs[i].checked)
              {
              if(rodia[i].value=="0"){
                alert(‘<bean:message key="P040BCI843"/>‘);
                       return false;
              }
                 orders=orders+chkBoxs[i].id+","+objFrm.selYM.value+","+suppnoList[i].value+";";
               
                 if(acounterID =="-1")
                 {
                    acounterID = acounterList[i].value;
                 }else{
                    if(acounterID != acounterList[i].value)
                    {
                       alert(‘<bean:message key="P040BCI837"/>‘);
                       return false;
                    }
                 }
                 cnt++;
               // if(cnt>1)
               //  {
                //    alert(‘<bean:message key="P040BCI828"/>‘);
                //    return false;
                // }
              }
        }
        if(cnt == 0)
        {
             alert(‘<bean:message key="P040BCI829"/>‘);
             return false;
        }
    
      objFrm.action="bpf010901.do";
      objFrm.actionMethodId.value = "runAction";
      objFrm.inparaList.value = orders;
      if(acounterID == "")
      {
         objFrm.saveFlag.value = "0";
      }
      else
      {
         objFrm.saveFlag.value = "1";
      }
      objFrm.screenId.value = "BPF0109-01";
   objFrm.submit();
  }
  function doSelect()
  {
      objFrm = document.forms[0];
      if(objFrm.selYM.value=="")
      {
          alert(‘<bean:message key="P040BCI836"/>‘);
          return false;
      }
     
      objFrm.action="bpf010901.do";
      objFrm.actionMethodId.value = "runAction";
      objFrm.inparaList.value = "";
      objFrm.saveFlag.value = "1";
      
      objFrm.screenId.value = "BPF0109-01";
   objFrm.submit();
  }
  function doSearchInvoice(suborderno) {
       var url="bpf010801.do?actionMethodId=runSearchInvoice&conditionMap(SubOrderNo)="+suborderno;
       window.open(url,‘<bean:message key="P040BCT801"/>‘,"toolbar=no,menubar=no, scrollbars=no, resizable=no,location=no, status=no,top=300,left=100,height=400,width=700");
  
  }
  function doSave(msg)
  {
      choose();
   objFrm = document.forms[0];
      objFrm.actionMethodId.value = "runPageSave";

      if(objFrm.inparaList.value == "")
      {
          alert(msg);
          return ;
      }
      
   objFrm.submit();
  }
  function doExport() {
   objFrm = document.forms[0];
      objFrm.actionMethodId.value = "runPageExport";
   objFrm.submit();
  }
  
     function chooseAll(chkBox) {
        
         var chkBoxs = document.getElementsByName("chklst");
         var len = chkBoxs.length;
         for (var i = 0; i < len; i++) {
              chkBoxs[i].checked = chkBox.checked;
         }
        
        }
        function choose()
        {
           var orders = "";
           var chkBoxs = document.getElementsByName("chklst");
           var txt = document.getElementsByName("acceptymd");
           var sel = document.getElementsByName("status");
        var len = chkBoxs.length;
        for (var i = 0; i < len; i++) {
              if(chkBoxs[i].checked)
              {
                 orders=orders+chkBoxs[i].id+","+sel[i].value+","+txt[i].value+";";
              }
        }

        objFrm = document.forms[0];
        objFrm.inparaList.value = orders;
        }
     function InvertChoose() {
           var chkBoxs = document.getElementsByName("chklst");
           var len = chkBoxs.length;
            for (var i = 0; i < len; i++) {
             chkBoxs[i].checked = !chkBoxs[i].checked;
          }
         }
     function getInfo() {
    var showDiv = document.getElementByIdx_x("showDiv");
    if(showDiv){
     showDiv.style.height = (document.body.clientHeight - 250) +"px";
    }
    var showDiv1 = document.getElementByIdx_x("showDiv1");
    if(showDiv1){
     showDiv1.style.width = (document.body.clientWidth - 10) +"px";
    }
    
    var table1 = document.getElementByIdx_x("titleTable");
       var table2 = document.getElementByIdx_x("iscTab");
    var trs1 = table1.getElementsByTagName_r("tr");
    var tds1 = trs1[0].getElementsByTagName_r("th");
    var trs2 = table2.getElementsByTagName_r("tr");
    var tds2 = trs2[0].getElementsByTagName_r("td");
    for(var i=0;i<tds2.length-1;i++){
     
     tds1[i].style.width = tds2[i].clientWidth -6 +"px";
       }
    
   }
  getInfo();
 </script> 
</body>
<jsp:include page="/jsp/iscFrameWork/showAllTypeMessage.jsp" flush="true" />
</html>

【131031】jsp学习实例 (2013-10-31 15:29:28)

标签:

原文地址:http://www.cnblogs.com/husam/p/3684020.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!