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.
 
 
 
 
 
 

221 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. if (!!keyValue) {
  10. NewEmpId = keyValue;
  11. }
  12. //console.log("keyValue:" + keyValue + " NewEmpId:" + NewEmpId);
  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. page.bind();
  21. page.initData();
  22. page.hide();
  23. },
  24. hide: function () {
  25. if (isTeacher == "1") {
  26. $("#EmpNo").parent().hide();
  27. //$("#EmpName").parent().hide();
  28. $("#F_CompanyId").parent().hide();
  29. $("#F_DepartmentId").parent().hide();
  30. $("#SpellBrief").parent().hide();
  31. //$("#IdentityCardNo").parent().hide();
  32. $("#ProvinceNo").parent().hide();
  33. $("#CityNo").parent().hide();
  34. $("#RegionNo").parent().hide();
  35. $("#LocusOfArchives").parent().hide();
  36. $("#OverseasChineseNo").parent().hide();
  37. $("#HealthStatusNo").parent().hide();
  38. $("#CultureDegreeNo").parent().hide();
  39. //$("#DegreeNo").parent().hide();
  40. $("#FamilyOriginNo").parent().hide();
  41. $("#GraduateSchoolName").parent().hide();
  42. $("#SubjectSpeciesNo").parent().hide();
  43. $("#ForeignLanguageNo").parent().hide();
  44. $("#EmpSortNo").parent().hide();
  45. $("#EmpFullTimeNo").parent().hide();
  46. $("#DeptNo").parent().hide();
  47. $("#TitleOfTechPostNo").parent().hide();
  48. $("#InSchoolDate").parent().hide();
  49. $("#resume").parent().hide();
  50. //$("#Photo").parent().hide();
  51. }
  52. },
  53. bind: function () {
  54. //选项卡
  55. $("#PM_EducationExperience").attr("src", "/EducationalAdministration/PM_EducationExperience/Index?empId=" + NewEmpId);
  56. $("#PM_TechnicalPost").attr("src", "/EducationalAdministration/PM_TechnicalPost/Index?empId=" + NewEmpId);
  57. $("#PM_WorkerTechnology").attr("src", "/EducationalAdministration/PM_WorkerTechnology/Index?empId=" + NewEmpId);
  58. $("#PM_Resume").attr("src", "/EducationalAdministration/PM_Resume/Index?empId=" + NewEmpId);
  59. $("#PM_FamilySituation").attr("src", "/EducationalAdministration/PM_FamilySituation/Index?empId=" + NewEmpId);
  60. $('#lr_form_tabs').lrFormTab();
  61. $('#lr_form_tabs ul li').eq(0).trigger('click');
  62. //校区
  63. $('#F_CompanyId').lrDataSourceSelect({
  64. code: 'company', value: 'f_companyid', text: 'f_fullname',
  65. select: function (item) {
  66. if (!!item) {
  67. // 部门
  68. $('#F_DepartmentId').lrselectRefresh({
  69. type: 'tree',
  70. // 是否允许搜索
  71. allowSearch: true,
  72. // 访问数据接口地址
  73. url: top.$.rootUrl + '/LR_OrganizationModule/Department/GetTree',
  74. // 访问数据接口参数
  75. param: { companyId: item.f_companyid, parentId: '0' }
  76. });
  77. }
  78. }
  79. });
  80. $('#F_DepartmentId').lrselect();
  81. $('#GenderNo').lrDataItemSelect({ code: 'usersexbit' });
  82. $('#IsHasLesson').lrDataItemSelect({ code: 'YesOrNoBit' });
  83. $('#NationalityNo').lrDataSourceSelect({ code: 'BCdNationality', value: 'nationalityno', text: 'nationality' });
  84. $('#PartyFaceNo').lrDataSourceSelect({ code: 'BCdPartyFace', value: 'partyfaceno', text: 'partyface' });
  85. $('#ProvinceNo').lrDataSourceSelect({
  86. code: 'DIC_PROVINCE', value: 'pcode', text: 'pname',
  87. select: function (item) {
  88. if (!!item) {
  89. $('#CityNo').lrselectRefresh({
  90. url: "/DIC_CITY/GetListByProvinceCode",
  91. param: { ProvinceCode: item.pcode },
  92. value: 'CCODE',
  93. text: 'CNAME'
  94. });
  95. $('#RegionNo').lrselectRefresh({
  96. url: "",
  97. data: []
  98. });
  99. }
  100. }
  101. });
  102. $('#CityNo').lrselect({
  103. select: function (item) {
  104. if (!!item) {
  105. $('#RegionNo').lrselectRefresh({
  106. url: top.$.rootUrl + "/DIC_AREA/GetAreasListByCityCode",
  107. param: { cityCode: item.CCODE },
  108. value: 'ACODE',
  109. text: 'ANAME'
  110. });
  111. }
  112. }
  113. });
  114. $('#RegionNo').lrselect();
  115. $('#OverseasChineseNo').lrDataSourceSelect({ code: 'BCdOverseasChinese', value: 'overseaschineseno', text: 'overseaschinesename' });
  116. $('#HealthStatusNo').lrDataSourceSelect({ code: 'BCdHealthStatus', value: 'healthstatusno', text: 'healthstatus' });
  117. $('#CultureDegreeNo').lrDataSourceSelect({ code: 'BCdCultureDegree', value: 'culturedegreeno', text: 'culturedegree' });
  118. $('#DegreeNo').lrDataSourceSelect({ code: 'BCdDegree', value: 'degreeno', text: 'degreename' });
  119. $('#FamilyOriginNo').lrDataSourceSelect({ code: 'BCdFamilyOrigin', value: 'familyoriginno', text: 'familyorigin' });
  120. $('#SubjectSpeciesNo').lrDataSourceSelect({ code: 'BCdSubjectSpecies', value: 'subjectspeciesno', text: 'subjectspecies' });
  121. $('#ForeignLanguageNo').lrDataSourceSelect({ code: 'BCdForeignLanguage', value: 'foreignlanguageno', text: 'foreignlanguagename' });
  122. $('#EmpSortNo').lrDataItemSelect({ code: 'jsgw' });
  123. $('#EmpFullTimeNo').lrDataItemSelect({ code: 'EmpFullTime' });
  124. $('#ObtainWay').lrDataItemSelect({ code: 'ObtainWay' });
  125. $('#DeptNo').lrDataSourceSelect({ code: 'CdDeptInfo', value: 'deptno', text: 'deptname' });
  126. $('#PostRank').lrDataSourceSelect({ code: 'BCdTitleOfTechPost', value: 'titleoftechpostno', text: 'titleoftechpost' });
  127. $('#Photo').lrUploader();
  128. $('#HighestRecord').lrDataSourceSelect({ code: 'BCdCultureDegree', value: 'culturedegreeno', text: 'culturedegree' });
  129. $('#ObtainWayOfHighestRecord').lrDataItemSelect({ code: 'ObtainWay' });
  130. $('#InitialDegree').lrDataSourceSelect({ code: 'BCdDegree', value: 'degreeno', text: 'degreename' });
  131. $('#ObtainWayOfInitialDegree').lrDataItemSelect({ code: 'ObtainWayOfDegree' });
  132. $('#ObtainWayOfHighestDegree').lrDataItemSelect({ code: 'ObtainWayOfDegree' });
  133. $('#PositionLevel').lrDataItemSelect({ code: 'PositionLevel' });
  134. $('#JobRank').lrDataItemSelect({ code: 'TechnicalPost' });
  135. $('#WorkLevel').lrDataItemSelect({ code: 'TechnicalLevelOfWorker' });
  136. $('#CompilationCategory').lrDataItemSelect({ code: 'CompilationCategory' });
  137. $('#IsInActiveStatus').lrDataItemSelect({ code: 'JobStatus' });
  138. //内容编辑器
  139. ue = UE.getEditor('editor');
  140. //监听身份证号,绑定出生日期
  141. $("#IdentityCardNo").blur(function () {
  142. var cardNo = $(this).val().trim();
  143. if (cardNo) {
  144. var date = cardNo.slice(6, 10) + "-" + cardNo.slice(10, 12) + "-" + cardNo.slice(12, 14);
  145. $("#Birthday").val(date);
  146. }
  147. });
  148. },
  149. initData: function () {
  150. if (!!keyValue) {
  151. $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/EmpInfo/GetFormData?keyValue=' + keyValue, function (data) {
  152. for (var id in data) {
  153. if (!!data[id].length && data[id].length > 0) {
  154. $('#' + id).jfGridSet('refreshdata', data[id]);
  155. }
  156. else {
  157. $('[data-table="' + id + '"]').lrSetFormData(data[id]);
  158. }
  159. ue.ready(function () {
  160. ue.setContent(data[id].resume);
  161. });
  162. }
  163. $("#EmpNo").attr("disabled", "disabled");
  164. });
  165. }
  166. }
  167. };
  168. // 保存数据
  169. acceptClick = function (callBack) {
  170. if (!$('body').lrValidform()) {
  171. return false;
  172. }
  173. var postData = $('body').lrGetFormData();
  174. postData["resume"] = ue.getContent(null, null, true);
  175. postData["EmpId"] = NewEmpId;
  176. var postDatas = {
  177. strEntity: JSON.stringify(postData)
  178. };
  179. //姓名重复提示
  180. var EmpName = $('#EmpName').val();
  181. $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/EmpInfo/GetEmpInfoEntitiesByEmpName?empName=' + EmpName, function (data) {
  182. if (!!data.length && data.length > 0) {
  183. var num = data.length;
  184. if (!!keyValue) {
  185. for (var i = 0; i < data.length; i++) {
  186. if (data[i].EmpId == keyValue) {
  187. num = num - 1;
  188. break;
  189. }
  190. }
  191. }
  192. if (num > 0) {
  193. learun.layerConfirm('系统中姓名为' + EmpName + '的教师已经有' + num + '名,是否确认保存?', function (res) {
  194. if (res) {
  195. $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/EmpInfo/SaveForm?keyValue=' + keyValue, postDatas, function (res) {
  196. // 保存成功后才回调
  197. if (!!callBack) {
  198. callBack();
  199. }
  200. });
  201. }
  202. });
  203. return;
  204. }
  205. }
  206. $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/EmpInfo/SaveForm?keyValue=' + keyValue, postDatas, function (res) {
  207. // 保存成功后才回调
  208. if (!!callBack) {
  209. callBack();
  210. }
  211. });
  212. });
  213. };
  214. page.init();
  215. }