Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 
 
 

241 строка
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: 'BCdPartyFace' });
  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: 'CollegeType', allowSearch: true });
  128. $('#DegreeNo').lrDataItemSelect({ code: 'BCdDegree', 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. $('#ObtainWayOfHighestRecord').lrDataItemSelect({ code: 'ObtainWay' });
  140. $('#InitialDegree').lrDataItemSelect({ code: 'BCdDegree', allowSearch: true });
  141. $('#ObtainWayOfInitialDegree').lrDataItemSelect({ code: 'ObtainWayOfDegree' });
  142. $('#ObtainWayOfHighestDegree').lrDataItemSelect({ code: 'ObtainWayOfDegree' });
  143. $('#PositionLevel').lrDataItemSelect({ code: 'PositionLevel' });
  144. $('#JobRank').lrDataItemSelect({ code: 'TechnicalPost' });
  145. $('#WorkLevel').lrDataItemSelect({ code: 'TechnicalLevelOfWorker' });
  146. $('#CompilationCategory').lrDataItemSelect({ code: 'CompilationCategory' });
  147. $('#IsInActiveStatus').lrDataItemSelect({ code: 'JobStatus' });
  148. $('#ProfessionalTitle').lrDataItemSelect({ code: 'jszc' });
  149. $('#ProfessionalTitleLevel').lrDataItemSelect({ code: 'TeacherTitlePostLevel' });
  150. //内容编辑器
  151. ue = UE.getEditor('editor');
  152. //监听身份证号,绑定出生日期
  153. $("#IdentityCardNo").blur(function () {
  154. var cardNo = $(this).val().trim();
  155. if (cardNo) {
  156. var date = cardNo.slice(6, 10) + "-" + cardNo.slice(10, 12) + "-" + cardNo.slice(12, 14);
  157. $("#Birthday").val(date);
  158. }
  159. });
  160. $('#lr_print').on('click',function() {
  161. $('#tab1').print();
  162. })
  163. },
  164. initData: function () {
  165. if (!!keyValue) {
  166. $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/EmpInfo/GetFormData?keyValue=' + keyValue, function (data) {
  167. for (var id in data) {
  168. if (!!data[id].length && data[id].length > 0) {
  169. $('#' + id).jfGridSet('refreshdata', data[id]);
  170. console.log(2);
  171. }
  172. else {
  173. $('[data-table="' + id + '"]').lrSetFormData(data[id]);
  174. }
  175. ue.ready(function () {
  176. ue.setContent(data[id].resume);
  177. });
  178. }
  179. $("#EmpNo").attr("disabled", "disabled");
  180. });
  181. }
  182. }
  183. };
  184. // 保存数据
  185. acceptClick = function (callBack) {
  186. if (!$('body').lrValidform()) {
  187. return false;
  188. }
  189. var postData = $('body').lrGetFormData();
  190. postData["resume"] = ue.getContent(null, null, true);
  191. postData["EmpId"] = NewEmpId;
  192. var postDatas = {
  193. strEntity: JSON.stringify(postData)
  194. };
  195. //姓名重复提示
  196. var EmpName = $('#EmpName').val();
  197. $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/EmpInfo/GetEmpInfoEntitiesByEmpName?empName=' + EmpName, function (data) {
  198. if (!!data.length && data.length > 0) {
  199. var num = data.length;
  200. if (!!keyValue) {
  201. for (var i = 0; i < data.length; i++) {
  202. if (data[i].EmpId == keyValue) {
  203. num = num - 1;
  204. break;
  205. }
  206. }
  207. }
  208. if (num > 0) {
  209. learun.layerConfirm('系统中姓名为' + EmpName + '的教师已经有' + num + '名,是否确认保存?', function (res) {
  210. if (res) {
  211. $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/EmpInfo/SaveForm?keyValue=' + keyValue, postDatas, function (res) {
  212. // 保存成功后才回调
  213. if (!!callBack) {
  214. callBack();
  215. }
  216. });
  217. }
  218. });
  219. return;
  220. }
  221. }
  222. $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/EmpInfo/SaveForm?keyValue=' + keyValue, postDatas, function (res) {
  223. // 保存成功后才回调
  224. if (!!callBack) {
  225. callBack();
  226. }
  227. });
  228. });
  229. };
  230. page.init();
  231. }