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.
 
 
 
 
 
 

171 lines
7.3 KiB

  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2020-03-30 14:00
  5. * 描 述:教育经历
  6. */
  7. var refreshGirdData;
  8. var empId = request('empId');
  9. var status = false;
  10. var bootstrap = function ($, learun) {
  11. "use strict";
  12. var page = {
  13. init: function () {
  14. page.refreshStatus();
  15. page.initGird();
  16. page.bind();
  17. },
  18. refreshStatus: function () {
  19. //获取主表状态
  20. learun.httpAsyncGet(top.$.rootUrl + '/EducationalAdministration/EmpInfo/GetFormData?keyValue=' + empId, function (res) {
  21. if (res.code == 200) {
  22. if (res.data.EmpInfo != null) {
  23. status = res.data.EmpInfo.EducationExperienceStatus;
  24. }
  25. }
  26. });
  27. },
  28. bind: function () {
  29. // 刷新
  30. $('#lr_refresh').on('click', function () {
  31. location.reload();
  32. });
  33. // 新增
  34. $('#lr_add').on('click', function () {
  35. if (status == 'true') {
  36. learun.alert.warning('已提交,不能再修改!');
  37. return;
  38. }
  39. learun.layerForm({
  40. id: 'formInPM_EducationExperience',
  41. title: '新增',
  42. url: top.$.rootUrl + '/EducationalAdministration/PM_EducationExperience/Form?empId=' + empId,
  43. width: 600,
  44. height: 400,
  45. callBack: function (id) {
  46. return top[id].acceptClick(refreshGirdData);
  47. }
  48. });
  49. });
  50. // 编辑
  51. $('#lr_edit').on('click', function () {
  52. if (status == 'true') {
  53. learun.alert.warning('已提交,不能再修改!');
  54. return;
  55. }
  56. var keyValue = $('#gridtable').jfGridValue('ID');
  57. if (learun.checkrow(keyValue)) {
  58. learun.layerForm({
  59. id: 'formInPM_EducationExperience',
  60. title: '编辑',
  61. url: top.$.rootUrl + '/EducationalAdministration/PM_EducationExperience/Form?keyValue=' + keyValue + '&empId=' + empId,
  62. width: 600,
  63. height: 400,
  64. callBack: function (id) {
  65. return top[id].acceptClick(refreshGirdData);
  66. }
  67. });
  68. }
  69. });
  70. // 删除
  71. $('#lr_delete').on('click', function () {
  72. if (status == 'true') {
  73. learun.alert.warning('已提交,不能再修改!');
  74. return;
  75. }
  76. var keyValue = $('#gridtable').jfGridValue('ID');
  77. if (learun.checkrow(keyValue)) {
  78. learun.layerConfirm('是否确认删除该项!', function (res) {
  79. if (res) {
  80. learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/PM_EducationExperience/DeleteForm', { keyValue: keyValue }, function () {
  81. refreshGirdData();
  82. });
  83. }
  84. });
  85. }
  86. });
  87. // 提交
  88. $('#lr_check').on('click', function () {
  89. if (status == 'true') {
  90. learun.alert.warning('已提交,不能再修改!');
  91. return;
  92. }
  93. learun.layerConfirm('是否确认提交!', function (res) {
  94. if (res) {
  95. learun.postForm(top.$.rootUrl + '/EducationalAdministration/PM_EducationExperience/Submit', { empId: empId, status: true }, function (info) {
  96. refreshGirdData();
  97. });
  98. }
  99. });
  100. });
  101. // 取消提交
  102. $('#lr_uncheck').on('click', function () {
  103. learun.layerConfirm('是否取消提交!', function (res) {
  104. if (res) {
  105. learun.postForm(top.$.rootUrl + '/EducationalAdministration/PM_EducationExperience/Submit', { empId: empId, status: false }, function () {
  106. refreshGirdData();
  107. });
  108. }
  109. });
  110. });
  111. },
  112. // 初始化列表
  113. initGird: function () {
  114. $('#gridtable').lrAuthorizeJfGrid({
  115. url: top.$.rootUrl + '/EducationalAdministration/PM_EducationExperience/GetPageList',
  116. headData: [
  117. { label: "时间", name: "ETime", width: 130, align: "left" },
  118. { label: "学校", name: "School", width: 100, align: "left" },
  119. { label: "专业", name: "Major", width: 100, align: "left" },
  120. {
  121. label: "学历", name: "Education", width: 100, align: "left",
  122. formatterAsync: function (callback, value, row, op, $cell) {
  123. learun.clientdata.getAsync('dataItem', {
  124. key: value,
  125. code: 'CollegeType',
  126. callback: function (_data) {
  127. callback(_data.text);
  128. }
  129. });
  130. }
  131. },
  132. { label: "学位", name: "AcademicDegree", width: 100, align: "left" },
  133. {
  134. label: "学制", name: "EducationalSystem", width: 100, align: "left",
  135. formatterAsync: function (callback, value, row, op, $cell) {
  136. learun.clientdata.getAsync('dataItem', {
  137. key: value,
  138. code: 'EductionalSystme',
  139. callback: function (_data) {
  140. callback(_data.text);
  141. }
  142. });
  143. }
  144. },
  145. { label: "专业描述", name: "Describe", width: 100, align: "left" },
  146. { label: "备注", name: "Remark", width: 100, align: "left" },
  147. {
  148. label: "提交状态", name: "SubmitStatus", width: 100, align: "left",
  149. formatter: function (cellvalue) {
  150. return cellvalue == true ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>";
  151. }
  152. },
  153. ],
  154. mainId: 'ID',
  155. isPage: true
  156. });
  157. page.search();
  158. },
  159. search: function (param) {
  160. param = param || {};
  161. param.EmpId = empId;
  162. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  163. }
  164. };
  165. refreshGirdData = function () {
  166. page.search();
  167. page.refreshStatus();
  168. };
  169. page.init();
  170. }