|  | @@ -0,0 +1,239 @@
 | 
	
		
			
				|  |  | +<%@ page contentType="text/html;charset=UTF-8" %>
 | 
	
		
			
				|  |  | +<%@ include file="/webpage/include/taglib.jsp"%>
 | 
	
		
			
				|  |  | +<script type="text/javascript">
 | 
	
		
			
				|  |  | +    function formatJiananNumMoney(obj,index) {
 | 
	
		
			
				|  |  | +        var val = $(obj).val();
 | 
	
		
			
				|  |  | +        var jiananAfterArchitectureCost=$("#preliminaryList"+index+"_jiananAfterArchitectureCost").val();
 | 
	
		
			
				|  |  | +        var jiananAfterInstallCost=$("#preliminaryList"+index+"_jiananAfterInstallCost").val();
 | 
	
		
			
				|  |  | +        var jiananAfterOtherCost=$("#preliminaryList"+index+"_jiananAfterOtherCost").val();
 | 
	
		
			
				|  |  | +        if(jiananAfterArchitectureCost==undefined||!isNumber(jiananAfterArchitectureCost)||jiananAfterArchitectureCost==''){
 | 
	
		
			
				|  |  | +            jiananAfterArchitectureCost=0;
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        if(jiananAfterInstallCost==undefined||!isNumber(jiananAfterInstallCost)||jiananAfterInstallCost==''){
 | 
	
		
			
				|  |  | +            jiananAfterInstallCost=0;
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        if(jiananAfterOtherCost==undefined||!isNumber(jiananAfterOtherCost)||jiananAfterOtherCost==''){
 | 
	
		
			
				|  |  | +            jiananAfterOtherCost=0;
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        var total=(parseFloat(jiananAfterArchitectureCost) + parseFloat(jiananAfterInstallCost)+parseFloat(jiananAfterOtherCost)).toFixed(2);
 | 
	
		
			
				|  |  | +        $("#preliminaryList"+index+"_jiananAfterTotalCost").val(total);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        if(!isNumber(val))return;
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +    function formatOtherNumMoney(obj,index) {
 | 
	
		
			
				|  |  | +        var val = $(obj).val();
 | 
	
		
			
				|  |  | +        var otherAfterArchitectureCost=$("#preliminaryList"+index+"_otherAfterArchitectureCost").val();
 | 
	
		
			
				|  |  | +        var otherAfterClearCost=$("#preliminaryList"+index+"_otherAfterClearCost").val();
 | 
	
		
			
				|  |  | +        var otherAfterOtherCost=$("#preliminaryList"+index+"_otherAfterOtherCost").val();
 | 
	
		
			
				|  |  | +        if(otherAfterArchitectureCost==undefined||!isNumber(otherAfterArchitectureCost)||otherAfterArchitectureCost==''){
 | 
	
		
			
				|  |  | +            otherAfterArchitectureCost=0;
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        if(otherAfterClearCost==undefined||!isNumber(otherAfterClearCost)||otherAfterClearCost==''){
 | 
	
		
			
				|  |  | +            otherAfterClearCost=0;
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        if(otherAfterOtherCost==undefined||!isNumber(otherAfterOtherCost)||otherAfterOtherCost==''){
 | 
	
		
			
				|  |  | +            otherAfterOtherCost=0;
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        var total=(parseFloat(otherAfterArchitectureCost) + parseFloat(otherAfterClearCost)+parseFloat(otherAfterOtherCost)).toFixed(2);
 | 
	
		
			
				|  |  | +        $("#preliminaryList"+index+"_otherAfterTotalCost").val(total);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        if(!isNumber(val))return;
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +</script>
 | 
	
		
			
				|  |  | +<form id="subForm"  action="#" onsubmit="return false;" method="post" class="form-horizontal">
 | 
	
		
			
				|  |  | +    <c:forEach items="${signList}" var="sign">
 | 
	
		
			
				|  |  | +        <c:if test="${sign =='preliminary'}">
 | 
	
		
			
				|  |  | +            <div class="layui-item nav-btns" style="padding-left:0px;">
 | 
	
		
			
				|  |  | +                <a class="nav-btn nav-btn-add" onclick="addRowCost('#preliminaryList',preliminaryIdx,preliminaryTpl)" title="新增"><i class="fa fa-plus"></i> 新增</a>
 | 
	
		
			
				|  |  | +                <table:importExcelCost url="${ctx}/workPreliminary/workPreliminaryDesignEstimate/import"></table:importExcelCost><!-- 导入按钮 -->
 | 
	
		
			
				|  |  | +            </div>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            <table id="contentTable" class="table table-bordered table-condensed can-edit">
 | 
	
		
			
				|  |  | +                <thead>
 | 
	
		
			
				|  |  | +                    <tr>
 | 
	
		
			
				|  |  | +                        <th colspan="15" style="font-size: 20px">输变电工程初步设计概算审查汇总表</th>
 | 
	
		
			
				|  |  | +                    </tr>
 | 
	
		
			
				|  |  | +                    <tr>
 | 
	
		
			
				|  |  | +                        <th rowspan="3" class="hide"></th>
 | 
	
		
			
				|  |  | +                        <th rowspan="3" >序号</th>
 | 
	
		
			
				|  |  | +                        <th rowspan="3" >工程或费用名称</th>
 | 
	
		
			
				|  |  | +                        <th colspan="6" >建安工程(万元)</th>
 | 
	
		
			
				|  |  | +                        <th colspan="6">其他费用(万元)</th>
 | 
	
		
			
				|  |  | +                        <th width="60" rowspan="3">操作</th>
 | 
	
		
			
				|  |  | +                    </tr>
 | 
	
		
			
				|  |  | +                    <tr>
 | 
	
		
			
				|  |  | +                        <th rowspan="2">评审前</th>
 | 
	
		
			
				|  |  | +                        <th colspan="4">评审后</th>
 | 
	
		
			
				|  |  | +                        <th rowspan="2">备注</th>
 | 
	
		
			
				|  |  | +                        <th rowspan="2">评审前</th>
 | 
	
		
			
				|  |  | +                        <th colspan="4">评审后</th>
 | 
	
		
			
				|  |  | +                        <th rowspan="2">备注</th>
 | 
	
		
			
				|  |  | +                    </tr>
 | 
	
		
			
				|  |  | +                    <tr>
 | 
	
		
			
				|  |  | +                        <th>建筑工程费</th>
 | 
	
		
			
				|  |  | +                        <th>安装工程费</th>
 | 
	
		
			
				|  |  | +                        <th>其他费用</th>
 | 
	
		
			
				|  |  | +                        <th>合计</th>
 | 
	
		
			
				|  |  | +                        <th>建设工程其他费用</th>
 | 
	
		
			
				|  |  | +                        <th>场地征用清理费用</th>
 | 
	
		
			
				|  |  | +                        <th>其他费用</th>
 | 
	
		
			
				|  |  | +                        <th>合计</th>
 | 
	
		
			
				|  |  | +                    </tr>
 | 
	
		
			
				|  |  | +                </thead>
 | 
	
		
			
				|  |  | +                <tbody id="preliminaryList">
 | 
	
		
			
				|  |  | +                </tbody>
 | 
	
		
			
				|  |  | +            </table>
 | 
	
		
			
				|  |  | +        </c:if>
 | 
	
		
			
				|  |  | +    </c:forEach>
 | 
	
		
			
				|  |  | +	<script type="text/template" id="preliminaryTpl">//<!--
 | 
	
		
			
				|  |  | +        <tr id="preliminaryList{{idx}}">
 | 
	
		
			
				|  |  | +            <td class="hide">
 | 
	
		
			
				|  |  | +                <input id="preliminaryList{{idx}}_id" subName="id" class="contentDetail" type="hidden" value="{{row.id}}"/>
 | 
	
		
			
				|  |  | +                <input id="preliminaryList{{idx}}_delFlag" subName="delFlag" class="contentDetail" type="hidden" value="0"/>
 | 
	
		
			
				|  |  | +                <input id="preliminaryList{{idx}}_costType" subName="costType" class="contentDetail"  type="hidden" value="{{row.costType}}"/>
 | 
	
		
			
				|  |  | +                <input id="preliminaryList{{idx}}_type" subName="type" class="contentDetail"  type="hidden" value="preliminary"/>
 | 
	
		
			
				|  |  | +            </td>
 | 
	
		
			
				|  |  | +            <td>
 | 
	
		
			
				|  |  | +                <input id="preliminaryList{{idx}}_costNum" subName="costNum" readonly="readonly" style="text-align: center"  value="{{idx}}" type="text" class="form-control contentDetail"/>
 | 
	
		
			
				|  |  | +            </td>
 | 
	
		
			
				|  |  | +            <td>
 | 
	
		
			
				|  |  | +                <input id="preliminaryList{{idx}}_costName" subName="costName" value="{{row.costName}}" type="text" class="form-control contentDetail"/>
 | 
	
		
			
				|  |  | +            </td>
 | 
	
		
			
				|  |  | +            <td>
 | 
	
		
			
				|  |  | +                <input id="preliminaryList{{idx}}_jiananBeforeCost" subName="jiananBeforeCost" type="text" value="{{row.jiananBeforeCost}}"  class="form-control number contentDetail money"/>
 | 
	
		
			
				|  |  | +            </td>
 | 
	
		
			
				|  |  | +            <td>
 | 
	
		
			
				|  |  | +                <input id="preliminaryList{{idx}}_jiananAfterArchitectureCost" subName="jiananAfterArchitectureCost" type="text" value="{{row.jiananAfterArchitectureCost}}"   onchange="formatJiananNumMoney(this,{{idx}});" class="form-control number contentDetail money"/>
 | 
	
		
			
				|  |  | +            </td>
 | 
	
		
			
				|  |  | +            <td>
 | 
	
		
			
				|  |  | +                <input id="preliminaryList{{idx}}_jiananAfterInstallCost" subName="jiananAfterInstallCost" type="text" value="{{row.jiananAfterInstallCost}}"  onchange="formatJiananNumMoney(this,{{idx}});"  class="form-control number contentDetail money"/>
 | 
	
		
			
				|  |  | +            </td>
 | 
	
		
			
				|  |  | +            <td>
 | 
	
		
			
				|  |  | +                <input id="preliminaryList{{idx}}_jiananAfterOtherCost" subName="jiananAfterOtherCost" type="text"  value="{{row.jiananAfterOtherCost}}"  onchange="formatJiananNumMoney(this,{{idx}});" class="form-control number  contentDetail money"/>
 | 
	
		
			
				|  |  | +            </td>
 | 
	
		
			
				|  |  | +            <td>
 | 
	
		
			
				|  |  | +                <input id="preliminaryList{{idx}}_jiananAfterTotalCost" readonly="readonly" subName="jiananAfterTotalCost" type="text"    value="{{row.jiananAfterTotalCost}}" class="form-control number contentDetail"/>
 | 
	
		
			
				|  |  | +            </td>
 | 
	
		
			
				|  |  | +            <td>
 | 
	
		
			
				|  |  | +                <input id="preliminaryList{{idx}}_jiananRemark" subName="jiananRemark" type="text"  value="{{row.jiananRemark}}" class="form-control contentDetail"/>
 | 
	
		
			
				|  |  | +            </td>
 | 
	
		
			
				|  |  | +            <td>
 | 
	
		
			
				|  |  | +                <input id="preliminaryList{{idx}}_otherBeforeCost" subName="otherBeforeCost" type="text"  value="{{row.otherBeforeCost}}" class="form-control number contentDetail"/>
 | 
	
		
			
				|  |  | +            </td>
 | 
	
		
			
				|  |  | +            <td>
 | 
	
		
			
				|  |  | +                <input id="preliminaryList{{idx}}_otherAfterArchitectureCost" subName="otherAfterArchitectureCost" type="text"  value="{{row.otherAfterArchitectureCost}}" onchange="formatOtherNumMoney(this,{{idx}});" class="form-control number contentDetail"/>
 | 
	
		
			
				|  |  | +            </td>
 | 
	
		
			
				|  |  | +            <td>
 | 
	
		
			
				|  |  | +                <input id="preliminaryList{{idx}}_otherAfterClearCost" subName="otherAfterClearCost" type="text"  value="{{row.otherAfterClearCost}}" onchange="formatOtherNumMoney(this,{{idx}});" class="form-control number contentDetail"/>
 | 
	
		
			
				|  |  | +            </td>
 | 
	
		
			
				|  |  | +            <td>
 | 
	
		
			
				|  |  | +                <input id="preliminaryList{{idx}}_otherAfterOtherCost" subName="otherAfterOtherCost" type="text"  value="{{row.otherAfterOtherCost}}" onchange="formatOtherNumMoney(this,{{idx}});" class="form-control  contentDetail"/>
 | 
	
		
			
				|  |  | +            </td>
 | 
	
		
			
				|  |  | +            <td>
 | 
	
		
			
				|  |  | +                <input id="preliminaryList{{idx}}_otherAfterTotalCost" readonly="readonly" subName="otherAfterTotalCost" type="text"  value="{{row.otherAfterTotalCost}}" class="form-control  contentDetail"/>
 | 
	
		
			
				|  |  | +            </td>
 | 
	
		
			
				|  |  | +            <td>
 | 
	
		
			
				|  |  | +                <input id="preliminaryList{{idx}}_otherRemark" subName="otherRemark" type="text"  value="{{row.otherRemark}}" class="form-control  contentDetail"/>
 | 
	
		
			
				|  |  | +            </td>
 | 
	
		
			
				|  |  | +            <td class="text-center op-td">
 | 
	
		
			
				|  |  | +                        <a href="#" onclick="delRow(this, '#preliminaryList{{idx}}')"   class="op-btn op-btn-delete"><i class="fa fa-trash"></i> 取消</a>
 | 
	
		
			
				|  |  | +            </td>
 | 
	
		
			
				|  |  | +        </tr>//-->
 | 
	
		
			
				|  |  | +    </script>
 | 
	
		
			
				|  |  | +    <script type="text/javascript">
 | 
	
		
			
				|  |  | +        var preliminaryIdx = 0, preliminaryTpl = $("#preliminaryTpl").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);
 | 
	
		
			
				|  |  | +                    }
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +            });
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            var data = ${fns:toJson(preliminaryList)};
 | 
	
		
			
				|  |  | +            for (var i=0; i<data.length; i++){
 | 
	
		
			
				|  |  | +                addRowCost('#preliminaryList', preliminaryIdx, preliminaryTpl,data[i]);
 | 
	
		
			
				|  |  | +                $("#preliminaryList"+i+"_nodeTypes").val(data[i].nodeTypes);
 | 
	
		
			
				|  |  | +                $("#preliminaryList"+i+"_expenseType").val(data[i].expenseType);
 | 
	
		
			
				|  |  | +                $("#preliminaryList"+i+"_unit").val(data[i].unit);
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            $(":input.money").change();
 | 
	
		
			
				|  |  | +        })
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        function addRowCost(list, idx, tpl, row){
 | 
	
		
			
				|  |  | +            idx = idx+1;
 | 
	
		
			
				|  |  | +            bornTemplete(list, idx, tpl, row, idx);
 | 
	
		
			
				|  |  | +            preliminaryIdx +=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 delRow(obj, prefix,idx){
 | 
	
		
			
				|  |  | +            var id = $(prefix+"_id");
 | 
	
		
			
				|  |  | +            var delFlag = $(prefix+"_delFlag");
 | 
	
		
			
				|  |  | +            if(id.val()==null||id.val()==''){
 | 
	
		
			
				|  |  | +                $(obj).parent().parent().remove();
 | 
	
		
			
				|  |  | +            }else {
 | 
	
		
			
				|  |  | +                delFlag.val("1");
 | 
	
		
			
				|  |  | +                $(obj).parent().parent().hide();
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        function genRow(data) {
 | 
	
		
			
				|  |  | +            for (var i = 0; i < data.length; i++) {
 | 
	
		
			
				|  |  | +                addRowCost('#preliminaryList',preliminaryIdx,preliminaryTpl,data[i]);
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            $(":input.money").change();
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        function genDetailStr(){
 | 
	
		
			
				|  |  | +            var costList = $("#preliminaryList tr");
 | 
	
		
			
				|  |  | +            var contentStr = "[";
 | 
	
		
			
				|  |  | +            for(var j=0; j<costList.length;j++){
 | 
	
		
			
				|  |  | +                contentStr+="{"
 | 
	
		
			
				|  |  | +                var idstr = $(costList[j]).attr("id");
 | 
	
		
			
				|  |  | +                var detail = $("tr[id="+idstr+"] .contentDetail");
 | 
	
		
			
				|  |  | +                for(var i=0; i<detail.length;i++){
 | 
	
		
			
				|  |  | +                    contentStr+="'"
 | 
	
		
			
				|  |  | +                    contentStr+=$(detail[i]).attr("subName");
 | 
	
		
			
				|  |  | +                    contentStr+="'"
 | 
	
		
			
				|  |  | +                    contentStr+=":";
 | 
	
		
			
				|  |  | +                    contentStr+="'"
 | 
	
		
			
				|  |  | +                    contentStr+=$(detail[i]).val();
 | 
	
		
			
				|  |  | +                    contentStr+="'"
 | 
	
		
			
				|  |  | +                    if(i!=detail.length-1){
 | 
	
		
			
				|  |  | +                        contentStr+=","
 | 
	
		
			
				|  |  | +                    }
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +                contentStr+="}"
 | 
	
		
			
				|  |  | +                if(j!=costList.length-1){
 | 
	
		
			
				|  |  | +                    contentStr+=","
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            contentStr += "]";
 | 
	
		
			
				|  |  | +            return contentStr;
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +    </script>
 | 
	
		
			
				|  |  | +</form>
 |