<%@ 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}/workfullproprietorsheet/workFullProprietorsheet/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);
					}
				}
			});

            if (${requestScope.disabled eq 'false'}) {
                $("#startTime").attr('disabled',true);
                $("#endTime").attr('disabled',true);
                $("#reason").attr('disabled',true);
            }
		});
	</script>
</head>

<body class="hideScroll">
		<form:form id="inputForm" modelAttribute="workFullProprietorsheet"  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="${requestScope.message}"/>
		<c:set var="status" value="${workFullProprietorsheet.act.status}" />
			<table class="table table-bordered  table-condensed dataTables-example dataTable no-footer">
				<tbody>
					<tr>
						<td class="width-15 active" rowspan="9"><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">
								${workFullProprietorsheet.reportedCompany}
						</td>
					</tr>
					<tr>
						<td class="width-15 active"><label class="pull-right">联系单主题：</label></td>
						<td class="width-40" colspan="3">
								${workFullProprietorsheet.proprietorsheetTopic}
						</td>
					</tr>
					<tr>
						<td class="width-15 active"><label class="pull-right">项目编号：</label></td>
						<td class="width-30">
								${workFullProprietorsheet.projectNumber}
						</td>
						<td class="width-15 active"><label class="pull-right">业主联系单编号：</label></td>
						<td class="width-30">
								${workFullProprietorsheet.proprietorsheetNumber}
						</td>
					</tr>
					<tr>
						<td class="width-15 active"><label class="pull-right">施工标段：</label></td>
						<td class="width-30">
								${workFullProprietorsheet.constructSection}
						</td>
						<td class="width-15 active"><label class="pull-right">是否产生费用增减：</label></td>
						<td class="width-30">
								${fns:getDictLabel(workFullProprietorsheet.costIncreaseDecrease,'cost_increase_decrease' ,'' )}
						</td>
					</tr>
					<tr>
						<td class="width-15 active"><label class="pull-right">业主处理意见：</label></td>
						<td class="width-40" colspan="3">
								${workFullProprietorsheet.proprietorComment}
						</td>
					</tr>
					<tr>
						<td class="width-15 active"><label class="pull-right">变更原因及主要内容：</label></td>
						<td class="width-40" colspan="3">
								${workFullProprietorsheet.changeContext}
						</td>
					</tr>
					<tr>
						<td class="width-15 active"><label class="pull-right">备注信息：</label></td>
						<td class="width-40" colspan="3">
								${workFullProprietorsheet.remarks}
						</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 workFullProprietorsheet.workAttachments}">
											<c:forEach items="${workFullProprietorsheet.workAttachments}" var="attachment" varStatus="varStatus">
												<tr>
													<%--<td>${varStatus.index+1}</td>--%>
														<%--<td>${workFullProprietorsheet.workattachment.attachmentName}</td>--%>
													<c:choose>
														<c:when test="${fn:containsIgnoreCase(attachment.attachmentName,'jpg')
													   or fn:containsIgnoreCase(attachment.attachmentName,'png')
													   or fn:containsIgnoreCase(attachment.attachmentName,'gif')
													   or fn:containsIgnoreCase(attachment.attachmentName,'jpeg')}">
															<td><img src="${attachment.url}" onclick="openDialogView(' ','${ctx}/sys/picturepreview/picturePreview?url=${attachment.url}','860px','600px')" width="50" height="50" alt="${attachment.attachmentName}"/></td>
														</c:when>
														<c:otherwise>
															<c:choose>
																<c:when test="${fn:containsIgnoreCase(attachment.attachmentName,'pdf')}">
																	<%--<td><a href="${workFullProprietorsheet.workattachment.url}"><span title="${workFullProprietorsheet.workattachment.attachmentName}">${fns:abbr(workFullProprietorsheet.workattachment.attachmentName, 20)}</span></a></td>--%>
																	<td><a href="javascript:void(0)" onclick="preview('预览','${attachment.url}','80%','80%','1')">
																		<span title="${attachment.attachmentName}">${fns:abbr(attachment.attachmentName, 30)}</span></a></td>
																</c:when>
																<c:otherwise>
																	<%--<td><a href="javascript:void(0)" onclick="openDialogViewPre('预览','${ctx}/previewController/previewUrl?fileUrl=${workFullProprietorsheet.workattachment.url}','80%','80%')"><span title="${workFullProprietorsheet.workattachment.attachmentName}">${fns:abbr(workFullProprietorsheet.workattachment.attachmentName, 20)}</span></a></td>--%>
																	<td><a href="javascript:void(0)" onclick="preview('预览','${attachment.url}','80%','80%')">
																		<span title="${attachment.attachmentName}">${fns:abbr(attachment.attachmentName, 30)}</span>
																	</a></td>
																</c:otherwise>
															</c:choose>
														</c:otherwise>
													</c:choose>
													<td>${attachment.attachmentUser}</td>
													<td><fmt:formatDate value="${attachment.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
													<td>
														<a href="${ctx}/workfullmanage/workFullManage/downLoadAttach?file=${attachment.url}" class="btn btn-success btn-xs">下载</a>
													</td>
												</tr>
											</c:forEach>
										</c:if>
									</table>
								</div>
							</div>
						</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="${workFullProprietorsheet.act.procInsId}"/>
		<act:histoicFlow procInsId="${workFullProprietorsheet.act.procInsId}"/>
	</form:form>
</body>
</html>