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.
 
 
 
 
 
 

277 lines
12 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. $("#SalaryNumber").parent().hide();
  56. //$("#Photo").parent().hide();
  57. }
  58. },
  59. bind: function () {
  60. //选项卡
  61. $("#PM_EducationExperience").attr("src", "/EducationalAdministration/PM_EducationExperience/Index?empId=" + NewEmpId);
  62. $("#PM_TechnicalPost").attr("src", "/EducationalAdministration/PM_TechnicalPost/Index?empId=" + NewEmpId);
  63. $("#PM_WorkerTechnology").attr("src", "/EducationalAdministration/PM_WorkerTechnology/Index?empId=" + NewEmpId);
  64. $("#PM_Resume").attr("src", "/EducationalAdministration/PM_Resume/Index?empId=" + NewEmpId);
  65. $("#PM_FamilySituation").attr("src", "/EducationalAdministration/PM_FamilySituation/Index?empId=" + NewEmpId);
  66. $('#lr_form_tabs').lrFormTab();
  67. $('#lr_form_tabs ul li').eq(0).trigger('click');
  68. //校区
  69. $('#F_CompanyId').lrDataSourceSelect({
  70. code: 'company', value: 'f_companyid', text: 'f_fullname',
  71. select: function (item) {
  72. if (!!item) {
  73. // 部门
  74. $('#F_DepartmentId').lrselectRefresh({
  75. type: 'tree',
  76. // 是否允许搜索
  77. allowSearch: true,
  78. // 访问数据接口地址
  79. url: top.$.rootUrl + '/LR_OrganizationModule/Department/GetTreeNoCheck',
  80. // 访问数据接口参数
  81. param: { companyId: item.f_companyid, parentId: '0' }
  82. });
  83. }
  84. }
  85. });
  86. $('#F_DepartmentId').lrselect();
  87. $('#GenderNo').lrDataItemSelect({ code: 'usersexbit' });
  88. $('#IsHasLesson').lrDataItemSelect({ code: 'YesOrNoBit' });
  89. $('#NationalityNo').lrDataItemSelect({ code: 'National' });
  90. $('#PartyFaceNo').lrDataItemSelect({ code: 'PolityStatus' });
  91. $('#ProvinceNo').lrDataSourceSelect({
  92. code: 'DIC_PROVINCE', value: 'pcode', text: 'pname',
  93. select: function (item) {
  94. if (!!item) {
  95. $('#CityNo').lrselectRefresh({
  96. url: "/DIC_CITY/GetListByProvinceCode",
  97. param: { ProvinceCode: item.pcode },
  98. value: 'CCODE',
  99. text: 'CNAME'
  100. });
  101. $('#RegionNo').lrselectRefresh({
  102. url: "",
  103. data: []
  104. });
  105. }
  106. }
  107. });
  108. $('#CityNo').lrselect({
  109. select: function (item) {
  110. if (!!item) {
  111. $('#RegionNo').lrselectRefresh({
  112. url: top.$.rootUrl + "/DIC_AREA/GetAreasListByCityCode",
  113. param: { cityCode: item.CCODE },
  114. value: 'ACODE',
  115. text: 'ANAME'
  116. });
  117. }
  118. }
  119. });
  120. $('#RegionNo').lrselect();
  121. $('#OverseasChineseNo').lrDataItemSelect({ code: 'BCdOverseasChinese', allowSearch: true });
  122. $('#HealthStatusNo').lrDataItemSelect({ code: 'BCdHealthStatus', allowSearch: true });
  123. //初始学历
  124. $('#CultureDegreeNo').lrDataItemSelect({ code: 'CollegeType', allowSearch: true });
  125. $('#DegreeNo').lrDataItemSelect({ code: 'BCdDegree', allowSearch: true });
  126. $('#FamilyOriginNo').lrDataItemSelect({ code: 'BCdFamilyOrigin', allowSearch: true });
  127. $('#SubjectSpeciesNo').lrDataItemSelect({ code: 'SubjectSpecies', allowSearch: true });
  128. $('#ForeignLanguageNo').lrDataItemSelect({ code: 'BCdForeignLanguage', allowSearch: true });
  129. $('#EmpSortNo').lrDataItemSelect({ code: 'jsgw' });
  130. $('#EmpFullTimeNo').lrDataItemSelect({ code: 'EmpFullTime' });
  131. $('#ObtainWay').lrDataItemSelect({ code: 'ObtainWay' });
  132. //$('#DeptNo').lrDataSourceSelect({ code: 'CdDeptInfo', value: 'deptno', text: 'deptname' });
  133. $('#PostRank').lrDataItemSelect({ code: 'PostRank', allowSearch: true });
  134. $('#Photo').lrUploader();
  135. //最高学历
  136. $('#HighestRecord').lrDataItemSelect({ code: 'CollegeType', allowSearch: true });
  137. $('#ObtainWayOfHighestRecord').lrDataItemSelect({ code: 'ObtainWay' });
  138. $('#InitialDegree').lrDataItemSelect({ code: 'BCdDegree', allowSearch: true });
  139. $('#ObtainWayOfInitialDegree').lrDataItemSelect({ code: 'ObtainWayOfDegree' });
  140. $('#ObtainWayOfHighestDegree').lrDataItemSelect({ code: 'ObtainWayOfDegree' });
  141. $('#PositionLevel').lrDataItemSelect({ code: 'PositionLevel' });
  142. $('#JobRank').lrDataItemSelect({ code: 'TeacherTitlePostLevel' });
  143. $('#WorkLevel').lrDataItemSelect({ code: 'WorkerTechnologyGrade' });
  144. $('#Marital').lrDataItemSelect({ code: 'MaritalType', allowSearch: true });
  145. //编制类别
  146. $('#CompilationCategory').lrDataItemSelect({
  147. code: 'CompilationCategory', select: function (item) {
  148. if (!!item && item.id == "02") {//编外
  149. //经费渠道
  150. $('#EmployType').lrselectRefresh({
  151. url: '/LR_SystemModule/DataItem/GetDetailList',
  152. param: { itemCode: 'FundingChannels' },
  153. value: 'F_ItemValue',
  154. text: 'F_ItemName'
  155. });
  156. } else {
  157. $('#EmployType').lrselectRefresh({
  158. url: "",
  159. data: []
  160. });
  161. }
  162. }
  163. });
  164. //经费渠道
  165. $('#EmployType').lrselect();
  166. $('#IsInActiveStatus').lrDataItemSelect({ code: 'JobStatus' });
  167. $('#ProfessionalTitle').lrDataItemSelect({ code: 'jszc' });
  168. $('#ProfessionalTitleLevel').lrDataItemSelect({ code: 'TeacherTitlePostLevel' });
  169. $('#TeacherQualifications').lrDataItemSelect({ code: 'TeacherQualifications' });
  170. //内容编辑器
  171. ue = UE.getEditor('editor');
  172. //监听身份证号,绑定出生日期
  173. $("#IdentityCardNo").blur(function () {
  174. var cardNo = $(this).val().trim();
  175. if (cardNo) {
  176. var date = cardNo.slice(6, 10) + "-" + cardNo.slice(10, 12) + "-" + cardNo.slice(12, 14);
  177. $("#Birthday").val(date);
  178. }
  179. });
  180. $('#lr_print').on('click', function () {
  181. $('#tab1').print();
  182. })
  183. },
  184. initData: function () {
  185. if (!!keyValue) {
  186. $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/EmpInfo/GetFormData?keyValue=' + keyValue, function (data) {
  187. for (var id in data) {
  188. if (!!data[id].length && data[id].length > 0) {
  189. $('#' + id).jfGridSet('refreshdata', data[id]);
  190. }
  191. else {
  192. $('[data-table="' + id + '"]').lrSetFormData(data[id]);
  193. }
  194. ue.ready(function () {
  195. ue.setContent(data[id].resume);
  196. });
  197. }
  198. $("#EmpNo").attr("disabled", "disabled");
  199. });
  200. }
  201. }
  202. };
  203. // 保存数据
  204. acceptClick = function (callBack) {
  205. if (!$('body').lrValidform()) {
  206. return false;
  207. }
  208. var postData = $('body').lrGetFormData();
  209. postData["resume"] = ue.getContent(null, null, true);
  210. postData["EmpId"] = NewEmpId;
  211. var postDatas = {
  212. strEntity: JSON.stringify(postData)
  213. };
  214. //姓名重复提示
  215. var EmpName = $('#EmpName').val();
  216. $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/EmpInfo/GetEmpInfoEntitiesByEmpName?empName=' + EmpName,
  217. function (data) {
  218. if (!!data.length && data.length > 0) {
  219. var num = data.length;
  220. if (!!keyValue) {
  221. for (var i = 0; i < data.length; i++) {
  222. if (data[i].EmpId == keyValue) {
  223. num = num - 1;
  224. break;
  225. }
  226. }
  227. }
  228. if (num > 0) {
  229. learun.layerConfirm('系统中姓名为' + EmpName + '的教师已经有' + num + '名,是否确认保存?',
  230. function (res) {
  231. if (res) {
  232. $.lrSaveForm(
  233. top.$.rootUrl +
  234. '/EducationalAdministration/EmpInfo/SaveForm?keyValue=' +
  235. keyValue,
  236. postDatas,
  237. function (res) {
  238. // 保存成功后才回调
  239. if (!!callBack) {
  240. callBack();
  241. }
  242. });
  243. }
  244. });
  245. return;
  246. }
  247. }
  248. $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/EmpInfo/SaveForm?keyValue=' + keyValue,
  249. postDatas,
  250. function (res) {
  251. // 保存成功后才回调
  252. if (!!callBack) {
  253. callBack();
  254. }
  255. });
  256. });
  257. //工资编号重复判断
  258. /*var s = $("#SalaryNumber").val();
  259. var sn = s.sort();
  260. for (var j = 0; j <s.length; j++) {
  261. if (sn[j] == sn[j+1]
  262. ) {
  263. alert("工资编号重复:" + sn[j]);
  264. }
  265. }*/
  266. };
  267. page.init();
  268. }