<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/webpage/include/taglib.jsp"%>
<html>
<head>
	<title>招标项目信息管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
        $(function(){
            var oneSize = $(".oneTab").size();
            for(var i = 0;i < oneSize;i++){
                var hei = $(".oneTab:eq("+i+")").parent().height();
                $(".oneTab:eq("+i+")").css("height",hei-5)
                    .css("vertical-align","middle")
                    .css("line-height",hei+"px")
            }
            $("img").not(".upload_ico").each(function () {
                var num = 1 ;
                $(this).click(function () {
                    var flag = num%2;
                    if(flag == 1){
                        $(this).css("width","90%");
                        $(this).css("height","90%");
                        num++;
                    }else if(flag ==0){
                        $(this).css("width","50px");
                        $(this).css("height","50px");
                        num++;
                    }
                })
            });
        })
		var validateForm;
		function doSubmit(){//回调函数，在编辑和保存动作时，供openDialog调用提交表单。
		  if(validateForm.form()){
			  $("#inputForm").submit();
			  return true;
		  }
	
		  return false;
		}
		$(document).ready(function() {
			validateForm = $("#inputForm").validate({
				submitHandler: function(form){
					loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
            laydate.render({
                elem: '#projectStartDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎，因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
                event: 'focus' //响应事件。如果没有传入event，则按照默认的click
            });
            laydate.render({
                elem: '#projectEndDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎，因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
                event: 'focus' //响应事件。如果没有传入event，则按照默认的click
            });
            var isControlPrice = "${workBidingProject.isControlPrice}";
            if(isControlPrice==1){
                $("#controlPrice").show();
                $("#controlPriceVal").show();
            }
        });

        function setContractValue(obj){
            $.ajax({
                type:'post',
                url:'${ctx}/workengineeringproject/workEngineeringProject/getContractInfo',
                data:{
                    "obj":obj
                },
                success:function(data){
                    var d = JSON.parse(data);
                    $("#contractNum").val(d.contractNum);
                    $("#clientName").val(d.clientName);
                    $("#clientId").val(d.clientId);
                    $("#linkmanName").val(d.linkmanName);
                    $("#linkmanPhone").val(d.linkmanPhone);
                    $("#linkmanEmail").val(d.linkmanEmail);
                    $("#linkmanPosition").val(d.linkmanPosition);

                }
            })
        }
        function display(n){
            if(n==1){
                $("#controlPrice").show();
                $("#controlPriceVal").show();
            }else{
                $("#controlPrice").hide();
                $("#controlPriceVal").hide();
            }
        }
	</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);
            }
        });

        /**
         * 查看联系人（需要用到linkManList）
         */
        function selectLinkman(index,target) {
            if(target=='linkman'){
                var manList = JSON.parse('${requestScope.linkmanList}');

                var linkman = manList[index];
                $("#linkmanOffice").val(linkman.linkmanOffice);
                $("#linkmanPosition").val(linkman.linkmanPosition);
                $("#QQ").val(linkman.QQ);
                $("#linkmanPhone").val(linkman.linkmanPhone);
                $("#linkmanMobile").val(linkman.linkmanMobile);
                $("#linkmanEmail").val(linkman.linkmanEmail);
            }
        }

	</script>
