|  | @@ -0,0 +1,201 @@
 | 
	
		
			
				|  |  | +<%@ 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 beforeCumulativeCompletionMoney=$("#workScheduleList"+index+"_beforeCumulativeCompletionMoney").val();
 | 
	
		
			
				|  |  | +        var beforeTotalPaymentMoney=$("#workScheduleList"+index+"_beforeTotalPaymentMoney").val();
 | 
	
		
			
				|  |  | +        if(beforeCumulativeCompletionMoney==undefined||!isNumber(beforeCumulativeCompletionMoney)||beforeCumulativeCompletionMoney==''){
 | 
	
		
			
				|  |  | +            beforeCumulativeCompletionMoney=0;
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        if(beforeTotalPaymentMoney==undefined||!isNumber(beforeTotalPaymentMoney)||beforeTotalPaymentMoney==''){
 | 
	
		
			
				|  |  | +            beforeTotalPaymentMoney=0;
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        var total=(parseFloat(beforeTotalPaymentMoney) / parseFloat(beforeCumulativeCompletionMoney)).toFixed(2);
 | 
	
		
			
				|  |  | +        $("#workScheduleList"+index+"_beforePayRatio").val(total);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        if(!isNumber(val))return;
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +    function formatOtherNumMoney(obj,index) {
 | 
	
		
			
				|  |  | +        var val = $(obj).val();
 | 
	
		
			
				|  |  | +        var currentCumulativeCompletionMoney=$("#workScheduleList"+index+"_currentCumulativeCompletionMoney").val();
 | 
	
		
			
				|  |  | +        var currentTotalPaymentMoney=$("#workScheduleList"+index+"_currentTotalPaymentMoney").val();
 | 
	
		
			
				|  |  | +        if(currentCumulativeCompletionMoney==undefined||!isNumber(currentCumulativeCompletionMoney)||currentCumulativeCompletionMoney==''){
 | 
	
		
			
				|  |  | +            currentCumulativeCompletionMoney=0;
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        if(currentTotalPaymentMoney==undefined||!isNumber(currentTotalPaymentMoney)||currentTotalPaymentMoney==''){
 | 
	
		
			
				|  |  | +            currentTotalPaymentMoney=0;
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        var total=(parseFloat(currentTotalPaymentMoney) / parseFloat(currentCumulativeCompletionMoney)).toFixed(2);
 | 
	
		
			
				|  |  | +        $("#workScheduleList"+index+"_currentPayRatio").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 =='materialsPrice'}">
 | 
	
		
			
				|  |  | +            <div class="layui-item nav-btns" style="padding-left:0px;">
 | 
	
		
			
				|  |  | +                <a class="nav-btn nav-btn-add" onclick="addRowCost('#workScheduleList',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="8" style="font-size: 20px">暂定材料价的审核、特殊材料价格的询价审核</th>
 | 
	
		
			
				|  |  | +                    </tr>
 | 
	
		
			
				|  |  | +                    <tr>
 | 
	
		
			
				|  |  | +                        <th class="hide"></th>
 | 
	
		
			
				|  |  | +                        <th>序号</th>
 | 
	
		
			
				|  |  | +                        <th>材料名称</th>
 | 
	
		
			
				|  |  | +                        <th>规格及名称</th>
 | 
	
		
			
				|  |  | +                        <th>施工工艺使用部位</th>
 | 
	
		
			
				|  |  | +                        <th>材料单价</th>
 | 
	
		
			
				|  |  | +                        <th>甲方、咨询核定价(不含税价)</th>
 | 
	
		
			
				|  |  | +                        <th>备注</th>
 | 
	
		
			
				|  |  | +                        <th width="60">操作</th>
 | 
	
		
			
				|  |  | +                    </tr>
 | 
	
		
			
				|  |  | +                </thead>
 | 
	
		
			
				|  |  | +                <tbody id="workScheduleList">
 | 
	
		
			
				|  |  | +                </tbody>
 | 
	
		
			
				|  |  | +            </table>
 | 
	
		
			
				|  |  | +        </c:if>
 | 
	
		
			
				|  |  | +    </c:forEach>
 | 
	
		
			
				|  |  | +	<script type="text/template" id="preliminaryTpl">//<!--
 | 
	
		
			
				|  |  | +        <tr id="workScheduleList{{idx}}">
 | 
	
		
			
				|  |  | +            <td class="hide">
 | 
	
		
			
				|  |  | +                <input id="workScheduleList{{idx}}_id" subName="id" class="contentDetail" type="hidden" value="{{row.id}}"/>
 | 
	
		
			
				|  |  | +                <input id="workScheduleList{{idx}}_delFlag" subName="delFlag" class="contentDetail" type="hidden" value="0"/>
 | 
	
		
			
				|  |  | +                <input id="workScheduleList{{idx}}_costType" subName="costType" class="contentDetail"  type="hidden" value="{{row.costType}}"/>
 | 
	
		
			
				|  |  | +                <input id="workScheduleList{{idx}}_type" subName="type" class="contentDetail"  type="hidden" value="materialsPrice"/>
 | 
	
		
			
				|  |  | +            </td>
 | 
	
		
			
				|  |  | +            <td>
 | 
	
		
			
				|  |  | +                <input id="workScheduleList{{idx}}_costNum" subName="costNum" readonly="readonly" style="text-align: center"  value="{{idx}}" type="text" class="form-control contentDetail"/>
 | 
	
		
			
				|  |  | +            </td>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            <td>
 | 
	
		
			
				|  |  | +                <input id="workScheduleList{{idx}}_materialsName" subName="materialsName" style="text-align: center"  value="{{row.materialsName}}" type="text" class="form-control contentDetail"/>
 | 
	
		
			
				|  |  | +            </td>
 | 
	
		
			
				|  |  | +            <td>
 | 
	
		
			
				|  |  | +                <input id="workScheduleList{{idx}}_specificationName" subName="specificationName" type="text" value="{{row.specificationName}}" class="form-control contentDetail"/>
 | 
	
		
			
				|  |  | +            </td>
 | 
	
		
			
				|  |  | +            <td>
 | 
	
		
			
				|  |  | +                <input id="workScheduleList{{idx}}_partUsed" subName="partUsed" type="text" value="{{row.partUsed}}" class="form-control contentDetail"/>
 | 
	
		
			
				|  |  | +            </td>
 | 
	
		
			
				|  |  | +            <td>
 | 
	
		
			
				|  |  | +                <input id="workScheduleList{{idx}}_materialPrice" subName="materialPrice" type="text" value="{{row.materialPrice}}" class="form-control contentDetail"/>
 | 
	
		
			
				|  |  | +            </td>
 | 
	
		
			
				|  |  | +            <td>
 | 
	
		
			
				|  |  | +                <input id="workScheduleList{{idx}}_nuclearPrice" subName="nuclearPrice" type="text"  value="{{row.nuclearPrice}}" class="form-control number  contentDetail money"/>
 | 
	
		
			
				|  |  | +            </td>
 | 
	
		
			
				|  |  | +            <td>
 | 
	
		
			
				|  |  | +                <input id="workScheduleList{{idx}}_remarks" subName="remarks" type="text"  value="{{row.remarks}}" class="form-control  contentDetail"/>
 | 
	
		
			
				|  |  | +            </td>
 | 
	
		
			
				|  |  | +            <td class="text-center op-td">
 | 
	
		
			
				|  |  | +                        <a href="#" onclick="delRow(this, '#workScheduleList{{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(workScheduleList)};
 | 
	
		
			
				|  |  | +            console.log(data);
 | 
	
		
			
				|  |  | +            for (var i=0; i<data.length; i++){
 | 
	
		
			
				|  |  | +                addRowCost('#workScheduleList', preliminaryIdx, preliminaryTpl,data[i]);
 | 
	
		
			
				|  |  | +                $("#workScheduleList"+i+"_nodeTypes").val(data[i].nodeTypes);
 | 
	
		
			
				|  |  | +                $("#workScheduleList"+i+"_expenseType").val(data[i].expenseType);
 | 
	
		
			
				|  |  | +                $("#workScheduleList"+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 = $("#workScheduleList 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('#workScheduleList',preliminaryIdx,preliminaryTpl,data[i]);
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            $(":input.money").change();
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        function genDetailStr(){
 | 
	
		
			
				|  |  | +            var costList = $("#workScheduleList 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;
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        function genSecondDetailStr(){
 | 
	
		
			
				|  |  | +            return '';
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +    </script>
 | 
	
		
			
				|  |  | +</form>
 |