<%@ 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 () {
            //只做查看时，禁用掉以下标签
            $('input,textarea,select').attr('disabled',"disabled");
        })
    </script>
</head>
<body>
<div class="ibox-content">
<form:form id="inputForm" modelAttribute="workSealForm" action="" method="post" class="form-horizontal">
    <form:hidden path="id"/>
    <c:set var="id" value="${workSealForm.id}" />
    <c:set var="ids" value="${workSealForm.ids}" />
    <sys:message content="${message}"/>
    <div class="control-group">
        <label class="control-label">用印文件名称：</label>
        <div class="controls">
            ${workSealForm.documentName}
        <span class="help-inline"></span>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label">文件个数：</label>
        <div class="controls">
            ${workSealForm.documentCount}
        <span class="help-inline"></span>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label">申请时间：</label>
        <div class="controls">
                ${workSealForm.applicationDate}
        <span class="help-inline"></span>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label">印章类型：</label>
        <div class="controls">
                ${fns:getMainDictLabel(workSealForm.sealType, 'seal_type', '')}
        <span class="help-inline"></span>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label">经办人：</label>
        <div class="controls">
                ${workSealForm.user.name}
        <span class="help-inline"></span>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label">用印部门：</label>
        <div class="controls">
            ${workSealForm.office.name}
            <span class="help-inline"></span>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label">用印原因：</label>
        <div class="controls">
             ${workSealForm.reason}
             <span class="help-inline"></span>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label">附件信息：</label>
        <div id="fileid" class="controls">
            <table id="workReportList"  style="text-align: center;width: 100%;margin-top:10px;"  class="table table-striped table-bordered table-condensed" >
                <thead>
                <tr>
                    <%--<td>序号</td>--%><td>文件名</td><td>上传人</td><td>上传时间</td><td>操作</td>
                </tr>
                </thead>
                <tbody id="file_attachment_report">
                <c:forEach items="${workSealForm.workAttachments}" var="attachment" varStatus="status">
                    <tr>
                       <%-- <td>${status.index + 1}</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,'bmp')
                                                               or fn:containsIgnoreCase(attachment.attachmentName,'jpeg')}">
                                <td><img src="${attachment.url}" width="50" height="50" alt="${fns:abbr(attachment.attachmentName,30)}"/></td>
                            </c:when>
                            <c:otherwise>
                                <c:choose>
                                    <c:when test="${fn:containsIgnoreCase(attachment.attachmentName,'pdf')}">
                                        <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="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="javascript:location.href='${ctx}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent('${attachment.url}');" class="btn btn-success btn-xs">下载</a>
                            <%--<a href="${ctx}/workfullmanage/workFullManage/downLoadAttach?file=${attachment.url}" class="btn btn-success btn-xs">下载</a>
                           --%>
                            <a href="javascript:void(0)" onclick="deleteFileFromAliyun(this,'${ctx}/workengineeringproject/workEngineeringProject/deleteFileFromAliyun?attachmentId=${attachment.id}&id=${workEngineeringProject.id}&type=2')" class="btn btn-danger btn-xs" >删除</a>
                        </td>
                    </tr>
                </c:forEach>
                </tbody>
            </table>
    </div>
    </form:form>
</div>
</body>
</html>
