You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

244 lines
11 KiB

  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2019-01-29 17:31
  5. * 描 述:教师信息管理
  6. */
  7. var acceptClick;
  8. var keyValue = request('keyValue');
  9. var isView = request('isView');
  10. if (!!keyValue) {
  11. NewEmpId = keyValue;
  12. }
  13. var isTeacher = request('isTeacher');
  14. var bootstrap = function ($, learun) {
  15. "use strict";
  16. var ue;
  17. var page = {
  18. init: function () {
  19. $('.lr-form-wrap').lrscroll();
  20. if (isView) {
  21. $.each($("[data-table=EmpInfo]"), function (i, item) {
  22. $(item).children('div,input').attr('readonly', 'readonly');
  23. });
  24. //选项卡显示证书信息、培训信息、
  25. $('.lr-form-tabs').find('li.showInViewLi').removeClass();
  26. }
  27. page.bind();
  28. page.initData();
  29. page.hide();
  30. },
  31. hide: function () {
  32. if (isTeacher == "1") {
  33. $("#EmpNo").parent().hide();
  34. //$("#EmpName").parent().hide();
  35. $("#F_CompanyId").parent().hide();
  36. $("#F_DepartmentId").parent().hide();
  37. $("#SpellBrief").parent().hide();
  38. //$("#IdentityCardNo").parent().hide();
  39. $("#ProvinceNo").parent().hide();
  40. $("#CityNo").parent().hide();
  41. $("#RegionNo").parent().hide();
  42. $("#LocusOfArchives").parent().hide();
  43. $("#OverseasChineseNo").parent().hide();
  44. $("#HealthStatusNo").parent().hide();
  45. $("#CultureDegreeNo").parent().hide();
  46. //$("#DegreeNo").parent().hide();
  47. $("#FamilyOriginNo").parent().hide();
  48. $("#GraduateSchoolName").parent().hide();
  49. $("#SubjectSpeciesNo").parent().hide();
  50. $("#ForeignLanguageNo").parent().hide();
  51. //$("#EmpSortNo").parent().hide();
  52. $("#EmpFullTimeNo").parent().hide();
  53. //$("#DeptNo").parent().hide();
  54. //$("#TitleOfTechPostNo").parent().hide();
  55. //$("#InSchoolDate").parent().hide();
  56. $("#resume").parent().hide();
  57. //$("#Photo").parent().hide();
  58. }
  59. },
  60. bind: function () {
  61. //选项卡
  62. $("#PM_EducationExperience").attr("src", "/EducationalAdministration/PM_EducationExperience/Index?empId=" + NewEmpId);
  63. $("#PM_TechnicalPost").attr("src", "/EducationalAdministration/PM_TechnicalPost/Index?empId=" + NewEmpId);
  64. //$("#PM_WorkerTechnology").attr("src", "/EducationalAdministration/PM_WorkerTechnology/Index?empId=" + NewEmpId);
  65. $("#PM_Resume").attr("src", "/EducationalAdministration/PM_Resume/Index?empId=" + NewEmpId);
  66. $("#PM_FamilySituation").attr("src", "/EducationalAdministration/PM_FamilySituation/Index?empId=" + NewEmpId);
  67. $("#TeacherCertificate").attr("src", "/PersonnelManagement/TeacherCertificate/Index?empId=" + NewEmpId);
  68. $("#TeacherTrain").attr("src", "/PersonnelManagement/TeacherTrain/Index?empId=" + NewEmpId);
  69. $('#lr_form_tabs').lrFormTab();
  70. $('#lr_form_tabs ul li').eq(0).trigger('click');
  71. //校区
  72. $('#F_CompanyId').lrDataSourceSelect({
  73. code: 'company', value: 'f_companyid', text: 'f_fullname',
  74. select: function (item) {
  75. if (!!item) {
  76. // 部门
  77. $('#F_DepartmentId').lrselectRefresh({
  78. type: 'tree',
  79. // 是否允许搜索
  80. allowSearch: true,
  81. // 访问数据接口地址
  82. url: top.$.rootUrl + '/LR_OrganizationModule/Department/GetTree',
  83. // 访问数据接口参数
  84. param: { companyId: item.f_companyid, parentId: '0' }
  85. });
  86. }
  87. }
  88. });
  89. $('#F_DepartmentId').lrselect({ allowSearch:true});
  90. $('#GenderNo').lrDataItemSelect({ code: 'usersexbit' });
  91. $('#IsHasLesson').lrDataItemSelect({ code: 'YesOrNoBit' });
  92. $('#NationalityNo').lrDataItemSelect({ code: 'National' });
  93. $('#PartyFaceNo').lrDataItemSelect({ code: 'PolityStatus' });
  94. $('#ProvinceNo').lrDataSourceSelect({
  95. code: 'DIC_PROVINCE', value: 'pcode', text: 'pname',
  96. select: function (item) {
  97. if (!!item) {
  98. $('#CityNo').lrselectRefresh({
  99. url: "/DIC_CITY/GetListByProvinceCode",
  100. param: { ProvinceCode: item.pcode },
  101. value: 'CCODE',
  102. text: 'CNAME'
  103. });
  104. $('#RegionNo').lrselectRefresh({
  105. url: "",
  106. data: []
  107. });
  108. }
  109. }
  110. });
  111. $('#CityNo').lrselect({
  112. select: function (item) {
  113. if (!!item) {
  114. $('#RegionNo').lrselectRefresh({
  115. url: top.$.rootUrl + "/DIC_AREA/GetAreasListByCityCode",
  116. param: { cityCode: item.CCODE },
  117. value: 'ACODE',
  118. text: 'ANAME'
  119. });
  120. }
  121. }
  122. });
  123. $('#RegionNo').lrselect();
  124. $('#OverseasChineseNo').lrDataItemSelect({ code: 'BCdOverseasChinese', allowSearch: true });
  125. $('#HealthStatusNo').lrDataItemSelect({ code: 'BCdHealthStatus', allowSearch: true });
  126. //初始学历
  127. $('#CultureDegreeNo').lrDataItemSelect({ code: 'RecordInSchool', allowSearch: true });
  128. $('#DegreeNo').lrDataItemSelect({ code: 'DegreeInSchool', allowSearch: true });
  129. $('#FamilyOriginNo').lrDataItemSelect({ code: 'BCdFamilyOrigin', allowSearch: true });
  130. $('#SubjectSpeciesNo').lrDataItemSelect({ code: 'BCdSubjectSpecies', allowSearch: true });
  131. $('#ForeignLanguageNo').lrDataItemSelect({ code: 'BCdForeignLanguage', allowSearch: true });
  132. $('#EmpSortNo').lrDataItemSelect({ code: 'jsgw' });
  133. $('#EmpFullTimeNo').lrDataItemSelect({ code: 'EmpFullTime' });
  134. //$('#ObtainWay').lrDataItemSelect({ code: 'ObtainWay' });
  135. //$('#DeptNo').lrDataSourceSelect({ code: 'CdDeptInfo', value: 'deptno', text: 'deptname' });
  136. $('#PostRank').lrDataItemSelect({ code: 'BCdTitleOfTechPost', allowSearch: true });
  137. $('#Photo').lrUploader();
  138. //$('#HighestRecord').lrDataSourceSelect({ code: 'BCdCultureDegree', value: 'culturedegreeno', text: 'culturedegree' });
  139. $('#HighestRecord').lrDataItemSelect({ code: 'RecordInSchool'});
  140. //$('#ObtainWayOfHighestRecord').lrDataItemSelect({ code: 'ObtainWay' });
  141. $('#ObtainWayOfHighestRecord').lrDataItemSelect({ code: 'ObtainWayOfDegree' });
  142. $('#InitialDegree').lrDataItemSelect({ code: 'DegreeInSchool'});
  143. $('#ObtainWayOfInitialDegree').lrDataItemSelect({ code: 'ObtainWayOfDegree' });
  144. $('#ObtainWayOfHighestDegree').lrDataItemSelect({ code: 'ObtainWayOfDegree' });
  145. //$('#PositionLevel').lrDataItemSelect({ code: 'PositionLevel' });
  146. $('#JobRank').lrDataItemSelect({ code: 'JobGrade' });//TechnicalPost
  147. $('#WorkLevel').lrDataItemSelect({ code: 'TechnicalLevelOfWorker' });
  148. $('#CompilationCategory').lrDataItemSelect({ code: 'CompilationCategory' });
  149. $('#IsInActiveStatus').lrDataItemSelect({ code: 'JobStatus' });
  150. $('#ProfessionalTitle').lrDataItemSelect({ code: 'jszc' });
  151. //$('#ProfessionalTitleLevel').lrDataItemSelect({ code: 'TeacherTitlePostLevel' });
  152. //内容编辑器
  153. ue = UE.getEditor('editor');
  154. //监听身份证号,绑定出生日期
  155. $("#IdentityCardNo").blur(function () {
  156. var cardNo = $(this).val().trim();
  157. if (cardNo) {
  158. var date = cardNo.slice(6, 10) + "-" + cardNo.slice(10, 12) + "-" + cardNo.slice(12, 14);
  159. $("#Birthday").val(date);
  160. }
  161. });
  162. $('#lr_print').on('click',function() {
  163. $('#tab1').print();
  164. })
  165. },
  166. initData: function () {
  167. if (!!keyValue) {
  168. $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/EmpInfo/GetFormData?keyValue=' + keyValue, function (data) {
  169. for (var id in data) {
  170. if (!!data[id].length && data[id].length > 0) {
  171. $('#' + id).jfGridSet('refreshdata', data[id]);
  172. console.log(2);
  173. }
  174. else {
  175. $('[data-table="' + id + '"]').lrSetFormData(data[id]);
  176. }
  177. ue.ready(function () {
  178. ue.setContent(data[id].resume);
  179. });
  180. }
  181. $("#EmpNo").attr("disabled", "disabled");
  182. });
  183. }
  184. }
  185. };
  186. // 保存数据
  187. acceptClick = function (callBack) {
  188. if (!$('body').lrValidform()) {
  189. return false;
  190. }
  191. var postData = $('body').lrGetFormData();
  192. postData["resume"] = ue.getContent(null, null, true);
  193. postData["EmpId"] = NewEmpId;
  194. var postDatas = {
  195. strEntity: JSON.stringify(postData)
  196. };
  197. //姓名重复提示
  198. var EmpName = $('#EmpName').val();
  199. $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/EmpInfo/GetEmpInfoEntitiesByEmpName?empName=' + EmpName, function (data) {
  200. if (!!data.length && data.length > 0) {
  201. var num = data.length;
  202. if (!!keyValue) {
  203. for (var i = 0; i < data.length; i++) {
  204. if (data[i].EmpId == keyValue) {
  205. num = num - 1;
  206. break;
  207. }
  208. }
  209. }
  210. if (num > 0) {
  211. learun.layerConfirm('系统中姓名为' + EmpName + '的教师已经有' + num + '名,是否确认保存?', function (res) {
  212. if (res) {
  213. $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/EmpInfo/SaveForm?keyValue=' + keyValue, postDatas, function (res) {
  214. // 保存成功后才回调
  215. if (!!callBack) {
  216. callBack();
  217. }
  218. });
  219. }
  220. });
  221. return;
  222. }
  223. }
  224. $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/EmpInfo/SaveForm?keyValue=' + keyValue, postDatas, function (res) {
  225. // 保存成功后才回调
  226. if (!!callBack) {
  227. callBack();
  228. }
  229. });
  230. });
  231. };
  232. page.init();
  233. }