|
@@ -286,6 +286,42 @@
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
+ var certificateList = JSON.parse('${fns:toJson(workStaffBasicInfo.certificateList)}');
|
|
|
+
|
|
|
+ for (var i = 0; i < certificateList.length; i++) {
|
|
|
+ var item = certificateList[i];
|
|
|
+
|
|
|
+ // 拼接 ID 前缀
|
|
|
+ var prefix = 'certificateList' + i + '_';
|
|
|
+
|
|
|
+
|
|
|
+ if (item.name == "") {
|
|
|
+ $("#" + prefix + "major").html('<option value=""></option>');
|
|
|
+ } else {
|
|
|
+ $("#" + prefix + "major").html('<option value=""></option>');
|
|
|
+ $.ajax({
|
|
|
+ type:"post",
|
|
|
+ url:'${ctx}/workstaff/workStaffBasicInfo/getMessage',
|
|
|
+ data:{"type":item.name},
|
|
|
+ dataType:"json",
|
|
|
+ async: false,
|
|
|
+ success:function(data){
|
|
|
+ if(data.success) {
|
|
|
+ for (var info in data.data){
|
|
|
+ if(data.data[info].value == item.major){
|
|
|
+ $("#" + prefix + "majorShow").val(data.data[info].label);
|
|
|
+ return
|
|
|
+ }else{
|
|
|
+ $("#" + prefix + "majorShow").val("");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
});
|
|
|
</script>
|
|
|
<script type="text/javascript">
|
|
@@ -494,16 +530,15 @@
|
|
|
<thead>
|
|
|
<tr>
|
|
|
<th class="hide"></th>
|
|
|
- <th width="10%"><span class="require-item">*</span>证书名称</th>
|
|
|
+ <th width="13%"><span class="require-item">*</span>证书名称</th>
|
|
|
<th width="10%"><span class="require-item">*</span>证书编号</th>
|
|
|
<th width="10%">发证机关</th>
|
|
|
<th width="11%"><span class="require-item">*</span>发证日期</th>
|
|
|
<th width="11%">注册日期</th>
|
|
|
<th width="9%">注册证书编号</th>
|
|
|
- <th width="7%">专业</th>
|
|
|
- <th width="6%">等级</th>
|
|
|
+ <th width="10%">专业</th>
|
|
|
<th width="6%">取得方式</th>
|
|
|
- <th width="10%">文件<span style="color: #FF8C69; font-size: 10px; font-weight: normal; margin-left: 5px;">(图片)</span></th>
|
|
|
+ <th width="10%">文件</th>
|
|
|
</tr>
|
|
|
</thead>
|
|
|
<tbody id="certificateList">
|
|
@@ -515,9 +550,14 @@
|
|
|
<input id="certificateList${varStatus.index}_fileName" name="certificateList[${varStatus.index}].fileName" type="hidden" value="${certificate.fileName}"/>
|
|
|
<input id="certificateList${varStatus.index}_filePath" name="certificateList[${varStatus.index}].filePath" type="hidden" value="${certificate.filePath}"/>
|
|
|
<input id="certificateList${varStatus.index}_major" name="certificateList[${varStatus.index}].major" type="hidden" value="${certificate.major}"/>
|
|
|
+ <input id="certificateList${varStatus.index}_name" name="certificateList[${varStatus.index}].name" type="hidden" value="${certificate.name}"/>
|
|
|
</td>
|
|
|
<td>
|
|
|
- <input id="certificateList${varStatus.index}_name" name="certificateList[${varStatus.index}].name" value="${certificate.name}" type="text" readonly="true" class="form-control layui-input" />
|
|
|
+ <select disabled readonly="true" class="form-control ">
|
|
|
+ <c:forEach items="${fns:getMainDictList('certificate_type')}" var="var">
|
|
|
+ <option value="${var.value}" <c:if test="${certificate.name eq var.value}">selected</c:if>>${var.label}</option>
|
|
|
+ </c:forEach>
|
|
|
+ </select>
|
|
|
</td>
|
|
|
<td>
|
|
|
<input id="certificateList${varStatus.index}_num" name="certificateList[${varStatus.index}].num" readonly="true" class="form-control " value="${certificate.num}"/>
|
|
@@ -536,59 +576,60 @@
|
|
|
<td>
|
|
|
<input id="certificateList${varStatus.index}_registNum" name="certificateList[${varStatus.index}].registNum" readonly="true" class="form-control" value="${certificate.registNum}"/>
|
|
|
</td>
|
|
|
- <td>
|
|
|
- <select disabled readonly="true" class="form-control ">
|
|
|
- <c:forEach items="${fns:getMainDictList('certificate_major')}" var="var">
|
|
|
- <option value="${var.value}" <c:if test="${certificate.major eq var.value}">selected</c:if>>${var.label}</option>
|
|
|
- </c:forEach>
|
|
|
- </select>
|
|
|
- </td>
|
|
|
- <td>
|
|
|
- <input id="certificateList${varStatus.index}_grade" name="certificateList[${varStatus.index}].grade" readonly="true" class="form-control" value="${certificate.grade}"/>
|
|
|
+ <td id = "majorTd">
|
|
|
+ <input id="certificateList${varStatus.index}_majorShow" readonly="true" class="form-control" value=""/>
|
|
|
+ <%--<select disabled readonly="true" class="form-control ">
|
|
|
+ <c:forEach items="${fns:getMainDictList('certificate_major')}" var="var">
|
|
|
+ <option value="${var.value}" <c:if test="${certificate.major eq var.value}">selected</c:if>>${var.label}</option>
|
|
|
+ </c:forEach>
|
|
|
+ </select>--%>
|
|
|
</td>
|
|
|
<td>
|
|
|
<input id="certificateList${varStatus.index}_issType" name="certificateList[${varStatus.index}].issType" readonly="true" class="form-control" value="${certificate.issType}"/>
|
|
|
</td>
|
|
|
<td class="text-left op-td">
|
|
|
- <c:if test="${not empty certificate.filePathStr}">
|
|
|
- <%-- 安全处理URL中的 & --%>
|
|
|
- <c:set var="safeFilePath" value="${fn:replace(certificate.filePathStr, '&', '&')}" />
|
|
|
+ <!-- 文件或图片展示区域 -->
|
|
|
+ <span id="laborContractList${varStatus.index}_fileName1">
|
|
|
+ <c:if test="${not empty certificate.filePathStr}">
|
|
|
+ <!-- 提取文件名 -->
|
|
|
+ <c:set var="fileNameArr" value="${fn:split(certificate.filePath, '/')}" />
|
|
|
+ <c:set var="fileName" value="${fileNameArr[fn:length(fileNameArr) - 1]}" />
|
|
|
|
|
|
- <%-- 先从 certificate.fileName 里提取扩展名 --%>
|
|
|
- <c:set var="fileNameArr" value="${fn:split(certificate.fileName, '.')}" />
|
|
|
- <c:set var="fileExt" value="${fn:toLowerCase(fileNameArr[fn:length(fileNameArr) - 1])}" />
|
|
|
+ <!-- 提取文件扩展名 -->
|
|
|
+ <c:set var="extArr" value="${fn:split(fileName, '.')}" />
|
|
|
+ <c:set var="ext" value="${fn:toLowerCase(extArr[fn:length(extArr) - 1])}" />
|
|
|
|
|
|
- <%-- 如果没有后缀,尝试从 filePathStr 里提取 --%>
|
|
|
- <c:choose>
|
|
|
- <c:when test="${fn:contains(certificate.fileName, '.')}">
|
|
|
- <%-- 已经有后缀 --%>
|
|
|
- <c:set var="downloadFileName" value="${certificate.fileName}" />
|
|
|
- </c:when>
|
|
|
- <c:otherwise>
|
|
|
- <%-- 从路径最后部分提取后缀 --%>
|
|
|
- <c:set var="pathParts" value="${fn:split(certificate.filePathStr, '/')}"/>
|
|
|
- <c:set var="lastPart" value="${pathParts[fn:length(pathParts) - 1]}" />
|
|
|
- <c:set var="lastPartArr" value="${fn:split(lastPart, '.')}" />
|
|
|
- <c:set var="pathExt" value="${fn:toLowerCase(lastPartArr[fn:length(lastPartArr) - 1])}" />
|
|
|
- <c:set var="downloadFileName" value="${certificate.fileName}.${pathExt}" />
|
|
|
- </c:otherwise>
|
|
|
- </c:choose>
|
|
|
+ <!-- 判断是否是图片类型 -->
|
|
|
+ <c:choose>
|
|
|
+ <c:when test="${ext == 'jpg' || ext == 'jpeg' || ext == 'png' || ext == 'gif' || ext == 'bmp' || ext == 'webp'}">
|
|
|
+ <!-- 图片预览 -->
|
|
|
+ <img src="${certificate.filePathThumbnailStr}" width="24" height="24"
|
|
|
+ style="cursor:pointer; vertical-align:middle;"
|
|
|
+ onclick="preview('预览','${certificate.filePathStr}','90%','90%','1')"
|
|
|
+ alt="图片预览" title="点击预览图片" />
|
|
|
+ </c:when>
|
|
|
+ <c:otherwise>
|
|
|
+ <c:choose>
|
|
|
+ <c:when test="${fn:containsIgnoreCase(certificate.fileName,'pdf')}">
|
|
|
+ <a class="attention-info" href="javascript:void(0)" style="color: #007bff;" onclick="preview('预览','${certificate.filePathStr}','90%','90%','1')">${certificate.fileName}</a>
|
|
|
+ </c:when>
|
|
|
+ <c:otherwise>
|
|
|
+ <a class="attention-info" href="javascript:void(0)" style="color: #007bff;" onclick="preview('预览','${certificate.filePathStr}','90%','90%')">${certificate.fileName}</a>
|
|
|
+ </c:otherwise>
|
|
|
+ </c:choose>
|
|
|
+ </c:otherwise>
|
|
|
+ </c:choose>
|
|
|
+ </c:if>
|
|
|
+ </span>
|
|
|
|
|
|
- <%-- 显示图片缩略图 --%>
|
|
|
- <img src="${safeFilePath}" width="24" height="24"
|
|
|
- style="cursor:pointer; vertical-align:middle;"
|
|
|
- onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${safeFilePath}','90%','90%')"
|
|
|
- alt="文件预览" title="点击预览" />
|
|
|
+ <!-- 下载按钮 -->
|
|
|
+ <a href="javascript:void(0);"
|
|
|
+ title="下载 ${certificate.fileName}"
|
|
|
+ style="color: #28a745; margin-left: 5px; text-decoration: none;"
|
|
|
+ onclick="downloadFile('${ctx}', '${certificate.filePath}', '${certificate.fileName}')">
|
|
|
+ <i class="fa fa-download"></i>
|
|
|
+ </a>
|
|
|
|
|
|
- <%-- 下载按钮 --%>
|
|
|
- <a href="javascript:void(0);"
|
|
|
- title="下载文件"
|
|
|
- style="color: #28a745; margin-left: 5px; text-decoration: none;"
|
|
|
- onclick="downloadFile('${ctx}', '${certificate.filePath}', '${downloadFileName}')">
|
|
|
- <i class="fa fa-download"></i>
|
|
|
- </a>
|
|
|
- </c:if>
|
|
|
- <input id="certificateList${varStatus.index}_file" name="certificateList[${varStatus.index}].file" style="display:none" type="file" onchange="changeFileName(this,1)"/>
|
|
|
</td>
|
|
|
</tr>
|
|
|
</c:forEach>
|