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.
 
 
 
 
 
 

281 line
13 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. $("#PM_PositionChange").attr("src", "/EducationalAdministration/PM_PositionChange/Index?empId=" + NewEmpId);
  67. $("#PM_YearAssess").attr("src", "/EducationalAdministration/PM_YearAssess/Index?empId=" + NewEmpId);
  68. $("#PM_Certificate").attr("src", "/EducationalAdministration/PM_Certificate/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/GetTreeNoCheck',
  83. // 访问数据接口参数
  84. param: { companyId: item.f_companyid, parentId: '0' }
  85. });
  86. }
  87. }
  88. });
  89. $('#F_DepartmentId').lrselect();
  90. $('#GenderNo').lrDataItemSelect({ code: 'usersexbit' });
  91. $('#IsHasLesson').lrDataItemSelect({ code: 'YesOrNoBit' });
  92. $('#NationalityNo').lrDataItemSelect({ code: 'National' });
  93. $('#PartyFaceNo').lrDataItemSelect({ code: 'PolityStatus' });
  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: 'SubjectSpecies', 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: 'PostRank', allowSearch: true });
  137. $('#Photo').lrUploader();
  138. //最高学历
  139. $('#HighestRecord').lrDataItemSelect({ code: 'CollegeType', allowSearch: true });
  140. $('#ObtainWayOfHighestRecord').lrDataItemSelect({ code: 'ObtainWay' });
  141. $('#InitialDegree').lrDataItemSelect({ code: 'BCdDegree', allowSearch: true });
  142. $('#ObtainWayOfInitialDegree').lrDataItemSelect({ code: 'ObtainWayOfDegree' });
  143. $('#ObtainWayOfHighestDegree').lrDataItemSelect({ code: 'ObtainWayOfDegree' });
  144. $('#PositionLevel').lrDataItemSelect({ code: 'PositionLevel' });
  145. $('#JobRank').lrDataItemSelect({ code: 'TeacherTitlePostLevel' });
  146. $('#WorkLevel').lrDataItemSelect({ code: 'WorkerTechnologyGrade' });
  147. $('#Marital').lrDataItemSelect({ code: 'MaritalType', allowSearch: true });
  148. //编制类别
  149. $('#CompilationCategory').lrDataItemSelect({
  150. code: 'CompilationCategory', select: function (item) {
  151. if (!!item && item.id == "02") {//编外
  152. //经费渠道
  153. $('#EmployType').lrselectRefresh({
  154. url: '/LR_SystemModule/DataItem/GetDetailList',
  155. param: { itemCode: 'FundingChannels' },
  156. value: 'F_ItemValue',
  157. text: 'F_ItemName'
  158. });
  159. } else {
  160. $('#EmployType').lrselectRefresh({
  161. url: "",
  162. data: []
  163. });
  164. }
  165. }
  166. });
  167. //经费渠道
  168. $('#EmployType').lrselect();
  169. $('#IsInActiveStatus').lrDataItemSelect({ code: 'JobStatus' });
  170. $('#ProfessionalTitle').lrDataItemSelect({ code: 'jszc' });
  171. $('#ProfessionalTitleLevel').lrDataItemSelect({ code: 'TeacherTitlePostLevel' });
  172. $('#TeacherQualifications').lrDataItemSelect({ code: 'TeacherQualifications' });
  173. $('#MandarinLevel').lrDataItemSelect({ code: 'MandarinLevel' });
  174. //内容编辑器
  175. ue = UE.getEditor('editor');
  176. //监听身份证号,绑定出生日期
  177. $("#IdentityCardNo").blur(function () {
  178. var cardNo = $(this).val().trim();
  179. if (cardNo) {
  180. var date = cardNo.slice(6, 10) + "-" + cardNo.slice(10, 12) + "-" + cardNo.slice(12, 14);
  181. $("#Birthday").val(date);
  182. }
  183. });
  184. $('#lr_print').on('click', function () {
  185. $('#tab1').print();
  186. })
  187. },
  188. initData: function () {
  189. if (!!keyValue) {
  190. $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/EmpInfo/GetFormData?keyValue=' + keyValue, function (data) {
  191. for (var id in data) {
  192. if (!!data[id].length && data[id].length > 0) {
  193. $('#' + id).jfGridSet('refreshdata', data[id]);
  194. }
  195. else {
  196. $('[data-table="' + id + '"]').lrSetFormData(data[id]);
  197. }
  198. ue.ready(function () {
  199. ue.setContent(data[id].resume);
  200. });
  201. }
  202. $("#EmpNo").attr("disabled", "disabled");
  203. });
  204. }
  205. }
  206. };
  207. // 保存数据
  208. acceptClick = function (callBack) {
  209. if (!$('body').lrValidform()) {
  210. return false;
  211. }
  212. var postData = $('body').lrGetFormData();
  213. postData["resume"] = ue.getContent(null, null, true);
  214. postData["EmpId"] = NewEmpId;
  215. var postDatas = {
  216. strEntity: JSON.stringify(postData)
  217. };
  218. //姓名重复提示
  219. var EmpName = $('#EmpName').val();
  220. $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/EmpInfo/GetEmpInfoEntitiesByEmpName?empName=' + EmpName,
  221. function (data) {
  222. if (!!data.length && data.length > 0) {
  223. var num = data.length;
  224. if (!!keyValue) {
  225. for (var i = 0; i < data.length; i++) {
  226. if (data[i].EmpId == keyValue) {
  227. num = num - 1;
  228. break;
  229. }
  230. }
  231. }
  232. if (num > 0) {
  233. learun.layerConfirm('系统中姓名为' + EmpName + '的教师已经有' + num + '名,是否确认保存?',
  234. function (res) {
  235. if (res) {
  236. $.lrSaveForm(
  237. top.$.rootUrl +
  238. '/EducationalAdministration/EmpInfo/SaveForm?keyValue=' +
  239. keyValue,
  240. postDatas,
  241. function (res) {
  242. // 保存成功后才回调
  243. if (!!callBack) {
  244. callBack();
  245. }
  246. });
  247. }
  248. });
  249. return;
  250. }
  251. }
  252. $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/EmpInfo/SaveForm?keyValue=' + keyValue,
  253. postDatas,
  254. function (res) {
  255. // 保存成功后才回调
  256. if (!!callBack) {
  257. callBack();
  258. }
  259. });
  260. });
  261. //工资编号重复判断
  262. /*var s = $("#SalaryNumber").val();
  263. var sn = s.sort();
  264. for (var j = 0; j <s.length; j++) {
  265. if (sn[j] == sn[j+1]
  266. ) {
  267. alert("工资编号重复:" + sn[j]);
  268. }
  269. }*/
  270. };
  271. page.init();
  272. }