<%@ 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>
	<script type="text/javascript">
		var validateForm;
		function doSubmit(){//回调函数，在编辑和保存动作时，供openDialog调用提交表单。
		  if(validateForm.form()){
			  $("#inputForm").submit();
			  return true;
		  }else {
              parent.layer.msg("信息未填写完整!", {icon: 5});
          }
		  return false;
		}
		$(document).ready(function() {

            $("input[name='ext']").on('ifChecked', function(event){
                var radioVal = $(this).val();
                if(radioVal == 0){
                    $("#td1").removeClass("hide");
                    $("#td2").addClass("hide");
                    $("#cid").removeClass("hide");
                    $("#td4").attr("rowspan","4")
                }else{
                    $("#td1").addClass("hide");
                    $("#cid").addClass("hide");
                    $("#td2").removeClass("hide");
                    $("#td4").attr("rowspan","3")
                }
            });
            if("${workFullManage.ext}" == "1"){
                $("#ext1").iCheck('check')
            }else{
                $("#ext").iCheck('check')
            }

			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);
					}
				}
			});
			$("#askPayMode").change(function(){
				if($(this).val() == 4){
				    $("#standardExplain").attr("class","form-control required")
				}
			});
            $("#attachment_btn").click(function () {
                $("#attachment_file").click();
            });
            getRandom()
		});
        function setContractValue(obj){
            $.ajax({
                type:'post',
                url:'${ctx}/workfullmanage/workFullManage/getContractInfo',
                data:{
                    "obj":obj
                },
                success:function(data){
                    var d = JSON.parse(data);
                    $("#contractId").val(d.contractNum);
                    //$("#clientIdName").val(d.clientName);
                    //$("#clientIdId").val(d.clientId);
                    $("#clientLevel").val(d.creditRank);
                    $("#position").val(d.linkmanPosition);
                    $("#linkMan").val(d.linkmanName);
                    $("#linkPhone").val(d.linkmanPhone);
                    $("#QQ").val(d.QQ);
                    $("#Email").val(d.linkmanEmail);
                }
            });
        }
        function openBill(title,url,width,height,target,formId,eleId){
            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: true, //开启最大化最小化按钮
                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中展示
					var $document = iframeWin.contentWindow.document;

					if(formId){
						formSubmit($document,formId,eleId,index);
					}else{
                        getSelectedItem($document,eleId,index)
					}
                },
                cancel: function(index){
                }
            });
        }
        function getSelectedItem($document,constructId,index){
            var $td = $($document.getElementById("contentTable")).find("tbody").find(".i-checks:checked");
            var size = $td.size();
            if(size == 0 ){
                top.layer.alert('请至少选择一条数据!', {icon: 0, title:'警告'});
                return "-1";
            }
            if(size > 1 ){
                top.layer.alert('只能选择一条数据!', {icon: 0, title:'警告'});
                return "-1";
            }
            var id =  $td.attr("id");
            var unitName = $.trim($td.parent().parent().parent().find("td").eq(1).find("a").html());
            var unitLinkMan = $.trim($td.parent().parent().parent().find("td").eq(2).html());
            var unitLinkPhone = $.trim($td.parent().parent().parent().find("td").eq(3).html());
            var msg = $.trim($td.parent().parent().parent().find("td").eq(5).html());
            var d = {};
            	d.id = id,
				d.unitName = unitName,
				d.unitLinkMan = unitLinkMan,
				d.linkPhone = unitLinkPhone,
				d.msg = msg
            	$(constructId).html(joinCode(d));
            top.layer.close(index)
        }

		function formSubmit($document,inputForm,constructId,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) {
                        $(constructId).html('');
                        var d = data;
                        if(d.msg == "cnounique"){
                            parent.layer.msg("该施工单位已存在!",{icon:1});
                            return false;
                        }else if(d.msg == "snounique"){
                            parent.layer.msg("该监理单位已存在!",{icon:1});
                            return false;
                        }else if(d.msg == "dnounique"){
                            parent.layer.msg("该设计单位已存在!",{icon:1});
                            return false;
                        }
                        var str = joinCode(d);
						$(constructId).html(str);
						parent.layer.msg(d.str,{icon:1});
						top.layer.close(index)
                    }
                });
            }
		}

		function joinCode(d){
            var formUrl = '${ctx}/workfullmanage/workFullDesign/form?id='+d.id;
            var formId  = 'inputFormDesign';
            var tableId = '#designId';
            var deleteUrl = '${ctx}/workfullmanage/workFullDesign/delete?id='+d.id;
            if(d.msg == "cunique"){
                formUrl = '${ctx}/workfullmanage/workFullConstruct/form?id='+d.id;
                deleteUrl = '${ctx}/workfullmanage/workFullConstruct/delete?id='+d.id;
                formId = 'inputForm';
                tableId = '#constructId';
            }else if(d.msg == "sunique"){
                formUrl = '${ctx}/workfullmanage/workFullSurvey/form?id='+d.id;
                deleteUrl = '${ctx}/workfullmanage/workFullSurvey/delete?id='+d.id;
                formId = 'inputFormSurvey';
                tableId = '#surveyId';
            }
            var str = '<tr>' +
                '<td class="hide"><input type="hidden" id="'+tableId.replace("#","")+'" name="'+tableId.replace("#","")+'.id" value="'+d.id+'" /></td>'+
                '<td>'+
                '    <a href="javascript:void(0)" onclick=\"openDialogView(\'查看\',\''+formUrl+'&tabId=1\',\'800px\',\'500px\')\">'+d.unitName+'</a>'+
                '</td>'+
                '<td>'+d.unitLinkMan+'</td>'+
                '<td>'+d.linkPhone+'</td>'+
                '<td>'+
                '    <a href="javascript:void(0)" onclick=\"openBill(\'修改\', \''+formUrl+''+
                //										'&index='+$.trim(i)+''+
                '\',\'800px\', \'500px\',false,\''+formId+'\',\''+tableId+'\')\" class="btn btn-success btn-xs" ><i class="fa fa-edit"></i> 修改</a>'+
                '    <a href="javascript:void(0)" onclick=\"deleteData(this,\''+deleteUrl+'\')\" class="btn btn-danger btn-xs" ><i class="fa fa-edit"></i> 取消</a>'+
                '</td>'+
                '</tr>';
            return str;
		}
        /**
         * 删除单位信息
         * @param obj
         */
		function deleteData(obj,deleteUrl){
		    $(obj).parent().parent().remove();
//		    $.ajax({
//				type:"post",
//				url:deleteUrl,
//				success:function(data){
//					if(data.str){
//					    parent.layer.msg('删除成功',{icon:1});
//						$(obj).parent().parent().remove();
//					}
//				}
//			});
		}

        /**
		 * 设置客户信息
         * @param obj
         */
        var linkManList = null;
        var build_linkManList = null;
		function setValue(obj,type){
		    $.ajax({
				type:"post",
				data:{
				    "obj":obj
				},
				url:'${ctx}/workfullmanage/workFullManage/getWorkClientInfo',
				success:function(data){
				    var d = JSON.parse(data);
				    var defaultLinkMan = d[0];
				    if(type == 1){
				        linkManList = d;
				        $("#linkman_list").html("");
				        $(".linkman_attr").val("");
				        if(defaultLinkMan != null && defaultLinkMan != undefined && defaultLinkMan !=""){
                            $("#clientLevel").val(defaultLinkMan.creditRank);
                            $("#linkMan").val(defaultLinkMan.linkmanName);
                            $("#position").val(defaultLinkMan.linkmanPosition);
                            $("#linkPhone").val(defaultLinkMan.linkmanPhone);
                            $("#Email").val(defaultLinkMan.linkmanEmail);
                            $("#QQ").val(defaultLinkMan.QQ);

                            $.each(d,function(n,value) {
                                var optionTag = '<option id="linkman_attr_'+n+'" type="text" value='+n+'>'+value.linkmanName+'</option>';
                                $("#linkman_list").append(optionTag);
                            });
                            $("#linkman_list option:first").prop("selected","selected").text(defaultLinkMan.linkmanName);
                        }
                    }else{
				        build_linkManList = d;
				        $("#build_linkman_list").html("");
				        $(".build_linkman_attr").val("");
                        if(defaultLinkMan != null && defaultLinkMan != undefined && defaultLinkMan !=""){
                            $("#build_clientLevel").val(defaultLinkMan.creditRank);
                            $("#build_linkMan").val(defaultLinkMan.linkmanName);
                            $("#build_position").val(defaultLinkMan.linkmanPosition);
                            $("#build_linkPhone").val(defaultLinkMan.linkmanPhone);
                            $("#build_Email").val(defaultLinkMan.linkmanEmail);
                            $("#build_QQ").val(defaultLinkMan.QQ);

                            $.each(d,function(n,value) {
                                var optionTag = '<option id="build_linkman_attr_'+n+'" type="text" value='+n+'>'+value.linkmanName+'</option>';
                                $("#build_linkman_list").append(optionTag);
                            });
                            $("#build_linkman_list option:first").prop("selected","selected").text(defaultLinkMan.linkmanName);
                        }
                    }
				}
			})
		}
		/**
		 * 查看联系人（需要用到linkManList）
		 */
		function selectLinkman(index,target) {
			if(target=='linkman'){
                var manList = linkManList ;
			    if(manList ==null){
			        manList = JSON.parse('${requestScope.linkmanList}');
			    }
			    var linkman = manList[index];
                $("#clientLevel").val(linkman.creditRank);
                $("#linkMan").val(linkman.linkmanName);
                $("#position").val(linkman.linkmanPosition);
                $("#linkPhone").val(linkman.linkmanPhone);
                $("#Email").val(linkman.linkmanEmail);
                $("#QQ").val(linkman.QQ);

			}
			if(target=='build_linkman'){
                var manList = build_linkManList ;
                if(manList ==null){
                    manList = JSON.parse('${requestScope.build_linkmanList}');
                }
                var build_linkman = manList[index];
                $("#build_clientLevel").val(build_linkman.creditRank);
                $("#build_linkMan").val(build_linkman.linkmanName);
                $("#build_position").val(build_linkman.linkmanPosition);
                $("#build_linkPhone").val(build_linkman.linkmanPhone);
                $("#build_Email").val(build_linkman.linkmanEmail);
                $("#build_QQ").val(build_linkman.QQ);
            }
        }

        function urlRedict(file,attach){
            var index = parent.layer.load(0, {shade: false});
            $.post("${ctx}/workfullmanage/workFullManage/deleteFile",
                {"file":file,"attach":attach},
                function(result){
                    var d = JSON.parse(result);
                    if(d.str){
                        location.reload();
                        parent.layer.msg("删除成功！！！",{icon:6});
                        parent.layer.close(index);
                    }
                });
        }
        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(!$("#fullProjectNumber").val()){
                $("#fullProjectNumber").val(GetRandomn)
            }
        }

        function insertTitle(tValue){
            var list = "${workFullManage.workAttachments}";
            var size = (list.split('url')).length-1;
            var files = $("#attachment_file")[0].files;            for(var i = 0;i<files.length;i++) {                var file = files[i];
            var attachmentId = "";
            var attachmentFlag = "36";
            console.log(file);
            var timestamp=new Date().getTime();

            var storeAs = "attachment-file/workClientInfo/"+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,size);}
        }


        function  chooseType() {
            if($("#psort").val()==1){
                $("#ssort ").attr("value","");
                document.getElementById( "t1").style.display= "";
                document.getElementById( "t2").style.display= "";
                $("#ssort11").show();$("#ssort12").show();$("#ssort13").show();
                $("#ssort21").hide();$("#ssort22").hide();$("#ssort23").hide();$("#ssort24").hide();
                $("#ssort31").hide();$("#ssort32").hide();$("#ssort33").hide();$("#ssort34").hide();$("#ssort35").hide();$("#ssort36").hide();
                $("#ssort41").hide();$("#ssort42").hide();
                $("#ssort51").hide();$("#ssort52").hide();$("#ssort53").hide();$("#ssort54").hide();$("#ssort55").hide();
                $("#ssort101").hide();$("#ssort102").hide();
            }
            else if($("#psort").val()==2){
                $("#ssort ").attr("value","");
                document.getElementById( "t1").style.display= "";
                document.getElementById( "t2").style.display= "";
                $("#ssort11").hide();$("#ssort12").hide();$("#ssort13").hide();
                $("#ssort21").show();$("#ssort22").show();$("#ssort23").show();$("#ssort24").show();
                $("#ssort31").hide();$("#ssort32").hide();$("#ssort33").hide();$("#ssort34").hide();$("#ssort35").hide();$("#ssort36").hide();
                $("#ssort41").hide();$("#ssort42").hide();
                $("#ssort51").hide();$("#ssort52").hide();$("#ssort53").hide();$("#ssort54").hide();$("#ssort55").hide();
                $("#ssort101").hide();$("#ssort102").hide();
            }
            else if($("#psort").val()==3){
                $("#ssort ").attr("value","");
                document.getElementById( "t1").style.display= "";
                document.getElementById( "t2").style.display= "";
                $("#ssort11").hide();$("#ssort12").hide();$("#ssort13").hide();
                $("#ssort21").hide();$("#ssort22").hide();$("#ssort23").hide();$("#ssort24").hide();
                $("#ssort31").show();$("#ssort32").show();$("#ssort33").show();$("#ssort34").show();$("#ssort35").show();$("#ssort36").show();
                $("#ssort41").hide();$("#ssort42").hide();
                $("#ssort51").hide();$("#ssort52").hide();$("#ssort53").hide();$("#ssort54").hide();$("#ssort55").hide();
                $("#ssort101").hide();$("#ssort102").hide();
            }
            else if($("#psort").val()==4){
                $("#ssort ").attr("value","");
                document.getElementById( "t1").style.display= "";
                document.getElementById( "t2").style.display= "";
                $("#ssort11").hide();$("#ssort12").hide();$("#ssort13").hide();
                $("#ssort21").hide();$("#ssort22").hide();$("#ssort23").hide();$("#ssort24").hide();
                $("#ssort31").hide();$("#ssort32").hide();$("#ssort33").hide();$("#ssort34").hide();$("#ssort35").hide();$("#ssort36").hide();
                $("#ssort41").show();$("#ssort42").show();
                $("#ssort51").hide();$("#ssort52").hide();$("#ssort53").hide();$("#ssort54").hide();$("#ssort55").hide();
                $("#ssort101").hide();$("#ssort102").hide();
            }
            else if($("#psort").val()==5){
                $("#ssort ").attr("value","");
                document.getElementById( "t1").style.display= "";
                document.getElementById( "t2").style.display= "";
                $("#ssort11").hide();$("#ssort12").hide();$("#ssort13").hide();
                $("#ssort21").hide();$("#ssort22").hide();$("#ssort23").hide();$("#ssort24").hide();
                $("#ssort31").hide();$("#ssort32").hide();$("#ssort33").hide();$("#ssort34").hide();$("#ssort35").hide();$("#ssort36").hide();
                $("#ssort41").hide();$("#ssort42").hide();
                $("#ssort51").show();$("#ssort52").show();$("#ssort53").show();$("#ssort54").show();$("#ssort55").show();
                $("#ssort101").hide();$("#ssort102").hide();
            }
            else if($("#psort").val()==10){
                $("#ssort ").attr("value","");
                document.getElementById( "t1").style.display= "";
                document.getElementById( "t2").style.display= "";
                $("#ssort11").hide();$("#ssort12").hide();$("#ssort13").hide();
                $("#ssort21").hide();$("#ssort22").hide();$("#ssort23").hide();$("#ssort24").hide();
                $("#ssort31").hide();$("#ssort32").hide();$("#ssort33").hide();$("#ssort34").hide();$("#ssort35").hide();$("#ssort36").hide();
                $("#ssort41").hide();$("#ssort42").hide();
                $("#ssort51").hide();$("#ssort52").hide();$("#ssort53").hide();$("#ssort54").hide();$("#ssort55").hide();
                $("#ssort101").show();$("#ssort102").show();
            }else{
                document.getElementById( "t1").style.display= "none";
                document.getElementById( "t2").style.display= "none";
            }
        }
	</script>
	<script type="text/javascript">
		$(function () {

            if(${requestScope.linkmanList !=null}){
                var defaultLinkmanName = "";
                $.each(JSON.parse('${requestScope.linkmanList}'),function(n,value){
                    var optionTag = '<option id="linkman_attr_'+n+'" type="text" value='+n+'>'+value.linkmanName+'</option>';
                    $("#linkman_list").append(optionTag);
                    if(n==0){defaultLinkmanName=value.linkmanName;}
                });
                $("#linkman_list option:first").prop("selected","selected").text(defaultLinkmanName);
            }
            if(${requestScope.build_linkmanList !=null}){
                var defaultLinkmanName = "";
                $.each(JSON.parse('${requestScope.build_linkmanList}'),function(n,value){
                    var optionTag = '<option id="build_linkman_attr_'+n+'" type="text" value='+n+'>'+value.linkmanName+'</option>';
                    $("#build_linkman_list").append(optionTag);
                    if(n==0){defaultLinkmanName=value.linkmanName;}
                });
                $("#build_linkman_list option:first").prop("selected","selected").text(defaultLinkmanName);
            }

        })
	</script>
	<style>
		.input-group{
			width:100%;
		}
	</style>
