<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/webpage/include/taglib.jsp"%>
<html>
<head>
    <title>项目管理</title>
    <meta name="decorator" content="default"/>
    <script src="${ctxp}/static/layui/layui.js"></script>
    <script type="text/javascript" src="${ctxStatic}/helloweba_editable-select/jquery.editable-select.min.js"></script>
    <script type="text/javascript" src="${ctxStatic}/iCheck/icheck.min.js"></script>
    <link rel='stylesheet' type="text/css" href="${ctxStatic}/helloweba_editable-select/jquery.editable-select.min.css"/>
    <link rel='layuicss' type="text/css" href="${ctxp}/static/layui/css/layui.css"/>
    <style>
        #projectDesc-error{
            left:0;
            top:82px;
        }
        .layui-layer-dialog{
            background: red;
        }
        #workClientLinkmanList td input{
            margin-left:-10px !important;
            height: 42px !important;
        }
    </style>


    <script>
        //主要是用到laydate
        layui.use( 'laydate', function () {
            var laydate = layui.laydate;
            //核心方法
            function timeAdd(){
                lay('.datetime').each(function() {
                    laydate.render({
                        elem : this,
                        trigger : 'click'
                    });
                });
            }
            //初始化时先调用一次，确保静态的那一行可点
            timeAdd();
        })
    </script>


    <script type="text/javascript">
        var validateForm;
        var isMasterClient = true;//是否是主委托方
        var clientCount = 0;
        function doSubmit(i){//回调函数，在编辑和保存动作时，供openDialog调用提交表单。
            if(validateForm.form()){
                // if($(".trIdAdds").length==0){
                //     top.layer.alert('请至少上传一个项目计划表或者实施方案文档！', {icon: 0});
                //     return;
                // }
                if($("#workClientLinkmanList tr").length==0){
                    top.layer.alert('请至少选择一个委托方联系人！', {icon: 0});
                    return;
                }
                /*if($("#workConstructionLinkmanList tr").length==0){
                    top.layer.alert('请至少选择一个施工方联系人！', {icon: 0});
                    return;
                }*/
                if(i==2){
                    $("#inputForm").attr("action","${ctx}/project/projectRecords/tstore");
                }
                $("#inputForm").submit();
                return true;
            }

            return false;
        }
        $(document).ready(function() {
            var radioVal ;
            validateForm = $("#inputForm").validate({
                submitHandler: function(form){
                    loading('正在提交，请稍等...');
                    form.submit();
                },
                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);
                    }
                }
            });

            laydate.render({
                elem: '#beginDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎，因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
                event: 'focus', //响应事件。如果没有传入event，则按照默认的click
                type : 'date'
            });
            laydate.render({
                elem: '#endDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎，因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
                event: 'focus', //响应事件。如果没有传入event，则按照默认的click
                type : 'date'
            });

            <%--$('#scaleType').editableSelect({--%>
                <%--effects: 'slide'--%>
            <%--});--%>
            <%--$('#scaleType').val("${projectRecords.scaleType}")--%>
            <%--$('#scaleUnit').editableSelect({--%>
                <%--effects: 'slide'--%>
            <%--});--%>
            <%--$('#scaleUnit').val("${projectRecords.scaleUnit}")--%>

            $("input[name='ext']").on('ifChecked',function(event){
                radioVal = $(this).val();
                if(radioVal == 0){
                    //有合同状态
                    $("#divv2 input").val("");
                    // $("#workClientLinkmanList tr").remove();
                    $("#divv").show();
                    $("#divv3").show();
                }else{
                    $("#divv input").val('');
                    $("#divv2 input").val("");
                    $("#divv3 input").val("");
                    // $("#workClientLinkmanList tr").remove();
                    $("#divv").hide();
                    $("#divv3").hide();
                    $("#linkmanId").val("");
                }
            });

            //自动选择合同状态
            if ($("#projectName").val() != null) {
                if ($("#contractName").val() == "") {
                    $("#ext1").iCheck("check");
                }
            }


            $('#areaId').on("change", function () {
                var areaId = $("#areaId").val();
                $("#province").val('');
                $("#city").val('');
                $("#county").val('');
                $.ajax({
                    type : "POST",
                    url : "${ctx}/sys/area/getParent",
                    data : {'areaId':areaId},
                    //请求成功
                    success : function(result) {
                        var pro = result.province;
                        var city = result.city;
                        var county  = result.county;
                        if(pro != '') {
                            $("#province").val(pro);
                        }
                        if(city != '') {
                            $("#city").val(city);
                        }
                        if(county != '') {
                            $("#county").val(county);
                        }
                    },

                });
            })

        });


        function setContractValue(obj){
            var clientId = $("#contractClientId").val();
            $.ajax({
                type:'post',
                url:'${ctx}/project/projectRecords/getContractInfo',
                data:{
                    "id":obj
                },
                success:function(data){
                    $("#contractName").val(data.name);
                    $("#contractPrice").val(data.contractPrice);
                    formatNum($("#contractPrice"));
                    $("#contractClientName").val(data.client.name);
                    $("#contractClientId").val(data.client.id);
                    $("#constructionProjectType").val(data.constructionProjectTypeStr);
                    $("#linkmanId").val(data.workClinetInfoIds);
                    //清理之前的联系人
                    var newClientId  = data.client.id;
                    if(clientId != newClientId){
                        $("#workClientLinkmanList tr").remove();
                        if(isMasterClient){
                            clientCount++;
                            setLinkMan(newClientId);
                            isMasterClient = false;
                        }
                    }
                    // console.log("clientId------newClientId");
                    // console.log(clientId+"------"+newClientId);
                }
            });
        }

        function getFee() {
            $("#unitFees").val('');
            var totalFee = $("#totalFees").val();
            var count = $("#buildingScale").val();
            if(count != '' && totalFee != '') {
                var cFee = Math.round(parseInt(totalFee) / parseInt(count) * 100) / 100 * 10000;
                $("#unitFees").val(cFee);
            }
        }

        function getBudlingFees() {
            $("#buildingPercent").val('');
            $("#buildingUnitFees").val('');
            var totalFee = $("#totalFees").val();
            var budFee = $("#buildingFees").val();
            var count = $("#buildingScale").val();
            if(totalFee != '') {
                var p = Math.round(parseInt(budFee) / parseInt(totalFee) * 100 * 100) / 100;
            }
            if(count != '') {
                var pp = Math.round(parseInt(budFee) / parseInt(count) * 100) / 100 * 10000;
            }
            $("#buildingPercent").val(p);
            $("#buildingUnitFees").val(pp);
        }

        function getInstallFees() {
            $("#installPercent").val('');
            $("#installUnitFees").val('');
            var totalFee = $("#totalFees").val();
            var budFee = $("#installFees").val();
            var count = $("#buildingScale").val();
            if(totalFee != '') {
                var p = Math.round(parseInt(budFee) / parseInt(totalFee) * 100 * 100) / 100;
            }
            if(count != '') {
                var pp = Math.round(parseInt(budFee) / parseInt(count) * 100) / 100 * 10000;
            }
            $("#installPercent").val(p);
            $("#installUnitFees").val(pp);
        }

        function setLinkMan(newClientId) {
            $.ajax({
                url:"${ctx}/project/projectRecords/getLinkManByClientId",
                data:{"clientId":newClientId},
                type:"post",
                dataType:"json",
                success:function (d) {
                    // console.log(d);
                    addRow('#workClientLinkmanList', workClientLinkmanRowIdx, workClientLinkmanTpl);workClientLinkmanRowIdx = workClientLinkmanRowIdx + 1;
                    var row = workClientLinkmanRowIdx - 1 ;
                    $("#workClientLinkmanList"+row+"_id").val(d.id);
                    $("#workClientLinkmanList"+row+"_clientId_id").val(d.clientId);
                    $("#workClientLinkmanList"+row+"_clientName").val(d.clientName);
                    $("#workClientLinkmanList"+row+"_name").val(d.linkName);
                    $("#workClientLinkmanList"+row+"_linkMobile").val(d.linkMobile);
                    $("#workClientLinkmanList"+row+"_linkPhone").val(d.linkPhone);
                    $("#workClientLinkmanList"+row+"_clientName").prop("readonly","readonly");
                    $("#workClientLinkmanList"+row+"_name").prop("readonly","readonly");
                    $("#workClientLinkmanList"+row+"_linkMobile").prop("readonly","readonly");
                    $("#workClientLinkmanList"+row+"_linkPhone").prop("readonly","readonly");
                }
            });
        }
        function setValuee(obj){
            var successRows = 0;
            ss = $("#workClientLinkmanList tr").length;
            for (var i = 0; i < obj.length; i++) {
                //没有重复的客户id，就可以插入
                var canInsert = true;
                for (var j = 0; j < ss; j++) {
                    var cid = $("#workClientLinkmanList" + j + "_id").val();
                    if(cid == obj[i].id){
                        canInsert = false;
                        // console.log("重复！！");
                        break;
                    }
                }
                if(canInsert==true){
                    var idArr = $("#workClientLinkmanList tr:visible .clientId");
                    if (obj[i].id != '' && !hasInArr(obj[i].id, idArr)) {
                        addRow("#workClientLinkmanList", workClientLinkmanRowIdx, workClientLinkmanTpl, obj[i]);
                        workClientLinkmanRowIdx = workClientLinkmanRowIdx + 1;
                        successRows++;
                    }
                }
            }
            clientCount=successRows+clientCount;
            // console.log("success==="+successRows);
            // console.log("clientCount==="+clientCount);

            //如果主委托方还没有设置，则将第一个客户设置为主委托方
            if(obj[0].name != null){
                if(isMasterClient){
                    $("#contractClientName").val(obj[0].clientId.name);
                    isMasterClient = false;
                }
            }
        }
        function hasInArr(id,idArr) {
            for(var i=0;i<idArr.length;i++){
                if(id==$(idArr[i]).val()){
                    return true;
                }
            }
            return false;
        }
        function existLinkman(id,length) {
            for (var i=0;i<length;i++) {
                var val = $('#workClientLinkmanList'+i+'_id').val();
                if(id==val){
                    return true;
                }
            }
            return false;
        }

        function setClientInfo(obj) {
            for(var i=0;i<obj.length;i++){
                var idArr = $("#workConstructionLinkmanList tr:visible .linkmanId");
                if(obj[i].id!=''&&!hasInArr(obj[i].id,idArr)){
                    addRow("#workConstructionLinkmanList",workConstructionLinkmanRowIdx,workConstructionLinkmanTpl,obj[i]);
                    workConstructionLinkmanRowIdx=workConstructionLinkmanRowIdx+1;
                }
            }
        }
        function existConstructionLinkman(obj,length) {
            for (var i=0;i<length;i++) {
                var val = $('#workConstructionLinkmanList'+i+'_id').val();
                var cid = $('#workConstructionLinkmanList'+i+'_cid').val();
                if(obj.id==val&&obj.client.id==cid){
                    return true;
                }
            }
            return false;
        }

        function insertTitle(tValue){
            var files = $("#attachment_file")[0].files;            for(var i = 0;i<files.length;i++) {                var file = files[i];
                var attachmentId = $("#id").val();
                var attachmentFlag = "82";
                /*console.log(file);*/
                var timestamp=new Date().getTime();

                var storeAs = "attachment-file/projectRecords/"+timestamp+"/"+file['name'];
                var uploadPath="http://gangwan-app.oss-cn-hangzhou.aliyuncs.com/"+storeAs;/*将这段字符串存到数据库即可*/
                var divId = "_attachment";
                $("#addFile"+divId).show();
                multipartUploadWithSts(storeAs, file,attachmentId,attachmentFlag,uploadPath,divId,0);}
        }


        function addFile() {
            $("#attachment_file").click();
        }

        function addRow(list, idx, tpl, row){
            // var idx1 = $("#workClientLinkmanList tr").length;
            bornTemplete(list, idx, tpl, row, idx);
        }
        function addPlanRow(list, idx, tpl, row){
            // var idx1 = $("#workClientLinkmanList tr").length;
            bornTempletePlan(list, idx, tpl, row, idx);
        }

        function bornTempletePlan(list, idx, tpl, row, idx1){
            $(list).append(Mustache.render(tpl, {
                idx: idx, delBtn: true, row: row,
                order:idx1 + 1
            }));
            $(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");
                    }
                }
            });

            laydate.render({
                elem : (list+idx+"_beginDate"),
                event: 'focus',
                type : 'date',
                trigger: 'click'
            });
            laydate.render({
                elem : (list+idx+"_endDate"),
                event: 'focus',
                type : 'date',
                trigger: 'click'
            });
        }

        function bornTemplete(list, idx, tpl, row, idx1){
            $(list).append(Mustache.render(tpl, {
                idx: idx, delBtn: true, row: row,
                order:idx1 + 1
            }));
            $(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){
            var id = $(prefix+"_id");
            var delFlag = $(prefix+"_delFlag");
            $(obj).parent().parent().remove();
        }
        function delPlanRow(obj, prefix){
            var id = $(prefix+"_id");
            var delFlag = $(prefix+"_delFlag");
            $(prefix+"_delFlag").val(1);
            $(obj).parent().parent().hide();
        }
        function formatNum(obj) {
            var val = $(obj).val();
            if(val==null||val==''|| isNaN(val))return;
            var money = parseFloat((val + "").replace(/[^\d\.-]/g, "")).toFixed(2) + "";
            var l = money.split(".")[0].split("").reverse(),
                r = money.split(".")[1];
            t = "";
            for(i = 0; i < l.length; i ++ )
            {
                t += l[i] + ((i + 1) % 3 == 0 && (i + 1) != l.length ? "," : "");
            }
            $(obj).val(t.split("").reverse().join("") + "." + r);
        }
        function openBill2(title,url,width,height,target,formId){
            var frameIndex = parent.layer.getFrameIndex(window.name);
            var urls = url+"&index="+frameIndex;
            if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端，就使用自适应大小弹窗
                width='auto';
                height='auto';
            }else{//如果是PC端，根据用户设置的width和height显示。

            }
            top.layer.open({
                type: 2,
                area: [width, height],
                title: title,
                skin:"two-btns",
                maxmin: false, //开启最大化最小化按钮
                content: urls ,
                btn: ['确定','关闭'],
                yes: function(index, layero){
                    var body = top.layer.getChildFrame('body', index);
                    var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象，执行iframe页的方法：iframeWin.method();
                    var inputForm = body.find('#inputForm');
                    var top_iframe;
                    if(target){
                        top_iframe = target;//如果指定了iframe，则在改frame中跳转
                    }else{
                        top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
                    }
                    inputForm.attr("target",top_iframe);//表单提交成功后，从服务器返回的url在当前tab中展示
                    inputForm.attr("action","${ctx}/project/projectRecords/linkManSave");//表单提交成功后，从服务器返回的url在当前tab中展示
                    var $document = iframeWin.contentWindow.document;

                    formSubmit2($document,formId,index);

                },
                cancel: function(index){
                }
            });


        }

        function addRow(list, idx, tpl, row){
            var idx1 = $("#projectPlanList tr").length;
            if(list == '#projectPlanList'){
                bornTemplete(list, idx, tpl, row, idx1);
            }
            var idx2 = $("#workClientLinkmanList tr").length;
            if(list == '#workClientLinkmanList'){
                bornTemplete(list, idx, tpl, row, idx2);
            }
        }


        function formSubmit2($document,inputForm,index){
            var validateForm = $($document.getElementById(inputForm)).validate({
                submitHandler: function(form){
                    loading('正在提交，请稍等...');
                    form.submit();
                },
                errorContainer: "#messageBox",
                errorPlacement: function(error, element) {
                    $($document.getElementById("#messageBox")).text("输入有误，请先更正。");
                    if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
                        error.appendTo(element.parent().parent());
                    } else {
                        error.insertAfter(element);
                    }
                }
            });
            if(validateForm.form()){
                $($document.getElementById(inputForm)).ajaxSubmit({
                    success:function(data) {
                        var d = data;
                        if(d.msg == "false"){
                            parent.layer.msg("保存客户信息异常!",{icon:2});
                            return false;
                        }

                        addRow('#workClientLinkmanList', workClientLinkmanRowIdx, workClientLinkmanTpl);workClientLinkmanRowIdx = workClientLinkmanRowIdx + 1;
                        var row = workClientLinkmanRowIdx - 1 ;

                        $("#"+"workClientLinkmanList"+row+"_id").val(d.id);
                        $("#"+"workClientLinkmanList"+row+"_clientId_id").val(d.clientId);
                        $("#"+"workClientLinkmanList"+row+"_clientName").val(d.clientName);
                        $("#"+"workClientLinkmanList"+row+"_name").val(d.linkName);
                        $("#"+"workClientLinkmanList"+row+"_linkMobile").val(d.linkMobile);
                        $("#"+"workClientLinkmanList"+row+"_linkPhone").val(d.linkPhone);
                        if(isMasterClient){
                            $("#contractClientName").val(d.clientName);
                            isMasterClient = false;
                        }
                        parent.layer.msg(d.str,{icon:1});
                        top.layer.close(index)
                    }
                });
            }
        }
    </script>
