Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 
 
 

183 строки
7.9 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').jfGrid({
  115. url: top.$.rootUrl + '/EducationalAdministration/PM_EducationExperience/GetPageList',
  116. headData: [
  117. { label: "开始时间", name: "STime", width: 130, align: "left" },
  118. { label: "结束时间", name: "ETime", width: 130, align: "left" },
  119. { label: "学校", name: "School", width: 100, align: "left" },
  120. { label: "专业", name: "Major", width: 100, align: "left" },
  121. {
  122. label: "学历", name: "Education", width: 100, align: "left",
  123. formatterAsync: function (callback, value, row, op, $cell) {
  124. learun.clientdata.getAsync('dataItem', {
  125. key: value,
  126. code: 'RecordInSchool',
  127. callback: function (_data) {
  128. callback(_data.text);
  129. }
  130. });
  131. }
  132. },
  133. {
  134. label: "学位", name: "AcademicDegree", width: 100, align: "left",
  135. formatterAsync: function (callback, value, row, op, $cell) {
  136. learun.clientdata.getAsync('dataItem', {
  137. key: value,
  138. code: 'DegreeInSchool',
  139. callback: function (_data) {
  140. callback(_data.text);
  141. }
  142. });
  143. }
  144. },
  145. {
  146. label: "学制", name: "EducationalSystem", width: 100, align: "left",
  147. formatterAsync: function (callback, value, row, op, $cell) {
  148. learun.clientdata.getAsync('dataItem', {
  149. key: value,
  150. code: 'EductionalSystme',
  151. callback: function (_data) {
  152. callback(_data.text);
  153. }
  154. });
  155. }
  156. },
  157. { label: "专业描述", name: "Describe", width: 100, align: "left" },
  158. { label: "备注", name: "Remark", width: 100, align: "left" },
  159. {
  160. label: "提交状态", name: "SubmitStatus", width: 100, align: "left",
  161. formatter: function (cellvalue) {
  162. return cellvalue == true ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>";
  163. }
  164. },
  165. ],
  166. mainId: 'ID',
  167. isPage: true
  168. });
  169. page.search();
  170. },
  171. search: function (param) {
  172. param = param || {};
  173. param.EmpId = empId;
  174. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  175. }
  176. };
  177. refreshGirdData = function () {
  178. page.search();
  179. page.refreshStatus();
  180. };
  181. page.init();
  182. }