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.

Index.js 7.9 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
  2. * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2021-04-14 11:52
  5. * 描 述:学生撤销违纪管理
  6. */
  7. var refreshGirdData;
  8. var bootstrap = function ($, learun) {
  9. "use strict";
  10. var processId = '';
  11. var page = {
  12. init: function () {
  13. page.initGird();
  14. page.bind();
  15. },
  16. bind: function () {
  17. $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
  18. page.search(queryJson);
  19. }, 220, 400);
  20. // 刷新
  21. $('#lr_refresh').on('click', function () {
  22. location.reload();
  23. });
  24. // 新增
  25. $('#lr_add').on('click', function () {
  26. learun.layerForm({
  27. id: 'form',
  28. title: '新增',
  29. url: top.$.rootUrl + '/EducationalAdministration/StuCancelDisciplineManagement/Form',
  30. width: 1000,
  31. height: 600,
  32. callBack: function (id) {
  33. var res = false;
  34. // 验证数据
  35. res = top[id].validForm();
  36. // 保存数据
  37. if (res) {
  38. res = top[id].save('', function () {
  39. page.search();
  40. });
  41. }
  42. return res;
  43. }
  44. });
  45. });
  46. // 编辑
  47. $('#lr_edit').on('click', function () {
  48. var keyValue = $('#gridtable').jfGridValue('Id');
  49. if (learun.checkrow(keyValue)) {
  50. var CheckStatus = $('#gridtable').jfGridValue('CheckStatus');
  51. if (CheckStatus != "0") {
  52. learun.alert.warning("当前项已提交!");
  53. return false;
  54. }
  55. learun.layerForm({
  56. id: 'form',
  57. title: '编辑',
  58. url: top.$.rootUrl + '/EducationalAdministration/StuCancelDisciplineManagement/Form?keyValue=' + keyValue,
  59. width: 1000,
  60. height: 600,
  61. callBack: function (id) {
  62. var res = false;
  63. // 验证数据
  64. res = top[id].validForm();
  65. // 保存数据
  66. if (res) {
  67. res = top[id].save('', function () {
  68. page.search();
  69. });
  70. }
  71. return res;
  72. }
  73. });
  74. }
  75. });
  76. // 删除
  77. $('#lr_delete').on('click', function () {
  78. var keyValue = $('#gridtable').jfGridValue('Id');
  79. if (learun.checkrow(keyValue)) {
  80. var CheckStatus = $('#gridtable').jfGridValue('CheckStatus');
  81. if (CheckStatus != "0") {
  82. learun.alert.warning("当前项已提交!");
  83. return false;
  84. }
  85. learun.layerConfirm('是否确认删除该项!', function (res) {
  86. if (res) {
  87. learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/StuCancelDisciplineManagement/DeleteForm', { keyValue: keyValue }, function () {
  88. refreshGirdData();
  89. });
  90. }
  91. });
  92. }
  93. });
  94. //  查看
  95. $('#lr_view').on('click', function () {
  96. var keyValue = $('#gridtable').jfGridValue('Id');
  97. if (learun.checkrow(keyValue)) {
  98. learun.layerForm({
  99. id: 'formview',
  100. title: '查看',
  101. url: top.$.rootUrl + '/EducationalAdministration/StuCancelDisciplineManagement/FormView?keyValue=' + keyValue,
  102. width: 1000,
  103. height: 600,
  104. btn: null
  105. });
  106. }
  107. });
  108. //  提交
  109. $('#lr_submit').on('click', function () {
  110. var keyValue = $('#gridtable').jfGridValue('Id');
  111. if (learun.checkrow(keyValue)) {
  112. var CheckStatus = $('#gridtable').jfGridValue('CheckStatus');
  113. if (CheckStatus != "0") {
  114. learun.alert.warning("当前项已提交!");
  115. return false;
  116. }
  117. learun.layerConfirm('是否确认提交该项!', function (res) {
  118. if (res) {
  119. processId = learun.newGuid();
  120. learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuCancelDisciplineManagement/DoSubmit', { keyValue: keyValue, status: "1", processId: processId }, function (res) {
  121. refreshGirdData(res, {});
  122. });
  123. }
  124. });
  125. }
  126. });
  127. },
  128. // 初始化列表
  129. initGird: function () {
  130. $('#gridtable').lrAuthorizeJfGrid({
  131. url: top.$.rootUrl + '/EducationalAdministration/StuCancelDisciplineManagement/GetPageList',
  132. headData: [
  133. {
  134. label: "申请人", name: "CreateUserId", width: 100, align: "left",
  135. formatterAsync: function (callback, value, row, op, $cell) {
  136. learun.clientdata.getAsync('user', {
  137. key: value,
  138. callback: function (_data) {
  139. callback(_data.name);
  140. }
  141. });
  142. }
  143. },
  144. { label: "申请时间", name: "CreateTime", width: 120, align: "left" },
  145. { label: "事情经过", name: "Things", width: 150, align: "left" },
  146. { label: "撤销原因", name: "Reason", width: 150, align: "left" },
  147. {
  148. label: "审核状态", name: "CheckStatus", width: 100, align: "left", formatter: function (cellvalue) {
  149. return cellvalue == "1" ? "<span class=\"label label-warning\">审核中</span>" : cellvalue == "2" ? "<span class=\"label label-success\">审核通过</span>" : cellvalue == "3" ? "<span class=\"label label-danger\">审核未通过</span>" : "<span class=\"label label-default\">草稿</span>";
  150. }
  151. },
  152. ],
  153. mainId: 'Id',
  154. isPage: true,
  155. sidx: "CreateTime desc"
  156. });
  157. page.search();
  158. },
  159. search: function (param) {
  160. param = param || {};
  161. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  162. }
  163. };
  164. refreshGirdData = function (res, postData) {
  165. if (!!res) {
  166. if (res.code == 200) {
  167. // 发起流程
  168. var postData = {
  169. schemeCode: 'StuCancelDisciplineManagement',// 填写流程对应模板编号
  170. processId: processId,
  171. level: '1',
  172. };
  173. learun.httpAsync('Post', top.$.rootUrl + '/LR_NewWorkFlow/NWFProcess/CreateFlow', postData, function (data) {
  174. learun.loading(false);
  175. });
  176. }
  177. page.search();
  178. }
  179. };
  180. page.init();
  181. }