|
@@ -17,7 +17,10 @@
|
|
}
|
|
}
|
|
var total=(parseFloat(jiananAfterArchitectureCost) + parseFloat(jiananAfterInstallCost)+parseFloat(jiananAfterOtherCost)).toFixed(2);
|
|
var total=(parseFloat(jiananAfterArchitectureCost) + parseFloat(jiananAfterInstallCost)+parseFloat(jiananAfterOtherCost)).toFixed(2);
|
|
$("#preliminaryList"+index+"_jiananAfterTotalCost").val(total);
|
|
$("#preliminaryList"+index+"_jiananAfterTotalCost").val(total);
|
|
-
|
|
|
|
|
|
+ updateSum("jiananAfterArchitectureCost")
|
|
|
|
+ updateSum("jiananAfterInstallCost")
|
|
|
|
+ updateSum("jiananAfterOtherCost")
|
|
|
|
+ updateSum("jiananAfterTotalCost")
|
|
if(!isNumber(val))return;
|
|
if(!isNumber(val))return;
|
|
}
|
|
}
|
|
function formatOtherNumMoney(obj,index) {
|
|
function formatOtherNumMoney(obj,index) {
|
|
@@ -37,8 +40,35 @@
|
|
var total=(parseFloat(otherAfterArchitectureCost) + parseFloat(otherAfterClearCost)+parseFloat(otherAfterOtherCost)).toFixed(2);
|
|
var total=(parseFloat(otherAfterArchitectureCost) + parseFloat(otherAfterClearCost)+parseFloat(otherAfterOtherCost)).toFixed(2);
|
|
$("#preliminaryList"+index+"_otherAfterTotalCost").val(total);
|
|
$("#preliminaryList"+index+"_otherAfterTotalCost").val(total);
|
|
|
|
|
|
|
|
+ updateSum("otherAfterArchitectureCost")
|
|
|
|
+ updateSum("otherAfterClearCost")
|
|
|
|
+ updateSum("otherAfterOtherCost")
|
|
|
|
+ updateSum("otherAfterTotalCost")
|
|
if(!isNumber(val))return;
|
|
if(!isNumber(val))return;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ function beforeCost(obj,index) {
|
|
|
|
+ updateSum("otherBeforeCost")
|
|
|
|
+ updateSum("jiananBeforeCost")
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ function updateSum(name) {
|
|
|
|
+ var totalSum = 0;
|
|
|
|
+ for(var i = 1; i<100; i++){
|
|
|
|
+ //判断是否是隐藏行,如果是隐藏行则不进行运算
|
|
|
|
+ if(!$("#preliminaryList"+i).is(":hidden")){
|
|
|
|
+ var reult = parseFloat($("#preliminaryList"+i+"_"+name).val());
|
|
|
|
+ if(!isNaN(reult)){
|
|
|
|
+ totalSum += reult;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(0 == totalSum){
|
|
|
|
+ document.getElementById(name).innerHTML='';
|
|
|
|
+ }else{
|
|
|
|
+ document.getElementById(name).innerHTML=totalSum.toFixed(2);;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
</script>
|
|
</script>
|
|
<form id="subForm" action="#" onsubmit="return false;" method="post" class="form-horizontal">
|
|
<form id="subForm" action="#" onsubmit="return false;" method="post" class="form-horizontal">
|
|
<c:forEach items="${signList}" var="sign">
|
|
<c:forEach items="${signList}" var="sign">
|
|
@@ -82,6 +112,8 @@
|
|
</thead>
|
|
</thead>
|
|
<tbody id="preliminaryList">
|
|
<tbody id="preliminaryList">
|
|
</tbody>
|
|
</tbody>
|
|
|
|
+ <tfoot id="preliminaryFootList">
|
|
|
|
+ </tfoot>
|
|
</table>
|
|
</table>
|
|
</c:if>
|
|
</c:if>
|
|
</c:forEach>
|
|
</c:forEach>
|
|
@@ -100,10 +132,10 @@
|
|
<input id="preliminaryList{{idx}}_costName" subName="costName" value="{{row.costName}}" type="text" class="form-control contentDetail"/>
|
|
<input id="preliminaryList{{idx}}_costName" subName="costName" value="{{row.costName}}" type="text" class="form-control contentDetail"/>
|
|
</td>
|
|
</td>
|
|
<td>
|
|
<td>
|
|
- <input id="preliminaryList{{idx}}_jiananBeforeCost" subName="jiananBeforeCost" type="text" value="{{row.jiananBeforeCost}}" class="form-control number contentDetail money"/>
|
|
|
|
|
|
+ <input id="preliminaryList{{idx}}_jiananBeforeCost" subName="jiananBeforeCost" onchange="beforeCost(this,{{idx}});" type="text" value="{{row.jiananBeforeCost}}" class="form-control number contentDetail money"/>
|
|
</td>
|
|
</td>
|
|
<td>
|
|
<td>
|
|
- <input id="preliminaryList{{idx}}_jiananAfterArchitectureCost" subName="jiananAfterArchitectureCost" type="text" value="{{row.jiananAfterArchitectureCost}}" onchange="formatJiananNumMoney(this,{{idx}});" class="form-control number contentDetail money"/>
|
|
|
|
|
|
+ <input id="preliminaryList{{idx}}_jiananAfterArchitectureCost" subName="jiananAfterArchitectureCost" type="text" value="{{row.jiananAfterArchitectureCost}}" onchange="formatJiananNumMoney(this,{{idx}});" class="form-control number contentDetail money"/>
|
|
</td>
|
|
</td>
|
|
<td>
|
|
<td>
|
|
<input id="preliminaryList{{idx}}_jiananAfterInstallCost" subName="jiananAfterInstallCost" type="text" value="{{row.jiananAfterInstallCost}}" onchange="formatJiananNumMoney(this,{{idx}});" class="form-control number contentDetail money"/>
|
|
<input id="preliminaryList{{idx}}_jiananAfterInstallCost" subName="jiananAfterInstallCost" type="text" value="{{row.jiananAfterInstallCost}}" onchange="formatJiananNumMoney(this,{{idx}});" class="form-control number contentDetail money"/>
|
|
@@ -118,16 +150,16 @@
|
|
<input id="preliminaryList{{idx}}_jiananRemark" subName="jiananRemark" type="text" value="{{row.jiananRemark}}" class="form-control contentDetail"/>
|
|
<input id="preliminaryList{{idx}}_jiananRemark" subName="jiananRemark" type="text" value="{{row.jiananRemark}}" class="form-control contentDetail"/>
|
|
</td>
|
|
</td>
|
|
<td>
|
|
<td>
|
|
- <input id="preliminaryList{{idx}}_otherBeforeCost" subName="otherBeforeCost" type="text" value="{{row.otherBeforeCost}}" class="form-control number contentDetail"/>
|
|
|
|
|
|
+ <input id="preliminaryList{{idx}}_otherBeforeCost" subName="otherBeforeCost" type="text" onchange="beforeCost(this,{{idx}});" value="{{row.otherBeforeCost}}" class="form-control number contentDetail"/>
|
|
</td>
|
|
</td>
|
|
<td>
|
|
<td>
|
|
- <input id="preliminaryList{{idx}}_otherAfterArchitectureCost" subName="otherAfterArchitectureCost" type="text" value="{{row.otherAfterArchitectureCost}}" onchange="formatOtherNumMoney(this,{{idx}});" class="form-control number contentDetail"/>
|
|
|
|
|
|
+ <input id="preliminaryList{{idx}}_otherAfterArchitectureCost" subName="otherAfterArchitectureCost" type="text" value="{{row.otherAfterArchitectureCost}}" onchange="formatOtherNumMoney(this,{{idx}});" class="form-control number contentDetail money"/>
|
|
</td>
|
|
</td>
|
|
<td>
|
|
<td>
|
|
- <input id="preliminaryList{{idx}}_otherAfterClearCost" subName="otherAfterClearCost" type="text" value="{{row.otherAfterClearCost}}" onchange="formatOtherNumMoney(this,{{idx}});" class="form-control number contentDetail"/>
|
|
|
|
|
|
+ <input id="preliminaryList{{idx}}_otherAfterClearCost" subName="otherAfterClearCost" type="text" value="{{row.otherAfterClearCost}}" onchange="formatOtherNumMoney(this,{{idx}});" class="form-control number contentDetail money"/>
|
|
</td>
|
|
</td>
|
|
<td>
|
|
<td>
|
|
- <input id="preliminaryList{{idx}}_otherAfterOtherCost" subName="otherAfterOtherCost" type="text" value="{{row.otherAfterOtherCost}}" onchange="formatOtherNumMoney(this,{{idx}});" class="form-control contentDetail"/>
|
|
|
|
|
|
+ <input id="preliminaryList{{idx}}_otherAfterOtherCost" subName="otherAfterOtherCost" type="text" value="{{row.otherAfterOtherCost}}" onchange="formatOtherNumMoney(this,{{idx}});" class="form-control contentDetail money"/>
|
|
</td>
|
|
</td>
|
|
<td>
|
|
<td>
|
|
<input id="preliminaryList{{idx}}_otherAfterTotalCost" readonly="readonly" subName="otherAfterTotalCost" type="text" value="{{row.otherAfterTotalCost}}" class="form-control contentDetail"/>
|
|
<input id="preliminaryList{{idx}}_otherAfterTotalCost" readonly="readonly" subName="otherAfterTotalCost" type="text" value="{{row.otherAfterTotalCost}}" class="form-control contentDetail"/>
|
|
@@ -140,8 +172,59 @@
|
|
</td>
|
|
</td>
|
|
</tr>//-->
|
|
</tr>//-->
|
|
</script>
|
|
</script>
|
|
|
|
+
|
|
|
|
+ <script type="text/template" id="preliminaryFootTpl">//<!--
|
|
|
|
+ <tr id="preliminaryFootList{{idx}}">
|
|
|
|
+ <td style="text-align: center">
|
|
|
|
+ 合计
|
|
|
|
+ </td>
|
|
|
|
+ <td style="text-align: center">
|
|
|
|
+
|
|
|
|
+ </td>
|
|
|
|
+ <td id="jiananBeforeCost">
|
|
|
|
+
|
|
|
|
+ </td>
|
|
|
|
+ <td id="jiananAfterArchitectureCost">
|
|
|
|
+
|
|
|
|
+ </td>
|
|
|
|
+ <td id="jiananAfterInstallCost">
|
|
|
|
+
|
|
|
|
+ </td>
|
|
|
|
+ <td id = "jiananAfterOtherCost">
|
|
|
|
+
|
|
|
|
+ </td>
|
|
|
|
+ <td id="jiananAfterTotalCost">
|
|
|
|
+
|
|
|
|
+ </td>
|
|
|
|
+ <td style="text-align: center">
|
|
|
|
+
|
|
|
|
+ </td>
|
|
|
|
+ <td id="otherBeforeCost">
|
|
|
|
+
|
|
|
|
+ </td>
|
|
|
|
+ <td id="otherAfterArchitectureCost">
|
|
|
|
+
|
|
|
|
+ </td>
|
|
|
|
+ <td id= "otherAfterClearCost">
|
|
|
|
+
|
|
|
|
+ </td>
|
|
|
|
+ <td id="otherAfterOtherCost">
|
|
|
|
+ </td>
|
|
|
|
+ <td id="otherAfterTotalCost">
|
|
|
|
+
|
|
|
|
+ </td>
|
|
|
|
+ <td style="text-align: center">
|
|
|
|
+
|
|
|
|
+ </td>
|
|
|
|
+ <td class="text-center op-td" style="text-align: center">
|
|
|
|
+
|
|
|
|
+ </td>
|
|
|
|
+ </tr>//-->
|
|
|
|
+ </script>
|
|
<script type="text/javascript">
|
|
<script type="text/javascript">
|
|
|
|
+ var recordInt = 0;
|
|
var preliminaryIdx = 0, preliminaryTpl = $("#preliminaryTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
|
|
var preliminaryIdx = 0, preliminaryTpl = $("#preliminaryTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
|
|
|
|
+ var preliminaryFootIdx = 0, preliminaryFootTpl = $("#preliminaryFootTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
|
|
var validateForm2;
|
|
var validateForm2;
|
|
$(function(){
|
|
$(function(){
|
|
validateForm2 = $("#subForm").validate({
|
|
validateForm2 = $("#subForm").validate({
|
|
@@ -170,6 +253,10 @@
|
|
idx = idx+1;
|
|
idx = idx+1;
|
|
bornTemplete(list, idx, tpl, row, idx);
|
|
bornTemplete(list, idx, tpl, row, idx);
|
|
preliminaryIdx +=1;
|
|
preliminaryIdx +=1;
|
|
|
|
+ if(recordInt ==0){
|
|
|
|
+ bornTemplete('#preliminaryFootList',preliminaryFootIdx,preliminaryFootTpl, row, idx);
|
|
|
|
+ }
|
|
|
|
+ recordInt+=1;
|
|
}
|
|
}
|
|
|
|
|
|
function bornTemplete(list, idx, tpl, row, idx1){
|
|
function bornTemplete(list, idx, tpl, row, idx1){
|
|
@@ -199,6 +286,17 @@
|
|
delFlag.val("1");
|
|
delFlag.val("1");
|
|
$(obj).parent().parent().hide();
|
|
$(obj).parent().parent().hide();
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ updateSum("jiananAfterArchitectureCost")
|
|
|
|
+ updateSum("jiananAfterInstallCost")
|
|
|
|
+ updateSum("jiananAfterOtherCost")
|
|
|
|
+ updateSum("jiananAfterTotalCost")
|
|
|
|
+ updateSum("otherAfterArchitectureCost")
|
|
|
|
+ updateSum("otherAfterClearCost")
|
|
|
|
+ updateSum("otherAfterOtherCost")
|
|
|
|
+ updateSum("otherAfterTotalCost")
|
|
|
|
+ updateSum("otherBeforeCost")
|
|
|
|
+ updateSum("jiananBeforeCost")
|
|
}
|
|
}
|
|
|
|
|
|
function genRow(data) {
|
|
function genRow(data) {
|