|
@@ -82,7 +82,232 @@
|
|
|
</tr>
|
|
|
</c:forEach>
|
|
|
</tbody>
|
|
|
+ <tfoot id="preliminaryFootList">
|
|
|
+ </tfoot>
|
|
|
</table>
|
|
|
</c:if>
|
|
|
</c:forEach>
|
|
|
-</form>
|
|
|
+</form>
|
|
|
+
|
|
|
+<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" style='text-align:center;'>
|
|
|
+
|
|
|
+ </td>
|
|
|
+ <td id="jiananAfterArchitectureCost" style='text-align:center;'>
|
|
|
+
|
|
|
+ </td>
|
|
|
+ <td id="jiananAfterInstallCost" style='text-align:center;'>
|
|
|
+
|
|
|
+ </td>
|
|
|
+ <td id = "jiananAfterOtherCost" style='text-align:center;'>
|
|
|
+
|
|
|
+ </td>
|
|
|
+ <td id="jiananAfterTotalCost" style='text-align:center;'>
|
|
|
+
|
|
|
+ </td>
|
|
|
+ <td style="text-align: center">
|
|
|
+
|
|
|
+ </td>
|
|
|
+ <td id="otherBeforeCost" style='text-align:center;'>
|
|
|
+
|
|
|
+ </td>
|
|
|
+ <td id="otherAfterArchitectureCost" style='text-align:center;'>
|
|
|
+
|
|
|
+ </td>
|
|
|
+ <td id= "otherAfterClearCost" style='text-align:center;'>
|
|
|
+
|
|
|
+ </td>
|
|
|
+ <td id="otherAfterOtherCost" style='text-align:center;'>
|
|
|
+ </td>
|
|
|
+ <td id="otherAfterTotalCost" style='text-align:center;'>
|
|
|
+
|
|
|
+ </td>
|
|
|
+ <td style="text-align: center">
|
|
|
+
|
|
|
+ </td>
|
|
|
+ </tr>//-->
|
|
|
+</script>
|
|
|
+
|
|
|
+<script type="text/javascript">
|
|
|
+ var recordInt = 0;
|
|
|
+ var preliminaryFootIdx = 0, preliminaryFootTpl = $("#preliminaryFootTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
|
|
|
+ var validateForm2;
|
|
|
+ $(function(){
|
|
|
+ validateForm2 = $("#subForm").validate({
|
|
|
+ errorContainer: "#messageBox",
|
|
|
+ errorPlacement: function(error, element) {
|
|
|
+ $("#messageBox").text("输入有误,请先更正。");
|
|
|
+ if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
|
|
|
+ error.appendTo(element.parent().parent());
|
|
|
+ } else {
|
|
|
+ error.insertAfter(element);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ addRowCost('#preliminaryFootList', preliminaryFootIdx, preliminaryFootTpl,"");
|
|
|
+ $(":input.money").change();
|
|
|
+ })
|
|
|
+
|
|
|
+ function addRowCost(list, idx, tpl, row){
|
|
|
+ idx = idx+1;
|
|
|
+ if(recordInt ==0){
|
|
|
+ bornTemplete('#preliminaryFootList',preliminaryFootIdx,preliminaryFootTpl, row, idx);
|
|
|
+ }
|
|
|
+ recordInt+=1;
|
|
|
+ }
|
|
|
+
|
|
|
+ function bornTemplete(list, idx, tpl, row, idx1){
|
|
|
+ var idx1 = $("#preliminaryList tr").length +1;
|
|
|
+ $(list).append(Mustache.render(tpl, {
|
|
|
+ idx: idx, delBtn: true, row: row,
|
|
|
+ order:idx1 + 1, idx1:idx1
|
|
|
+ }));
|
|
|
+ $(list+idx).find("select").each(function(){
|
|
|
+ $(this).val($(this).attr("data-value"));
|
|
|
+ });
|
|
|
+ $(list+idx).find("input[type='checkbox'], input[type='radio']").each(function(){
|
|
|
+ var ss = $(this).attr("data-value").split(',');
|
|
|
+ for (var i=0; i<ss.length; i++){
|
|
|
+ if($(this).val() == ss[i]){
|
|
|
+ $(this).attr("checked","checked");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ function jiananBeforeCost() {
|
|
|
+ var totalSum = 0
|
|
|
+ $('#preliminaryList tr').each(function() {
|
|
|
+ $(this).find('td:eq(2)').each(function(){
|
|
|
+ totalSum += parseFloat($(this).text());
|
|
|
+ });
|
|
|
+ });
|
|
|
+ return totalSum;
|
|
|
+ }
|
|
|
+ function jiananAfterArchitectureCost() {
|
|
|
+ var totalSum = 0
|
|
|
+ $('#preliminaryList tr').each(function() {
|
|
|
+ $(this).find('td:eq(3)').each(function(){
|
|
|
+ totalSum += parseFloat($(this).text());
|
|
|
+ });
|
|
|
+ });
|
|
|
+ return totalSum;
|
|
|
+ }
|
|
|
+ function jiananAfterInstallCost() {
|
|
|
+ var totalSum = 0
|
|
|
+ $('#preliminaryList tr').each(function() {
|
|
|
+ $(this).find('td:eq(4)').each(function(){
|
|
|
+ totalSum += parseFloat($(this).text());
|
|
|
+ });
|
|
|
+ });
|
|
|
+ return totalSum;
|
|
|
+ }
|
|
|
+ function jiananAfterOtherCost() {
|
|
|
+ var totalSum = 0
|
|
|
+ $('#preliminaryList tr').each(function() {
|
|
|
+ $(this).find('td:eq(5)').each(function(){
|
|
|
+ totalSum += parseFloat($(this).text());
|
|
|
+ });
|
|
|
+ });
|
|
|
+ return totalSum;
|
|
|
+ }
|
|
|
+ function jiananAfterTotalCost() {
|
|
|
+ var totalSum = 0
|
|
|
+ $('#preliminaryList tr').each(function() {
|
|
|
+ $(this).find('td:eq(6)').each(function(){
|
|
|
+ totalSum += parseFloat($(this).text());
|
|
|
+ });
|
|
|
+ });
|
|
|
+ return totalSum;
|
|
|
+ }
|
|
|
+
|
|
|
+ function otherBeforeCost() {
|
|
|
+ var totalSum = 0
|
|
|
+ $('#preliminaryList tr').each(function() {
|
|
|
+ $(this).find('td:eq(8)').each(function(){
|
|
|
+ totalSum += parseFloat($(this).text());
|
|
|
+ });
|
|
|
+ });
|
|
|
+ return totalSum;
|
|
|
+ }
|
|
|
+ function otherAfterArchitectureCost() {
|
|
|
+ var totalSum = 0
|
|
|
+ $('#preliminaryList tr').each(function() {
|
|
|
+ $(this).find('td:eq(9)').each(function(){
|
|
|
+ totalSum += parseFloat($(this).text());
|
|
|
+ });
|
|
|
+ });
|
|
|
+ return totalSum;
|
|
|
+ }
|
|
|
+ function otherAfterClearCost() {
|
|
|
+ var totalSum = 0
|
|
|
+ $('#preliminaryList tr').each(function() {
|
|
|
+ $(this).find('td:eq(10)').each(function(){
|
|
|
+ totalSum += parseFloat($(this).text());
|
|
|
+ });
|
|
|
+ });
|
|
|
+ return totalSum;
|
|
|
+ }
|
|
|
+ function otherAfterOtherCost() {
|
|
|
+ var totalSum = 0
|
|
|
+ $('#preliminaryList tr').each(function() {
|
|
|
+ $(this).find('td:eq(11)').each(function(){
|
|
|
+ totalSum += parseFloat($(this).text());
|
|
|
+ });
|
|
|
+ });
|
|
|
+ return totalSum;
|
|
|
+ }
|
|
|
+ function otherAfterTotalCost() {
|
|
|
+ var totalSum = 0
|
|
|
+ $('#preliminaryList tr').each(function() {
|
|
|
+ $(this).find('td:eq(12)').each(function(){
|
|
|
+ totalSum += parseFloat($(this).text());
|
|
|
+ });
|
|
|
+ });
|
|
|
+ return totalSum;
|
|
|
+ }
|
|
|
+ if(document.readyState=="complete"){
|
|
|
+ var jiananBeforeCost = jiananBeforeCost();
|
|
|
+ var jiananAfterArchitectureCost = jiananAfterArchitectureCost();
|
|
|
+ var jiananAfterInstallCost = jiananAfterInstallCost();
|
|
|
+ var jiananAfterOtherCost = jiananAfterOtherCost();
|
|
|
+ var jiananAfterTotalCost = jiananAfterTotalCost();
|
|
|
+
|
|
|
+ var otherBeforeCost = otherBeforeCost();
|
|
|
+ var otherAfterArchitectureCost = otherAfterArchitectureCost();
|
|
|
+ var otherAfterClearCost = otherAfterClearCost();
|
|
|
+ var otherAfterOtherCost = otherAfterOtherCost();
|
|
|
+ var otherAfterTotalCost = otherAfterTotalCost();
|
|
|
+
|
|
|
+ jiananBeforeCost = jiananBeforeCost.toFixed(2);
|
|
|
+ jiananAfterArchitectureCost = jiananAfterArchitectureCost.toFixed(2);
|
|
|
+ jiananAfterInstallCost = jiananAfterInstallCost.toFixed(2);
|
|
|
+ jiananAfterOtherCost = jiananAfterOtherCost.toFixed(2);
|
|
|
+ jiananAfterTotalCost = jiananAfterTotalCost.toFixed(2);
|
|
|
+
|
|
|
+ otherBeforeCost = otherBeforeCost.toFixed(2);
|
|
|
+ otherAfterArchitectureCost = otherAfterArchitectureCost.toFixed(2);
|
|
|
+ otherAfterClearCost = otherAfterClearCost.toFixed(2);
|
|
|
+ otherAfterOtherCost = otherAfterOtherCost.toFixed(2);
|
|
|
+ otherAfterTotalCost = otherAfterTotalCost.toFixed(2);
|
|
|
+
|
|
|
+ document.getElementById('jiananBeforeCost').innerHTML=jiananBeforeCost;
|
|
|
+ document.getElementById('jiananAfterArchitectureCost').innerHTML=jiananAfterArchitectureCost;
|
|
|
+ document.getElementById('jiananAfterInstallCost').innerHTML=jiananAfterInstallCost;
|
|
|
+ document.getElementById('jiananAfterOtherCost').innerHTML=jiananAfterOtherCost;
|
|
|
+ document.getElementById('jiananAfterTotalCost').innerHTML=jiananAfterTotalCost;
|
|
|
+
|
|
|
+ document.getElementById('otherBeforeCost').innerHTML=otherBeforeCost;
|
|
|
+ document.getElementById('otherAfterArchitectureCost').innerHTML=otherAfterArchitectureCost;
|
|
|
+ document.getElementById('otherAfterClearCost').innerHTML=otherAfterClearCost;
|
|
|
+ document.getElementById('otherAfterOtherCost').innerHTML=otherAfterOtherCost;
|
|
|
+ document.getElementById('otherAfterTotalCost').innerHTML=otherAfterTotalCost;
|
|
|
+ }
|
|
|
+</script>
|