Browse Source

人力资源管理 人员信息登记部分代码提交

徐滕 1 week ago
parent
commit
3002eca2fe
25 changed files with 3712 additions and 449 deletions
  1. 14 4
      src/main/java/com/jeeplus/modules/sys/web/UserController.java
  2. 5 1
      src/main/java/com/jeeplus/modules/workprojectnotify/web/WorkProjectNotifyController.java
  3. 74 0
      src/main/java/com/jeeplus/modules/workstaff/service/WorkStaffBasicInfoService.java
  4. 21 2
      src/main/java/com/jeeplus/modules/workstaff/web/WorkStaffBasicInfoController.java
  5. 1 1
      src/main/resources/mappings/modules/workstaff/WorkStaffAchievementDao.xml
  6. 1 1
      src/main/resources/mappings/modules/workstaff/WorkStaffCertificateDao.xml
  7. 1 1
      src/main/resources/mappings/modules/workstaff/WorkStaffEducationDao.xml
  8. 1 1
      src/main/resources/mappings/modules/workstaff/WorkStaffExperienceDao.xml
  9. 1 1
      src/main/resources/mappings/modules/workstaff/WorkStaffFamilyDao.xml
  10. 1 1
      src/main/resources/mappings/modules/workstaff/WorkStaffLaborContractDao.xml
  11. 1 1
      src/main/resources/mappings/modules/workstaff/WorkStaffLanguagesDao.xml
  12. 1 1
      src/main/resources/mappings/modules/workstaff/WorkStaffRecordDao.xml
  13. 1 1
      src/main/resources/mappings/modules/workstaff/WorkStaffRewardsDao.xml
  14. 1 1
      src/main/resources/mappings/modules/workstaff/WorkStaffSocialPositionDao.xml
  15. 1 1
      src/main/resources/mappings/modules/workstaff/WorkStaffTitleDao.xml
  16. 1 1
      src/main/resources/mappings/modules/workstaff/WorkStaffTrainingDao.xml
  17. 2 6
      src/main/webapp/webpage/modules/sys/userInfo.jsp
  18. 233 215
      src/main/webapp/webpage/modules/workstaff/workStaffBasicCertificateModify.jsp
  19. 50 11
      src/main/webapp/webpage/modules/workstaff/workStaffBasicDetailAudit.jsp
  20. 86 23
      src/main/webapp/webpage/modules/workstaff/workStaffBasicDetailForm.jsp
  21. 82 18
      src/main/webapp/webpage/modules/workstaff/workStaffBasicDetailModify.jsp
  22. 90 49
      src/main/webapp/webpage/modules/workstaff/workStaffBasicDirectlyAudit.jsp
  23. 235 37
      src/main/webapp/webpage/modules/workstaff/workStaffBasicDirectlyModify.jsp
  24. 2642 0
      src/main/webapp/webpage/modules/workstaff/workStaffBasicInfoEmploymentInForm.jsp
  25. 166 71
      src/main/webapp/webpage/modules/workstaff/workStaffBasicInfoForm.jsp

+ 14 - 4
src/main/java/com/jeeplus/modules/sys/web/UserController.java

