<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/webpage/include/taglib.jsp"%>
<html>
<head>
	<title>工作日志管理</title>
	<meta name="decorator" content="default"/>
	<%--<style type="text/css">--%>
		<%--img {width:50px; height:50px;}--%>
	<%--</style>--%>
	<script type="text/javascript">
        $(function () {

        })
	</script>
</head>
<body>
<div class="single-form">
	<div class="container view-form">
	<form:form id="inputForm" modelAttribute="workReport" action="" method="post" class="form-horizontal">
		<form:hidden path="id"/>
		<input type="hidden" name="type" value="3">
		<sys:message content="${message}"/>
		<div class="form-group layui-row first lw12">
			<div class="form-group-label"><h2>基础信息</h2></div>
			<div class="layui-item layui-col-sm6">
				<label class="layui-form-label">类型：</label>
				<div class="layui-input-block">
					<input htmlEscape="false" readonly="true" class="form-control  layui-input" value="${fns:getDictLabel('3','work_report_type' ,'' )}"/>
				</div>
			</div>
			<div class="layui-item layui-col-sm6">
				<label class="layui-form-label">状态：</label>
				<div class="layui-input-block">
					<div class="input-group">
						<input htmlEscape="false" readonly="true" class="form-control  layui-input" value="${fns:getDictLabel(workReport.status, 'oa_notify_status', '')}"/>
					</div>
				</div>
			</div>
			<div class="layui-item layui-col-sm12 with-textarea" style="min-height: 142px;">
				<label class="layui-form-label">本月工作内容：</label>
				<div class="layui-input-block">
					<textarea htmlEscape="false" readonly="true" rows="6"  maxlength="2000"  class="form-control required">${workReport.thisContent}</textarea>
				</div>
			</div>
			<div class="layui-item layui-col-sm12 with-textarea" style="min-height: 142px;">
				<label class="layui-form-label">下月工作计划：</label>
				<div class="layui-input-block">
					<textarea htmlEscape="false" readonly="true" rows="6"  maxlength="2000"  class="form-control required">${workReport.nextContent}</textarea>
				</div>
			</div>
			<div class="layui-item layui-col-sm6">
				<label class="layui-form-label">开始时间：</label>
				<div class="layui-input-block">
					<input readonly="true" type="text" maxlength="20" class="form-control layui-input"
						   value="<fmt:formatDate value="${workReport.startDate}" pattern="yyyy-MM-dd"/>"/>
				</div>
			</div>
			<div class="layui-item layui-col-sm6">
				<label class="layui-form-label">结束时间：</label>
				<div class="layui-input-block">
					<input readonly="true" type="text" maxlength="20" class="form-control layui-input"
						   value="<fmt:formatDate value="${workReport.finishDate}" pattern="yyyy-MM-dd"/>"/>
				</div>
			</div>
			<div class="layui-item layui-col-sm12 with-textarea">
				<label class="layui-form-label">备注：</label>
				<div class="layui-input-block">
					<textarea htmlEscape="false" readonly="true" rows="4"  maxlength="2000"  class="form-control required">${workReport.remarks}</textarea>
				</div>
			</div>
		</div>
		<div class="form-group layui-row">
			<div class="form-group-label"><h2>相关附件</h2></div>
			<div class="layui-item layui-col-xs12" style="padding:0 16px;">
				<table id="listAttachment" class="table table-bordered table-condensed details">
					<thead>
					<tr>
							<%-- <th>序号</th>--%>
						<th>文件</th>
						<th>上传人</th>
						<th>上传时间</th>
						<th width="180px">操作</th>
					</tr>
					</thead>
					<tbody id="file_attachment">
					<%--<c:if test="${workReport.status == '0'}">--%>
						<c:forEach items="${workReport.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" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.url}','90%','90%')" alt="${workClientAttachment.attachmentName}">
									</c:when>
									<c:otherwise>
										<c:choose>
											<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
												<td><a class="attention-info" href="javascript:void(0)" onclick="preview('预览','${workClientAttachment.url}','90%','90%','1')">${workClientAttachment.attachmentName}</a></td>
											</c:when>
											<c:otherwise>
												<td><a class="attention-info" href="javascript:void(0)" onclick="preview('预览','${workClientAttachment.url}','90%','90%')">${workClientAttachment.attachmentName}</a></td>
											</c:otherwise>
										</c:choose>
									</c:otherwise>
								</c:choose>
								<td>${workClientAttachment.createBy.name}</td>
								<td><fmt:formatDate value="${workClientAttachment.createDate}" type="both"/></td>
								<td class="op-td">
									<div class="op-btn-box" >
										<a href="javascript:location.href='${ctx}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent(encodeURIComponent('${workClientAttachment.url}'));" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
									</div>
								</td>
							</tr>
						</c:forEach>
					<%--</c:if>--%>
					</tbody>
				</table>
			</div>
		</div>
		<c:if test="${workReport.status eq '1'}">
			<div class="form-group layui-row">
				<div class="form-group-label"><h2>接收人信息</h2></div>
				<div class="layui-item layui-col-xs12" style="padding:0 16px;">
					<table id="contentTableUser" class="table table-bordered table-condensed details">
						<thead>
						<tr>
							<th>接收人</th>
							<th>接收部门</th>
							<th>阅读状态</th>
							<th>阅读时间</th>
						</tr>
						</thead>
						<tbody>
						<c:forEach items="${workReport.workReportRecordListUser}" var="workReportRecordU">
							<tr>
								<td>
										${workReportRecordU.user.name}
								</td>
								<td>
										${workReportRecordU.user.office.name}
								</td>
								<td>
										${fns:getDictLabel(workReportRecordU.readFlag, 'oa_notify_read', '')}
								</td>
								<td>
									<fmt:formatDate value="${workReportRecordU.readDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
								</td>
							</tr>
						</c:forEach>
						</tbody>
					</table>
				</div>
			</div>
		</c:if>
	</form:form>

		<!-- ==已发布，评论与回复== -->
		<c:if test="${workReport.status eq '1'}">
			<div class="form-group layui-row">
				<div class="form-group-label"><h2>评论信息</h2></div>
				<div class="layui-item layui-col-xs12" style="padding:0 16px;">
					<table id="commentTable" class="table table-bordered table-condensed details">
						<thead>
						<tr>
							<th>评论者|回复者</th>
							<th>类型</th>
							<th>内容</th>
							<th>创建时间</th>
							<th>更新时间</th>
							<th>备注信息</th>
						</tr>
						</thead>
						<tbody>
						<c:choose>
							<c:when test="${empty workReportReviewList}">
								<tr>
									<td colspan="6" align="center">尚无评论|回复</td>
								</tr>
							</c:when>
							<c:when test="${!empty workReportReviewList}">
								<tr>
									<th  class="sort-column createBy.name">评论者|回复者</th>
									<th  class="sort-column type">类型</th>
									<th  class="sort-column content">内容</th>
									<th  class="sort-column createDate">创建时间</th>
									<th  class="sort-column updateDate">更新时间</th>
									<th  class="sort-column remarks">备注信息</th>
								</tr>
								<c:forEach items="${workReportReviewList}" var="workReportReview">
									<tr>
										<td>
												${workReportReview.createBy.name}
										</td>
										<td>
												${fns:getDictLabel(workReportReview.type, 'work_report_review_type', '')}
										</td>
										<td>
												${workReportReview.content}
										</td>
										<td>
											<fmt:formatDate value="${workReportReview.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
										</td>
										<td>
											<fmt:formatDate value="${workReportReview.updateDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
										</td>
										<td>
												${workReportReview.remarks}
										</td>
									</tr>
								</c:forEach>
							</c:when>
						</c:choose>
						</tbody>
					</table>
				</div>
			</div>
		</c:if>
	</div>
</div>
</body>
</html>