<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/webpage/include/taglib.jsp"%>
<html>
<head>
	<title>合同审批</title>
	<meta name="decorator" content="default"/>
	<%--<script src="${ctxStatic}/layer-v2.3/laydate/laydate.js"></script>--%>
	<style>
		label.error{
			left:0;
			top:40px;
		}
	</style>
	<script type="text/javascript">
        var validateForm;
        var count = 0;
        function doSubmit(obj){
            // 回调函数，在编辑和保存动作时，供openDialog调用提交表单。
            if(validateForm.form()){
				if(obj == 1){
					$('#flag').val('yes');
				}else{
					$('#flag').val('no');
				}
                // if($("#timeRequirements").val()==''){
                //     top.layer.alert('合同评审信息中时间要求不能为空！', {icon: 0});
                //     return;
                // }
                // if($("#specialRequirements").val()==''){
                //     top.layer.alert('合同评审信息中特殊要求不能为空！', {icon: 0});
                //     return;
                // }
                $("#inputForm").submit();
                return true;
            }else {
                parent.layer.msg("信息未填写完整!", {icon: 5});
            }
            return false;
        }
        $(document).ready(function() {
            if($("#createDate").val()==null || $("#createDate").val()==''){
                $("#createDate").val(getNowFormatDate());
            }
            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);
                    }
                }
            });

            // $("input[name='ext']").on('ifChecked', function(event){
            //     var radioVal = $(this).val();
            //     if(radioVal == 0){
            //         $("#td1").removeClass("hide");
            //         $("#td2").addClass("hide");
            //         $("#tr1").show()
            //         $("#tr2").show()
            //     }else{
            //         $("#td1").addClass("hide");
            //         $("#td2").removeClass("hide");
            //         $("#tr1").hide()
            //         $("#tr2").hide()
            //     }
            // });
            if("${workContractInfo.ext}" == "1"){
                $("#ext1").iCheck('check')
            }else{
                $("#ext").iCheck('check')
            }

            // getRandom();
            $("#contractFee").change(function(){
                //状态为其他的时候  添加required样式
                if($(this).val() == "4"){
                    $("#contractFeeDoc").attr("class","form-control required");
                }else{
                    $("#contractFeeDoc").attr("class","form-control");
                }
            });
            $("#contractType").attr("class","form-control required");
            /* $("#contractType").change(function(){
                 //状态为其他的时候  添加required样式
                 if($(this).val() == "5"){
                     $("#contractTypeDoc").attr("class","form-control required");
                 }else{
                     $("#contractTypeDoc").attr("class","form-control");
                 }
             })*/
            $("#attachment_btn").click(function () {
                $("#attachment_file").click();
            });
            $("#attachment_review_btn").click(function () {
                $("#attachment_review_file").click();
            });

            laydate.render({
                elem: '#contractDate',
                event: 'focus',
                type : 'date'
            });
            laydate.render({
                elem: '#effectiveDate',
                event: 'focus',
                type : 'date'
            });
            laydate.render({
                elem: '#closingDate',
                event: 'focus',
                type : 'date'
            });
            laydate.render({
                elem: '#createDate',
                event: 'focus',
                type : 'date'
            });
        });

        function addRow(list, idx, tpl, row){
            var idx1 = $("#workClientInfoList tr").length;
            if(list == '#workClientInfoList' && idx1 < 100){
                bornTemplete(list, idx, tpl, row, idx1);
            }
        }
        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) {
            count++;
            var id = $(prefix + "_id");
            var delFlag = $(prefix + "_delFlag");

            var clientId = $("#clientId").val();
            console.log(id.val()+"-----------"+clientId);
            if(id.val() == clientId){
                parent.layer.msg('主委托方不允许删除');
                return;
            }
            if (id.val() == "") {
                $(obj).parent().parent().remove();
            } else if (delFlag.val() == "0") {
                delFlag.val("1");
                $(obj).html("&divide;").attr("title", "撤回删除");
                $(obj).parent().parent().addClass("error");
                $(obj).parent().parent().addClass("hide");
            } else if (delFlag.val() == "1") {
                delFlag.val("0");
                $(obj).html("&times;").attr("title", "删除");
                $(obj).parent().parent().removeClass("error");
            }
           /* var idx1 = $("#workClientInfoList tr").length; //tr 总数
            for (var i = 0; i < idx1; i++) {
                $("#workClientInfoList tr").eq(i).find("td").eq(1).html(i + 1);
            }*/
        }

        function getRandom(){
            var GetRandomn = 1;
            //js生成时间戳
            var timestamp=new Date().getTime();
            //获取随机范围内数值的函数
            function GetRandom(n){
                //由随机数+时间戳+1组成
                GetRandomn=Math.floor(Math.random()*n+timestamp+1);
            }
            //开始调用，获得一个1-100的随机数
            GetRandom("30");
            if(!$("#contractNum").val()){
                $("#contractNum").val(GetRandomn)
            }
        }

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

            var storeAs = "attachment-file/workContractInfo/"+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 insertTitleReview(tValue){
            var files = $("#attachment_review_file")[0].files;            for(var i = 0;i<files.length;i++) {                var file = files[i];
            var attachmentId = "";
            var attachmentFlag = "84";
            console.log(file);
            var timestamp=new Date().getTime();

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

        function openBill(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,
                maxmin: false, //开启最大化最小化按钮
                skin:"two-btns",
                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}/workclientinfo/workClientInfo/contractsave");//表单提交成功后，从服务器返回的url在当前tab中展示
                    var $document = iframeWin.contentWindow.document;

                    formSubmit($document,formId,index);
                },
                cancel: function(index){
                }
            });
        }
        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,
                maxmin: false, //开启最大化最小化按钮
                skin:"two-btns",
                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}/workclientinfo/workClientInfo/contractsave");//表单提交成功后，从服务器返回的url在当前tab中展示
                    var $document = iframeWin.contentWindow.document;

                    formSubmit2($document,formId,index);
                },
                cancel: function(index){
                }
            });
        }
        function getNowFormatDate() {
            var date = new Date();
            var seperator1 = "-";
            var seperator2 = ":";
            var month = date.getMonth() + 1;
            var strDate = date.getDate();
            month = (month < 10)?"0"+month:month;
            strDate = (strDate < 10)?"0"+strDate:strDate;
            var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate;
            return currentdate;
        }
        function formSubmit($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;
                        }
                        $("#clientId").val(d.id);
                        $("#clientName").val(d.name);
                        addRow('#workClientInfoList', workClientInfoListRowIdx, workClientInfoListTpl);workClientInfoListRowIdx = workClientInfoListRowIdx + 1;
                        var row = workClientInfoListRowIdx - 1 ;
                        $("#"+"workClientInfoList"+row+"_id").val(d.id);
                        $("#"+"workClientInfoList"+row+"_name").val(d.name);
                        $("#"+"workClientInfoList"+row+"_companyType").val(d.companyType);
                        $("#"+"workClientInfoList"+row+"_companyIndustry").val(d.companyIndustry);
                        $("#"+"workClientInfoList"+row+"_area").val(d.areaName);
                        //$("#"+"workClientInfoList"+row+"_td").hide();
                        parent.layer.msg(d.str,{icon:1});
                        top.layer.close(index)
                    }
                });
            }
        }
        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('#workClientInfoList', workClientInfoListRowIdx, workClientInfoListTpl);workClientInfoListRowIdx = workClientInfoListRowIdx + 1;
                        console.log("---------"+data.companyType+"---------"+data.companyIndustry+"---------"+data.areaName);
                        console.log("---------"+workClientInfoListRowIdx+"---------"+workClientInfoListTpl);
                        var row = workClientInfoListRowIdx - 1 ;
                        $("#"+"workClientInfoList"+row+"_id").val(d.id);
                        $("#"+"workClientInfoList"+row+"_name").val(d.name);
                        $("#"+"workClientInfoList"+row+"_companyType").val(d.companyType);
                        $("#"+"workClientInfoList"+row+"_companyIndustry").val(d.companyIndustry);
                        $("#"+"workClientInfoList"+row+"_area").val(d.areaName);
                        parent.layer.msg(d.str,{icon:1});
                        top.layer.close(index)
                    }
                });
            }
        }
        function setPNumber(obj){
            $.ajax({
                type:'post',
                url:'${ctx}/workinvoice/workInvoice/getPNumberr',
                data:{
                    "obj":obj
                },
                success:function(data){
                    var d = JSON.parse(data);
                    $("#pNumber").val(d.pNumber);
                }
            })
        }
        function setRow(obj){
            $.ajax({
                type:'post',
                url:'${ctx}/workclientinfo/workClientInfo/getRow',
                data:{
                    "obj":obj
                },
                success:function(data){
                    var d = JSON.parse(data);

                    //自动计算出结果并填充在相应的输入框中
                    var size = $("#workClientInfoList tr").length+count;
                    if(size == 0){
                        addRow('#workClientInfoList', workClientInfoListRowIdx, workClientInfoListTpl);workClientInfoListRowIdx = workClientInfoListRowIdx + 1;
                        console.log("---------"+data.companyType+"---------"+data.companyIndustry+"---------"+data.areaName);
                        console.log("---------"+workClientInfoListRowIdx+"---------"+workClientInfoListTpl);
                        var row = workClientInfoListRowIdx - 1 ;
                        $("#"+"workClientInfoList"+row+"_id").val(d.id);
                        $("#"+"workClientInfoList"+row+"_name").val(d.name);
                        $("#"+"workClientInfoList"+row+"_companyType").val(d.companyType);
                        $("#"+"workClientInfoList"+row+"_companyIndustry").val(d.companyIndustry);
                        $("#"+"workClientInfoList"+row+"_area").val(d.areaName);
                    }else {
                        var num = 'alone';
                        for (var i = 0; i < size; i++) {
                            var _id = $("#workClientInfoList" + i + "_id").val();

                            var delFlag = $("#workClientInfoList" + i + "_delFlag").val();
                            if (_id != undefined && delFlag == 0) {
                                if (_id == d.id) {
                                    num = 'double'
                                    /*top.layer.alert('请您勿重复添加委托方列表信息', {icon: 0});*/
                                    return;
                                }
                            }
                        }
                        if(num == 'alone'){
                            addRow('#workClientInfoList', workClientInfoListRowIdx, workClientInfoListTpl);
                            workClientInfoListRowIdx = workClientInfoListRowIdx + 1;
                            console.log("---------" + data.companyType + "---------" + data.companyIndustry + "---------" + data.areaName);
                            console.log("---------" + workClientInfoListRowIdx + "---------" + workClientInfoListTpl);
                            var row = workClientInfoListRowIdx - 1;
                            $("#" + "workClientInfoList" + row + "_id").val(d.id);
                            $("#" + "workClientInfoList" + row + "_name").val(d.name);
                            $("#" + "workClientInfoList" + row + "_companyType").val(d.companyType);
                            $("#" + "workClientInfoList" + row + "_companyIndustry").val(d.companyIndustry);
                            $("#" + "workClientInfoList" + row + "_area").val(d.areaName);
                        }
                    }

                    //$("#"+"workClientInfoList"+row+"_td").hide();
                    //$("#pNumber").val(d.pNumber);
                }
            })
        }
     function setRow2(obj){
            $.ajax({
                type:'post',
                url:'${ctx}/workclientinfo/workClientInfo/getRow',
                data:{
                    "obj":obj
                },
                success:function(data){
                    var d = JSON.parse(data);
                    //自动计算出结果并填充在相应的输入框中
                    var size = $("#workClientInfoList tr").length+count;
                    if(size == 0){
                        addRow('#workClientInfoList', workClientInfoListRowIdx, workClientInfoListTpl);workClientInfoListRowIdx = workClientInfoListRowIdx + 1;
                        var row = workClientInfoListRowIdx - 1 ;
                        $("#"+"workClientInfoList"+row+"_id").val(d.id);
                        $("#"+"workClientInfoList"+row+"_name").val(d.name);
                        $("#"+"workClientInfoList"+row+"_companyType").val(d.companyType);
                        $("#"+"workClientInfoList"+row+"_companyIndustry").val(d.companyIndustry);
                        $("#"+"workClientInfoList"+row+"_area").val(d.areaName);
                    }else {
                        var num = "alone";
                        for (var i = 0; i < size; i++) {
                            var _id = $("#workClientInfoList" + i + "_id").val();

                            var delFlag = $("#workClientInfoList" + i + "_delFlag").val();
                            if (_id != undefined && delFlag == 0) {
                                if (_id == d.id) {
                                    num = "double";
                                    top.layer.alert('请勿重复选择委托方信息', {icon: 0});
                                    return;
                                }
                            }
                        }
                        if(num == 'alone'){
                            addRow('#workClientInfoList', workClientInfoListRowIdx, workClientInfoListTpl);
                            workClientInfoListRowIdx = workClientInfoListRowIdx + 1;
                            var row = workClientInfoListRowIdx - 1;
                            $("#" + "workClientInfoList" + row + "_id").val(d.id);
                            $("#" + "workClientInfoList" + row + "_name").val(d.name);
                            $("#" + "workClientInfoList" + row + "_companyType").val(d.companyType);
                            $("#" + "workClientInfoList" + row + "_companyIndustry").val(d.companyIndustry);
                            $("#" + "workClientInfoList" + row + "_area").val(d.areaName);
                        }
                    }
                }
            })
        }
        function hasInArr(id,idArr) {
            for(var i=0;i<idArr.length;i++){
                if(id==$(idArr[i]).val()){
                    return true;
                }
            }
            return false;
        }
        function setCatalogInfo(data){
            for(var i=0;i<data.length;i++){
                var idArr = $("#workClientInfoList tr:visible .clientInfoId");
                if(data[i].id!=''&&!hasInArr(data[i].id,idArr)){
                    addRow('#workClientInfoList', workClientInfoListRowIdx, workClientInfoListTpl);
                    workClientInfoListRowIdx = workClientInfoListRowIdx + 1;
                    var row = workClientInfoListRowIdx - 1 ;
                    $("#" + "workClientInfoList" + row + "_id").val(data[i].id);
                    $("#" + "workClientInfoList" + row + "_name").val(data[i].name);
                    $("#" + "workClientInfoList" + row + "_companyType").val(data[i].companyType);
                    $("#" + "workClientInfoList" + row + "_companyIndustry").val(data[i].companyIndustry);
                    $("#" + "workClientInfoList" + row + "_area").val(data[i].area);
                }
            }
        }
        //千位符号，保留两位小数
        function toThousands(s){
            if(/[^0-9\.]/.test(s)) return "无效值";
            s=s.replace(/^(\d*)$/,"$1.");
            s=(s+"00").replace(/(\d*\.\d\d)\d*/,"$1");
            s=s.replace(".",",");
            var re=/(\d)(\d{3},)/;
            while(re.test(s))
                s=s.replace(re,"$1,$2");
            s=s.replace(/,(\d\d)$/,".$1");
            return  s.replace(/^\./,"0.")
        }
        function setContractValue (){

		}
        function  deleteContract() {
			$("#totalContractIdId").val("");
            $("#totalContractIdName").val("");
        }
	</script>