@@ -524,7 +524,7 @@ public class UserController extends BaseController {
 
         List<WorkStaffCertificate> list = workStaffBasicInfo.getCertificateList();
         //获取专业类型
-        List<MainDictDetail> certificateMajor = DictUtils.getMainDictList("certificate_major");
+        /*List<MainDictDetail> certificateMajor = DictUtils.getMainDictList("certificate_major");
         for (WorkStaffCertificate workStaffCertificate : list) {
             if(StringUtils.isNotBlank(workStaffCertificate.getMajor())){
                 for (MainDictDetail mainDictDetail : certificateMajor) {
@@ -533,12 +533,22 @@ public class UserController extends BaseController {
                     }
                 }
             }
-        }
+        }*/
 
         List<WorkStaffCertificate> certificateList = workStaffBasicInfo.getCertificateList();
         List<MainDictDetail> certificateType = DictUtils.getMainDictList("certificate_type");
-        for (MainDictDetail type : certificateType) {
-            for (WorkStaffCertificate info: certificateList) {
+        for (WorkStaffCertificate info: certificateList) {
+            //获取对应执业资格证的专业
+            List<MainDictDetail> certificateMajor = workStaffBasicInfoService.getMainDictDetailByType(info.getName());
+            if(StringUtils.isNotBlank(info.getMajor())){
+                for (MainDictDetail mainDictDetail : certificateMajor) {
+                    if(info.getMajor().equals(mainDictDetail.getValue())){
+                        info.setMajor(mainDictDetail.getLabel());
+                    }
+                }
+            }
+
+            for (MainDictDetail type : certificateType) {
                 if(info.getName().equals(type.getValue())){
                     info.setName(type.getLabel());
                     break;

+ 5 - 1
src/main/java/com/jeeplus/modules/workprojectnotify/web/WorkProjectNotifyController.java

@@ -11300,7 +11300,11 @@ public class WorkProjectNotifyController extends BaseController {
 			String urlManage = WorkattachmentService.fileUrlManage(workStaffBasicInfo.getPicture());
 			workStaffBasicInfo.setPictureStr(urlManage);
 		}
-		workStaffBasicInfo.setHome("home");
+		if(StringUtils.isBlank(workProjectNotify.getHome())){
+			workStaffBasicInfo.setHome("home");
+		}else{
+			workStaffBasicInfo.setHome(workProjectNotify.getHome());
+		}
 		model.addAttribute("workStaffBasicInfo", workStaffBasicInfo);
 
 		if (workProjectNotify.getRemarks().contains("待处理") && !"1".equals(workProjectNotify.getStatus())) {

+ 74 - 0
src/main/java/com/jeeplus/modules/workstaff/service/WorkStaffBasicInfoService.java

@@ -2035,5 +2035,79 @@ public class WorkStaffBasicInfoService extends CrudService<WorkStaffBasicInfoDao
         }
     }
 
+    public List<MainDictDetail> getMainDictDetailByType (String type){
+
+        List<MainDictDetail> mainDictDetails = Lists.newArrayList();
+        try {
+            if(StringUtils.isNotBlank(type)){
+                switch (type){
+                    //一级造价师
+                    case "161":
+                        mainDictDetails = DictUtils.getMainDictList("certificate_major");
+                        break;
+                    //二级造价师
+                    case "171":
+                        mainDictDetails = DictUtils.getMainDictList("costEngineer_major");
+                        break;
+                    //一级建造师
+                    case "151":
+                        mainDictDetails = DictUtils.getMainDictList("architect_major");
+                        break;
+                    //二级建造师
+                    case "152":
+                        mainDictDetails = DictUtils.getMainDictList("architect_two_major");
+                        break;
+                    //一级监理师
+                    case "181":
+                        mainDictDetails = DictUtils.getMainDictList("certificate_first_supervisor");
+                        break;
+                    //注册会计师
+                    case "182":
+                        mainDictDetails = DictUtils.getMainDictList("certificate_cpa_accountant");
+                        break;
+                    //资产评估师
+                    case "183":
+                        mainDictDetails = DictUtils.getMainDictList("certificate_asset_appraiser");
+                        break;
+                    //税务师
+                    case "184":
+                        mainDictDetails = DictUtils.getMainDictList("certificate_tax_accountant");
+                        break;
+                    //房地产评估师
+                    case "185":
+                        mainDictDetails = DictUtils.getMainDictList("certificate_real_estate_appraiser");
+                        break;
+                    //咨询工程师
+                    case "186":
+                        mainDictDetails = DictUtils.getMainDictList("certificate_consulting_engineer");
+                        break;
+                    //其他
+                    case "187":
+                        mainDictDetails = DictUtils.getMainDictList("certificate_other");
+                        break;
+                    default:
+                        break;
+
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return mainDictDetails;
+    }
+
+    public Map getSortMessage(String type){
+        Map map = new HashMap();
+        List<MainDictDetail> mainDictDetails = getMainDictDetailByType(type);
+        if(!mainDictDetails.isEmpty()){
+            map.put("data",mainDictDetails);
+            map.put("success",true);
+        }else{
+            map.put("data","");
+            map.put("success",false);
+        }
+
+        return map;
+    }
 
 }

+ 21 - 2
src/main/java/com/jeeplus/modules/workstaff/web/WorkStaffBasicInfoController.java

@@ -1123,7 +1123,12 @@ public class WorkStaffBasicInfoController extends BaseController {
 		t.setId(basicInfo.getId());
 		workStaffBasicInfoService.save(t);
 		addMessage(redirectAttributes, "保存员工档案信息成功");
-		return "redirect:" + Global.getAdminPath() + "/home/?repage";
+		if (StringUtils.isNotBlank(workStaffBasicInfo.getHome()) && "home".equals(workStaffBasicInfo.getHome())){
+			return "redirect:" + Global.getAdminPath() + "/home/?repage";
+		}else if (StringUtils.isNotBlank(workStaffBasicInfo.getHome()) && "notifyList".equals(workStaffBasicInfo.getHome())){
+			return "redirect:" + Global.getAdminPath() + "/workprojectnotify/workProjectNotify/list/?repage";
+		}
+		return "redirect:"+Global.getAdminPath()+"/sys/user/info?repage";
 	}
 	@RequestMapping(value = "back")
 	public String back(WorkStaffBasicInfo workStaffBasicInfo, Model model, RedirectAttributes redirectAttributes,HttpServletRequest request) throws Exception{
@@ -1141,7 +1146,12 @@ public class WorkStaffBasicInfoController extends BaseController {
 
 		workStaffAchivesLogDao.updateBackOnTS(workStaffBasicInfo.getId());
 		addMessage(redirectAttributes, "驳回成功");
-		return "redirect:" + Global.getAdminPath() + "/home/?repage";
+		if (StringUtils.isNotBlank(workStaffBasicInfo.getHome()) && "home".equals(workStaffBasicInfo.getHome())){
+			return "redirect:" + Global.getAdminPath() + "/home/?repage";
+		}else if (StringUtils.isNotBlank(workStaffBasicInfo.getHome()) && "notifyList".equals(workStaffBasicInfo.getHome())){
+			return "redirect:" + Global.getAdminPath() + "/workprojectnotify/workProjectNotify/list/?repage";
+		}
+		return "redirect:"+Global.getAdminPath()+"/sys/user/info?repage";
 	}
 
 	/**
@@ -1315,4 +1325,13 @@ public class WorkStaffBasicInfoController extends BaseController {
 		SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
 		return sdf.parse(birthDateStr);
 	}
+
+
+
+	@RequestMapping("getMessage")
+	@ResponseBody
+	public Map getMessage(String type){
+		Map map = workStaffBasicInfoService.getSortMessage(type);
+		return  map;
+	}
 }

+ 1 - 1
src/main/resources/mappings/modules/workstaff/WorkStaffAchievementDao.xml

@@ -47,7 +47,7 @@
 				ORDER BY ${page.orderBy}
 			</when>
 			<otherwise>
-				ORDER BY a.update_date DESC
+				ORDER BY a.create_date asc
 			</otherwise>
 		</choose>
 	</select>

+ 1 - 1
src/main/resources/mappings/modules/workstaff/WorkStaffCertificateDao.xml

@@ -59,7 +59,7 @@
 				ORDER BY ${page.orderBy}
 			</when>
 			<otherwise>
-				ORDER BY a.update_date DESC
+				ORDER BY a.create_date asc
 			</otherwise>
 		</choose>
 	</select>

+ 1 - 1
src/main/resources/mappings/modules/workstaff/WorkStaffEducationDao.xml

@@ -52,7 +52,7 @@
 				ORDER BY ${page.orderBy}
 			</when>
 			<otherwise>
-				ORDER BY a.update_date DESC
+				ORDER BY a.create_date asc
 			</otherwise>
 		</choose>
 	</select>

+ 1 - 1
src/main/resources/mappings/modules/workstaff/WorkStaffExperienceDao.xml

@@ -48,7 +48,7 @@
 				ORDER BY ${page.orderBy}
 			</when>
 			<otherwise>
-				ORDER BY a.update_date DESC
+				ORDER BY a.create_date asc
 			</otherwise>
 		</choose>
 	</select>

+ 1 - 1
src/main/resources/mappings/modules/workstaff/WorkStaffFamilyDao.xml

@@ -46,7 +46,7 @@
 				ORDER BY ${page.orderBy}
 			</when>
 			<otherwise>
-				ORDER BY a.update_date DESC
+				ORDER BY a.create_date asc
 			</otherwise>
 		</choose>
 	</select>

+ 1 - 1
src/main/resources/mappings/modules/workstaff/WorkStaffLaborContractDao.xml

@@ -62,7 +62,7 @@
 				ORDER BY ${page.orderBy}
 			</when>
 			<otherwise>
-				ORDER BY a.update_date DESC
+				ORDER BY a.create_date asc
 			</otherwise>
 		</choose>
 	</select>

+ 1 - 1
src/main/resources/mappings/modules/workstaff/WorkStaffLanguagesDao.xml

@@ -47,7 +47,7 @@
 				ORDER BY ${page.orderBy}
 			</when>
 			<otherwise>
-				ORDER BY a.update_date DESC
+				ORDER BY a.create_date asc
 			</otherwise>
 		</choose>
 	</select>

+ 1 - 1
src/main/resources/mappings/modules/workstaff/WorkStaffRecordDao.xml

@@ -46,7 +46,7 @@
 				ORDER BY ${page.orderBy}
 			</when>
 			<otherwise>
-				ORDER BY a.update_date DESC
+				ORDER BY a.create_date asc
 			</otherwise>
 		</choose>
 	</select>

+ 1 - 1
src/main/resources/mappings/modules/workstaff/WorkStaffRewardsDao.xml

@@ -47,7 +47,7 @@
 				ORDER BY ${page.orderBy}
 			</when>
 			<otherwise>
-				ORDER BY a.update_date DESC
+				ORDER BY a.create_date asc
 			</otherwise>
 		</choose>
 	</select>

+ 1 - 1
src/main/resources/mappings/modules/workstaff/WorkStaffSocialPositionDao.xml

@@ -45,7 +45,7 @@
 				ORDER BY ${page.orderBy}
 			</when>
 			<otherwise>
-				ORDER BY a.update_date DESC
+				ORDER BY a.create_date asc
 			</otherwise>
 		</choose>
 	</select>

+ 1 - 1
src/main/resources/mappings/modules/workstaff/WorkStaffTitleDao.xml

@@ -48,7 +48,7 @@
 				ORDER BY ${page.orderBy}
 			</when>
 			<otherwise>
-				ORDER BY a.update_date DESC
+				ORDER BY a.create_date asc
 			</otherwise>
 		</choose>
 	</select>

+ 1 - 1
src/main/resources/mappings/modules/workstaff/WorkStaffTrainingDao.xml

@@ -51,7 +51,7 @@
 				ORDER BY ${page.orderBy}
 			</when>
 			<otherwise>
-				ORDER BY a.update_date DESC
+				ORDER BY a.create_date asc
 			</otherwise>
 		</choose>
 	</select>

+ 2 - 6
src/main/webapp/webpage/modules/sys/userInfo.jsp

@@ -1093,14 +1093,13 @@
                                         <table id="certificateTable" class="table table-bordered table-condensed details">
                                             <thead>
                                             <tr>
-                                                <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="10%"><span class="require-item">*</span>发证日期</th>
                                                 <th width="10%">注册日期</th>
                                                 <th width="10%">注册证书编号</th>
-                                                <th width="10%">专业</th>
-                                                <th width="10%">等级</th>
+                                                <th width="13%">专业</th>
                                                 <th width="10%">取得方式</th>
                                                 <th width="10%">文件</th>
                                             </tr>
@@ -1130,9 +1129,6 @@
                                                             ${certificate.major}
                                                     </td>
                                                     <td>
-                                                            ${certificate.grade}
-                                                    </td>
-                                                    <td>
                                                             ${certificate.issType}
                                                     </td>
                                                     <td class="text-left op-td">

File diff suppressed because it is too large
+ 233 - 215
src/main/webapp/webpage/modules/workstaff/workStaffBasicCertificateModify.jsp


+ 50 - 11
src/main/webapp/webpage/modules/workstaff/workStaffBasicDetailAudit.jsp

@@ -291,6 +291,44 @@
 					}
 				}
 			});
+
+            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">
@@ -461,7 +499,6 @@
                                                 <img alt="_blank" id="this_upload_image_1" name="pictureFile" class="upload_ico" style="cursor:pointer;"  src="${pageContext.request.contextPath}/static/common/img/pic_add.png"/>
                                             </c:otherwise>
                                         </c:choose>
-                                        <input id="picture" type="text" name="picture" style="display: none" class="basicInfo">
                                         <input id="this_upload_file_1" type="file" style="display:none"  name="pictureFile"  onchange="this_upload_show_image(1)"  class="form-control"/>
                                         <!-- ✅ 后端路径字段(用于提交) -->
                                         <input type="hidden" id="picture" name="picture" value="${workStaffBasicInfo.picture}">
@@ -868,14 +905,13 @@
                             <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%">文件</th>
                             </tr>
@@ -889,9 +925,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}"/>
@@ -910,15 +951,13 @@
                                     <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 ">
+                                    <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}_grade" name="certificateList[${varStatus.index}].grade" readonly="true" class="form-control" value="${certificate.grade}"/>
+                                        </select>--%>
                                     </td>
                                     <td>
                                         <input id="certificateList${varStatus.index}_issType" name="certificateList[${varStatus.index}].issType" readonly="true" class="form-control" value="${certificate.issType}"/>

+ 86 - 23
src/main/webapp/webpage/modules/workstaff/workStaffBasicDetailForm.jsp

@@ -110,7 +110,77 @@
                 });
             }
             cacuAge('${workStaffBasicInfo.idCard}','1');
+
+            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){
+                            console.log(data)
+                            if(data.success) {
+                                for (var info in data.data){
+                                    if(data.data[info].value == item.major){
+                                        $("#" + prefix + "major").append(new Option(data.data[info].label,data.data[info].value,true,true));
+                                    }else{
+                                        $("#" + prefix + "major").append(new Option(data.data[info].label,data.data[info].value));
+                                    }
+
+
+                                }
+                            }
+                        }
+                    })
+                }
+            }
 		});
+        function nameChange(obj){
+            console.log(obj)
+            console.log(obj.id)
+            let id = obj.id; // "certificateList0_name"
+            let prefix = id.substring(0, id.lastIndexOf('_') + 1);
+            console.log(prefix);
+            $("#" + prefix + "major")
+            if (obj.value == "") {
+                $("#" + prefix + "major").html('<option value=""></option>');
+            } else {
+                $("#" + prefix + "major").html('<option value=""></option>');
+                $.ajax({
+                    type:"post",
+                    url:'${ctx}/workstaff/workStaffBasicInfo/getMessage',
+                    data:{"type":obj.value},
+                    dataType:"json",
+                    async: false,
+                    success:function(data){
+                        if(data.success) {
+                            for (var info in data.data){
+                                if(info == 0){
+                                    $("#" + prefix + "major").append(new Option(data.data[info].label,data.data[info].value,true,true));
+                                }else{
+                                    $("#" + prefix + "major").append(new Option(data.data[info].label,data.data[info].value));
+                                }
+
+                            }
+                        }
+                    }
+                })
+                /*layui.form.render("select");*/
+            }
+        }
 	</script>
     <script type="text/javascript">
         //上传用户头像
@@ -1245,14 +1315,13 @@
                             <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%"><span class="require-item">*</span>专业</th>
                                 <th width="6%">取得方式</th>
                                 <th width="10%">文件</th>
                                 <th width="10%">操作</th>
@@ -1268,9 +1337,9 @@
                                         <input id="certificateList${varStatus.index}_filePath" name="certificateList[${varStatus.index}].filePath" type="hidden" value="${certificate.filePath}"/>
                                     </td>
                                     <td>
-                                        <select name="certificateList[${varStatus.index}].name" id="certificateList${varStatus.index}_name" class="form-control judgment">
+                                        <select name="certificateList[${varStatus.index}].name" id="certificateList${varStatus.index}_name" class="form-control judgment" onchange="nameChange(this)">
                                             <c:forEach items="${fns:getMainDictList('certificate_type')}" var="var">
-                                                <option value="${var.label}" <c:if test="${certificate.name eq var.label}">selected</c:if>>${var.label}</option>
+                                                <option value="${var.value}" <c:if test="${certificate.name eq var.value}">selected</c:if>>${var.label}</option>
                                             </c:forEach>
                                         </select>
                                     </td>
@@ -1293,15 +1362,12 @@
                                     </td>
                                     <td>
                                         <select name="certificateList[${varStatus.index}].major" id="certificateList${varStatus.index}_major" class="form-control judgment">
-                                            <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>
+                                                <%--<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" class="form-control" value="${certificate.grade}"/>
-                                    </td>
-                                    <td>
                                         <select name="certificateList[${varStatus.index}].issType" id="certificateList${varStatus.index}_issType" class="form-control">
                                             <option value="考试" <c:if test="${'考试' eq certificate.issType}">selected</c:if>>考试</option>
                                             <option value="考核" <c:if test="${'考核' eq certificate.issType}">selected</c:if>>考核</option>
@@ -1380,13 +1446,13 @@
                                 <input id="certificateList{{idx}}_filePath" name="certificateList[{{idx}}].filePath" type="hidden" value="{{row.filePath}}"/>
                                 </td>
                                 <td>
-                                <select name="certificateList[{{idx}}].name" id="certificateList{{idx}}_name" class="form-control judgment">
-                                <option value=""></option>
-                                <c:forEach items="${fns:getMainDictList('certificate_type')}" var="var">
-                                <option value="${var.label}">${var.label}</option>
-                            </c:forEach>
-                            </select>
-                            </td>
+                                    <select name="certificateList[{{idx}}].name" id="certificateList{{idx}}_name" class="form-control judgment" onchange="nameChange(this)">
+                                        <option value=""></option>
+                                        <c:forEach items="${fns:getMainDictList('certificate_type')}" var="var">
+                                            <option value="${var.value}">${var.label}</option>
+                                        </c:forEach>
+                                    </select>
+                                </td>
                             <td>
                             <input id="certificateList{{idx}}_num" name="certificateList[{{idx}}].num" class="form-control judgment" value="{{row.num}}"/>
                                 </td>
@@ -1406,15 +1472,12 @@
                                 </td>
                                 <td>
                                     <select name="certificateList[{{idx}}].major" id="certificateList{{idx}}_major" class="form-control judgment">
-                                        <c:forEach items="${fns:getMainDictList('certificate_major')}" var="var">
+                                        <%--<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>
+                                        </c:forEach>--%>
                                     </select>
                                 </td>
                                 <td>
-                                <input id="certificateList{{idx}}_grade" name="certificateList[{{idx}}].grade" class="form-control" value="{{row.grade}}"/>
-                                </td>
-                                <td>
                                 <select name="certificateList[{{idx}}].issType" id="certificateList{{idx}}_issType" class="form-control">
                                 <option value="考试" selected >考试</option>
                                 <option value="考核">考核</option>

+ 82 - 18
src/main/webapp/webpage/modules/workstaff/workStaffBasicDetailModify.jsp

@@ -79,6 +79,7 @@
 		$(document).ready(function() {
             layui.use(['form', 'layer'], function () {
                 var form = layui.form;
+
             });
 			validateForm = $("#inputForm").validate({
 				submitHandler: function(form){
@@ -113,7 +114,77 @@
                 });
             }
             cacuAge('${workStaffBasicInfo.idCard}','1');
-		});
+
+            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 + "major").append(new Option(data.data[info].label,data.data[info].value,true,true));
+                                    }else{
+                                        $("#" + prefix + "major").append(new Option(data.data[info].label,data.data[info].value));
+                                    }
+
+
+                                }
+                            }
+                        }
+                    })
+                }
+            }
+        });
+
+        function nameChange(obj){
+            console.log(obj)
+            console.log(obj.id)
+            let id = obj.id; // "certificateList0_name"
+            let prefix = id.substring(0, id.lastIndexOf('_') + 1);
+            console.log(prefix);
+            $("#" + prefix + "major")
+            if (obj.value == "") {
+                $("#" + prefix + "major").html('<option value=""></option>');
+            } else {
+                $("#" + prefix + "major").html('<option value=""></option>');
+                $.ajax({
+                    type:"post",
+                    url:'${ctx}/workstaff/workStaffBasicInfo/getMessage',
+                    data:{"type":obj.value},
+                    dataType:"json",
+                    async: false,
+                    success:function(data){
+                        if(data.success) {
+                            for (var info in data.data){
+                                if(info == 0){
+                                    $("#" + prefix + "major").append(new Option(data.data[info].label,data.data[info].value,true,true));
+                                }else{
+                                    $("#" + prefix + "major").append(new Option(data.data[info].label,data.data[info].value));
+                                }
+
+                            }
+                        }
+                    }
+                })
+                /*layui.form.render("select");*/
+            }
+        }
 	</script>
     <script type="text/javascript">
         //上传用户头像
