選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 
 
 
 

174 行
7.4 KiB

  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2020-11-04 14:08
  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.PositionLevelStatus;
  24. }
  25. }
  26. });
  27. },
  28. bind: function () {
  29. $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
  30. page.search(queryJson);
  31. }, 220, 400);
  32. $('#OldLevel').lrDataItemSelect({ code: 'PositionLevel' });
  33. $('#NewLevel').lrDataItemSelect({ code: 'PositionLevel' });
  34. // 刷新
  35. $('#lr_refresh').on('click', function () {
  36. location.reload();
  37. });
  38. // 新增
  39. $('#lr_add').on('click', function () {
  40. if (status == 'true') {
  41. learun.alert.warning('已提交,不能再修改!');
  42. return;
  43. }
  44. learun.layerForm({
  45. id: 'formInPM_PositionChange',
  46. title: '新增',
  47. url: top.$.rootUrl + '/EducationalAdministration/PM_PositionChange/Form?empId=' + empId,
  48. width: 600,
  49. height: 400,
  50. callBack: function (id) {
  51. return top[id].acceptClick(refreshGirdData);
  52. }
  53. });
  54. });
  55. // 编辑
  56. $('#lr_edit').on('click', function () {
  57. if (status == 'true') {
  58. learun.alert.warning('已提交,不能再修改!');
  59. return;
  60. }
  61. var keyValue = $('#gridtable').jfGridValue('ID');
  62. if (learun.checkrow(keyValue)) {
  63. learun.layerForm({
  64. id: 'formInPM_PositionChange',
  65. title: '编辑',
  66. url: top.$.rootUrl + '/EducationalAdministration/PM_PositionChange/Form?keyValue=' + keyValue + '&empId=' + empId,
  67. width: 600,
  68. height: 400,
  69. callBack: function (id) {
  70. return top[id].acceptClick(refreshGirdData);
  71. }
  72. });
  73. }
  74. });
  75. // 删除
  76. $('#lr_delete').on('click', function () {
  77. if (status == 'true') {
  78. learun.alert.warning('已提交,不能再修改!');
  79. return;
  80. }
  81. var keyValue = $('#gridtable').jfGridValue('ID');
  82. if (learun.checkrow(keyValue)) {
  83. learun.layerConfirm('是否确认删除该项!', function (res) {
  84. if (res) {
  85. learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/PM_PositionChange/DeleteForm', { keyValue: keyValue }, function () {
  86. refreshGirdData();
  87. });
  88. }
  89. });
  90. }
  91. });
  92. // 提交
  93. $('#lr_check').on('click', function () {
  94. if (status == 'true') {
  95. learun.alert.warning('已提交,不能再修改!');
  96. return;
  97. }
  98. learun.layerConfirm('是否确认提交!', function (res) {
  99. if (res) {
  100. learun.postForm( top.$.rootUrl + '/EducationalAdministration/PM_PositionChange/Submit', { empId: empId, status: true }, function (info) {
  101. refreshGirdData();
  102. });
  103. }
  104. });
  105. });
  106. // 取消提交
  107. $('#lr_uncheck').on('click', function () {
  108. learun.layerConfirm('是否取消提交!', function (res) {
  109. if (res) {
  110. learun.postForm(top.$.rootUrl + '/EducationalAdministration/PM_PositionChange/Submit', { empId: empId, status: false }, function () {
  111. refreshGirdData();
  112. });
  113. }
  114. });
  115. });
  116. },
  117. // 初始化列表
  118. initGird: function () {
  119. $('#gridtable').jfGrid({
  120. url: top.$.rootUrl + '/EducationalAdministration/PM_PositionChange/GetPageList',
  121. headData: [
  122. {
  123. label: "原聘任等级", name: "OldLevel", width: 100, align: "left",
  124. formatterAsync: function (callback, value, row, op, $cell) {
  125. learun.clientdata.getAsync('dataItem', {
  126. key: value,
  127. code: 'PositionLevel',
  128. callback: function (_data) {
  129. callback(_data.text);
  130. }
  131. });
  132. }
  133. },
  134. {
  135. label: "现聘任等级", name: "NewLevel", width: 100, align: "left",
  136. formatterAsync: function (callback, value, row, op, $cell) {
  137. learun.clientdata.getAsync('dataItem', {
  138. key: value,
  139. code: 'PositionLevel',
  140. callback: function (_data) {
  141. callback(_data.text);
  142. }
  143. });
  144. }
  145. },
  146. { label: "变更原因", name: "ChangeReason", width: 100, align: "left" },
  147. { label: "备注", name: "Remark", width: 100, align: "left" },
  148. { label: "是否同步", name: "IsSync", width: 100, align: "left", formatter: function (cellvalue) { return cellvalue == true ? "是" : "否" } },
  149. {
  150. label: "提交状态", name: "SubmitStatus", width: 100, align: "left",
  151. formatter: function (cellvalue) {
  152. return cellvalue == true ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>";
  153. }
  154. },
  155. ],
  156. mainId: 'ID',
  157. isPage: true,
  158. sidx:'UpdateTime desc'
  159. });
  160. page.search();
  161. },
  162. search: function (param) {
  163. param = param || {};
  164. param.EmpId = empId;
  165. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  166. }
  167. };
  168. refreshGirdData = function () {
  169. page.search();
  170. page.refreshStatus();
  171. };
  172. page.init();
  173. }