真善美

          勇于承擔(dān)責(zé)任; 如果你做不到,要提前跟別人說(shuō)明,不要等到事情發(fā)生后再解釋。

            BlogJava :: 首頁(yè) ::  :: 聯(lián)系 :: 聚合  :: 管理 ::
            55 隨筆 :: 0 文章 :: 29 評(píng)論 :: 0 Trackbacks
            1 <%@ page pageEncoding="GBK"%>
            2 <%@ include file="../public/appcontext.jsp"%>
            3 <html>
            4     <head>
            5         <title>模塊基本信息</title>
            6         <logic:notEqual name="moduleInfoForm" property="maModbaseinfo.ar"
            7             value="1">
            8             <script language="javascript">    
            9             //記錄頁(yè)面展示條數(shù)
           10             var count=0;
           11             /**
           12             *校驗(yàn)頁(yè)面輸入的合法性,通過(guò)則保存
           13             */    
           14             function toSave(operation) {
           15                 with (document.forms[0]) {    
           16                     //循環(huán)判斷輸入信息是否合法            
           17                     for(i=0;i<count;i++){
           18                         if(document.all('moduleInfoList['+i+'].mon')!=null) {                        
           19                             document.all('moduleInfoList['+i+'].mon').value=trim(document.all('moduleInfoList['+i+'].mon').value);
           20                             if(document.all('moduleInfoList['+i+'].mon').value==""){
           21                                 alert("警告:請(qǐng)輸入[模塊名稱(chēng)]的值!");
           22                                 document.all('moduleInfoList['+i+'].mon').focus();
           23                                 return false;
           24                             }                            
           25                         }else{
           26                             alert("警告:請(qǐng)輸入[模塊名稱(chēng)]的值!");
           27                             document.all('moduleInfoList['+i+'].mon').focus();
           28                             return false;
           29                         }
           30                         if(document.all('moduleInfoList['+i+'].smce')!=null) {       
           31                             var str =trim(document.all('moduleInfoList['+i+'].smce').value);
           32                             if((str=="0.00"|| (str=="")){
           33                                 alert("警告:請(qǐng)輸入[估計(jì)模塊規(guī)模]的值!");
           34                                 document.all('moduleInfoList['+i+'].smce').focus();
           35                                 return false;
           36                             }
           37                             if(str.length>6){
           38                                 document.all('moduleInfoList['+i+'].smce').value = str.substr(0,1)+str.substr(2,str.length);                            
           39                             }
           40                         }else{
           41                             alert("警告:請(qǐng)輸入[估計(jì)模塊規(guī)模]的值!");
           42                             document.all('moduleInfoList['+i+'].smce').focus();
           43                             return false;
           44                         }
           45                         if(document.all('moduleInfoList['+i+'].smu')!=null) {
           46                             document.all('moduleInfoList['+i+'].smu').value=trim(document.all('moduleInfoList['+i+'].smu').value);
           47                             if(document.all('moduleInfoList['+i+'].smu').value=="2"){
           48                                 var str=document.all('moduleInfoList['+i+'].smce').value;
           49                                 var s = str.substr(str.length-2,str.length-1);
           50                                 if(s!="00"){
           51                                     alert("警告:[代碼規(guī)模單位]選擇功能點(diǎn)時(shí),[估計(jì)代碼規(guī)模]應(yīng)為整數(shù)!");
           52                                     document.all('moduleInfoList['+i+'].smu').focus();
           53                                     return false;
           54                                 }
           55                             }
           56                             if(document.all('moduleInfoList['+i+'].smu').value==""){
           57                                 alert("警告:請(qǐng)輸入[代碼規(guī)模單位]的值!");
           58                                 document.all('moduleInfoList['+i+'].smu').focus();
           59                                 return false;
           60                             }
           61                         }                        
           62                         var ontext=trim(document.all('moduleInfoList['+i+'].on').value);
           63                         if(ontext==null||ontext=="") {
           64                             alert("警告:請(qǐng)輸入[操作人]的值!");
           65                             document.all('moduleInfoList['+i+'].on').focus();
           66                             return false;                                                        
           67                         }else{                        
           68                             var patrn=/^[0-9]{6}$/
           69                             if (!patrn.exec(document.all('moduleInfoList['+i+'].on').value)){
           70                                 alert("警告:[操作人]的值為6位員工號(hào),請(qǐng)重新輸入!"); 
           71                                 document.all('moduleInfoList['+i+'].on').focus();
           72                                 return false
           73                              }
           74                         } 
           75                         if(document.all('moduleInfoList['+i+'].operdateStr')!=null) {     
           76                             document.all('moduleInfoList['+i+'].operdateStr').value=trim(document.all('moduleInfoList['+i+'].operdateStr').value);
           77                             if((document.all('moduleInfoList['+i+'].operdateStr').value=="")||(document.all('moduleInfoList['+i+'].operdateStr').value==null)){
           78                                 alert("警告:請(qǐng)輸入第"+(i+1)+"行[操作日期]的值!");
           79                                 document.all('moduleInfoList['+i+'].operdateStr').focus();
           80                                 return false;
           81                             }                                                        
           82                         }            
           83                     }    
           84                 action ="<%=root%>/moduleInfoAction.do?method="+operation; 
           85                 submit();      
           86                 }
           87         }
           88                 /**
           89             *刪除方法
           90             */    
           91             function toRemove(modid) {
           92             with (document.forms[0]) {
           93                 if(confirm("確定刪除此條信息?")){
           94                     count--;
           95                     action ="<%=root%>/moduleInfoAction.do?method=doDel&id="+modid; 
           96                        submit();  
           97                     }else{
           98                         return false;
           99                     }           
          100                }
          101           }           
          102     </script>
          103         </logic:notEqual>
          104     </head>
          105     <body>
          106         <common:form action="/moduleInfoAction.do" method="post">
          107             <html:hidden name="moduleInfoForm" property="inid" styleId="inid" />
          108             <html:hidden name="moduleInfoForm" property="maModbaseinfo.ar"
          109                 styleId="shFlag" />
          110             <html:hidden name="moduleInfoForm" property="proQueryFlag"
          111                 styleId="proQueryFlag" />
          112             <div align="center">
          113                 <table width="95%" border="0" cellpadding="0" cellspacing="1">
          114                     <tr>
          115                         <td colspan="5" align="left" class="line2">
          116                             <html:errors />
          117                             <html:messages id="message" message="true">
          118                                 <bean:write name="message" filter="false" />
          119                             </html:messages>
          120                         </td>
          121                     </tr>
          122                 </table>
          123                 <logic:equal name="moduleInfoForm" property="proQueryFlag" value="1">
          124                     <table>
          125                         <tr>
          126                             <td colspan="9" align="center" class="line2">
          127                                 <font color="red"> 請(qǐng)先錄入項(xiàng)目信息! </font>
          128                             </td>
          129                         </tr>
          130                     </table>
          131                 </logic:equal>
          132                 <logic:notEqual name="moduleInfoForm" property="proQueryFlag"
          133                     value="1">
          134                     <table width="95%" border="1" cellpadding="0" cellspacing="1">
          135                         <thead>
          136                             <tr>
          137                                 <th align="center" colspan="12" class="line2">
          138                                     模塊基本信息
          139                                 </th>
          140                             </tr>
          141                             <tr>
          142                                 <td class="td1" align="center" nowrap>
          143                                     模塊編號(hào)
          144                                 </td>
          145                                 <td class="td1" align="center" nowrap>
          146                                     模塊名稱(chēng)
          147                                 </td>
          148                                 <td class="td1" align="center" nowrap>
          149                                     估計(jì)模塊規(guī)模
          150                                 </td>
          151                                 <td class="td1" align="center" nowrap>
          152                                     代碼規(guī)模單位
          153                                 </td>
          154                                 <td class="td1" align="center" nowrap>
          155                                     操作人
          156                                 </td>
          157                                 <td class="td1" align="center" nowrap>
          158                                     操作日期
          159                                 </td>
          160                                 <td class="td1" align="center" nowrap>
          161                                     審核人
          162                                 </td>
          163                                 <td class="td1" align="center" nowrap>
          164                                     審核日期
          165                                 </td>
          166                                 <td class="td1" align="center" nowrap>
          167                                     審核意見(jiàn)
          168                                 </td>
          169                                 <logic:notEqual name="moduleInfoForm" property="maModbaseinfo.ar"
          170                                     value="1">
          171                                     <td class="td1" align="center" width="34" nowrap>
          172                                         操作
          173                                     </td>
          174                                 </logic:notEqual>
          175                             </tr>
          176                         </thead>
          177                         <logic:notEqual name="moduleInfoForm" property="maModbaseinfo.ar"
          178                             value="1">
          179                             <logic:notEmpty name="moduleInfoForm" property="moduleInfoList">
          180                                 <tbody id="docTbody">
          181                                     <logic:iterate name="moduleInfoForm" property="moduleInfoList"
          182                                         id="moduleInfoList" indexId="index">
          183                                         <%int idx = index.intValue();
          184                                           String nodel = "nodel_"+ idx +"_";
          185                                           String del = "del_"+ idx +"_";
          186                                     %>
          187                                         <tr>
          188                                             <td nowrap>
          189                                                 <common:hidden name="moduleInfoList" property="operFlag"
          190                                                     styleId="operFlag" indexed="true" />
          191                                                 <common:hidden name="moduleInfoList" property="ar"
          192                                                     styleId="ar" indexed="true" />
          193                                                 <Script language="javascript">count++;</script>
          194                                                 <common:text name="moduleInfoList" property="id"
          195                                                     styleId="id" empty="true" label="模塊編號(hào)"
          196                                                     style="border:none;background:none;" validator="text(0,6)"
          197                                                     size="6" indexed="true" readonly="true" />
          198                                             </td>
          199                                             <td nowrap>
          200                                                 <common:text name="moduleInfoList" property="mon"
          201                                                     styleId="mon" empty="false" label="模塊名稱(chēng)"
          202                                                     validator="text(0,20)" size="11" indexed="true" />
          203                                             </td>
          204                                             <td nowrap>
          205                                                 <common:text name="moduleInfoList" property="smce"
          206                                                     styleId="smce" empty="false" label="估計(jì)模塊規(guī)模"
          207                                                     validator="Decimal(6,2)" size="6" indexed="true" />
          208                                             </td>
          209                                             <td nowrap>
          210                                                 <param:select name="moduleInfoList" property="smu"
          211                                                     label="代碼規(guī)模單位" empty="false" nullStr="請(qǐng)選擇" styleId="smu"
          212                                                     type="smuTag" indexed="true" withCode="false" />
          213                                             </td>
          214                                             <td nowrap>
          215                                                 <common:text name="moduleInfoList" property="on"
          216                                                     styleId="on" empty="false" label="操作人" validator="text(0,6)"
          217                                                     size="6" indexed="true" />
          218                                             </td>
          219                                             <td nowrap>
          220                                                 <common:text styleClass="input" name="moduleInfoList"
          221                                                     property="operdateStr" styleId="operdateStr" empty="false"
          222                                                     label="操作日期" size="10" onclick="setday(this)"
          223                                                     validator="text(0,10)" readonly="true" indexed="true" />
          224                                             </td>
          225                                             <td nowrap align="right">
          226                                                 <common:text name="moduleInfoList" property="an"
          227                                                     styleId="an" empty="true" label="審核人" validator="text(0,6)"
          228                                                     size="6" indexed="true"
          229                                                     style="border:none;background:none;" readonly="true" />
          230                                             </td>
          231                                             <td nowrap align="center">
          232                                                 <common:text name="moduleInfoList" property="adStr"
          233                                                     styleId="adStr" empty="true" label="審核日期"
          234                                                     validator="text(0,10)" size="10"
          235                                                     style="border:none;background:none;" indexed="true"
          236                                                     readonly="true" />
          237                                             </td>
          238                                             <td nowrap>
          239                                                 <common:textarea styleId="ac" label="審核意見(jiàn)"
          240                                                     validator="text(0,255)" empty="true" name="moduleInfoList"
          241                                                     property="ac" readonly="true"
          242                                                     style="border:none;background:none;overflow:auto"
          243                                                     indexed="true" />
          244                                             </td>
          245                                             <td width="34">
          246                                                 <div id="<%=nodel%>" style="display:inline">
          247                                                     <logic:equal name="moduleInfoList" property="operFlag"
          248                                                         value="1">
          249                                                         --
          250                                                     </logic:equal>
          251                                                     <logic:equal name="moduleInfoList" property="operFlag"
          252                                                         value="0">
          253                                                         <a href="#"
          254                                                             onclick="toRemove('<bean:write name="moduleInfoList" property="id"/>')">刪除</a>
          255                                                     </logic:equal>
          256                                                 </div>
          257                                                 <div id="<%=del%>" style="display:none">
          258                                                     <a href="#"
          259                                                         onclick="if(confirm('是否確定刪除此費(fèi)用信息?')){editableTable.removeRow(<bean:write name='index'/>);count--;}"
          260                                                         style="CURSOR: hand;">刪除</a>
          261                                                 </div>
          262                                             </td>
          263                                         </tr>
          264                                     </logic:iterate>
          265                                 </tbody>
          266                             </logic:notEmpty>
          267                             <tr>
          268                                 <td nowrap colspan="10" align="right">
          269                                     <a href="#" onclick="addRows()">添加&nbsp;</a>
          270                                 </td>
          271                             </tr>
          272                             <tr>                                
          273                                 <td nowrap colspan="10" align="center">
          274                                     <input type="button" value=" 保存 " name="btnSave" class="btn"
          275                                         onclick="toSave('doSave')" />
          276                                 </td>
          277                             </tr>
          278                         </logic:notEqual>
          279                         <logic:equal name="moduleInfoForm" property="maModbaseinfo.ar"
          280                             value="1">
          281                             <logic:notEmpty name="moduleInfoForm" property="moduleInfoList">
          282                                 <tbody>
          283                                     <logic:iterate name="moduleInfoForm" property="moduleInfoList"
          284                                         id="data" indexId="index">
          285                                         <tr>
          286                                             <td nowrap align="center">
          287                                                 <bean:write name="data" property="id" />
          288                                             </td>
          289                                             <td nowrap>
          290                                                 <bean:write name="data" property="mon" />
          291                                             </td>
          292                                             <td nowrap align="right">
          293                                                 <bean:write name="data" property="smce" />
          294                                             </td>
          295                                             <td nowrap align="right">
          296                                                 <bean:write name="data" property="smu" />
          297                                             </td>
          298                                             <td nowrap align="right">
          299                                                 <bean:write name="data" property="on" />
          300                                             </td>
          301                                             <td nowrap align="center">
          302                                                 <bean:write name="data" property="operdate"
          303                                                     format="yyyy-MM-dd" />
          304                                             </td>
          305                                             <td nowrap align="right">
          306                                                 <bean:write name="data" property="an" />
          307                                             </td>
          308                                             <td nowrap align="center">
          309                                                 <bean:write name="data" property="ad" format="yyyy-MM-dd" />
          310                                             </td>
          311                                             <td nowrap>
          312                                                 <html:textarea name="data" property="ac" readonly="true" />
          313                                             </td>
          314                                         </tr>
          315                                     </logic:iterate>
          316                                     <tr>
          317                                         <td colspan="9" align="center">
          318                                             <font color="red"> 審核已通過(guò),如需改動(dòng),請(qǐng)聯(lián)系審核人! </font>
          319                                         </td>
          320                                     </tr>
          321                                 </tbody>
          322                             </logic:notEmpty>
          323                         </logic:equal>
          324                     </table>
          325                 </logic:notEqual>
          326             </div>
          327         </common:form>
          328         <logic:notEqual name="moduleInfoForm" property="maModbaseinfo.ar"
          329             value="1">
          330             <script language="javascript">
          331             /**
          332             *添加一行
          333             */
          334                var editableTable=new EditableTable("docTbody",false,"id_0_","operFlag_0_");
          335                function addRows(){
          336                 editableTable.addRow();
          337                 count++;
          338                 //得到新加的行號(hào)
          339                 var new_idx = document.all("docTbody").childNodes.length - 1;
          340                 //清空
          341                 document.getElementById("id_"+new_idx+"_").value="";
          342                 document.getElementById("mon_"+new_idx+"_").value="";
          343                 document.getElementById("smce_"+new_idx+"_").value="";
          344                 document.getElementById("smu_"+new_idx+"_").value="";
          345                 document.getElementById("on_"+new_idx+"_").value="";
          346                 document.getElementById("operdateStr_"+new_idx+"_").value="";
          347                 document.getElementById("an_"+new_idx+"_").value="";
          348                 document.getElementById("adStr_"+new_idx+"_").value="";
          349                 document.getElementById("ac_"+new_idx+"_").value="";
          350                 //顯示刪除連接                
          351                 document.getElementById("nodel_"+new_idx+"_").style.display="none";
          352                 document.getElementById("del_"+new_idx+"_").style.display="inline";
          353             }
          354           </script>
          355         </logic:notEqual>
          356     </body>
          357 </html>
          358 
          359 
          posted on 2007-08-30 21:33 真善美 閱讀(365) 評(píng)論(0)  編輯  收藏 所屬分類(lèi): Java學(xué)習(xí)
          主站蜘蛛池模板: 谢通门县| 高阳县| 乐至县| 嘉鱼县| 外汇| 时尚| 建平县| 托克托县| 富川| 定边县| 南昌市| 日土县| 内江市| 沙坪坝区| 安义县| 商洛市| 东安县| 原阳县| 离岛区| 阜南县| 峨眉山市| 顺平县| 池州市| 南溪县| 冀州市| 永修县| 鹤壁市| 天峻县| 江山市| 舞阳县| 若尔盖县| 久治县| 双江| 芷江| 祥云县| 科尔| 遵义县| 来宾市| 青田县| 霍州市| 铜川市|