@@ -1176,14 +1247,13 @@
                             <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%"><span class="require-item">*</span>专业</th>
                                 <th width="6%">取得方式</th>
                                 <th width="10%">文件</th>
                                 <th width="10%">操作</th>
@@ -1199,9 +1269,9 @@
                                         <input id="certificateList${varStatus.index}_filePath" name="certificateList[${varStatus.index}].filePath" type="hidden" value="${certificate.filePath}"/>
                                     </td>
                                     <td>
-                                        <select name="certificateList[${varStatus.index}].name" id="certificateList${varStatus.index}_name" class="form-control judgment">
+                                        <select name="certificateList[${varStatus.index}].name" id="certificateList${varStatus.index}_name" class="form-control judgment" onchange="nameChange(this)">
                                             <c:forEach items="${fns:getMainDictList('certificate_type')}" var="var">
-                                                <option value="${var.label}" <c:if test="${certificate.name eq var.label}">selected</c:if>>${var.label}</option>
+                                                <option value="${var.value}" <c:if test="${certificate.name eq var.value}">selected</c:if>>${var.label}</option>
                                             </c:forEach>
                                         </select>
                                     </td>
@@ -1224,15 +1294,12 @@
                                     </td>
                                     <td>
                                         <select name="certificateList[${varStatus.index}].major" id="certificateList${varStatus.index}_major" class="form-control judgment">