</head>
<body>
<div class="single-form">
    <div class="container">
        <sys:message content="${message}"/>
        <form:form id="inputForm" modelAttribute="projectRecords" action="${ctx}/project/projectRecords/save" method="post" class="form-horizontal">
            <form:hidden path="id"/>
            <form:hidden path="workContractInfo.client.id" id="contractClientId" value="${workContractInfo.client.id}"/>

            <div class="form-group layui-row first">
                <div class="form-group layui-row">
                    <div class="form-group-label"><h2>项目合同信息</h2></div>
                    <div class="layui-item layui-col-sm6 lw7">
                        <label class="layui-form-label">合同情况：</label>
                        <div class="layui-input-block">
                            <input type="radio" class="i-checks" name="ext" checked id="ext" value="0">
                            <label for="ext">有合同</label>
                            <input type="radio" class="i-checks" name="ext" id="ext1" value="1">
                            <label for="ext1">无合同</label>
                        </div>
                    </div>
                </div>
               <div class="form-group layui-row">
                   <div id="divv">
                       <div class="layui-item layui-col-sm12 lw7" id="d1">
                           <label class="layui-form-label"><span class="require-item">*</span>选择合同：</label>
                           <div class="layui-input-block  with-icon">
                               <sys:gridselectContract url="${ctx}/project/projectRecords/selectcontract" type="" isTotal="" id="contractId" name="workContractInfo.id"  value="${projectRecords.workContractInfo.id}"  title="选择合同" labelName="workContractInfo.name"
                                                       labelValue="${projectRecords.workContractInfo.name}" cssClass="form-control required layui-input" fieldLabels="合同名称" fieldKeys="name" searchLabel="合同名称" searchKey="name" ></sys:gridselectContract>
                           </div>
                       </div>
                       <div class="layui-item layui-col-sm6 lw7">
                           <label class="layui-form-label">合同名称：</label>
                           <div class="layui-input-block">
                               <input  htmlEscape="false"  readonly="true" id="contractName"  class="form-control layui-input" value="${projectRecords.workContractInfo.name}"/>
                           </div>
                       </div>
                       <div class="layui-item layui-col-sm6 lw7">
                           <label class="layui-form-label double-line">合同金额(元)：</label>
                           <div class="layui-input-block">
                               <input htmlEscape="false"  readonly="true" id="contractPrice"  class="form-control layui-input" value="${projectRecords.workContractInfo.contractPrice}" onchange="formatNum(this);"/>
                           </div>
                       </div>
                   </div>
                   <div id="divv2">
                       <div class="layui-item layui-col-sm6 lw7">
                           <label class="layui-form-label">主委托方：</label>
                           <div class="layui-input-block">
                               <input htmlEscape="false"  readonly="true" id="contractClientName" name="workContractInfo.client.name" class="form-control layui-input" value="${projectRecords.workContractInfo.client.name}"/>
                           </div>
                       </div>
                   </div>
                   <div id="divv3">
                       <div class="layui-item layui-col-sm6 lw7">
                           <label class="layui-form-label">工程分类：</label>
                           <div class="layui-input-block">
                               <input htmlEscape="false"  readonly="true" id="constructionProjectType"  class="form-control layui-input" value="${projectRecords.workContractInfo.constructionProjectTypeStr}"/>
                           </div>
                       </div>
                   </div>
               </div>
            </div>

            <div class="form-group layui-row">
                <div class="form-group-label"><h2>项目基础信息</h2></div>
                <div class="layui-item layui-col-sm6 lw7">
                    <label class="layui-form-label"><span class="require-item">*</span>项目名称：</label>
                    <div class="layui-input-block">
                        <form:input path="projectName" htmlEscape="false"  class="form-control layui-input required"/>
                    </div>
                </div>
                <div class="layui-item layui-col-sm6 lw7">
                    <label class="layui-form-label">项目编号：</label>
                    <div class="layui-input-block">
                        <div class="input-group">
                            <form:input path="projectId" htmlEscape="false"  readonly="true" class="form-control layui-input"/>
                            <span class="input-group-btn">
                                <label class="form-status"><c:choose><c:when test="${not empty projectRecords.projectStatus}">${fns:getDictLabel(projectRecords.projectStatus, 'audit_state', '')}</c:when><c:otherwise>新添</c:otherwise></c:choose></label>
                             </span>
                        </div>
                    </div>
                </div>
                <%--<div class="layui-item layui-col-sm6 lw7">--%>
                    <%--<label class="layui-form-label">规模类型：</label>--%>
                    <%--<div class="layui-input-block">--%>
                        <%--<form:select path="scaleType" class="form-control editable-select layui-input" id="scaleType" value="${scaleType}">--%>
                            <%--<form:option value=""/>--%>
                            <%--<form:options items="${fns:getMainDictList('scale_type')}" itemLabel="label" itemValue="label" htmlEscape="false"/>--%>
                        <%--</form:select>--%>
                    <%--</div>--%>
                <%--</div>--%>
                <%--<div class="layui-item layui-col-sm6 lw7">--%>
                    <%--<label class="layui-form-label">规模单位：</label>--%>
                    <%--<div class="layui-input-block">--%>
                        <%--<form:select path="scaleUnit" class="form-control editable-select layui-input" id="scaleUnit" value="${scaleUnit}">--%>
                            <%--<form:option value=""/>--%>
                            <%--<form:options items="${fns:getMainDictList('scale_unit')}" itemLabel="label" itemValue="label" htmlEscape="false"/>--%>
                        <%--</form:select>--%>
                    <%--</div>--%>
                <%--</div>--%>
                <%--<div class="layui-item layui-col-sm6 lw7">--%>
                    <%--<label class="layui-form-label">规模数量：</label>--%>
                    <%--<div class="layui-input-block">--%>
                        <%--<form:input path="scaleQuantity" htmlEscape="false"  class="form-control number layui-input"/>--%>
                    <%--</div>--%>
                <%--</div>--%>
                <div class="layui-item layui-col-sm6 lw7">
                    <label class="layui-form-label"><span class="require-item">*</span>项目所在地：</label>
                    <div class="layui-input-block  with-icon">
                        <sys:treeselect id="area" name="area.id" value="${projectRecords.area.id}" labelName="area.name" labelValue="${projectRecords.area.name}"
                                        title="区域" url="/sys/area/treeData" cssClass="form-control layui-input" allowClear="true" notAllowSelectParent="false"/>
                    </div>
                </div>
                <div class="layui-item layui-col-sm6 lw7">
                    <label class="layui-form-label">所在省份：</label>
                    <div class="layui-input-block">
                        <form:input path="province" htmlEscape="false" id="province" class="form-control layui-input" readonly="true"/>
                    </div>
                </div>
                <div class="layui-item layui-col-sm6 lw7">
                    <label class="layui-form-label">所在地级市：</label>
                    <div class="layui-input-block">
                        <form:input path="city" htmlEscape="false" id="city" class="form-control layui-input" readonly="true"/>
                    </div>
                </div>
                <div class="layui-item layui-col-sm6 lw7">
                    <label class="layui-form-label">所在区县：</label>
                    <div class="layui-input-block">
                        <form:input path="county" htmlEscape="false" id="county" class="form-control layui-input" readonly="true"/>
                    </div>
                </div>
                <div class="layui-item layui-col-sm6 lw7">
                    <label class="layui-form-label">建设地点：</label>
                    <div class="layui-input-block">
                        <form:input path="projectSite" htmlEscape="false"  class="form-control layui-input"/>
                    </div>
                </div>
                <div class="layui-item layui-col-sm6 lw7">
                    <label class="layui-form-label"><span class="require-item">*</span>项目负责人：</label>
                    <div class="layui-input-block  with-icon">
                        <sys:treeselectt id="master" name="projectLeaders" value="${projectRecords.leaderIds}" labelName="leaderNameStr" labelValue="${projectRecords.leaderNameStr}"
                                         title="用户" url="/sys/office/treeDataAll?type=3" checked="true" cssClass="form-control required layui-input" allowClear="true" notAllowSelectParent="true"/>
                    </div>
                </div>
                <div class="layui-item layui-col-sm6 lw7">
                    <label class="layui-form-label">创建人：</label>
                    <div class="layui-input-block">
                        <form:input path="createBy.name" htmlEscape="false"  readonly="true"  class="form-control  layui-input"/>
                        <form:hidden path="createBy.id" htmlEscape="false"   readonly="true"  class="form-control  layui-input"/>
                    </div>
                </div>
                <div class="layui-item layui-col-sm6 lw7">
                    <label class="layui-form-label">创建日期：</label>
                    <div class="layui-input-block">
                        <input id="createDate" name="createDate" htmlEscape="false"  value="<fmt:formatDate value="${projectRecords.createDate}" pattern="yyyy-MM-dd"/>" readonly="readonly"  class="form-control required layui-input"/>
                    </div>
                </div>
                <%--<div class="layui-item layui-col-sm6 lw7">--%>
                    <%--<label class="layui-form-label">工程结构：</label>--%>
                    <%--<div class="layui-input-block">--%>
                        <%--<form:select path="projectStructure" class="form-control editable-select layui-input" id="projectStructure" value="${projectStructure}">--%>
                            <%--<form:option value=""/>--%>
                            <%--<form:options items="${fns:getMainDictList('project_structure')}" itemLabel="label" itemValue="label" htmlEscape="false"/>--%>
                        <%--</form:select>--%>
                    <%--</div>--%>
                <%--</div>--%>
                <%--<div class="layui-item layui-col-sm6 lw7">--%>
                    <%--<label class="layui-form-label">地上层数：</label>--%>
                    <%--<div class="layui-input-block">--%>
                        <%--<form:input path="onGroundNum" htmlEscape="false"  class="form-control layui-input number"/>--%>
                    <%--</div>--%>
                <%--</div>--%>
                <%--<div class="layui-item layui-col-sm6 lw7">--%>
                    <%--<label class="layui-form-label">底下层数：</label>--%>
                    <%--<div class="layui-input-block">--%>
                        <%--<form:input path="underGroundNum" htmlEscape="false"  class="form-control layui-input number"/>--%>
                    <%--</div>--%>
                <%--</div>--%>
                <%--<div class="layui-item layui-col-sm6 lw7">--%>
                    <%--<label class="layui-form-label double-line"><span class="require-item">*</span>建筑面积或规模：</label>--%>
                    <%--<div class="layui-input-block">--%>
                        <%--<form:input path="buildingScale" htmlEscape="false"  class="form-control layui-input required number" onchange="getFee()"/>--%>
                    <%--</div>--%>
                <%--</div>--%>
                <%--<div class="layui-item layui-col-sm6 lw7">--%>
                    <%--<label class="layui-form-label">计量单位：</label>--%>
                    <%--<div class="layui-input-block">--%>
                        <%--<form:select path="measuringUnit" class="form-control editable-select layui-input" id="measuringUnit" value="${measuringUnit}">--%>
                            <%--<form:option value=""/>--%>
                            <%--<form:options items="${fns:getMainDictList('scale_unit')}" itemLabel="label" itemValue="label" htmlEscape="false"/>--%>
                        <%--</form:select>--%>
                    <%--</div>--%>
                <%--</div>--%>
                <%--<div class="layui-item layui-col-sm6 lw7">--%>
                    <%--<label class="layui-form-label">工程用途：</label>--%>
                    <%--<div class="layui-input-block">--%>
                        <%--<form:select path="projectUse" class="form-control editable-select layui-input" id="projectUse" value="${projectUse}">--%>
                            <%--<form:option value=""/>--%>
                            <%--<form:options items="${fns:getMainDictList('project_use')}" itemLabel="label" itemValue="label" htmlEscape="false"/>--%>
                        <%--</form:select>--%>
                    <%--</div>--%>
                <%--</div>--%>
                <%--<div class="layui-item layui-col-sm6 lw7">--%>
                    <%--<label class="layui-form-label double-line"><span class="require-item">*</span>咨询标的额(万元)：</label>--%>
                    <%--<div class="layui-input-block">--%>
                        <%--<form:input path="totalFees" htmlEscape="false" id="totalFees" class="form-control layui-input required number" onchange="getFee()"/>--%>
                    <%--</div>--%>
                <%--</div>--%>
                <%--<div class="layui-item layui-col-sm6 lw7">--%>
                    <%--<label class="layui-form-label double-line">其中土建造价(万元)：</label>--%>
                    <%--<div class="layui-input-block">--%>
                        <%--<form:input path="buildingFees" htmlEscape="false" id="buildingFees" class="form-control layui-input" onchange="getBudlingFees()"/>--%>
                    <%--</div>--%>
                <%--</div>--%>
                <%--<div class="layui-item layui-col-sm6 lw7">--%>
                    <%--<label class="layui-form-label double-line">其中安装造价(万元)：</label>--%>
                    <%--<div class="layui-input-block">--%>
                        <%--<form:input path="installFees" htmlEscape="false" id="installFees" class="form-control layui-input" onchange="getInstallFees()"/>--%>
                    <%--</div>--%>
                <%--</div>--%>
                <%--<div class="layui-item layui-col-sm6 lw7">--%>
                    <%--<label class="layui-form-label double-line">其中土建百分比(%)：</label>--%>
                    <%--<div class="layui-input-block">--%>
                        <%--<form:input path="buildingPercent" htmlEscape="false" id="buildingPercent" class="form-control layui-input" readonly="true"/>--%>
                    <%--</div>--%>
                <%--</div>--%>
                <%--<div class="layui-item layui-col-sm6 lw7">--%>
                    <%--<label class="layui-form-label double-line">其中安装百分比(%)：</label>--%>
                    <%--<div class="layui-input-block">--%>
                        <%--<form:input path="installPercent" htmlEscape="false" id="installPercent" class="form-control layui-input" readonly="true"/>--%>
                    <%--</div>--%>
                <%--</div>--%>
                <%--<div class="layui-item layui-col-sm6 lw7">--%>
                    <%--<label class="layui-form-label">单位造价(元)：</label>--%>
                    <%--<div class="layui-input-block">--%>
                        <%--<form:input path="unitFees" htmlEscape="false" id="unitFees" class="form-control layui-input" readonly="true"/>--%>
                    <%--</div>--%>
                <%--</div>--%>
                <%--<div class="layui-item layui-col-sm6 lw7">--%>
                    <%--<label class="layui-form-label double-line">土建单位造价(元)：</label>--%>
                    <%--<div class="layui-input-block">--%>
                        <%--<form:input path="buildingUnitFees" htmlEscape="false" id="buildingUnitFees" class="form-control layui-input" readonly="true"/>--%>
                    <%--</div>--%>
                <%--</div>--%>
                <%--<div class="layui-item layui-col-sm6 lw7">--%>
                    <%--<label class="layui-form-label double-line">安装单位造价(元)：</label>--%>
                    <%--<div class="layui-input-block">--%>
                        <%--<form:input path="installUnitFees" htmlEscape="false" id="installUnitFees" class="form-control layui-input" readonly="true"/>--%>
                    <%--</div>--%>
                <%--</div>--%>
                <div class="layui-item layui-col-sm6 lw7 with-textarea">
                    <label class="layui-form-label"><span class="require-item">*</span>工程概况：</label>
                    <div class="layui-input-block">
                        <form:textarea path="projectDesc" htmlEscape="false" rows="4"  maxlength="255"  class="form-control required"/>
                    </div>
                </div>
                <div class="layui-item layui-col-sm6 lw7 with-textarea">
                    <label class="layui-form-label ">特殊要求：</label>
                    <div class="layui-input-block">
                        <form:textarea path="remarks" htmlEscape="false" rows="4"  maxlength="255"  class="form-control "/>
                    </div>
                </div>
                <div class="layui-item layui-col-sm12 lw7">
                    <label class="layui-form-label"><span class="require-item">*</span>项目计划书：</label>
                    <div class="layui-input-block">
                        <div class="layui-item nav-btns" style="padding-left:0px;">
                            <a class="nav-btn nav-btn-add"
                               onclick="addPlanRow('#projectPlanList', workClientBankRowIdx, workClientBankTpl);workClientBankRowIdx = workClientBankRowIdx + 1;"
                               title="新增"><i class="fa fa-plus"></i> 新增</a>
                        </div>
                        <table id="bankinfo" class="table table-bordered table-condensed can-edit">
                            <thead>
                            <tr>
                                <th width="15%">开始时间</th>
                                <th width="15%">结束时间</th>
                                <th width="50%;">工作内容</th>
                                <th width="20%">操作</th>
                            </tr>
                            </thead>
                            <tbody id="projectPlanList">

                            </tbody>
                        </table>
                        <script type="text/template" id="workClientBankTpl">//<!--
                            <tr id="projectPlanList{{idx}}">
                                <td class="hide">
                                    <input id="projectPlanList{{idx}}_id" name="projectPlanList[{{idx}}].id" type="hidden" value="{{row.id}}"/>
                                    <input id="projectPlanList{{idx}}_delFlag" name="projectPlanList[{{idx}}].delFlag" type="hidden" value="0"/>
                                </td>
                                <td>
                                    <input lay-verify="date" placeholder="yyyy-MM-dd" autocomplete="off" id="projectPlanList{{idx}}_beginDate" name="projectPlanList[{{idx}}].beginDate" type="text" value="{{row.beginDate}}"  class="form-control required datetime"/>
                                </td>
                                <td>
                                    <input lay-verify="date" placeholder="yyyy-MM-dd" autocomplete="off" id="projectPlanList{{idx}}_endDate" name="projectPlanList[{{idx}}].endDate" type="text" value="{{row.endDate}}"  class="form-control required datetime"/>
                                </td>
                                <td>
                                    <input id="projectPlanList{{idx}}_remarks" name="projectPlanList[{{idx}}].remarks" type="text" value="{{row.remarks}}"    class="form-control required"/>
                                </td>

                                <td class="text-center op-td" width="10">
                                    {{#delBtn}}<span class="op-btn op-btn-delete" onclick="delPlanRow(this, '#projectPlanList{{idx}}')" title="删除"><i class="fa fa-trash"></i>&nbsp;删除</span>{{/delBtn}}
                                </td>
                            </tr>//-->
                        </script>
                    </div>
                </div>
            </div>



            <div>
                <div class="form-group-label"><h2><span class="require-item">*</span>委托方联系人信息</h2></div>
                <div class="layui-item nav-btns" style="float: left;width: 155px">
                    <sys:gridselect1  id="linkman" url="${ctx}/workclientinfo/workClientInfo/linkmanList"
                                      name="linkman.id"  title="选择客户"
                                      value="${projectRecords.workContractInfo.workClinetInfoIds}"
                                      cssClass="form-control required" fieldLabels="联系人" fieldKeys="name"
                                      searchLabel="联系人" searchKey="name"></sys:gridselect1>
                </div>
                <div class="layui-item nav-btns" style="float: left;">
                    <a href="javascript:void(0)"
                       onclick="openBill2('新增客户管理', '${ctx}/workclientinfo/workClientInfo/form?param=2','95%','95%',false,'inputForm')"
                       class="nav-btn nav-btn-add"><i class="fa fa-plus"></i> 新增客户</a>
                </div>

                <div class="layui-item layui-col-xs12 form-table-container" style="padding:0px">
                    <table id="contentTable1" class="table table-bordered table-condensed details">
                        <thead>
                        <tr>
                            <th class="hide"></th>
                            <th width="20%"><font color="red">*</font>委托方</th>
                            <th width="20%">联系人姓名</th>
                            <th width="20%">联系方式1</th>
                            <th width="20%">联系方式2</th>
                            <th width="20%">操作</th>
                        </tr>
                        </thead>
                        <tbody id="workClientLinkmanList">
                        </tbody>
                    </table>
                    <script type="text/template" id="workClientLinkmanTpl">//<!--
            <tr id="workClientLinkmanList{{idx}}">
                <td class="hide">
                    <input id="workClientLinkmanList{{idx}}_id" name="workClientLinkmanList[{{idx}}].id" type="hidden" value="{{row.id}}"/>
                    <input id="workClientLinkmanList{{idx}}_clientId_id" name="workClientLinkmanList[{{idx}}].clientId.id" type="hidden" value="{{row.clientId.id}}"/>
                    <input id="workClientLinkmanList{{idx}}_delFlag" name="workClientLinkmanList[{{idx}}].delFlag" type="hidden" value="0"/>
                </td>
                <td>
                    <input readonly="true" id="workClientLinkmanList{{idx}}_clientName" name="workClientLinkmanList[{{idx}}].clientId.name" type="text" value="{{row.clientId.name}}"    class="form-control "/>
                </td>
                <td>
                    <input readonly="true" id="workClientLinkmanList{{idx}}_name" name="workClientLinkmanList[{{idx}}].name" type="text" value="{{row.name}}"    class="form-control required"/>
                </td>

                <td>
                    <input readonly="true" id="workClientLinkmanList{{idx}}_linkPhone" name="workClientLinkmanList[{{idx}}].linkPhone" type="text" value="{{row.linkPhone}}"    class="form-control isTel"/>
                </td>
                <td>
                    <input readonly="true" id="workClientLinkmanList{{idx}}_linkMobile" name="workClientLinkmanList[{{idx}}].linkMobile" type="text" value="{{row.linkMobile}}"    class="form-control isPhone"/>
                </td>
                <td class="text-center op-td" >
                    {{#delBtn}}<span class="op-btn op-btn-delete" onclick="delRow(this, '#workClientLinkmanList{{idx}}')" title="删除"><i class="glyphicon glyphicon-remove"></i>&nbsp;删除</span>{{/delBtn}}
                </td>
            </tr>//-->
                    </script>
                    <script type="text/javascript">
                        var workClientLinkmanRowIdx = 0,
                            workClientLinkmanTpl = $("#workClientLinkmanTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, "");
                        $(document).ready(function () {
                            var data = ${fns:toJson(workClientInfo.workClientLinkmanList)};
                            if(data!=null && data.length() > 0){
                                for (var i = 0; i < data.length; i++) {
                                    addRow('#workClientLinkmanList', workClientLinkmanRowIdx, workClientLinkmanTpl, data[i]);
                                    workClientLinkmanRowIdx = workClientLinkmanRowIdx + 1;
                                }
                            }
                        });
                    </script>
                </div>
            </div>

            <div class="form-group layui-row">
                <div class="form-group-label"><h2>施工方信息</h2></div>
                <div class="layui-item nav-btns">
                    <sys:gridselectClientLink url="${ctx}/workclientinfo/workClientInfo/clientInfolist" id="constructionOrgList"   title="选择施工单位"
                                              cssClass="form-control required" fieldLabels="${fns:urlEncode('客户编号')}" fieldKeys="name"  searchLabel="${fns:urlEncode('客户名称')}" searchKey="name"></sys:gridselectClientLink>
                </div>
                <div class="layui-item layui-col-xs12 form-table-container">
                    <table id="contentTable2" class="table table-bordered table-condensed details">
                        <thead>
                        <tr>
                            <th class="hide"></th>
                            <th style="text-align: center" width="20%">施工方单位名称</th>
                            <th style="text-align: center" width="20%">联系人姓名</th>
                            <th style="text-align: center" width="20%">联系方式1</th>
                            <th style="text-align: center" width="20%">联系方式2</th>
                            <th width="20%">操作</th>
                        </tr>
                        </thead>
                        <tbody id="workConstructionLinkmanList">
                        </tbody>
                    </table>
                    <script type="text/template" id="workConstructionLinkmanTpl">//<!--
					<tr id="workConstructionLinkmanList{{idx}}">
					<td class="hide">
						<input id="workConstructionLinkmanList{{idx}}_id" name="workConstructionLinkmanList[{{idx}}].id" type="hidden" value="{{row.id}}" class="linkmanId"/>
						<input id="workConstructionLinkmanList{{idx}}_delFlag" name="workConstructionLinkmanList[{{idx}}].delFlag" type="hidden" value="0"/>
					</td>
					<td style="text-align: center">
						<input id="workConstructionLinkmanList{{idx}}_cid" name = "workConstructionLinkmanList[{{idx}}].clientId.id" type="hidden" value="{{row.clientId.id}}"/>
						{{row.clientId.name}}
					</td>
					<td style="text-align: center">
						{{row.name }}
					</td>
					<td style="text-align: center">
						{{row.linkPhone}}
					</td>
					<td style="text-align: center">
						{{row.linkMobile}}
					</td>
					<td class="text-center" width="10">
						{{#delBtn}}<span class="op-btn op-btn-delete" onclick="delRow(this, '#workConstructionLinkmanList{{idx}}')" title="删除"><i class="fa fa-trash"></i>&nbsp;删除</span>{{/delBtn}}
					</td>
				</tr>//-->
                    </script>
                    <script>
                        var workClientLinkmanRowIdx = 0, workClientLinkmanTpl = $("#workClientLinkmanTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
                        var workConstructionLinkmanRowIdx = 0, workConstructionLinkmanTpl = $("#workConstructionLinkmanTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
                        $(document).ready(function() {
                            var data = ${fns:toJson(projectRecords.workClientLinkmanList)};
                            if (data!=null) {
                                for (var i = 0; i < data.length; i++) {
                                    addRow('#workClientLinkmanList', workClientLinkmanRowIdx, workClientLinkmanTpl, data[i]);
                                    workClientLinkmanRowIdx = workClientLinkmanRowIdx + 1;
                                }
                            }
                            var dataBank = ${fns:toJson(projectRecords.workConstructionLinkmanList)};
                            if (dataBank!=null) {
                                for (var i = 0; i < dataBank.length; i++) {
                                    addRow('#workConstructionLinkmanList', workConstructionLinkmanRowIdx, workConstructionLinkmanTpl, dataBank[i]);
                                    workConstructionLinkmanRowIdx = workConstructionLinkmanRowIdx + 1;
                                }
                            }
                        });

                    </script>
                </div>
            </div>

            <div class="form-group layui-row">
                <div class="form-group-label"><h2><span class="require-item">*</span>项目计划附件信息</h2></div>
                <div class="layui-item nav-btns">
                    <a id="attachment_btn" class="nav-btn nav-btn-add" title="添加附件"  onclick="addFile()"><i class="fa fa-plus"></i>&nbsp;添加附件</a>
                    <a class="nav-btn nav-btn-export" title="下载模板"  onclick="window.location.href='${ctx}/project/projectRecords/downloadTemplate';"><i class="fa fa-download"></i>&nbsp;下载模板</a>
                </div>
                <div id="addFile_attachment" style="display: none" class="upload-progress">
                    <span id="fileName_attachment" ></span>
                    <b><span id="baifenbi_attachment" ></span></b>
                    <div class="progress">
                        <div id="jindutiao_attachment" class="progress-bar" style="width: 0%" aria-valuenow="0">
                        </div>
                    </div>
                </div>
                <input id="attachment_file" type="file" name="attachment_file" multiple="multiple" style="display: none;" onChange="if(this.value)insertTitle(this.value);"/>
                <span id="attachment_title"></span>
                <div class="layui-item layui-col-xs12 form-table-container">
                    <table id="listAttachment" class="table table-bordered table-condensed details">
                        <thead>
                        <tr>
                                <%-- <th>序号</th>--%>
                            <th width="25%">文件</th>
                            <th width="25%">上传人</th>
                            <th width="25%">上传时间</th>
                            <th width="150px">操作</th>
                        </tr>
                        </thead>
                        <tbody id="file_attachment">
                        <c:forEach items="${projectRecords.workAttachments}" var = "workClientAttachment" varStatus="status">
                            <tr class="trIdAdds">
                                    <%-- <td>${status.index + 1}</td>--%>
                                <c:choose>
                                    <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
                                        <td><img src="${workClientAttachment.url}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.url}','90%','90%')" alt="${workClientAttachment.attachmentName}">
                                    </c:when>
                                    <c:otherwise>
                                        <c:choose>
                                            <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
                                                <td><a class="attention-info" href="javascript:void(0)" onclick="preview('预览','${workClientAttachment.url}','90%','90%','1')">${workClientAttachment.attachmentName}</a></td>
                                            </c:when>
                                            <c:otherwise>
                                                <td><a class="attention-info" href="javascript:void(0)" onclick="preview('预览','${workClientAttachment.url}','90%','90%')">${workClientAttachment.attachmentName}</a></td>
                                            </c:otherwise>
                                        </c:choose>
                                    </c:otherwise>
                                </c:choose>
                                <td>${workClientAttachment.createBy.name}</td>
                                <td><fmt:formatDate value="${workClientAttachment.createDate}" type="both"/></td>
                                <td class="op-td">
                                    <div class="op-btn-box" >
                                        <a href="javascript:location.href='${ctx}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent(encodeURIComponent('${workClientAttachment.url}'));" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
                                        <a href="javascript:void(0)" onclick="deleteFileFromAliyun(this,'${ctx}/sys/workattachment/deleteFileFromAliyun?url=${workClientAttachment.url}&id=${workClientAttachment.id}&type=2','addFile')" class="op-btn op-btn-delete" ><i class="fa fa-trash"></i>&nbsp;删除</a>
                                    </div>
                                </td>
                            </tr>
                        </c:forEach>
                        </tbody>
                    </table>
                </div>
            </div>

            <div class="form-group layui-row">
                <div class="form-group-label"><h2>项目组成员列表</h2></div>
                <div class="layui-item layui-col-xs12 form-table-container">
                    <table id="usersListTable" class="table table-bordered table-condensed details">
                        <thead>
                        <tr>
                            <th width="25%">姓名</th>
                            <th width="25%">部门</th>
                            <th width="25%">职级</th>
                            <th width="80px;">状态</th>
                        </tr>
                        </thead>
                        <tbody id="usersList">
                        <c:if test="${not empty projectRecords.projectMembers}">
                            <c:forEach items="${projectRecords.projectMembers}" var="user">
                                <tr id="${user.id}">
                                    <td>
                                            ${user.name}
                                    </td>
                                    <td>
                                            ${user.office.name}
                                    </td>
                                    <td>
                                            ${user.basicInfo.jobGrade.name}
                                    </td>
                                    <td>
                                        <c:choose>
                                            <c:when test="${user.delFlag == 0}">
                                                正常
                                            </c:when>
                                            <c:otherwise>
                                                移除
                                            </c:otherwise>
                                        </c:choose>
                                    </td>
                                </tr>
                            </c:forEach>
                        </c:if>
                        </tbody>
                    </table>
                </div>
            </div>
            <div class="form-group layui-row page-end"></div>
        </form:form>
    </div>
</div>

<script type="text/javascript">
    var workClientLinkmanRowIdx = 0,
        workClientLinkmanTpl = $("#workClientLinkmanTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, "");
    var workClientBankRowIdx = 0,
        workClientBankTpl = $("#workClientBankTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, "");
    $(document).ready(function () {
        var data = ${fns:toJson(projectRecords.projectPlanList)};
        if (null!=data){
            for (var i = 0; i < data.length; i++) {
                addPlanRow('#projectPlanList', workClientBankRowIdx, workClientBankTpl, data[i]);
                workClientBankRowIdx = workClientBankRowIdx + 1;
            }
        }
        /*var dataBank = ${fns:toJson(projectRecords.projectPlanList)};
        if (null!=dataBank){
            for (var i = 0; i < dataBank.length; i++) {
                addRow('#projectPlanList', workClientBankRowIdx, workClientBankTpl, dataBank[i]);
                workClientBankRowIdx = workClientBankRowIdx + 1;
            }
        }*/
    });

</script>
</body>
</html>