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.
 
 
 
 
 
 

276 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. //内容编辑器
  170. ue = UE.getEditor('editor');
  171. //监听身份证号,绑定出生日期
  172. $("#IdentityCardNo").blur(function () {
  173. var cardNo = $(this).val().trim();
  174. if (cardNo) {
  175. var date = cardNo.slice(6, 10) + "-" + cardNo.slice(10, 12) + "-" + cardNo.slice(12, 14);
  176. $("#Birthday").val(date);
  177. }
  178. });
  179. $('#lr_print').on('click', function () {
  180. $('#tab1').print();
  181. })
  182. },
  183. initData: function () {
  184. if (!!keyValue) {
  185. $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/EmpInfo/GetFormData?keyValue=' + keyValue, function (data) {
  186. for (var id in data) {
  187. if (!!data[id].length && data[id].length > 0) {
  188. $('#' + id).jfGridSet('refreshdata', data[id]);
  189. }
  190. else {
  191. $('[data-table="' + id + '"]').lrSetFormData(data[id]);
  192. }
  193. ue.ready(function () {
  194. ue.setContent(data[id].resume);
  195. });
  196. }
  197. $("#EmpNo").attr("disabled", "disabled");
  198. });
  199. }
  200. }
  201. };
  202. // 保存数据
  203. acceptClick = function (callBack) {
  204. if (!$('body').lrValidform()) {
  205. return false;
  206. }
  207. var postData = $('body').lrGetFormData();
  208. postData["resume"] = ue.getContent(null, null, true);
  209. postData["EmpId"] = NewEmpId;
  210. var postDatas = {
  211. strEntity: JSON.stringify(postData)
  212. };
  213. //姓名重复提示
  214. var EmpName = $('#EmpName').val();
  215. $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/EmpInfo/GetEmpInfoEntitiesByEmpName?empName=' + EmpName,
  216. function (data) {
  217. if (!!data.length && data.length > 0) {
  218. var num = data.length;
  219. if (!!keyValue) {
  220. for (var i = 0; i < data.length; i++) {
  221. if (data[i].EmpId == keyValue) {
  222. num = num - 1;
  223. break;
  224. }
  225. }
  226. }
  227. if (num > 0) {
  228. learun.layerConfirm('系统中姓名为' + EmpName + '的教师已经有' + num + '名,是否确认保存?',
  229. function (res) {
  230. if (res) {
  231. $.lrSaveForm(
  232. top.$.rootUrl +
  233. '/EducationalAdministration/EmpInfo/SaveForm?keyValue=' +
  234. keyValue,
  235. postDatas,
  236. function (res) {
  237. // 保存成功后才回调
  238. if (!!callBack) {
  239. callBack();
  240. }
  241. });
  242. }
  243. });
  244. return;
  245. }
  246. }
  247. $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/EmpInfo/SaveForm?keyValue=' + keyValue,
  248. postDatas,
  249. function (res) {
  250. // 保存成功后才回调
  251. if (!!callBack) {
  252. callBack();
  253. }
  254. });
  255. });
  256. //工资编号重复判断
  257. /*var s = $("#SalaryNumber").val();
  258. var sn = s.sort();
  259. for (var j = 0; j <s.length; j++) {
  260. if (sn[j] == sn[j+1]
  261. ) {
  262. alert("工资编号重复:" + sn[j]);
  263. }
  264. }*/
  265. };
  266. page.init();
  267. }