<%@ 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 () {

            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="workBidProject" action="${ctx}/workbidproject/workBidProject/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>
			   <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">
							${workBidProject.projectName}
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">项目编号：</label></td>
					<td class="width-35" colspan="3">
							${workBidProject.projectNumber}
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">项目类型：</label></td>
					<td class="width-35">
							${fns:getMainDictLabel(workBidProject.projectType, 'contract_type', '')}
					</td>
					<td class="width-15 active"><label class="pull-right">类型说明：</label></td>
					<td class="width-35">
							${workBidProject.typeExplain}
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">项目来源：</label></td>
					<td class="width-35">
							${fns:getMainDictLabel(workBidProject.projectSource, 'bidProjectSource', '')}
					</td>
					<td class="width-15 active"><label class="pull-right">来源说明：</label></td>
					<td class="width-35">
							${workBidProject.sourceExplain}
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">行业分类：</label></td>
					<td class="width-35">
							${fns:getDictLabel(workBidProject.psort, 'psort', '')}
					</td>
					<td class="width-15 active"><label class="pull-right">详细分类：</label></td>
					<td class="width-35">
							<c:choose>
								<c:when test="${workBidProject.psort eq 1}">
										${fns:getDictLabel(workBidProject.ssort, 'ssort1', '')}
								</c:when>
								<c:when test="${workBidProject.psort eq 2}">
									${fns:getDictLabel(workBidProject.ssort, 'ssort2', '')}
								</c:when>
								<c:when test="${workBidProject.psort eq 3}">
									${fns:getDictLabel(workBidProject.ssort, 'ssort3', '')}
								</c:when>
								<c:when test="${workBidProject.psort eq 4}">
									${fns:getDictLabel(workBidProject.ssort, 'ssort4', '')}
								</c:when>
								<c:when test="${workBidProject.psort eq 5}">
									${fns:getDictLabel(workBidProject.ssort, 'ssort5', '')}
								</c:when>
								<c:when test="${workBidProject.psort eq 10}">
									${fns:getDictLabel(workBidProject.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">
						<c:choose>
						<c:when test="${workBidProject.isExt == 1}">
							系统外客户
						</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-75"  colspan="3">
						<table style="margin-top:10px;" id="contentTable" class="table table-striped table-bordered table-condensed">
							<thead>
								<tr>
									<th>序号</th>
									<th>联系人姓名</th>
									<th>部门</th>
									<th>职务</th>
									<th>QQ</th>
									<th>联系人电话</th>
									<th>联系人手机</th>
									<th>E-mail</th>
								</tr>
							</thead>
								<tbody id="workClientLinkmanList">
								<c:forEach items="${workBidProject.workClientLinkmanList}" var="workClientLinkman" varStatus="status">
									<tr>
										<td>${status.index + 1}</td>
										<td>${workClientLinkman.name}</td>
										<td>${workClientLinkman.office}</td>
										<td>${workClientLinkman.position}</td>
										<td>${workClientLinkman.qq}</td>
										<td>${workClientLinkman.linkPhone}</td>
										<td>${workClientLinkman.linkMobile}</td>
										<td>${workClientLinkman.email}</td>
									</tr>
								</c:forEach>
								<c:if test="${linkManSize == 0}">
									<tr>
										<td colspan="8">暂无数据</td>
									</tr>
								</c:if>
								</tbody>
						</table>
					</td>
				</tr>
-->

				<tr>
					<td class="width-15 active"><label class="pull-right">项目负责人：</label></td>
					<td class="width-35">
							${workPrequalification.projectMasterNames}
					</td>
					<td class="width-15 active"><label class="pull-right">项目组成员：</label></td>
					<td class="width-35">
							${workPrequalification.projectMemberNames}
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">资审日期：</label></td>
					<td class="width-35">
						<fmt:formatDate value="${workBidProject.trialDate}" pattern="yyyy-MM-dd"/>
					</td>
					<td class="width-15 active"><label class="pull-right">购买领用招标文件日期：</label></td>
					<td class="width-35">
						<fmt:formatDate value="${workBidProject.purchaseDate}" pattern="yyyy-MM-dd"/>
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">文件费用（元）：</label></td>
					<td class="width-35">
							${workBidProject.documentCost}
					</td>
					<td class="width-15 active"><label class="pull-right">装订费用（元）：</label></td>
					<td class="width-35">
							${workBidProject.bindCost}
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">报名日期：</label></td>
					<td class="width-35">
						<fmt:formatDate value="${workBidProject.registrationDate}" pattern="yyyy-MM-dd"/>
					</td>
					<td class="width-15 active"><label class="pull-right">是否外协：</label></td>
					<td class="width-35">
							${fns:getDictLabel(workBidProject.isSubcontract, 'is_subcontract', '')}
					</td>
				</tr>
				<tr>					
					<td class="width-15 active"><label class="pull-right">项目概况：</label></td>
					<td class="width-35" colspan="3">
							${workBidProject.projectSituation}
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">备注信息：</label></td>
					<td class="width-35" colspan="3">
							${workBidProject.remarks}
					</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">
							${workBidProject.extCompany}${workBidProject.bidCompany.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="${workBidProject.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="${workBidProject.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="${workBidProject.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="${workBidProject.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="${workBidProject.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="${workBidProject.workClientLinkmanList[0].email}" id="linkmanEmail" readonly="true" class="form-control linkman_attr"/>
					</td>
				</tr>
			</tbody>
		</table>

	</form:form>
</body>
</html>