</head>
<body>
<div class="single-form">
	<div class="container">
		<form:form id="inputForm" modelAttribute="workContractRe" enctype="multipart/form-data"  action ="${ctx}/workcontractre/workContractRe/saveAudit" method="post" class="form-horizontal">
			<form:hidden path="id"/>
			<form:hidden path="home"/>
			<form:hidden path="act.taskId"/>
			<form:hidden path="act.taskName"/>
			<form:hidden path="act.taskDefKey"/>
			<form:hidden path="act.procInsId"/>
			<form:hidden path="act.procDefId"/>
			<form:hidden id="flag" path="act.flag"/>
			<%--创建人--%>
			<form:hidden path="createBy.name" htmlEscape="false"  readonly="true" value="${fns:getUser().name}" class="form-control "/>
			<div class="tabs-container">
<%--				<div class="layui-tab" id="tabDiv">--%>
<%--					<ul class="layui-tab-title" >--%>
<%--						<li class="active"><a data-toggle="tab" href="#tab-11"  aria-expanded="true">合同信息</a></li>--%>
<%--&lt;%&ndash;						<li ><a data-toggle="tab" href="#tab-22"  aria-expanded="false">合同评审信息</a></li>&ndash;%&gt;--%>
<%--					</ul>--%>
<%--				</div>--%>
				<div class="tab-content">
					<div id="tab-11" class="tab-pane active">
						<div class="form-group layui-row first lw9">
							<div class="form-group-label"><h2>合同基础信息</h2></div>
							<%--<div class="layui-item layui-col-sm6">--%>
								<%--<label class="layui-form-label"><span class="require-item">*</span>合同来源：</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 class="layui-item layui-col-sm6">
								<label class="layui-form-label">评审编号：</label>
								<div class="layui-input-block">
									<div class="input-group">
										<form:input path="number" id="contractNum" htmlEscape="false" readonly="true" class="form-control  layui-input"/>
									</div>
								</div>
							</div>
							<div class="layui-item layui-col-sm6">
								<label class="layui-form-label"><span class="require-item">*</span>合同名称：</label>
								<div class="layui-input-block">
									<form:input path="name" htmlEscape="false" readonly="true"   class="form-control required layui-input"/>
								</div>
							</div>
							<div class="layui-item layui-col-sm6">
								<label class="layui-form-label">所属部门：</label>
								<div class="layui-input-block with-icon">
									<form:input path="office.name" htmlEscape="false" readonly="true" class="form-control required  layui-input"/>
								</div>
							</div>
							<div class="layui-item layui-col-sm6">
								<label class="layui-form-label double-line">合 同 金 额 (元)预计金额：</label>
								<div class="layui-input-block">
									<form:input path="money" htmlEscape="false"  readonly="true"   pattern="#.00" class="form-control required number  layui-input"/>
								</div>
							</div>
							<div class="layui-item layui-col-sm6">
								<label class="layui-form-label ">主委托方：</label>
								<div class="layui-input-block">
									<input htmlEscape="false"  readonly="true" class="form-control layui-input" value="${workContractRe.client.name}"/>
								</div>
							</div>

							<div class="layui-item layui-col-sm6 ">
								<label class="layui-form-label"><span class="require-item">*</span>合同类型：</label>
								<div class="layui-input-block">
									<input htmlEscape="false"  readonly="true" class="form-control layui-input" value="${fns:getMainDictLabel(workContractRe.type, 'contract_info_type', '')}"/>
								</div>
							</div>
							<div class="layui-item layui-col-sm6">
								<label class="layui-form-label">创建时间：</label>
								<div class="layui-input-block">
									<input htmlEscape="false"  readonly="true" class="form-control layui-input" value="<fmt:formatDate value="${workContractRe.startDate}" pattern="yyyy年MM月dd日"/>"/>
								</div>
							</div>
							<div class="layui-item layui-col-sm12 with-textarea">
								<label class="layui-form-label ">备注：</label>
								<div class="layui-input-block">
									<form:textarea path="remarks" readonly="true" id="remarks" htmlEscape="false" rows="4"  maxlength="255"  class="form-control "/>
								</div>
							</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="contentTable4" class="table table-bordered table-condensed no-bottom-margin details">
									<thead>
									<tr>
											<%--<th width="10%">序号</th>--%>
										<th width="30%">委托方名称</th>
										<th width="20%">客户性质</th>
										<th width="20%">所属行业</th>
										<th width="30%">所属地区</th>
									</tr>
									</thead>
									<tbody id="workClientInfoList">
									<c:if test="${not empty workContractRe.workClientInfoList}">
										<c:forEach items="${workContractRe.workClientInfoList}" var="casePeopleNorm" varStatus="index">
											<tr id="workClientInfoList${index.index}">
												<td class="hide">
														<%--<input id="workClientInfoList${index.index}_id" name="workClientInfoList[${index.index}].id" type="hidden" value="${casePeopleNorm.id}"/>--%>
												</td>
													<%--<td>--%>
													<%--${index.index + 1}--%>
													<%--</td>--%>
													<%--${fns:getDictLabel(workAccount.financialSubjectss, 'not_project_reimbursement', '')}--%>
												<td>
														<%--<input id="workClientInfoList${index.index}_name" name="workClientInfoList[${index.index}].name" type="text" value="${casePeopleNorm.name}" readonly="true"   class="form-control "/>--%>
														${casePeopleNorm.name}
												</td>
												<td>
														<%--<form:select id="workClientInfoList${index.index}_companyType" path="workClientInfoList[${index.index}].companyType" disabled="true" readonly="true" class="form-control">
                                                            <form:option value="" label=""/>
                                                            <form:options items="${fns:getMainDictList('company_type')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
                                                        </form:select>--%>
														${fns:getMainDictLabel(casePeopleNorm.companyType, 'company_type', '')}
												</td>
												<td>
														<%--<form:select id="workClientInfoList${index.index}_companyIndustry" path="workClientInfoList[${index.index}].companyIndustry" disabled="true" readonly="true" class="form-control">
                                                            <form:option value="" label=""/>
                                                            <form:options items="${fns:getMainDictList('company_industry')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
                                                        </form:select>--%>
														${fns:getMainDictLabel(casePeopleNorm.companyIndustry, 'company_industry', '')}
												</td>
												<td>
														<%--<input id="workClientInfoList${index.index}_area" name="workClientInfoList[${index.index}].area.name" type="text" value="${casePeopleNorm.area.name}"  readonly="true"  class="form-control "/>--%>
														${casePeopleNorm.area.name}
												</td>
											</tr>
										</c:forEach>
									</c:if>
									</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="contentTable" class="table table-bordered table-condensed no-bottom-margin details">
									<thead>
									<tr>

										<th>文件</th>
										<th>上传人</th>
										<th>上传时间</th>
										<th width="180px">操作</th>
									</tr>
									</thead>
									<tbody>
									<c:choose>
										<c:when test="${not empty workContractRe.workAttachments}">
											<c:forEach items="${workContractRe.workAttachments}" var="workClientAttachment" varStatus="status">
												<tr>
														<%--<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 href="javascript:void(0)" onclick="preview('预览','${workClientAttachment.url}','95%','95%','1')">${workClientAttachment.attachmentName}</a></td>
																</c:when>
																<c:otherwise>
																	<td><a href="javascript:void(0)" onclick="preview('预览','${workClientAttachment.url}','95%','95%')">${workClientAttachment.attachmentName}</a></td>
																</c:otherwise>
															</c:choose>
														</c:otherwise>
													</c:choose>
													<td>${workClientAttachment.createBy.name}</td>
													<td><fmt:formatDate value="${workClientAttachment.createDate}" pattern="yyyy-MM-dd"/></td>
													<td  class="op-td">
														<div class="op-btn-box" >
															<c:set var="signflag" value="${fns:getSysParam('sign_flag',fns:getUser())}"/>
															<c:choose>
																<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')
                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'doc')
                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'docx')
                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'xls')
                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'xlsx')
                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'ppt')
                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'pptx')}">
																	<c:choose>
																		<c:when test="${signflag == '是'}">
																			<a href="javascript:location.href='${ctx}/isignature/iSignatureDocument/download?recordId=${workClientAttachment.id}'" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
																		</c:when>
																		<c:otherwise>
																			<a href="javascript:location.href='${ctx}/workcontractinfo/workContractInfo/downLoadAttach?file='+encodeURIComponent(encodeURIComponent('${workClientAttachment.url}'));" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
																		</c:otherwise>
																	</c:choose>
																</c:when>
																<c:otherwise>
																	<a href="javascript:location.href='${ctx}/workcontractinfo/workContractInfo/downLoadAttach?file='+encodeURIComponent(encodeURIComponent('${workClientAttachment.url}'));" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
																</c:otherwise>
															</c:choose>
														</div>
													</td>
												</tr>
											</c:forEach>
										</c:when>
										<c:otherwise>
											<tr>
												<td colspan="4" align="center">暂无数据</td>
											</tr>
										</c:otherwise>
									</c:choose>
									</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 with-textarea" >
								<label class="layui-form-label">审批意见：</label>
								<div class="layui-input-block">
									<form:textarea path="act.comment" class="form-control" rows="4" maxlength="780" />
								</div>
							</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" >
								<act:flowChart procInsId="${workContractRe.act.procInsId}"/>
								<act:histoicFlow procInsId="${workContractRe.act.procInsId}"/>
							</div>
						</div>
						<div class="form-group layui-row page-end"></div>
					</div>
