<%@ 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">
		var validateForm;
		$('#btnPresent').click(function () { 

			$.ajax({
	             url:"${ctx}/workfullexecute/workFullExecute/present",
	             data:$('#loginForm').serialize(),
	             type:"post",
	             success:function(data){
	        
	             }					
			});
		});	
			
		$(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);
					}
				}
			});
		});
	</script>
</head>

<body class="hideScroll">
		<form:form id="inputForm" modelAttribute="workFullExecute"  method="post" class="form-horizontal">
		<form:hidden path="id"/>
		<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"/>
		<sys:message content="${message}"/>
		<c:set var="status" value="${workFullExecute.act.status}" />
			<table class="table table-bordered  table-condensed dataTables-example dataTable no-footer">
				<tbody>
				<tr>
					<td class="width-15 active" rowspan="4"><label class="pull-right">文件信息:</label></td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right"></font>文件名：</label></td>
					<td class="width-30">
							${workFullExecute.fileName}
					</td>
					<td class="width-15 active"><label class="pull-right"></font>文件类型：</label></td>
					<td class="width-30">
							${fns:getDictLabel(workFullExecute.fileType,'work_full_execute_fileType','')}
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">编制开始日期：</label></td>
					<td class="width-30">
						<fmt:formatDate value="${workFullExecute.startTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
					</td>
					<td class="width-15 active"><label class="pull-right">编制完成日期：</label></td>
					<td class="width-30">
						<fmt:formatDate value="${workFullExecute.endTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">文件附件：</label></td>
					<td class="width-40" colspan="3">
						<div>
							<div style="float:left; height: 100%; width: 100%; ">
								<table id="listExecuteFile"  style="text-align: center;width: 100%;margin-top:10px;"  class="table table-striped table-bordered table-condensed" >
									<tr>
										<%--<td>序号</td>--%><td>文件名</td><td>上传人</td><td>上传时间</td><td>操作</td>
									</tr>
									<c:if test="${not empty workFullExecute.executeFile}">
										<c:forEach items="${workFullExecute.executeFile}" var="exeFile" varStatus="varStatus">
											<tr>
												<%--<td>${varStatus.index+1}</td>--%>
													<%--<td>${workFullExecute.executeFile.attachmentName}</td>--%>
												<c:choose>
													<c:when test="${fn:containsIgnoreCase(exeFile.attachmentName,'jpg')
													   or fn:containsIgnoreCase(exeFile.attachmentName,'png')
													   or fn:containsIgnoreCase(exeFile.attachmentName,'gif')
													   or fn:containsIgnoreCase(exeFile.attachmentName,'jpeg')}">
														<td><img src="${exeFile.url}" onclick="openDialogView(' ','${ctx}/sys/picturepreview/picturePreview?url=${exeFile.url}','860px','600px')" width="50" height="50" alt="${exeFile.attachmentName}"/></td>
													</c:when>
													<c:otherwise>
														<c:choose>
															<c:when test="${fn:containsIgnoreCase(exeFile.attachmentName,'pdf')}">
																<td><a href="javascript:void(0)" onclick="preview('预览','${exeFile.url}','80%','80%','1')">
																	<span title="${exeFile.attachmentName}">${fns:abbr(exeFile.attachmentName, 30)}</span>
																</a></td>
																<%--<td><a href="${workFullExecute.executeFile.url}"><span title="${workFullExecute.executeFile.attachmentName}">${fns:abbr(workFullExecute.executeFile.attachmentName, 14)}</span></a></td>--%>
															</c:when>
															<c:otherwise>
																<td><a href="javascript:void(0)" onclick="preview('预览','${exeFile.url}','80%','80%')">
																	<span title="${exeFile.attachmentName}">${fns:abbr(exeFile.attachmentName, 30)}</span>
																</a></td>
																<%--<td><a href="javascript:void(0)" onclick="openDialogViewPre('预览','${ctx}/previewController/previewUrl?fileUrl=${workFullExecute.executeFile.url}','80%','80%')"><span title="${workFullExecute.executeFile.attachmentName}">${fns:abbr(workFullExecute.executeFile.attachmentName, 14)}</span></a></td>--%>
															</c:otherwise>
														</c:choose>
													</c:otherwise>
												</c:choose>
												<td>${exeFile.attachmentUser}</td>
												<td><fmt:formatDate value="${exeFile.createDate}" pattern="yyyy-MM-dd"/></td>
												<td>
													<a href="${ctx}/workfullmanage/workFullManage/downLoadAttach?file=${exeFile.url}" class="btn btn-success btn-xs">下载</a>
												</td>
											</tr>
										</c:forEach>
									</c:if>
								</table>
							</div>
						</div>
					</td>
				</tr>
				<tr>
					<td class="width-15 active" rowspan="2"><label class="pull-right">工作底稿:</label></td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">底稿附件：</label></td>
					<td class="width-40" colspan="3">
						<div>
							<div style="float:left; height: 100%; width: 100%; ">
								<table id="listManuscriptFile"  style="text-align: center;width: 100%;margin-top:10px;"  class="table table-striped table-bordered table-condensed" >
									<tr>
										<%--<td>序号</td>--%><td>文件名</td><td>上传人</td><td>上传时间</td><td>操作</td>
									</tr>
									<c:if test="${not empty workFullExecute.manuscriptFile}">
										<c:forEach items="${workFullExecute.manuscriptFile}" var="mFile" varStatus="varStatus">
											<tr>
												<%--<td>${varStatus.index + 1}</td>--%>
													<%--<td>${workFullExecute.manuscriptFile.attachmentName}</td>--%>
												<c:choose>
													<c:when test="${fn:containsIgnoreCase(mFile.attachmentName,'jpg')
													   or fn:containsIgnoreCase(mFile.attachmentName,'png')
													   or fn:containsIgnoreCase(mFile.attachmentName,'gif')
													   or fn:containsIgnoreCase(mFile.attachmentName,'jpeg')}">
														<td><img src="${mFile.url}" onclick="openDialogView(' ','${ctx}/sys/picturepreview/picturePreview?url=${mFile.url}','860px','600px')" width="50" height="50" alt="${mFile.attachmentName}"/></td>
													</c:when>
													<c:otherwise>
														<c:choose>
															<c:when test="${fn:containsIgnoreCase(mFile.attachmentName,'pdf')}">
																<td><a href="javascript:void(0)" onclick="preview('预览','${mFile.url}','80%','80%','1')">
																	<span title="${mFile.attachmentName}">${fns:abbr(mFile.attachmentName, 30)}</span></a></td>
															</c:when>
															<c:otherwise>
																<td><a href="javascript:void(0)" onclick="preview('预览','${mFile.url}','80%','80%')">
																	<span title="${mFile.attachmentName}">${fns:abbr(mFile.attachmentName, 30)}</span>
																</a></td>
															</c:otherwise>
														</c:choose>
													</c:otherwise>
												</c:choose>
												<td>${mFile.attachmentUser}</td>
												<td><fmt:formatDate value="${mFile.createDate}" pattern="yyyy-MM-dd"/></td>
												<td>
													<a href="${ctx}/workfullmanage/workFullManage/downLoadAttach?file=${mFile.url}" class="btn btn-success btn-xs">下载</a>
												</td>
											</tr>
										</c:forEach>
									</c:if>
								</table>
							</div>
						</div>
					</td>
				</tr>
				<tr>
					<td class="width-15 active" rowspan="4"><label class="pull-right">项目及客户信息:</label></td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right"></font>项目编号：</label></td>
					<td class="width-30">
							${workFullManage.fullProjectNumber}
					</td>
					<td class="width-15 active"><label class="pull-right"></font>合同编号：</label></td>
					<td class="width-30">
							${workFullManage.contractId}
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">项目名称：</label></td>
					<td class="width-30" colspan="3">
							${workFullManage.fullProjectName}
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">业主单位：</label></td>
					<td class="width-30" colspan="3">
							${workFullManage.workClientInfo.name}
					</td>
				</tr>
				<c:if test="${not empty status}">
					<tr>
						<td class="width-15 active" rowspan="2"><label class="pull-right">审批意见:</label></td>
					</tr>
					<tr>
						<td class="width-15 active"><label class="pull-right">意见：</label></td>
						<td class="width-30" colspan="3">
							<form:textarea path="act.comment" class="form-control " rows="3" maxlength="20"/>
						</td>
					</tr>
				</c:if>

				</tbody>
			</table>



		<act:flowChart procInsId="${workFullExecute.act.procInsId}"/>
		<act:histoicFlow procInsId="${workFullExecute.act.procInsId}"/>
	</form:form>
</body>
</html>