获取struts迭代list在页面显示的数据

js代码:

function  modifyPactMoney(){
	var table=$("#pactfee");
	var trs=table.find("tr");
	//先把保证金的重算
	for(var i=0;i<trs.length;i++){ 
		var feerate=$("#pactfee").find("[name='pactfeelist["+i+"].feerate']:last");
		var feetype=$("#pactfee").find("[name='pactfeelist["+i+"].feetype']:last");
		var feeratename=$(feerate).attr("name");
		var feetypeval=$(feetype).val();
		if(feeratename!=null && feeratename!=undefined && feetypeval=='301'){  
			checkfeewill(feerate);
		}
	}
	//然后再算其他的费用,因为其他费用是需要减掉保证金的
	for(var i=0;i<trs.length;i++){ 
		var feerate=$("#pactfee").find("[name='pactfeelist["+i+"].feerate']:last");
		var feetype=$("#pactfee").find("[name='pactfeelist["+i+"].feetype']:last");
		var feeratename=$(feerate).attr("name");
		var feetypeval=$(feetype).val();
		if(feeratename!=null && feeratename!=undefined && feetypeval!='301'){  
			checkfeewill(feerate);
		}
	}
}

  jsp代码:

<tr>
				<td  width="20%" class="td_left" style="align-text:center;">保函费用及<br/>保证金标准</td>
				<td colspan="3">
					<table class="report_table" style="width:100%" id="pactfee">
					    <tr>               
						    <td  style="width:18px;align-text:center;">
						    	<img src="<s:url value="/images/report/grid_tool_add.gif"/>" οnclick="myinsertRow($(this).parent().parent().parent().parent(),'pactfeelist',/(pactfeelist\[\d{1,}\])/ig,1,1);" ALT="新增费用" />
						    </td>
						    <td  style="width:20%;text-align:center;" >收费种类</td>  
							<td  style="width:20%;text-align:center;" >收费方式</td>  
							<td  style="width:20%;text-align:center;" >比率(费率/利率)%</td> 	 
							<td  style="width:20%;text-align:center;" >应收费用(元)</td> 
							<td  style="text-align:center;" >币种</td>
						</tr>
						<tr name="pactfeelist" style="display:none">                
						    <td>
						    	 <img src="<s:url value="/images/report/grid_tool_del.gif" />" οnclick="deleteRow($(this).parent().parent());modifyPactMoney();" />
							     <input type="hidden" name="pactfeelist[0].projid" value="<s:property value="projid"/>" disabled="true"/>
							     <input type="hidden" name="pactfeelist[0].feepactid" value="" disabled="true"/>       
							</td>
						    <td>
						         <dict:select dictTypeId="BMS_VOUCHER_TYPE" οnblur="checkDefault($(this));" name="pactfeelist[0].feetype" value="" cssClass="easyui-validatebox feetype" rule="required:true" disabled="true"/>       
							</td>
							<td>
						         <dict:select dictTypeId="BMS_FEE_METHOD" name="pactfeelist[0].feemethod" value="" cssClass="easyui-validatebox" rule="required:true" disabled="true"/>   
							</td>
							<td>
						        <input type="text" id="pactfeelist[0].feerate" name="pactfeelist[0].feerate" οnblur="modifyPactMoney();" οnfοcus="checkPactMoney();" disabled="true" class="easyui-validatebox feerate" data-options="required:true,validType:'number'" style="width:120px;"/> 
							</td>
							<td>
						        <input type="text" id="pactfeelist[0].feewill" οnblur="allFeeSum();" name="pactfeelist[0].feewill" disabled="true" class="easyui-validatebox feewill" data-options="required:true,validType:'number'" style="width:120px;"/>   
							</td>
							<td>
						        <dict:select dictTypeId="BMS_REGCURRID_TYPE" name="pactfeelist[0].currency" defultValue="001" value="" cssClass="easyui-validatebox" rule="required:true" disabled="true"/>   
							</td>
						</tr>
						<s:if test="!pactfeelist.isEmpty">
							<s:iterator value="pactfeelist" var="feeInfo" status="stus">
								<tr name="pactfeelist">                
								    <td>
								    	 <img src="<s:url value="/images/report/grid_tool_del.gif" />" οnclick="deleteRow($(this).parent().parent());modifyPactMoney();" />
									     <input type="hidden" name="pactfeelist[<s:property value="#stus.index + 1"/>].projid" value="<s:property value="projid"/>"/>
									     <input type="hidden" name="pactfeelist[<s:property value="#stus.index + 1"/>].feepactid" value="<s:property value="feepactid"/>"/>       
									</td>
								    <td>
								         <dict:select dictTypeId="BMS_VOUCHER_TYPE"  οnblur="checkDefault($(this));"  name="pactfeelist[%{#stus.index + 1}].feetype" value="#feeInfo.feetype" cssClass="easyui-validatebox feetype" rule="required:true"/>       
									</td>
									<td>
								         <dict:select dictTypeId="BMS_FEE_METHOD"  name="pactfeelist[%{#stus.index + 1}].feemethod" value="#feeInfo.feemethod" cssClass="easyui-validatebox" rule="required:true"/>   
									</td>
									<td>
								        <input type="text" id="pactfeelist[<s:property value="#stus.index + 1"/>].feerate" name="pactfeelist[<s:property value="#stus.index + 1"/>].feerate" οnblur="modifyPactMoney();" οnfοcus="checkPactMoney();"  value="<v:property value="feerate" number="true"/>" class="easyui-validatebox feerate" data-options="required:true,validType:'number'" style="width:120px;"/> 
									</td> 
									<td>
								        <input type="text" id="pactfeelist[<s:property value="#stus.index + 1"/>].feewill" name="pactfeelist[<s:property value="#stus.index + 1"/>].feewill"  οnblur="allFeeSum();" value="<v:property value="feewill" number="true"/>" class="easyui-validatebox feewill" data-options="required:true,validType:'number'" style="width:120px;"/>   
									</td>
									<td>
								        <dict:select dictTypeId="BMS_REGCURRID_TYPE" name="pactfeelist[%{#stus.index + 1}].currency" value="#feeInfo.currency" cssClass="easyui-validatebox" rule="required:true"/>   
									</td>
								</tr>
							</s:iterator>
						</s:if>
						
						<s:else >
							<tr name="pactfeelist">                
								<td>
									 <img src="<s:url value="/images/report/grid_tool_del.gif" />" />
									 <input type="hidden" name="pactfeelist[0].projid" value="<s:property value="projid"/>"/>
									 <input type="hidden" name="pactfeelist[0].feepactid" value="<s:property value="feepactid"/>"/>       
								</td>
								<td>
									 <dict:select dictTypeId="BMS_VOUCHER_TYPE" οnblur="checkDefault($(this));"  name="pactfeelist[0].feetype"  cssClass="easyui-validatebox feetype" rule="required:true"/>     
								</td>
								<td> 
									 <dict:select dictTypeId="BMS_FEE_METHOD"  name="pactfeelist[0].feemethod"  cssClass="easyui-validatebox" rule="required:true"/>   
								</td>
								<td>
									<input type="text" id="pactfeelist[0].feerate" name="pactfeelist[0].feerate" οnblur="modifyPactMoney();" οnfοcus="checkPactMoney();" class="easyui-validatebox feerate" data-options="required:true,validType:'number'" style="width:120px;"/> 
								</td> 
								<td>
									<input type="text" id="pactfeelist[0].feewill" name="pactfeelist[0].feewill"  οnblur="allFeeSum();" class="easyui-validatebox feewill" data-options="required:true,validType:'number'" style="width:120px;"/>   
								</td>
								<td>
									<dict:select dictTypeId="BMS_REGCURRID_TYPE" name="pactfeelist[0].currency" defultValue="001"  cssClass="easyui-validatebox" rule="required:true"/>   
								</td>
							</tr>
						</s:else>	                
						</table>
						<table width="100%">
						 <tr>
						 <td width="64%" align="right">合计收费:</td>
						 <td >
							 <span id="allFeeSum"></span>元
							 <input type="hidden"  id="baseInfoBZJFeeRate" value=""/>
						 </td>
						 </tr>
						 </table>
					</td>
				</tr>

  

转载于:https://www.cnblogs.com/xh_Blog/p/9618233.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值