</head>
<body class="hideScroll">
		<form:form id="inputForm" modelAttribute="workFullManage"  enctype="multipart/form-data" action="${ctx}/workfullmanage/workFullManage/save" method="post" class="form-horizontal">
		<form:hidden path="id"/>
		<sys:message content="${message}"/>	
		<table class="table table-bordered  table-condensed dataTables-example dataTable no-footer">
		   <tbody>
		   		<tr>
					<td class="width-20 active" rowspan="4" id="td4"><label class="pull-right">合同信息</label></td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">合同标识：</label></td>
					<td class="width-25" colspan="3">
						<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>
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">合同名称：</label></td>
					<td class="width-25" colspan="3" id="td1">
						<sys:gridselectContract url="${ctx}/workengineeringproject/workEngineeringProject/selectcontractId" type="5" isTotal="" id="contractId" name="workContractInfo.id"  value="${workFullManage.workContractInfo.id}"  title="选择合同" labelName="workContractInfo.name"
												labelValue="${workFullManage.workContractInfo.name}" cssClass="form-control" fieldLabels="合同信息id" fieldKeys="name" searchLabel="合同名称" searchKey="name" ></sys:gridselectContract>
					</td>
					<td  class="width-25 hide" colspan="3" id="td2">
						<form:input path="contractName" id="contractName" htmlEscape="false" class="form-control "/>
					</td>
				</tr>
				<tr id="cid">
					<td class="width-15 active"><label class="pull-right">合同编号：</label></td>
					<td class="width-25">
						<form:input path="contractId" htmlEscape="false"  readonly="true"  class="form-control "/>
					</td>
				</tr>
				<tr>
					<td class="width-20 active" rowspan="7"><label class="pull-right">项目信息</label></td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">总项目名称：</label></td>
					<td class="width-25" colspan="3">
						<c:choose>
							<c:when test="${not empty workFullManage.totalFullName}">
								<form:input path="totalFullName" readonly="true" class="form-control required" />
							</c:when>
							<c:otherwise>
								<sys:gridselectcalltotalproject url="${ctx}/workfullmanage/workFullManage/selectprojectTotal" id="totalFullId" name="totalFullId" isTotal="0"  value="${workFullManage.totalFullId}"  title="选择总项目" labelName="workFullManage.fullProjectName"
														   labelValue="${workFullManage.totalFullName}" cssClass="form-control" fieldLabels="工程" fieldKeys="fullProjectName" searchLabel="工程名称" searchKey="name" ></sys:gridselectcalltotalproject>
							</c:otherwise>
						</c:choose>
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right"><font color="red">*</font>项目编号：</label></td>
					<td class="width-25">
						<form:input path="fullProjectNumber" htmlEscape="false"  readonly="true"  class="form-control required"/>
					</td>
					<td class="width-15 active"><label class="pull-right"><font color="red">*</font>项目来源：</label></td>
					<td class="width-25">
						<form:select path="fullProjectSource" class="form-control required">
							<form:option value="" label=""/>
							<form:options items="${fns:getDictList('full_project_source')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
						</form:select>
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right"><font color="red">*</font>项目名称：</label></td>
					<td class="width-25">
						<form:input path="fullProjectName" htmlEscape="false"    class="form-control required"/>
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right"><font color="red">*</font>行业分类：</label></td>
					<td class="width-25">
						<form:select path="fullIndustryType" class="form-control required">
							<form:option value="" label=""/>
							<form:options items="${fns:getDictList('full_industry_type')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
						</form:select>
					</td>
					<td class="width-15 active"><label class="pull-right"><font color="red">*</font>结构类型：</label></td>
					<td class="width-25">
						<form:select path="fullStructureType" class="form-control required">
							<form:option value="" label=""/>
							<form:options items="${fns:getDictList('full_structure_type')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
						</form:select>
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">行业二分类：</label></td>
					<td class="width-25">
						<form:select id="psort" path="psort" class="form-control" onChange="chooseType()"><%--onChange="changeTypeExplain(this)"--%>
							<form:option value="" label=""/>
							<form:options items="${fns:getDictList('psort')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
						</form:select>
					</td>
					<td class="width-15 active" id="t1" style="display:none"><label class="pull-right">详细分类：</label></td>
					<td class="width-25" id="t2" style="display:none">
						<form:select path="ssort" class="form-control" onChange="changeTypeExplain(this)">
							<form:option value="" label=""/>
							<form:options id="ssort1" items="${fns:getDictList('ssort1')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
							<form:options id="ssort2" items="${fns:getDictList('ssort2')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
							<form:options id="ssort3" items="${fns:getDictList('ssort3')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
							<form:options id="ssort4" items="${fns:getDictList('ssort4')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
							<form:options id="ssort5" items="${fns:getDictList('ssort5')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
							<form:options id="ssort10" items="${fns:getDictList('ssort10')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
						</form:select>
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right"><font color="red">*</font>投资额（元）：</label></td>
					<td class="width-25">
						<form:input path="fullInvestMoney" htmlEscape="false"    class="form-control number"/>
					</td>
				</tr>
				<tr>
					<td class="width-20 active" rowspan="5"><label class="pull-right">客户信息</label></td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right"><font color="red">*</font>业主单位：</label></td>
					<td class="width-25" colspan="3">
						<sys:gridselectclientinfo url="${ctx}/workcontractinfo/workContractInfo/selectclient" type="1" id="clientId" name="clientId"  value="${workFullManage.workClientInfo.id}"  title="选择建设方单位" labelName="workClientInfo.name"
												  labelValue="${workFullManage.workClientInfo.name}" cssClass="form-control required" fieldLabels="单位" fieldKeys="name" searchLabel="客户名称" searchKey="name" searchLabel1="联系人" searchKey1="workLinkName"></sys:gridselectclientinfo>
					</td>
				</tr>
				<tr>
					<%--<td class="width-15 active"><label class="pull-right">客户信用等级：</label></td>--%>
					<%--<td class="width-25">--%>
						<%--<form:input path="workClientInfo.creditRank" id="clientLevel" readonly="true" class="form-control "/>--%>
					<%--</td>--%>
					<td class="width-15 active"><label class="pull-right">查看联系人：</label></td>
					<td class="width-25">
						<select id="linkman_list" onchange="selectLinkman(this.value,'linkman')" class="linkman_list max-width-100 form-control" />
					</td>
					<td class="width-15 active"><label class="pull-right">联系人：</label></td>
					<td class="width-25">
						<form:input path="workClientInfo.workClientLinkmanList[0].name" id="linkMan" readonly="true" class="form-control linkman_attr"/>
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">职务：</label></td>
					<td class="width-25">
						<form:input path="workClientInfo.workClientLinkmanList[0].position" id="position" readonly="true" class="form-control linkman_attr"/>
					</td>
					<td class="width-15 active"><label class="pull-right">联系方式：</label></td>
					<td class="width-25">
						<form:input path="workClientInfo.workClientLinkmanList[0].linkPhone" id="linkPhone" readonly="true" class="form-control linkman_attr"/>
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">QQ：</label></td>
					<td class="width-25">
						<form:input path="workClientInfo.workClientLinkmanList[0].qq" id="QQ" readonly="true" class="form-control linkman_attr"/>
					</td>
					<td class="width-15 active"><label class="pull-right">Email：</label></td>
					<td class="width-25">
						<form:input path="workClientInfo.workClientLinkmanList[0].email" id="Email" readonly="true" class="form-control linkman_attr"/>
					</td>
				</tr>

				<tr>
					<td class="width-20 active" rowspan="5"><label class="pull-right">建设方信息</label></td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right"><font color="red">*</font>业主单位：</label></td>
					<td class="width-25" colspan="3">
						<%--<form:input path="buildId" htmlEscape="false" readonly="true"   class="form-control "/>--%>
						<sys:gridselectclientinfo url="${ctx}/workcontractinfo/workContractInfo/selectclient" type="2" id="buildId" name="buildId"  value="${workFullManage.workBuildInfo.id}"  title="选择建设方单位" labelName="workBuildInfo.name"
										labelValue="${workFullManage.workBuildInfo.name}" cssClass="form-control required" fieldLabels="单位" fieldKeys="name" searchLabel="客户名称" searchKey="name" searchLabel1="联系人" searchKey1="workLinkName"></sys:gridselectclientinfo>
						<%--<sys:gridselectAhref url="${ctx}/workcontractinfo/workContractInfo/selectclientAhref" id="client" name="client.id"  value="${workContractInfo.client.id}"  title="选择客户ID" labelName="client.name"--%>
											 <%--labelValue="${workContractInfo.client.name}" cssClass="form-control required" fieldLabels="客户名称" fieldKeys="name" searchLabel="客户名称" searchKey="name" searchLabel1="联系人" searchKey1="workLinkName"></sys:gridselectAhref>--%>
					</td>
				</tr>
				<tr>
					<%--<td class="width-15 active"><label class="pull-right">客户信用等级：</label></td>--%>
					<%--<td class="width-25">--%>
						<%--<form:input path="workBuildInfo.creditRank" id="build_clientLevel" readonly="true" class="form-control "/>--%>
					<%--</td>--%>
					<td class="width-15 active"><label class="pull-right">查看联系人：</label></td>
					<td class="width-25">
						<select id="build_linkman_list" onchange="selectLinkman(this.value,'build_linkman')" class="build_linkman_list max-width-100 form-control" />
					</td>
					<td class="width-15 active"><label class="pull-right">联系人：</label></td>
					<td class="width-25">
						<form:input path="workBuildInfo.workClientLinkmanList[0].name" id="build_linkMan" readonly="true" class="form-control build_linkman_attr"/>
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">职务：</label></td>
					<td class="width-25">
						<form:input path="workBuildInfo.workClientLinkmanList[0].position" id="build_position" readonly="true" class="form-control build_linkman_attr"/>
					</td>
					<td class="width-15 active"><label class="pull-right">联系方式：</label></td>
					<td class="width-25">
						<form:input path="workBuildInfo.workClientLinkmanList[0].linkPhone" id="build_linkPhone" readonly="true" class="form-control build_linkman_attr"/>
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">QQ：</label></td>
					<td class="width-25">
						<form:input path="workBuildInfo.workClientLinkmanList[0].qq" id="build_QQ" readonly="true" class="form-control build_linkman_attr"/>
					</td>
					<td class="width-15 active"><label class="pull-right">Email：</label></td>
					<td class="width-25">
						<form:input path="workBuildInfo.workClientLinkmanList[0].email" id="build_Email" readonly="true" class="form-control build_linkman_attr"/>
					</td>
				</tr>

				<tr>
					<td class="width-20 active"><label class="pull-right">施工单位</label></td>
					<td colspan="4">
						<p>
							<span onclick="openBill('选择施工单位','${ctx}/workfullmanage/workFullConstruct/list?tabId=0','80%','80%',false,null,'#constructId')" class="btn btn-primary btn-sm">选择施工单位</span>
							<span onclick="openBill('添加施工单位','${ctx}/workfullmanage/workFullConstruct/form?tabId=0','80%','80%',false,'inputForm','#constructId')" class="btn btn-info btn-sm pull-right" >添加客户</span>
						</p>
						<table class="table table-bordered  table-condensed dataTables-example dataTable no-footer">
							<thead>
							<th>施工单位</th>
							<th>施工方联系人</th>
							<th>联系方式</th>
							<th>操作</th>
							</thead>
							<tbody id="constructId">
								<c:if test="${not empty workFullManage.constructId}">
									<tr>
										<td><a href="javascript:void(0)" onclick="openDialogView('查看','${ctx}/workfullmanage/workFullConstruct/form?id=${workFullManage.constructId.id}&tabId=1','80%','80%')">${workFullManage.constructId.unitName}</a></td>
										<td>${workFullManage.constructId.unitLinkMan}</td>
										<td>${workFullManage.constructId.linkPhone}</td>
										<td>
											<a href="javascript:void(0)" onclick="openBill('修改','${ctx}/workfullmanage/workFullConstruct/form?id=${workFullManage.constructId.id}','80%','80%',false,'inputForm','#constructId')" class="btn btn-success btn-xs" ><i class="fa fa-edit"></i> 修改</a>
											<a href="javascript:void(0)" onclick="deleteData(this,'${ctx}/workfullmanage/workFullConstruct/delete?id=${workFullManage.constructId.id}')" class="btn btn-danger btn-xs" ><i class="fa fa-edit"></i> 删除</a>
										</td>
									</tr>
								</c:if>
							</tbody>
						</table>
					</td>
				</tr>
				<tr>
					<td class="width-20 active"><label class="pull-right">监理单位</label></td>
					<td colspan="4">
						<p>
							<span onclick="openBill('选择监理单位','${ctx}/workfullmanage/workFullSurvey/list?tabId=0','80%','80%',false,null,'#surveyId')" class="btn btn-primary btn-sm">选择监理单位</span>
							<span onclick="openBill('添加监理单位','${ctx}/workfullmanage/workFullSurvey/form?tabId=0','80%','80%',false,'inputFormSurvey','#surveyId')" class="btn btn-info btn-sm pull-right">添加客户</span>
						</p>
						<table class="table table-bordered  table-condensed dataTables-example dataTable no-footer">
							<thead>
								<th>监理单位</th>
								<th>监理方联系人</th>
								<th>联系方式</th>
								<th>操作</th>
							</thead>
							<tbody id="surveyId">
								<c:if test="${not empty workFullManage.surveyId}">
									<tr>
										<td><a href="javascript:void(0)" onclick="openDialogView('查看','${ctx}/workfullmanage/workFullSurvey/form?id=${workFullManage.surveyId.id}&tabId=1','80%','80%')">${workFullManage.surveyId.unitName}</a></td>
										<td>${workFullManage.surveyId.unitLinkMan}</td>
										<td>${workFullManage.surveyId.linkPhone}</td>
										<td>
											<a href="javascript:void(0)" onclick="openBill('修改','${ctx}/workfullmanage/workFullSurvey/form?id=${workFullManage.surveyId.id}','80%','80%',false,'inputFormSurvey','#surveyId')" class="btn btn-success btn-xs" ><i class="fa fa-edit"></i> 修改</a>
											<a href="javascript:void(0)" onclick="deleteData(this,'${ctx}/workfullmanage/workFullSurvey/delete?id=${workFullManage.surveyId.id}')" class="btn btn-danger btn-xs" ><i class="fa fa-edit"></i> 删除</a>
										</td>
									</tr>
								</c:if>
							</tbody>
						</table>
					</td>
				</tr>
				<tr>
					<td class="width-20 active"><label class="pull-right">设计单位</label></td>
					<td colspan="4">
						<p>
							<span onclick="openBill('选择设计单位','${ctx}/workfullmanage/workFullDesign/list?tabId=0','80%','80%',false,null,'#designId')" class="btn btn-primary btn-sm">选择设计单位</span>
							<span onclick="openBill('添加设计单位','${ctx}/workfullmanage/workFullDesign/form?tabId=0','80%','80%',false,'inputFormDesign','#designId')" class="btn btn-info btn-sm pull-right">添加客户</span>
						</p>
						<table class="table table-bordered  table-condensed dataTables-example dataTable no-footer">
							<thead>
								<th>设计单位</th>
								<th>设计方联系人</th>
								<th>联系方式</th>
								<th>操作</th>
							</thead>
							<tbody id="designId">
								<tr>
									<c:if test="${not empty workFullManage.designId}">
										<td><a href="javascript:void(0)" onclick="openDialogView('查看','${ctx}/workfullmanage/workFullDesign/form?id=${workFullManage.designId.id}&tabId=1','80%','80%')">${workFullManage.designId.unitName}</a></td>
										<td>${workFullManage.designId.unitLinkMan}</td>
										<td>${workFullManage.designId.linkPhone}</td>
										<td>
											<a href="javascript:void(0)" onclick="openBill('修改','${ctx}/workfullmanage/workFullDesign/form?id=${workFullManage.designId.id}','80%','80%',false,'inputFormDesign','#designId')" class="btn btn-success btn-xs" ><i class="fa fa-edit"></i> 修改</a>
											<a href="javascript:void(0)" onclick="deleteData(this,'${ctx}/workfullmanage/workFullDesign/delete?id=${workFullManage.designId.id}')" class="btn btn-danger btn-xs" ><i class="fa fa-edit"></i> 删除</a>
										</td>
									</c:if>
								</tr>
							</tbody>
						</table>
					</td>
				</tr>
				<tr>
					<td class="width-20 active" rowspan="5"><label class="pull-right">项目概况</label></td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right"><font color="red">*</font>项目分类：</label></td>
					<td class="width-25">
						<form:select path="fullProjectType" class="form-control required">
							<form:option value="" label=""/>
							<form:options items="${fns:getDictList('full_project_type')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
						</form:select>
					</td>
					<td class="width-15 active"><label class="pull-right"><font color="red">*</font>工程所在地：</label></td>
					<td class="width-25">
						<%--<form:input path="fullProjectAddress" htmlEscape="false"    class="form-control required"/>--%>
						<sys:treeselect id="area" name="area.id" value="${workFullManage.area.id}" labelName="area.name" labelValue="${workFullManage.area.name}"
										title="区域" url="/sys/area/treeData" cssClass="form-control required" allowClear="true" notAllowSelectParent="true"/>
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right"><font color="red">*</font>工程性质：</label></td>
					<td class="width-25">
						<form:select path="fullProjectProperty" class="form-control required">
							<form:option value="" label=""/>
							<form:options items="${fns:getDictList('full_project_property')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
						</form:select>
					</td>

				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right"><font color="red">*</font>工程规模：</label></td>
					<td class="width-25">
						<form:input path="fullProjectScale" htmlEscape="false"    class="form-control required number"/>
					</td>
					<td class="width-15 active"><label class="pull-right"><font color="red">*</font>计量单位：</label></td>
					<td class="width-25">
						<form:select path="fullCountUnit" class="form-control required">
							<form:option value="" label=""/>
							<form:options items="${fns:getDictList('full_count_unit')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
						</form:select>
					</td>

				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right"><font color="red">*</font>项目特性：</label></td>
					<td class="width-25" colspan="3">
						<form:textarea path="fullProjectFeature" htmlEscape="false" rows="4"    class="form-control required"/>
					</td>
				</tr>
				<tr>
					<td class="width-20 active" rowspan="6"><label class="pull-right">洽谈记录</label></td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right"><font color="red">*</font>洽谈开始时间：</label></td>
					<td class="width-25">
						<input class="form-control layer-date laydate-icon required" id="talkStartTime" name="talkStartTime" value="<fmt:formatDate value="${workFullManage.talkStartTime}" pattern="yyyy-MM-dd"/>" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:MM:ss'})">
					</td>
					<td class="width-15 active"><label class="pull-right"><font color="red">*</font>咨询费用支付方式：</label></td>
					<td class="width-25">
						<form:select path="askPayMode" class="form-control required">
							<form:option value="" label=""/>
							<form:options items="${fns:getDictList('ask_pay_mode')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
						</form:select>
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right"><font color="red">*</font>洽谈结束时间：</label></td>
					<td class="width-25">
						<input class="form-control layer-date laydate-icon required" id="talkEndTime" name="talkEndTime" value="<fmt:formatDate value="${workFullManage.talkEndTime}" pattern="yyyy-MM-dd"/>" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:MM:ss'})">
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">标准说明：</label></td>
					<td class="width-25" colspan="3">
						<form:textarea path="standardExplain" id="standardExplain" htmlEscape="false" rows="4"    class="form-control "/>
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right"><font color="red">*</font>固定价（元）：</label></td>
					<td class="width-25">
						<form:input path="fixedPrice" htmlEscape="false"    class="form-control  number"/>
					</td>

				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">业主要求：</label></td>
					<td class="width-25" colspan="3">
						<form:textarea path="clientRequire" htmlEscape="false" rows="4"    class="form-control "/>
					</td>
				</tr>
				<tr>
					<td class="width-20 active" rowspan="2"><label class="pull-right">部门安排</label></td>
					<td class="width-15 active"><label class="pull-right"><font color="red">*</font>主办公司/部门：</label></td>
					<td class="width-25">
						<sys:treeselect id="hostCompany" name="hostCompany.id" value="${workFullManage.hostCompany.id}" labelName="hostCompany.name" labelValue="${workFullManage.hostCompany.name}"
							title="部门" url="/sys/office/treeDataAll?type=2" cssClass="form-control required" allowClear="true" notAllowSelectParent="true"/>
					</td>
					<td class="width-15 active"><label class="pull-right">协办公司/部门：</label></td>
					<td class="width-25">
						<sys:treeselect id="followCompany" name="followCompany.id" value="${workFullManage.followCompany.id}" labelName="followCompany.name" labelValue="${workFullManage.followCompany.name}"
							title="部门" url="/sys/office/treeDataAll?type=2" cssClass="form-control" allowClear="true" notAllowSelectParent="true"/>
					</td>
				</tr>
				<tr>

				</tr>
				<tr>
					<td class="width-20 active" rowspan="2"><label class="pull-right">人员安排</label></td>
					<td class="width-15 active"><label class="pull-right"><font color="red">*</font>主办公司/部门项目负责人：</label></td>
					<td class="width-25">
						<sys:treeselect id="hostMasterIds" name="hostMaster" value="${workFullManage.hostMaster}" labelName="hostMasterNames" labelValue="${workFullManage.hostMasterName}"
							title="用户" url="/sys/office/treeDataAll?type=3&isAll=false" cssClass="form-control required" allowClear="true" notAllowSelectParent="true" checked="true"/>
					</td>
					<td class="width-15 active"><label class="pull-right">协办公司/部门项目负责人：</label></td>
					<td class="width-25">
						<sys:treeselect id="followMasterIds" name="followMaster" value="${workFullManage.followMaster}" labelName="followMasterNames" labelValue="${workFullManage.followMasterName}"
							title="用户" url="/sys/office/treeDataAll?type=3&isAll=false" cssClass="form-control" allowClear="true" notAllowSelectParent="true" checked="true"/>
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">主办公司/部门项目成员：</label></td>
					<td class="width-25">
						<sys:treeselect id="hostMemberIds" name="hostMember" value="${workFullManage.hostMember}" labelName="hostMemberNames" labelValue="${workFullManage.hostMemberName}"
							title="用户" url="/sys/office/treeDataAll?type=3&isAll=false" cssClass="form-control" allowClear="true" notAllowSelectParent="true" checked="true"/>
					</td>
					<td class="width-15 active"><label class="pull-right">协办公司/部门项目成员：</label></td>
					<td class="width-25">
						<sys:treeselect id="followMemberIds" name="followMember" value="${workFullManage.followMember}" labelName="followMemberNames" labelValue="${workFullManage.followMemberName}"
							title="用户" url="/sys/office/treeDataAll?type=3&isAll=false" cssClass="form-control" allowClear="true" notAllowSelectParent="true" checked="true"/>
					</td>
				</tr>
		   </tbody>
		</table>
			<div class="width-25">
				<%--<div id="upload_image_div" class="addBtn">--%>
					<%--<div id="upload_div_1" style="float: left;position:relative;width: 57px;height: 68px;margin-right: 20px;" >--%>
						<%--<span  id="upload_image_1" class="btn btn-info btn-sm"  onclick="upload_image_button(1)">添加附件</span>--%>
						<%--<input id="upload_file_1" type="file"  name="upload_files" class="hide" onchange="upload_show_image(1,this)" /><br>--%>
					<%--</div>--%>
				<%--</div>--%>
					<div style="display: inline-block">
						<div id="addFile_attachment" style="display: none">
							<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);"/>
						<a id="attachment_btn" class="btn btn-info btn-xs" ><i class="fa fa-plus"></i> 添加附件</a>
						<span id="attachment_title"></span>
					</div>
					<br><br>
			</div>
			<table id="upTable" class="table table-striped table-bordered table-hover table-condensed dataTables-example">
				<thead>
				<tr>
					<%--<th>序号</th>--%>
					<th>附件名称</th>
					<th>上传人</th>
					<th>上传时间</th>
					<th>操作</th>
				</tr>
				</thead>
				<tbody id="file_attachment">
				<c:forEach items="${workFullManage.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" alt="${workClientAttachment.attachmentName}"/></td>
							</c:when>
							<c:otherwise>
								<c:choose>
									<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
										<td><a href="javascript:void(0)" onclick="preview('预览','${workClientAttachment.url}','80%','80%','1')">${workClientAttachment.attachmentName}</a></td>
									</c:when>
									<c:otherwise>
										<td><a href="javascript:void(0)" onclick="preview('预览','${workClientAttachment.url}','80%','80%')">${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 HH:mm:ss"/></td>
						<td>
							<a href="${ctx}/workfullmanage/workFullManage/downLoadAttach?file=${workClientAttachment.url}" class="btn btn-success btn-xs">下载</a>
							<a href="javascript:void(0)" onclick=urlRedict("${workClientAttachment.url}","${workClientAttachment.id}")  class="btn btn-danger btn-xs">删除</a>
						</td>
					</tr>
				</c:forEach>
				</tbody>
			</table>
	</form:form>

		<script type="text/javascript">
            <%--function upload_image_button(index){--%>

            <%--$("#upload_file_"+index).click();--%>
            <%--}--%>
            <%--function upload_show_image(index,obj){--%>
            <%--var image =$("#upload_file_"+index)[0].files[0];--%>
            <%--var url;--%>
            <%--if(image.name.indexOf("jpg") != -1--%>
            <%--|| image.name.indexOf("png") != -1--%>
            <%--|| image.name.indexOf("jpeg") != -1--%>
            <%--|| image.name.indexOf("gif") != -1--%>
            <%--|| image.name.indexOf("PNG") != -1){--%>
            <%--url = window.URL.createObjectURL(image);--%>
            <%--}else if(image.name.indexOf("pdf") != -1 || image.name.indexOf("PDF") != -1){--%>
            <%--url = "${ctxStatic}/common/img/pdf5.png";--%>
            <%--}else if(image.name.indexOf("doc") != -1 || image.name.indexOf("DOC") != -1--%>
            <%--|| image.name.indexOf("docx") != -1 || image.name.indexOf("DOCX") != -1){--%>
            <%--url = "${ctxStatic}/common/img/word.png";--%>
            <%--}else if(image.name.indexOf("xlsx") != -1 || image.name.indexOf("XLSX") != -1--%>
            <%--|| image.name.indexOf("xls") != -1 || image.name.indexOf("XLSX") != -1){--%>
            <%--url = "${ctxStatic}/common/img/excel.png";--%>
            <%--}else{--%>
            <%--url = "${ctxStatic}/common/img/file.jpg";--%>
            <%--}--%>
            <%--var length = $("#upload_image_div :file").length;--%>
            <%--var trlen = $("#upTable tbody tr").length;--%>
            <%--if((length + trlen) >= 6){--%>
            <%--parent.layer.msg("已经上传"+trlen+"个附件，最多只能上传5个附件",{icon:1});--%>
            <%--$(obj).remove();--%>
            <%--return;--%>
            <%--}--%>
            <%--if(length >= 6){--%>
            <%--parent.layer.msg("最多只能上传5个附件",{icon:1});--%>
            <%--$(obj).remove();--%>
            <%--return;--%>
            <%--}else{--%>
            <%--$(obj).before('<img src='+url+' width=50 height= 50 onclick="upload_image_button('+length+')" />').siblings("span").remove();--%>
            <%--var imgstr = '<div id="upload_div_'+(length + 1)+'" style="float: left;position:relative;width: 57px;margin-right: 20px;height: 57px;" >' +--%>
            <%--'             <span  id="upload_image_'+(length + 1)+'" class="btn btn-info btn-sm"  onclick="upload_image_button('+(length + 1)+')">添加附件</span>' +--%>
            <%--'             <input id="upload_file_'+(length+1)+'" type="file" class="hide" name="upload_files" onChange="upload_show_image('+(length+1)+',this)" />'+--%>
            <%--'         </div>';--%>
            <%--$("#upload_div_"+(length)).children("input").after('<i class="fa fa-close" style="position:absolute;" onclick="close_img(this)"></i><div title="'+image.name+'">'+cutString(image.name,3)+'</div>')--%>
            <%--$(obj).parent().after(imgstr)--%>
            <%--}--%>
            <%--}--%>
            <%--function close_img(obj) {--%>
            <%--$(obj).parent().remove();--%>
            <%--}--%>
            <%--/**--%>
            <%--* 截取字符串--%>
            <%--*/--%>
            <%--function cutString(str,len){--%>
            <%--if(str){--%>
            <%--return str.substr(0,len)+"..."--%>
            <%--}else{--%>
            <%--return "";--%>
            <%--}--%>
            <%--}--%>
            //上传
            function upload_image_button(index){
                $("#upload_file_"+index).click();
            }
            function upload_show_image(index){
                var image =$("#upload_file_"+index)[0].files[0];
                var url = window.URL.createObjectURL(image);
                if(image.name.indexOf("jpg") != -1
                    || image.name.indexOf("png") != -1
                    || image.name.indexOf("jpeg") != -1
                    || image.name.indexOf("gif") != -1
                    || image.name.indexOf("PNG") != -1){
                    url = window.URL.createObjectURL(image);
                }else if(image.name.indexOf("pdf") != -1 || image.name.indexOf("PDF") != -1){
                    url = "${ctxStatic}/common/img/pdf5.png";
                }else if(image.name.indexOf("doc") != -1 || image.name.indexOf("DOC") != -1
                    || image.name.indexOf("docx") != -1 || image.name.indexOf("DOCX") != -1){
                    url = "${ctxStatic}/common/img/word.png";
                }else if(image.name.indexOf("xlsx") != -1 || image.name.indexOf("XLSX") != -1
                    || image.name.indexOf("xls") != -1 || image.name.indexOf("XLSX") != -1){
                    url = "${ctxStatic}/common/img/excel.png";
                }else{
                    url = "${ctxStatic}/common/img/file.jpg";
                }
                $("#upload_image_"+index).attr("src",url);
                var length = $("#upload_image_div :file").length;
                if( index == length &&  length < 5 ){
                    upload_image_append(index);
                    add_x(index);
                }else if(index == length && length ==5){
                    var span = '<span id="upload_close_'+index+'" class="close_ico" style="cursor:pointer; position: absolute;top:-1px;right: -2px; display:inline-block;z-index:1;" onclick="close_img('+index+');"><i class="fa fa-close"></i></span>';
                    $("#upload_image_5").before(span);
                }
            }
            function upload_image_append(index){
                var div1 = "<div id='upload_div_"+(index+1)+"' style='float:left;position:relative;width: 64px;height: 57px;margin-left:5px;'>";
                var img = '<img id="upload_image_'+(index+1)+'" class="upload_ico" width="50px" height="50px"  onclick="upload_image_button('+(index+1)+')" src = "${pageContext.request.contextPath}/static/uploadify/upload_ico.png" style="cursor:pointer;width:50px;height:50px;"/>';
                var input = '<input id="upload_file_'+(index+1)+'" type="file" style="display:none;" name="upload_files" onChange="upload_show_image('+(index+1)+')" /><br>';
                var div2 = "</div>";
                $("#upload_image_div").append(div1+img+input+div2);
            }
            function close_img(index) {
                $("#upload_div_"+index).remove();
                var length = $("#upload_image_div :file").length;
                if(length == 0){
                    add_div();
                }else if(length == 1){
                    var x = $("#upload_image_div").find("span").text();
                    if("x" != x){
                        add_div();
                    }
                }
            }
            function add_x(index) {
                var span = '<span id="upload_close_'+index+'" class="close_ico" style="cursor:pointer; position: absolute;top:-1px;right: -2px; display:inline-block;z-index:1;" onclick="close_img('+index+');"><i class="fa fa-close"></i></span>';
                $("img:eq(-2)").before(span);
            }
            function add_div() {
                var upload_div_1 =
                    '<div id="upload_div_1" style="float: left;position:relative;width: 64px;height: 57px;margin-left:5px;" >'+
                    '<img  id="upload_image_1" class="upload_ico" style="cursor:pointer;width:50px;height:50px;"  src="${pageContext.request.contextPath}/static/uploadify/upload_ico.png"  onclick="upload_image_button(1)"/>'+
                    '<input id="upload_file_1" type="file" style="display:none"  name="upload_files"  onchange="upload_show_image(1)" /><br>'+
                    '</div>';
                $("#upload_image_div").html("").append(upload_div_1);
            }
		</script>
</body>
</html>