</head>
<body class="hideScroll">
<form:form id="inputForm" modelAttribute="workBidingProject" class="form-horizontal">
	   <table class="table table-bordered  table-condensed dataTables-example dataTable no-footer">
		   <tbody>
			   <div class="tabs-container">
				   <ul class="nav nav-tabs">
					   <li class="active"><a data-toggle="tab" href="#tab-1" aria-expanded="true" style="margin-top: 25px">基本信息</a>
					   </li>
				   </ul>
			   </div>
				<tr>
				   <td class="width-15 active"><label class="pull-right">合同名称：</label></td>
				   <td class="width-35">
					   ${workBidingProject.contract.name}
				   </td>
				   <td class="width-15 active"><label class="pull-right">合同编号：</label></td>
				   <td class="width-25">
					   ${workBidingProject.contract.contractNum}
				   </td>
				</tr>
				<tr>

					<td class="width-15 active"><label class="pull-right">投资额(元)：</label></td>
					<td class="width-35">
						${workBidingProject.investmentAmount}
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">招标方式：</label></td>
					<td class="width-35">
						${fns:getMainDictLabel(workBidingProject.biddingType, 'bidding_type', '')}
					</td>
					<td class="width-15 active"><label class="pull-right">批次：</label></td>
					<td class="width-35">
						${fns:getDictLabel(workBidingProject.batch, 'bidding_batch', '')}
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">行业分类：</label></td>
					<td class="width-35">
						${fns:getDictLabel(workBidingProject.psort, 'psort', '')}
					</td>
					<td class="width-15 active"><label class="pull-right">详细分类：</label></td>
					<td class="width-35">
						<c:choose>
							<c:when test="${workBidingProject.psort eq 1}">
								${fns:getDictLabel(workBidingProject.ssort, 'ssort1', '')}
							</c:when>
							<c:when test="${workBidingProject.psort eq 2}">
								${fns:getDictLabel(workBidingProject.ssort, 'ssort2', '')}
							</c:when>
							<c:when test="${workBidingProject.psort eq 3}">
								${fns:getDictLabel(workBidingProject.ssort, 'ssort3', '')}
							</c:when>
							<c:when test="${workBidingProject.psort eq 4}">
								${fns:getDictLabel(workBidingProject.ssort, 'ssort4', '')}
							</c:when>
							<c:when test="${workBidingProject.psort eq 5}">
								${fns:getDictLabel(workBidingProject.ssort, 'ssort5', '')}
							</c:when>
							<c:when test="${workBidingProject.psort eq 10}">
								${fns:getDictLabel(workBidingProject.ssort, 'ssort10', '')}
							</c:when>
							<c:otherwise>
								无
							</c:otherwise>
						</c:choose>
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">项目编号：</label></td>
					<td class="width-35">
						${workBidingProject.projectNumber}
					</td>
					<td class="width-15 active"><label class="pull-right">项目名称：</label></td>
					<td class="width-35">
						${workBidingProject.projectName}
					</td>
				</tr>
		   </tbody>
	   </table>

	   <table class="table table-bordered  table-condensed dataTables-example dataTable no-footer">
		   <tbody>
		   <div class="tabs-container">
			   <ul class="nav nav-tabs">
				   <li class="active"><a data-toggle="tab" href="#tab-1" aria-expanded="true" style="margin-top: 25px">客户单位</a>
				   </li>
			   </ul>
		   </div>
		   <tr>
			   <td class="width-15 active"><label class="pull-right">客户信息：</label></td>
			   <td class="width-35" colspan="3">
				   ${workBidingProject.client.name}
			   </td>
		   </tr>
		   <tr>
			   <td class="width-15 active"><label class="pull-right">联系人：</label></td>
			   <td class="width-35">
				   <select id="linkman_list" onchange="selectLinkman(this.value,'linkman')" class="linkman_list max-width-200 form-control" />
			   </td>
			   <td class="width-15 active"><label class="pull-right">部门：</label></td>
			   <td class="width-35">
				   <input value="${workBidingProject.client.workClientLinkmanList[0].office}" id="linkmanOffice" readonly="true" class="form-control linkman_attr"/>
			   </td>
		   </tr>
		   <tr>
			   <td class="width-15 active"><label class="pull-right">职务：</label></td>
			   <td class="width-35">
				   <input value="${workBidingProject.client.workClientLinkmanList[0].position}" id="linkmanPosition" readonly="true" class="form-control linkman_attr"/>
			   </td>
			   <td class="width-15 active"><label class="pull-right">QQ：</label></td>
			   <td class="width-35">
				   <input value="${workBidingProject.client.workClientLinkmanList[0].qq}" id="QQ" readonly="true" class="form-control linkman_attr"/>
			   </td>
		   </tr>
		   <tr>
			   <td class="width-15 active"><label class="pull-right">电话：</label></td>
			   <td class="width-35">
				   <input value="${workBidingProject.client.workClientLinkmanList[0].linkPhone}" id="linkmanPhone" readonly="true" class="form-control linkman_attr"/>
			   </td>
			   <td class="width-15 active"><label class="pull-right">手机：</label></td>
			   <td class="width-35">
				   <input value="${workBidingProject.client.workClientLinkmanList[0].linkPhone}" id="linkmanMobile" readonly="true" class="form-control linkman_attr"/>
			   </td>
		   </tr>
		   <tr>
			   <td class="width-15 active"><label class="pull-right">E-mail：</label></td>
			   <td class="width-35">
				   <input value="${workBidingProject.client.workClientLinkmanList[0].email}" id="linkmanEmail" readonly="true" class="form-control linkman_attr"/>
			   </td>
		   </tr>
		   </tbody>
	   </table>


	   <table class="table table-bordered  table-condensed dataTables-example dataTable no-footer">
		   <div class="tabs-container">
			   <ul class="nav nav-tabs">
				   <li class="active"><a data-toggle="tab" href="#tab-1" aria-expanded="true" style="margin-top: 25px">项目信息</a>
				   </li>
			   </ul>
		   </div>
		   <tbody>
				<tr>
					<td class="width-15 active"><label class="pull-right">标底或招标控制价：</label></td>
					<td class="width-35">
						<c:choose>
							<c:when test="${workBidingProject.isControlPrice eq '1'}">
								有
							</c:when>
							<c:otherwise>
								无
							</c:otherwise>
						</c:choose>
					</td>
					<td class="width-15 active" id ="controlPrice" style="display:none"><label class="pull-right"><font color="red">*</font>标底或招标控制价(元)：</label></td>
					<td class="width-35" colspan="3" id ="controlPriceVal" style="display:none">
						${workBidingProject.controlPrice}
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">需求部门：</label></td>
					<td class="width-35">
						${workBidingProject.demandOffice.name}
					</td>
					<td class="width-15 active"><label class="pull-right">施工地点/交货地：</label></td>
					<td class="width-35">
						${workBidingProject.area.name}
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">监督单位：</label></td>
					<td class="width-35">
						${workBidingProject.supervisoryOffice}
					</td>
					<td class="width-15 active"><label class="pull-right">资金属性：</label></td>
					<td class="width-35">
						${fns:getDictLabel(workBidingProject.capitalAttribute, 'biding_capital_attribute', '')}
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">工期/交货期：</label></td>
					<td class="width-35" >
						<fmt:formatDate value="${workBidingProject.projectStartDate}" pattern="yyyy-MM-dd"/>
					</td>
					<td class="width-15 active">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;至</td>
					</td>
					<td class="width-35" >
						<fmt:formatDate value="${workBidingProject.projectEndDate}" pattern="yyyy-MM-dd"/>
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">招标范围：</label></td>
					<td class="width-35" colspan="3">
						${workBidingProject.scopeOfBidding}
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">评标办法：</label></td>
					<td class="width-35" colspan="3">
						${workBidingProject.bidEvaluationMethod}
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">投资人资质要求：</label></td>
					<td class="width-35" colspan="3">
						${workBidingProject.investorQualification}
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">项目负责人资质要求：</label></td>
					<td class="width-35" colspan="3">
						${workBidingProject.hostProjectQualification}
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">其他要求：</label></td>
					<td class="width-35" colspan="3">
						${workBidingProject.otherRequirement}
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">项目组负责人：</label></td>
					<td class="width-35" colspan="3">
						${workBidingProject.projectMasterName}
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">项目组成员：</label></td>
					<td class="width-35" colspan="3">
						${workBidingProject.projectMemberName}
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">清单编制人员：</label></td>
					<td class="width-35" colspan="3">
						${workBidingProject.inventorUserName}
					</td>
				</tr>
		   </tbody>
	   </table>
</form:form>
</body>
</html>