educationSchool_select.js 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /**
  2. * 初始化子女就学详情对话框
  3. */
  4. var EducationSchoolInfoDlg = {
  5. educationSchoolInfoData : {},
  6. };
  7. /**
  8. * 申报人变更
  9. * @param content
  10. */
  11. EducationSchoolInfoDlg.nameChange = function(content){
  12. var talentId = $(content).val();
  13. if(Feng.isEmptyStr(talentId)){
  14. $("#talentId,#pSex,#pIdcard,#talentArrange,#certificateNo,#nativePlace").val("");
  15. return ;
  16. }
  17. var ajax = new $ax(Feng.ctxPath + "/api/talentInfo/detail/"+talentId, function(data){
  18. $("#pName").val(data.name);
  19. $("#pSex").val(data.sex);
  20. $("#pIdcard").val(data.idCard);
  21. $("#talentArrange").val(data.talentArrange);
  22. $("#certificateNo").val(data.certificateNO);
  23. $("#nativePlace").val(data.provinceName+data.cityName+data.countyName);
  24. $("#address").val(data.streetName);
  25. $("#phone").val(data.phone);
  26. },function(data){
  27. Feng.error("查询失败!" + data.responseJSON.message + "!");
  28. });
  29. ajax.start();
  30. }
  31. /**
  32. * 项目选择变更
  33. * @param content
  34. */
  35. EducationSchoolInfoDlg.projectChange = function(content){
  36. var project = $(content).val();
  37. if(Feng.isEmptyStr(project)){
  38. $("#applySchool").val("").parent().css("display","none");
  39. }
  40. if(project == CONFIG.education_school){
  41. $("#applySchool").val("").parent().css("display","block");
  42. }
  43. if(project == CONFIG.education_score){
  44. $("#applySchool").val("").parent().css("display","none");
  45. }
  46. }
  47. $(function() {
  48. Feng.initValidatorTip("educationSchoolForm",EducationSchoolInfoDlg.validateFields);
  49. //批量加载字典表数据
  50. var arr = [
  51. {"name":"companyStreet","code":"un_street"},
  52. {"name":"houseStreet","code":"un_street"},
  53. {"name":"talentArrange","code":"un_talentLevel"},
  54. {"name":"cRelation","code":"un_education_relation"},
  55. {"name":"nowGrade","code":"un_grade"},
  56. {"name":"project","code":"un_educationSchool_project"},
  57. {"name":"applySchool","code":"un_school_pool"}];
  58. Feng.findChildDictBatch(JSON.stringify(arr));
  59. $("#applySchool").on('chosen:ready', function(e, params) {
  60. $(".chosen-container-single .chosen-single").css("padding","4px 0px 0px 4px");
  61. });
  62. $("#applySchool").chosen({
  63. search_contains:true,    //关键字模糊搜索。设置为true,只要选项包含搜索词就会显示;设置为false,则要求从选项开头开始匹配
  64. disable_search: false,
  65. width:"100%",
  66. enable_split_word_search: true
  67. });
  68. $("select").each(function () {
  69. $(this).val($(this).attr("value")).trigger("change").trigger("chosen:updated");
  70. });
  71. var id = $("#id").val();
  72. if(Feng.isNotEmptyStr(id)){
  73. $("#fileLi").removeAttr("style");
  74. Feng.getCheckLog("logTable",{"type":CONFIG.project_school,"mainId":id,"typeFileId":"","active":1})
  75. }else{
  76. $("#fileLi").attr("style","pointer-events: none");
  77. }
  78. });