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.

FormModify.js 9.3 KiB

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