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.
 
 
 
 
 
 

202 lines
9.2 KiB

  1. /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
  2. * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2023-03-10 14:48
  5. * 描 述:团员评优申请管理
  6. */
  7. var refreshGirdData;
  8. var bootstrap = function ($, learun) {
  9. "use strict";
  10. var page = {
  11. init: function () {
  12. page.initGird();
  13. page.bind();
  14. },
  15. bind: function () {
  16. $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
  17. page.search(queryJson);
  18. }, 220, 400);
  19. // 刷新
  20. $('#lr_refresh').on('click', function () {
  21. location.reload();
  22. });
  23. // 新增
  24. $('#lr_add').on('click', function () {
  25. learun.layerForm({
  26. id: 'form',
  27. title: '新增',
  28. url: top.$.rootUrl + '/PersonnelManagement/LeagueMemberAppraise/Form',
  29. width: 600,
  30. height: 400,
  31. callBack: function (id) {
  32. return top[id].acceptClick(refreshGirdData);
  33. }
  34. });
  35. });
  36. // 编辑
  37. $('#lr_edit').on('click', function () {
  38. var keyValue = $('#gridtable').jfGridValue('Id');
  39. if (learun.checkrow(keyValue)) {
  40. var ApplyStatus = $('#gridtable').jfGridValue('ApplyStatus');
  41. if (ApplyStatus == "1") {
  42. learun.alert.warning("当前项申请中!");
  43. return false;
  44. } else if (ApplyStatus == "2") {
  45. learun.alert.warning("当前项已审核!");
  46. return false;
  47. } else if (ApplyStatus == "3") {
  48. learun.alert.warning("当前项未通过审核!");
  49. return false;
  50. }
  51. learun.layerForm({
  52. id: 'form',
  53. title: '编辑',
  54. url: top.$.rootUrl + '/PersonnelManagement/LeagueMemberAppraise/Form?keyValue=' + keyValue,
  55. width: 600,
  56. height: 400,
  57. callBack: function (id) {
  58. return top[id].acceptClick(refreshGirdData);
  59. }
  60. });
  61. }
  62. });
  63. // 删除
  64. $('#lr_delete').on('click', function () {
  65. var keyValue = $('#gridtable').jfGridValue('Id');
  66. if (learun.checkrow(keyValue)) {
  67. var ApplyStatus = $('#gridtable').jfGridValue('ApplyStatus');
  68. if (ApplyStatus == "1") {
  69. learun.alert.warning("当前项申请中!");
  70. return false;
  71. } else if (ApplyStatus == "2") {
  72. learun.alert.warning("当前项已审核!");
  73. return false;
  74. } else if (ApplyStatus == "3") {
  75. learun.alert.warning("当前项未通过审核!");
  76. return false;
  77. }
  78. learun.layerConfirm('是否确认删除该项!', function (res) {
  79. if (res) {
  80. learun.deleteForm(top.$.rootUrl + '/PersonnelManagement/LeagueMemberAppraise/DeleteForm', { keyValue: keyValue }, function () {
  81. refreshGirdData();
  82. });
  83. }
  84. });
  85. }
  86. });
  87. //  提交申请
  88. $('#lr_apply').on('click', function () {
  89. var keyValue = $('#gridtable').jfGridValue('Id');
  90. if (learun.checkrow(keyValue)) {
  91. var ApplyStatus = $('#gridtable').jfGridValue('ApplyStatus');
  92. if (ApplyStatus == "1") {
  93. learun.alert.warning("当前项申请中!");
  94. return false;
  95. } else if (ApplyStatus == "2") {
  96. learun.alert.warning("当前项已审核!");
  97. return false;
  98. } else if (ApplyStatus == "3") {
  99. learun.alert.warning("当前项未通过审核!");
  100. return false;
  101. }
  102. learun.layerConfirm('是否确认申请该项!', function (res) {
  103. if (res) {
  104. learun.postForm(top.$.rootUrl + '/PersonnelManagement/LeagueMemberAppraise/DoSubmit', { keyValue: keyValue }, function (res) {
  105. refreshGirdData();
  106. });
  107. }
  108. });
  109. }
  110. });
  111. //  审核通过
  112. $('#lr_check').on('click', function () {
  113. var keyValue = $('#gridtable').jfGridValue('Id');
  114. if (learun.checkrow(keyValue)) {
  115. var ApplyStatus = $('#gridtable').jfGridValue('ApplyStatus');
  116. if (ApplyStatus != "1") {
  117. learun.alert.warning("当前项不在申请中!");
  118. return false;
  119. }
  120. learun.layerConfirm('是否确认审核通过该项!', function (res) {
  121. if (res) {
  122. learun.postForm(top.$.rootUrl + '/PersonnelManagement/LeagueMemberAppraise/DoCheck', { keyValue: keyValue, status: '2' }, function (res) {
  123. refreshGirdData();
  124. });
  125. }
  126. });
  127. }
  128. });
  129. //  审核不通过
  130. $('#lr_checkno').on('click', function () {
  131. var keyValue = $('#gridtable').jfGridValue('Id');
  132. if (learun.checkrow(keyValue)) {
  133. var ApplyStatus = $('#gridtable').jfGridValue('ApplyStatus');
  134. if (ApplyStatus != "1") {
  135. learun.alert.warning("当前项不在申请中!");
  136. return false;
  137. }
  138. learun.layerConfirm('是否确认审核不通过该项!', function (res) {
  139. if (res) {
  140. learun.postForm(top.$.rootUrl + '/PersonnelManagement/LeagueMemberAppraise/DoCheck', { keyValue: keyValue, status: '3' }, function (res) {
  141. refreshGirdData();
  142. });
  143. }
  144. });
  145. }
  146. });
  147. },
  148. // 初始化列表
  149. initGird: function () {
  150. $('#gridtable').lrAuthorizeJfGrid({
  151. url: top.$.rootUrl + '/PersonnelManagement/LeagueMemberAppraise/GetPageList',
  152. headData: [
  153. { label: "团员", name: "LeagueMember", width: 100, align: "left" },
  154. { label: "理由", name: "Reason", width: 100, align: "left" },
  155. { label: "证明", name: "Prove", width: 100, align: "left" },
  156. { label: "申请时间", name: "ApplyTime", width: 130, align: "left" },
  157. {
  158. label: "申请状态", name: "ApplyStatus", width: 100, align: "left", formatter: function (cellvalue) {
  159. return cellvalue == "1" ? "申请中" : cellvalue == "2" ? "申请已通过" : cellvalue == "3" ? "申请未通过" : "草稿";
  160. }
  161. },
  162. {
  163. label: "申请人", name: "CreateUserId", width: 100, align: "left",
  164. formatterAsync: function (callback, value, row, op, $cell) {
  165. learun.clientdata.getAsync('user', {
  166. key: value,
  167. callback: function (_data) {
  168. callback(_data.name);
  169. }
  170. });
  171. }
  172. },
  173. { label: "审核时间", name: "CheckTime", width: 130, align: "left" },
  174. {
  175. label: "审核人", name: "CheckUserId", width: 100, align: "left",
  176. formatterAsync: function (callback, value, row, op, $cell) {
  177. learun.clientdata.getAsync('user', {
  178. key: value,
  179. callback: function (_data) {
  180. callback(_data.name);
  181. }
  182. });
  183. }
  184. },
  185. ],
  186. mainId: 'Id',
  187. isPage: true,
  188. sidx: 'CreateTime'
  189. });
  190. page.search();
  191. },
  192. search: function (param) {
  193. param = param || {};
  194. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  195. }
  196. };
  197. refreshGirdData = function () {
  198. $('#gridtable').jfGridSet('reload');
  199. };
  200. page.init();
  201. }