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.
 
 
 
 
 
 

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