-                                            <c:forEach items="${fns:getMainDictList('certificate_major')}" var="var">
+                                            <%--<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>
+                                            </c:forEach>--%>
                                         </select>
                                     </td>
                                     <td>
-                                        <input id="certificateList${varStatus.index}_grade" name="certificateList[${varStatus.index}].grade" class="form-control" value="${certificate.grade}"/>
-                                    </td>
-                                    <td>
                                         <select name="certificateList[${varStatus.index}].issType" id="certificateList${varStatus.index}_issType" class="form-control">
                                             <option value="考试" <c:if test="${'考试' eq certificate.issType}">selected</c:if>>考试</option>
                                             <option value="考核" <c:if test="${'考核' eq certificate.issType}">selected</c:if>>考核</option>
@@ -1312,10 +1379,10 @@
                                 <input id="certificateList{{idx}}_filePath" name="certificateList[{{idx}}].filePath" type="hidden" value="{{row.filePath}}"/>
                                 </td>
                             <td>
-                                <select name="certificateList[{{idx}}].name" id="certificateList{{idx}}_name" class="form-control judgment">
+                                <select name="certificateList[{{idx}}].name" id="certificateList{{idx}}_name" class="form-control judgment" onchange="nameChange(this)">
                                     <option value=""></option>
                                     <c:forEach items="${fns:getMainDictList('certificate_type')}" var="var">