<%--					<div id="tab-22" class="tab-pane">--%>
<%--						<div class="form-group layui-row first lw14">--%>
<%--							<div class="form-group-label"><h2>评审基础信息</h2></div>--%>
<%--							<div class="layui-item layui-col-sm6">--%>
<%--								<label class="layui-form-label"><span class="require-item">*</span>时间要求：</label>--%>
<%--								<div class="layui-input-block">--%>
<%--									<form:input id="timeRequirements" path="workContractReview.timeRequirements" htmlEscape="false" maxlength="64"    class="form-control required layui-input"/>--%>
<%--								</div>--%>
<%--							</div>--%>
<%--							<div class="layui-item layui-col-sm6">--%>
<%--								<label class="layui-form-label"><span class="require-item">*</span>特殊要求：</label>--%>
<%--								<div class="layui-input-block">--%>
<%--									<form:input id="specialRequirements" path="workContractReview.specialRequirements" htmlEscape="false" maxlength="64"     class="form-control required layui-input"/>--%>
<%--								</div>--%>
<%--							</div>--%>
<%--							<div class="layui-item layui-col-sm6">--%>
<%--								<label class="layui-form-label double-line"><span class="require-item">*</span>客户要求是否合法：</label>--%>
<%--								<div class="layui-input-block">--%>
<%--									<form:select path="workContractReview.isLegitimate" class="form-control simple-select required">--%>
<%--										<form:option value="" label=""/>--%>
<%--										<form:option value="1" label="是"/>--%>
<%--										<form:option value="0" label="否"/>--%>
<%--									</form:select>--%>
<%--								</div>--%>
<%--							</div>--%>
<%--							<div class="layui-item layui-col-sm6">--%>
<%--								<label class="layui-form-label double-line"><span class="require-item">*</span>客户诚信度的初步判断：</label>--%>
<%--								<div class="layui-input-block">--%>
<%--									<form:select path="workContractReview.credibility" class="form-control simple-select required">--%>
<%--										<form:option value="" label=""/>--%>
<%--										<form:option value="1" label="低"/>--%>
<%--										<form:option value="2" label="中"/>--%>
<%--										<form:option value="0" label="高"/>--%>
<%--									</form:select>--%>
<%--								</div>--%>
<%--							</div>--%>
<%--							<div class="layui-item layui-col-sm6">--%>
<%--								<label class="layui-form-label"><span class="require-item">*</span>风险初步评价：</label>--%>
<%--								<div class="layui-input-block">--%>
<%--									<form:select path="workContractReview.preliminaryRiskAssessmen" class="form-control simple-select required">--%>
<%--										<form:option value="" label=""/>--%>
<%--										<form:option value="1" label="低"/>--%>
<%--										<form:option value="0" label="高"/>--%>
<%--										<form:option value="2" label="中"/>--%>
<%--									</form:select>--%>
<%--								</div>--%>
<%--							</div>--%>
<%--							<div class="layui-item layui-col-sm6">--%>
<%--								<label class="layui-form-label double-line"><span class="require-item">*</span>被服务对象所处行业环境：</label>--%>
<%--								<div class="layui-input-block">--%>
<%--									<form:select path="workContractReview.serviceObjectIndustry" class="form-control simple-select required">--%>
<%--										<form:option value="" label=""/>--%>
<%--										<form:option value="1" label="正常"/>--%>
<%--										<form:option value="0" label="不正常"/>--%>
<%--									</form:select>--%>
<%--								</div>--%>
<%--							</div>--%>
<%--							<div class="layui-item layui-col-sm6">--%>
<%--								<label class="layui-form-label double-line"><span class="require-item">*</span>与服务有关的客户资料能否恰当获取：</label>--%>
<%--								<div class="layui-input-block">--%>
<%--									<form:select path="workContractReview.isProperAcquisition" class="form-control simple-select required">--%>
<%--										<form:option value="" label=""/>--%>
<%--										<form:option value="1" label="是"/>--%>
<%--										<form:option value="0" label="否"/>--%>
<%--									</form:select>--%>
<%--								</div>--%>
<%--							</div>--%>
<%--							<div class="layui-item layui-col-sm6">--%>
<%--								<label class="layui-form-label double-line"><span class="require-item">*</span>人员是否能专业胜任：</label>--%>
<%--								<div class="layui-input-block">--%>
<%--									<form:select path="workContractReview.isUserQualified" class="form-control simple-select required">--%>
<%--										<form:option value="" label=""/>--%>
<%--										<form:option value="1" label="是"/>--%>
<%--										<form:option value="0" label="否"/>--%>
<%--									</form:select>--%>
<%--								</div>--%>
<%--							</div>--%>
<%--							<div class="layui-item layui-col-sm6">--%>
<%--								<label class="layui-form-label double-line"><span class="require-item">*</span>是否需要借助外部专家力量：</label>--%>
<%--								<div class="layui-input-block">--%>
<%--									<form:select path="workContractReview.isExternalExpertPower" class="form-control simple-select required">--%>
<%--										<form:option value="" label=""/>--%>
<%--										<form:option value="1" label="需要"/>--%>
<%--										<form:option value="0" label="不需要"/>--%>
<%--									</form:select>--%>
<%--								</div>--%>
<%--							</div>--%>
<%--							<div class="layui-item layui-col-sm6">--%>
<%--								<label class="layui-form-label double-line"><span class="require-item">*</span>设备能否满足项目要求：</label>--%>
<%--								<div class="layui-input-block">--%>
<%--									<form:select path="workContractReview.isEquipmentMeetRequirements" class="form-control simple-select required">--%>
<%--										<form:option value="" label=""/>--%>
<%--										<form:option value="1" label="是"/>--%>
<%--										<form:option value="0" label="否"/>--%>
<%--									</form:select>--%>
<%--								</div>--%>
<%--							</div>--%>
<%--							<div class="layui-item layui-col-sm6">--%>
<%--								<label class="layui-form-label double-line"><span class="require-item">*</span>时间能否满足客户需求：</label>--%>
<%--								<div class="layui-input-block">--%>
<%--									<form:select path="workContractReview.isTimeMeetRequirements" class="form-control simple-select required">--%>
<%--										<form:option value="" label=""/>--%>
<%--										<form:option value="1" label="是"/>--%>
<%--										<form:option value="0" label="否"/>--%>
<%--									</form:select>--%>
<%--								</div>--%>
<%--							</div>--%>
<%--							<div class="layui-item layui-col-sm6">--%>
<%--								<label class="layui-form-label double-line"><span class="require-item">*</span>合同是否可以签定：</label>--%>
<%--								<div class="layui-input-block">--%>
<%--									<form:select path="workContractReview.isContractSignature" class="form-control simple-select required">--%>
<%--										<form:option value="" label=""/>--%>
<%--										<form:option value="1" label="是"/>--%>
<%--										<form:option value="0" label="否"/>--%>
<%--									</form:select>--%>
<%--								</div>--%>
<%--							</div>--%>
<%--							<div class="layui-item layui-col-sm12 with-textarea">--%>
<%--								<label class="layui-form-label">备注信息：</label>--%>
<%--								<div class="layui-input-block">--%>
<%--									<form:textarea path="workContractReview.remarks" htmlEscape="false" rows="4"   maxlength="500" class="form-control"/>--%>
<%--								</div>--%>
<%--							</div>--%>
<%--						</div>--%>
<%--						<div class="form-group layui-row">--%>
<%--                        <div class="form-group-label"><h2>合同评审附件信息</h2></div>--%>
<%--                        <div class="layui-item nav-btns">--%>
<%--                            <a id="attachment_review_btn" class="nav-btn nav-btn-add" title="添加附件"><i class="fa fa-plus"></i>&nbsp;添加附件</a>--%>
<%--                        </div>--%>
<%--                        <div id="addFile_attachment_review" style="display: none" class="upload-progress">--%>
<%--                            <span id="fileName_attachment_review" ></span>--%>
<%--                            <b><span id="baifenbi_attachment_review" ></span></b>--%>
<%--                            <div class="progress">--%>
<%--                                <div id="jindutiao_attachment_review" class="progress-bar" style="width: 0%" aria-valuenow="0">--%>
<%--                                </div>--%>
<%--                            </div>--%>
<%--                        </div>--%>
<%--                        <input id="attachment_review_file" type="file" multiple="multiple" name="attachment_file" style="display: none;" onChange="if(this.value)insertTitleReview(this.value);"/>--%>
<%--                        <span id="attachment_review_title"></span>--%>
<%--                        <div class="layui-item layui-col-xs12" style="padding:0 16px;">--%>
<%--                            <table id="listAttachmentReview" class="table table-bordered table-condensed details">--%>
<%--                                <thead>--%>
<%--                                <tr>--%>
<%--                                        &lt;%&ndash; <th>序号</th>&ndash;%&gt;--%>
<%--                                    <th>文件预览</th>--%>
<%--                                    <th>上传人</th>--%>
<%--                                    <th>上传时间</th>--%>
<%--                                    <th width="180px">操作</th>--%>
<%--                                </tr>--%>
<%--                                </thead>--%>
<%--                                <tbody id="file_attachment_review">--%>
<%--                                <c:forEach items="${workContractInfo.workContractReview.workAttachments}" var = "workClientAttachment" varStatus="status">--%>
<%--                                    <tr>--%>
<%--                                            &lt;%&ndash; <td>${status.index + 1}</td>&ndash;%&gt;--%>
<%--                                        <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>--%>
<%--                                                <c:if test="${workClientAttachment.createBy.id eq fns:getUser().id}">--%>
<%--                                                    <a href="javascript:void(0)" onclick="deleteFileFromAliyun(this,'${ctx}/sys/workattachment/deleteFileFromAliyun?url=${workClientAttachment.url}&id=${workClientAttachment.id}&type=2','addFile_attachment','_attachment_review')" class="op-btn op-btn-delete" ><i class="fa fa-trash"></i>&nbsp;删除</a>--%>
<%--                                                </c:if>--%>
<%--                                            </div>--%>
<%--                                        </td>--%>
<%--                                    </tr>--%>
<%--                                </c:forEach>--%>
<%--                                </tbody>--%>
<%--                            </table>--%>
<%--                        </div>--%>
<%--                    </div>--%>
<%--						<div class="form-group layui-row page-end"></div>--%>
<%--					</div>--%>
				</div>
			</div>
		</form:form>
	</div>
</div>
</body>
</html>