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.
 
 
 
 
 
 

173 lines
8.3 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 isTeacher = request('isTeacher');
  10. var colDataItemArr = ['OverseasChineseNo', 'FamilyOriginNo', 'HealthStatusNo', 'PartyFaceNo', 'NationalityNo', 'GenderNo', 'IsInActiveStatus', 'CompilationCategory', 'HighestRecord', 'ObtainWayOfHighestRecord', 'CultureDegreeNo', 'DegreeNo', 'ObtainWayOfHighestDegree', 'InitialDegree', 'ObtainWayOfInitialDegree', 'JobRank', 'WorkLevel', 'EmpFullTimeNo', 'IsHasLesson', 'SubjectSpeciesNo','ForeignLanguageNo'];
  11. var colDataItemCode = ['BCdOverseasChinese', 'BCdFamilyOrigin', 'BCdHealthStatus', 'PolityStatus', 'National', 'usersexbit', 'JobStatus', 'CompilationCategory', 'RecordInSchool', 'ObtainWayOfDegree', 'RecordInSchool', 'DegreeInSchool', 'ObtainWayOfDegree', 'DegreeInSchool', 'ObtainWayOfDegree', 'TechnicalPost', 'TechnicalLevelOfWorker', 'EmpFullTime', 'YesOrNoBit', 'BCdSubjectSpecies','BCdForeignLanguage'];
  12. var colDataSourceArr = [ 'F_CompanyId', 'F_DepartmentId'];
  13. var colDataSourceCode = ['company', 'classdata'];
  14. var colDataSourceValue = [ 'f_companyid', 'f_departmentid'];
  15. var colDataSourceText = ['f_fullname', 'f_fullname'];
  16. var bootstrap = function ($, learun) {
  17. "use strict";
  18. var ue;
  19. var page = {
  20. init: function () {
  21. $('.lr-form-wrap').lrscroll();
  22. page.bind();
  23. page.initData();
  24. page.hide();
  25. },
  26. hide: function () {
  27. if (isTeacher == "1") {
  28. $("#EmpNo").parent().hide();
  29. //$("#EmpName").parent().hide();
  30. $("#F_CompanyId").parent().hide();
  31. $("#F_DepartmentId").parent().hide();
  32. $("#SpellBrief").parent().hide();
  33. $("#IdentityCardNo").parent().hide();
  34. $("#ProvinceNo").parent().hide();
  35. $("#CityNo").parent().hide();
  36. $("#RegionNo").parent().hide();
  37. $("#LocusOfArchives").parent().hide();
  38. $("#OverseasChineseNo").parent().hide();
  39. $("#HealthStatusNo").parent().hide();
  40. $("#CultureDegreeNo").parent().hide();
  41. $("#DegreeNo").parent().hide();
  42. $("#FamilyOriginNo").parent().hide();
  43. $("#GraduateSchoolName").parent().hide();
  44. $("#SubjectSpeciesNo").parent().hide();
  45. $("#ForeignLanguageNo").parent().hide();
  46. $("#EmpFullTimeNo").parent().hide();
  47. $("#resume").parent().hide();
  48. $("#Photo").parent().hide();
  49. }
  50. },
  51. bind: function () {
  52. // 显示信息选项卡
  53. $('#tablist').lrFormTabEx();
  54. $('#tablist li').eq(0).trigger('click');
  55. $('#ProvinceNo').lrDataSourceSelect({
  56. code: 'DIC_PROVINCE', value: 'pcode', text: 'pname',
  57. select: function (item) {
  58. if (!!item) {
  59. $('#CityNo').lrselectRefresh({
  60. url: "/DIC_CITY/GetListByProvinceCode",
  61. param: { ProvinceCode: item.pcode },
  62. value: 'CCODE',
  63. text: 'CNAME'
  64. });
  65. $('#RegionNo').lrselectRefresh({
  66. url: "",
  67. data: []
  68. });
  69. }
  70. }
  71. });
  72. $('#CityNo').lrselect({
  73. select: function (item) {
  74. if (!!item) {
  75. $('#RegionNo').lrselectRefresh({
  76. url: top.$.rootUrl + "/DIC_AREA/GetAreasListByCityCode",
  77. param: { cityCode: item.CCODE },
  78. value: 'ACODE',
  79. text: 'ANAME'
  80. });
  81. }
  82. }
  83. });
  84. $('#RegionNo').lrselect();
  85. $('#Photo').lrUploader();
  86. //内容编辑器
  87. ue = UE.getEditor('editor');
  88. //监听身份证号,绑定出生日期
  89. //$("#IdentityCardNo").blur(function () {
  90. // var cardNo = $(this).val().trim();
  91. // if (cardNo) {
  92. // var date = cardNo.slice(6, 10) + "-" + cardNo.slice(10, 12) + "-" + cardNo.slice(12, 14);
  93. // $("#Birthday").val(date);
  94. // }
  95. //});
  96. //提交
  97. $('#lr_save_btn').on('click', function () {
  98. if (!$('body').lrValidform()) {
  99. return false;
  100. }
  101. var postData = $('body').lrGetFormData();
  102. postData["resume"] = ue.getContent(null, null, true);
  103. var postDatas = {
  104. strEntity: JSON.stringify(postData)
  105. };
  106. $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/EmpInfo/SaveFormModify?keyValue=' + keyValue, postDatas, function (res) {
  107. if (res.code == 200) {
  108. window.location.href = top.$.rootUrl + "/UserCenter/IndexInTeacher";
  109. }
  110. });
  111. return false;
  112. });
  113. //返回
  114. $('#lr_back_btn').on('click', function () {
  115. window.location.href = top.$.rootUrl + "/UserCenter/IndexInTeacher";
  116. });
  117. },
  118. initData: function () {
  119. if (!!keyValue) {
  120. $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/EmpInfo/GetFormData?keyValue=' + keyValue, function (data) {
  121. for (var id in data) {
  122. if (!!data[id].length && data[id].length > 0) {
  123. $('#' + id).jfGridSet('refreshdata', data[id]);
  124. }
  125. else {
  126. $('[data-table="' + id + '"]').lrSetFormData(data[id]);
  127. }
  128. ue.ready(function () {
  129. ue.setContent(data[id].resume);
  130. });
  131. //赋值
  132. $.each(data[id], function (key, value) {
  133. var dom = $('#' + key)[0];
  134. if (dom) {
  135. if (dom.tagName.toLowerCase() == "span") {
  136. $('#' + key).html(value);
  137. //数据字典
  138. if ($.inArray(key, colDataItemArr) >= 0) {
  139. learun.clientdata.getAsync('dataItem', {
  140. code: colDataItemCode[$.inArray(key, colDataItemArr)],
  141. key: '' + value + '',
  142. callback: function (data, op) {
  143. $('#' + key).html(data.text);
  144. }
  145. });
  146. }
  147. //数据源
  148. if ($.inArray(key, colDataSourceArr) >= 0) {
  149. learun.clientdata.getAsync('custmerData', {
  150. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + colDataSourceCode[$.inArray(key, colDataSourceArr)],
  151. key: value,
  152. keyId: colDataSourceValue[$.inArray(key, colDataSourceArr)],
  153. callback: function (data) {
  154. var txt = data['' + colDataSourceText[$.inArray(key, colDataSourceArr)] + ''];
  155. $('#' + key).html(txt).attr('title', txt);
  156. }
  157. });
  158. }
  159. }
  160. }
  161. });
  162. }
  163. });
  164. }
  165. }
  166. };
  167. page.init();
  168. }