-                                        <option value="${var.label}">${var.label}</option>
+                                        <option value="${var.value}">${var.label}</option>
                                     </c:forEach>
                                 </select>
                             </td>
@@ -1338,15 +1405,12 @@
                                 </td>
                                 <td>
                                     <select name="certificateList[{{idx}}].major" id="certificateList{{idx}}_major" class="form-control judgment">
-                                        <c:forEach items="${fns:getMainDictList('certificate_major')}" var="var">
+                                        <%--<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>
+                                        </c:forEach>--%>
                                     </select>
                                 </td>
                                 <td>
-                                <input id="certificateList{{idx}}_grade" name="certificateList[{{idx}}].grade" class="form-control" value="{{row.grade}}"/>
-                                </td>
-                                <td>
                                 <select name="certificateList[{{idx}}].issType" id="certificateList{{idx}}_issType" class="form-control">
                                 <option value="考试" selected >考试</option>
                                 <option value="考核">考核</option>

+ 90 - 49
src/main/webapp/webpage/modules/workstaff/workStaffBasicDirectlyAudit.jsp

@@ -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, '&', '&amp;')}" />
+                                        <!-- 文件或图片展示区域 -->
+                                        <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>

File diff suppressed because it is too large
+ 235 - 37
src/main/webapp/webpage/modules/workstaff/workStaffBasicDirectlyModify.jsp


File diff suppressed because it is too large
+ 2642 - 0
src/main/webapp/webpage/modules/workstaff/workStaffBasicInfoEmploymentInForm.jsp


File diff suppressed because it is too large
+ 166 - 71
src/main/webapp/webpage/modules/workstaff/workStaffBasicInfoForm.jsp