|
@@ -0,0 +1,262 @@
|
|
|
|
+<%@ 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" src="${ctxStatic}/helloweba_editable-select/jquery.editable-select.min.js"></script>
|
|
|
|
+ <link rel='stylesheet' type="text/css" href="${ctxStatic}/helloweba_editable-select/jquery.editable-select.min.css"/>
|
|
|
|
+ <script type="text/javascript" src="${ctxStatic}/layui/layui.js"></script>
|
|
|
|
+ <link rel='stylesheet' type="text/css" href="${ctxStatic}/layui/css/layui.css"/>
|
|
|
|
+ <script src="${ctxStatic}/layer-v2.3/layui/xmSelect.js" charset="utf-8"></script>
|
|
|
|
+ <script type="text/javascript">
|
|
|
|
+ $(document).ready(function() {
|
|
|
|
+ cacuAge('${workStaffBasicInfo.idCard}','1');
|
|
|
|
+ });
|
|
|
|
+ </script>
|
|
|
|
+ <script type="text/javascript">
|
|
|
|
+
|
|
|
|
+ function cacuAge(idCard,type){
|
|
|
|
+ if(type=='1'){
|
|
|
|
+ var pattern = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
|
|
|
|
+ if(!pattern.test(idCard)){
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ var age = 0;
|
|
|
|
+ var year='';
|
|
|
|
+ var months='';
|
|
|
|
+ var days='';
|
|
|
|
+ if(idCard.length==15){
|
|
|
|
+ year = "19"+idCard.substring(6,8);
|
|
|
|
+ months=idCard.substring(8,10);//截取身份证上的月
|
|
|
|
+ days=idCard.substring(10,12);//截取身份证上的日
|
|
|
|
+ }else {
|
|
|
|
+ year=idCard.substring(6,10);//截取身份证上的年
|
|
|
|
+ months=idCard.substring(10,12);//截取身份证上的月
|
|
|
|
+ days=idCard.substring(12,14);//截取身份证上的日
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ var myDate = new Date();
|
|
|
|
+ var month = myDate.getMonth() + 1;
|
|
|
|
+ var day = myDate.getDate();
|
|
|
|
+ age = myDate.getFullYear() - year - 1;
|
|
|
|
+ if (months< month || months == month && days <= day) {
|
|
|
|
+ age++;
|
|
|
|
+ }
|
|
|
|
+ if(age<0)age=0;
|
|
|
|
+ $("#age").val(age);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ function openLayerPreview(imgUrl) {
|
|
|
|
+ var img = new Image();
|
|
|
|
+ img.onload = function () {
|
|
|
|
+ var imgWidth = img.width;
|
|
|
|
+ var imgHeight = img.height;
|
|
|
|
+
|
|
|
|
+ // 最大限制,防止太大撑爆屏幕
|
|
|
|
+ var maxWidth = window.innerWidth * 0.8;
|
|
|
|
+ var maxHeight = window.innerHeight * 0.8;
|
|
|
|
+
|
|
|
|
+ // 缩放比例
|
|
|
|
+ var ratio = Math.min(maxWidth / imgWidth, maxHeight / imgHeight, 1);
|
|
|
|
+
|
|
|
|
+ var finalWidth = imgWidth * ratio;
|
|
|
|
+ var finalHeight = imgHeight * ratio;
|
|
|
|
+
|
|
|
|
+ layui.use('layer', function () {
|
|
|
|
+ var layer = layui.layer;
|
|
|
|
+ layer.open({
|
|
|
|
+ type: 1,
|
|
|
|
+ title: '图片预览',
|
|
|
|
+ shadeClose: true,
|
|
|
|
+ shade: 0.2,
|
|
|
|
+ area: [finalWidth + 'px', finalHeight + 'px'],
|
|
|
|
+ content: '<img src="' + imgUrl + '" style="width:100%;height:100%;object-fit:contain;">'
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ };
|
|
|
|
+ img.src = imgUrl;
|
|
|
|
+ }
|
|
|
|
+ </script>
|
|
|
|
+
|
|
|
|
+</head>
|
|
|
|
+<body>
|
|
|
|
+ <div class="single-form">
|
|
|
|
+ <div class="container view-form">
|
|
|
|
+ <form:form id="inputForm" modelAttribute="workStaffBasicInfo" action="${ctx}/workstaff/workStaffBasicInfo/save" enctype="multipart/form-data" method="post" class="form-horizontal">
|
|
|
|
+ <form:hidden path="id"/>
|
|
|
|
+ <form:hidden path="userId"/>
|
|
|
|
+ <div class="form-group layui-row first">
|
|
|
|
+ <div class="form-group-label"><h2>基本信息</h2></div>
|
|
|
|
+ <div class="layui-item layui-col-sm6 lw7" style="padding-right: 0;">
|
|
|
|
+ <div class="layui-item layui-col-sm12">
|
|
|
|
+ <label class="layui-form-label"><span class="require-item">*</span>姓 名:</label>
|
|
|
|
+ <div class="layui-input-block">
|
|
|
|
+ <form:input style="background-color: #f1f1f1" path="name" htmlEscape="false" readonly="true" class="form-control layui-input required"/>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="layui-item layui-col-sm12">
|
|
|
|
+ <label class="layui-form-label"><span class="require-item">*</span>性 别:</label>
|
|
|
|
+ <div class="layui-input-block">
|
|
|
|
+ <input style="background-color: #f1f1f1" value="${fns:getDictLabel(workStaffBasicInfo.gender,'sex','')}" type="text" readonly="true" class="form-control layui-input" />
|
|
|
|
+ <input name="gender" value="${workStaffBasicInfo.gender}" type="hidden" readonly="true" class="form-control layui-input" />
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="layui-item layui-col-sm12">
|
|
|
|
+ <label class="layui-form-label">身份证号码:</label>
|
|
|
|
+ <div class="layui-input-block">
|
|
|
|
+ <form:input style="background-color: #f1f1f1" path="idCard" htmlEscape="false" onchange="caculateAge(this.value);" readonly="true" class="form-control idCard layui-input"/>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="layui-item layui-col-sm6 lw7">
|
|
|
|
+ <div style="margin-right: 120px;">
|
|
|
|
+ <div class="layui-item layui-col-sm12">
|
|
|
|
+ <label class="layui-form-label"><span class="require-item">*</span>民 族:</label>
|
|
|
|
+ <div class="layui-input-block">
|
|
|
|
+ <input style="background-color: #f1f1f1" value="${fns:getDictLabel(workStaffBasicInfo.nation,'nation_type','')}" type="text" readonly="true" class="form-control layui-input" />
|
|
|
|
+ <input name="nation" value="${workStaffBasicInfo.nation}" type="hidden" readonly="true" class="form-control layui-input" />
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="layui-item layui-col-sm12">
|
|
|
|
+ <label class="layui-form-label">年 龄:</label>
|
|
|
|
+ <div class="layui-input-block">
|
|
|
|
+ <form:input style="background-color: #f1f1f1" path="age" htmlEscape="false" readonly="true" class="form-control layui-input"/>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="layui-item layui-col-sm12">
|
|
|
|
+ <label class="layui-form-label">出生日期:</label>
|
|
|
|
+ <div class="layui-input-block">
|
|
|
|
+ <input name="birthday" style="background-color: #f1f1f1" value="<fmt:formatDate value="${workStaffBasicInfo.birthday}" pattern="yyyy-MM-dd"/>" type="text" readonly="true" class="form-control layui-input" />
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="profile_box_wrapper">
|
|
|
|
+ <div class="profile_box">
|
|
|
|
+ <div id="this_upload_image_div_1">
|
|
|
|
+ <div id="this_upload_div_1" style="position:relative;">
|
|
|
|
+ <c:choose>
|
|
|
|
+ <c:when test="${not empty workStaffBasicInfo.picture}">
|
|
|
|
+ <%--<span id="this_upload_close_1" class="pic_close glyphicon glyphicon-remove" onclick="this_close_img(1)"></span>--%>
|
|
|
|
+ <img alt="_blank" id="this_upload_image_1" class="upload_ico" style="cursor:pointer;" src="${workStaffBasicInfo.picture}" />
|
|
|
|
+ </c:when>
|
|
|
|
+ <c:otherwise>
|
|
|
|
+ <img alt="_blank" id="this_upload_image_1" class="upload_ico" style="cursor:pointer;" src="${pageContext.request.contextPath}/static/common/img/pic_add.png" />
|
|
|
|
+ </c:otherwise>
|
|
|
|
+ </c:choose>
|
|
|
|
+ <input id="this_upload_file_1" type="file" style="display:none" name="pictureFile" onchange="this_upload_show_image(1)" class="form-control"/>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <div class="form-group layui-row">
|
|
|
|
+ <div class="form-group-label"><h2>执业资格证书</h2></div>
|
|
|
|
+ <div class="layui-item layui-col-xs12 form-table-container">
|
|
|
|
+ <table id="certificateTable" class="table table-bordered table-condensed details">
|
|
|
|
+ <thead>
|
|
|
|
+ <tr>
|
|
|
|
+ <th width="10%"><span class="require-item">*</span>证书名称</th>
|
|
|
|
+ <th width="10%"><span class="require-item">*</span>证书编号</th>
|
|
|
|
+ <th width="11%">注册日期</th>
|
|
|
|
+ <th width="11%"><span class="require-item">*</span>发证日期</th>
|
|
|
|
+ <th width="10%">发证机关</th>
|
|
|
|
+ <th width="10%">文件</th>
|
|
|
|
+ </tr>
|
|
|
|
+ </thead>
|
|
|
|
+ <tbody id="certificateList">
|
|
|
|
+ <c:forEach items="${workStaffBasicInfo.certificateList}" var="certificate" varStatus="varStatus">
|
|
|
|
+ <tr>
|
|
|
|
+ <td>
|
|
|
|
+ ${certificate.name}
|
|
|
|
+ </td>
|
|
|
|
+ <td>
|
|
|
|
+ ${certificate.num}
|
|
|
|
+ </td>
|
|
|
|
+ <td>
|
|
|
|
+ <fmt:formatDate value="${certificate.registDate}" pattern="yyyy-MM-dd"/>
|
|
|
|
+ </td>
|
|
|
|
+ <td>
|
|
|
|
+ <fmt:formatDate value="${certificate.issuingDate}" pattern="yyyy-MM-dd"/>
|
|
|
|
+ </td>
|
|
|
|
+ <td>
|
|
|
|
+ ${certificate.issuingAuthority}
|
|
|
|
+ </td>
|
|
|
|
+ <td class="text-left op-td">
|
|
|
|
+ <c:if test="${not empty certificate.filePathStr}">
|
|
|
|
+ <%-- 1. 安全处理URL中的 & --%>
|
|
|
|
+ <c:set var="safeFilePath" value="${fn:replace(certificate.filePathStr, '&', '&')}" />
|
|
|
|
+
|
|
|
|
+ <%-- 2. 提取文件名 --%>
|
|
|
|
+ <c:choose>
|
|
|
|
+ <c:when test="${not empty certificate.fileName}">
|
|
|
|
+ <c:set var="fileName" value="${certificate.fileName}" />
|
|
|
|
+ </c:when>
|
|
|
|
+ <c:otherwise>
|
|
|
|
+ <c:set var="fileNameArr" value="${fn:split(certificate.filePathStr, '/')}" />
|
|
|
|
+ <c:set var="fileName" value="${fileNameArr[fn:length(fileNameArr) - 1]}" />
|
|
|
|
+ </c:otherwise>
|
|
|
|
+ </c:choose>
|
|
|
|
+
|
|
|
|
+ <%-- 3. 提取文件扩展名(后缀)--%>
|
|
|
|
+ <c:set var="extArr" value="${fn:split(fileName, '.')}" />
|
|
|
|
+ <c:set var="ext" value="${fn:toLowerCase(extArr[fn:length(extArr) - 1])}" />
|
|
|
|
+
|
|
|
|
+ <%-- 4. 判断并显示文件内容(图片预览 / 链接预览) --%>
|
|
|
|
+ <c:choose>
|
|
|
|
+ <%-- ✅ 图片预览格式 --%>
|
|
|
|
+ <c:when test="${ext == 'jpg' || ext == 'jpeg' || ext == 'png' || ext == 'gif' || ext == 'bmp' || ext == 'webp'}">
|
|
|
|
+ <img src="${safeFilePath}" width="24" height="24"
|
|
|
|
+ style="cursor:pointer; vertical-align:middle;"
|
|
|
|
+ onclick="clickPicture('${safeFilePath}')"
|
|
|
|
+ alt="图片预览" title="点击预览图片" />
|
|
|
|
+ </c:when>
|
|
|
|
+
|
|
|
|
+ <%-- ✅ 非图片文件,按类型显示文件名并支持预览 --%>
|
|
|
|
+ <c:otherwise>
|
|
|
|
+ <c:choose>
|
|
|
|
+ <%-- PDF 特殊处理(可用 iframe 预览) --%>
|
|
|
|
+ <c:when test="${ext == 'pdf'}">
|
|
|
|
+ <a class="attention-info" href="javascript:void(0)"
|
|
|
|
+ style="color: #007bff;"
|
|
|
|
+ onclick="preview('预览','${safeFilePath}','90%','90%','1')">
|
|
|
|
+ ${fileName}
|
|
|
|
+ </a>
|
|
|
|
+ </c:when>
|
|
|
|
+
|
|
|
|
+ <%-- 其他文件格式 --%>
|
|
|
|
+ <c:otherwise>
|
|
|
|
+ <a class="attention-info" href="javascript:void(0)"
|
|
|
|
+ style="color: #007bff;"
|
|
|
|
+ onclick="preview('预览','${safeFilePath}','90%','90%')">
|
|
|
|
+ ${fileName}
|
|
|
|
+ </a>
|
|
|
|
+ </c:otherwise>
|
|
|
|
+ </c:choose>
|
|
|
|
+ </c:otherwise>
|
|
|
|
+ </c:choose>
|
|
|
|
+
|
|
|
|
+ <%-- 5. 下载按钮 --%>
|
|
|
|
+ <a href="javascript:void(0);"
|
|
|
|
+ title="下载 ${fileName}"
|
|
|
|
+ style="color: #28a745; margin-left: 5px; text-decoration: none;"
|
|
|
|
+ onclick="downloadFile('${ctx}', '${certificate.filePath}', '${fileName}')">
|
|
|
|
+ <i class="fa fa-download"></i>
|
|
|
|
+ </a>
|
|
|
|
+ </c:if>
|
|
|
|
+ </td>
|
|
|
|
+ </tr>
|
|
|
|
+ </c:forEach>
|
|
|
|
+ </tbody>
|
|
|
|
+ </table>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </form:form>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+</body>
|
|
|
|
+</html>
|