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 10 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
  2. * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2020-11-27 10:05
  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. $('#LeaveType').lrDataItemSelect({ code: 'LeaveType' });
  20. $('#CheckStatus').lrDataItemSelect({ code: 'LeaveCheck' });
  21. // 刷新
  22. $('#lr_refresh').on('click', function () {
  23. location.reload();
  24. });
  25. // 新增
  26. $('#lr_add').on('click', function () {
  27. learun.layerForm({
  28. id: 'form',
  29. title: '新增',
  30. url: top.$.rootUrl + '/EducationalAdministration/StuLeaveManagement/Form',
  31. width: 600,
  32. height: 400,
  33. callBack: function (id) {
  34. return top[id].acceptClick(refreshGirdData);
  35. }
  36. });
  37. });
  38. // 编辑
  39. $('#lr_edit').on('click', function () {
  40. var keyValue = $('#gridtable').jfGridValue('Id');
  41. if (learun.checkrow(keyValue)) {
  42. var status = $('#gridtable').jfGridValue('CheckStatus');
  43. if (status == "1" || status == "2") {
  44. learun.alert.warning("该项已审核无法编辑!");
  45. return false;
  46. }
  47. learun.layerForm({
  48. id: 'form',
  49. title: '编辑',
  50. url: top.$.rootUrl + '/EducationalAdministration/StuLeaveManagement/Form?keyValue=' + keyValue,
  51. width: 600,
  52. height: 400,
  53. callBack: function (id) {
  54. return top[id].acceptClick(refreshGirdData);
  55. }
  56. });
  57. }
  58. });
  59. // 删除
  60. $('#lr_delete').on('click', function () {
  61. var keyValue = $('#gridtable').jfGridValue('Id');
  62. if (learun.checkrow(keyValue)) {
  63. var status = $('#gridtable').jfGridValue('CheckStatus');
  64. if (status == "1") {
  65. learun.alert.warning("该项已审核通过无法删除!");
  66. return false;
  67. }
  68. learun.layerConfirm('是否确认删除该项!', function (res) {
  69. if (res) {
  70. learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/StuLeaveManagement/DeleteForm', { keyValue: keyValue }, function () {
  71. refreshGirdData();
  72. });
  73. }
  74. });
  75. }
  76. });
  77. },
  78. // 初始化列表
  79. initGird: function () {
  80. $('#gridtable').lrAuthorizeJfGrid({
  81. url: top.$.rootUrl + '/EducationalAdministration/StuLeaveManagement/GetPageList',
  82. headData: [
  83. {
  84. label: "审核状态", name: "CheckStatus", width: 100, align: "left",
  85. formatterAsync: function (callback, value, row, op, $cell) {
  86. learun.clientdata.getAsync('dataItem', {
  87. key: value,
  88. code: 'LeaveCheck',
  89. callback: function (_data) {
  90. callback(_data.text ? _data.text : "申请中");
  91. }
  92. });
  93. }
  94. },
  95. { label: "审核备注", name: "CheckRemark", width: 100, align: "left" },
  96. { label: "审核时间", name: "CheckTime", width: 130, align: "left" },
  97. {
  98. label: "审核人", name: "CheckUserNo", width: 100, align: "left",
  99. formatterAsync: function (callback, value, row, op, $cell) {
  100. learun.clientdata.getAsync('custmerData', {
  101. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo',
  102. key: value,
  103. keyId: 'empno',
  104. callback: function (_data) {
  105. callback(_data['empname']);
  106. }
  107. });
  108. }
  109. },
  110. {
  111. label: "请假类型", name: "LeaveType", width: 100, align: "left",
  112. formatterAsync: function (callback, value, row, op, $cell) {
  113. learun.clientdata.getAsync('dataItem', {
  114. key: value,
  115. code: 'LeaveType',
  116. callback: function (_data) {
  117. callback(_data.text);
  118. }
  119. });
  120. }
  121. },
  122. { label: "开始时间", name: "StartTime", width: 100, align: "left" },
  123. { label: "结束时间", name: "EndTime", width: 100, align: "left" },
  124. { label: "请假天数", name: "LeaveDay", width: 100, align: "left" },
  125. { label: "请假事由", name: "LeaveReason", width: 100, align: "left" },
  126. { label: "学号", name: "CreateUserNo", width: 100, align: "left" },
  127. { label: "姓名", name: "CreateUserName", width: 100, align: "left" },
  128. { label: "申请时间", name: "CreateTime", width: 130, align: "left" },
  129. {
  130. label: "班级", name: "ClassNo", width: 100, align: "left",
  131. formatterAsync: function (callback, value, row, op, $cell) {
  132. learun.clientdata.getAsync('custmerData', {
  133. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj',
  134. key: value,
  135. keyId: 'classno',
  136. callback: function (_data) {
  137. callback(_data['classname']);
  138. }
  139. });
  140. }
  141. },
  142. {
  143. label: "系部", name: "DeptNo", width: 100, align: "left",
  144. formatterAsync: function (callback, value, row, op, $cell) {
  145. learun.clientdata.getAsync('custmerData', {
  146. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo',
  147. key: value,
  148. keyId: 'deptno',
  149. callback: function (_data) {
  150. callback(_data['deptname']);
  151. }
  152. });
  153. }
  154. },
  155. {
  156. label: "专业", name: "MajorNo", width: 100, align: "left",
  157. formatterAsync: function (callback, value, row, op, $cell) {
  158. learun.clientdata.getAsync('custmerData', {
  159. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo',
  160. key: value,
  161. keyId: 'majorno',
  162. callback: function (_data) {
  163. callback(_data['majorname']);
  164. }
  165. });
  166. }
  167. },
  168. {
  169. label: "班主任", name: "ClassDiredctorNo", width: 100, align: "left",
  170. formatterAsync: function (callback, value, row, op, $cell) {
  171. learun.clientdata.getAsync('custmerData', {
  172. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo',
  173. key: value,
  174. keyId: 'empno',
  175. callback: function (_data) {
  176. callback(_data['empname']);
  177. }
  178. });
  179. }
  180. },
  181. {
  182. label: "辅导员", name: "ClassTutorNo", width: 100, align: "left",
  183. formatterAsync: function (callback, value, row, op, $cell) {
  184. learun.clientdata.getAsync('custmerData', {
  185. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo',
  186. key: value,
  187. keyId: 'empno',
  188. callback: function (_data) {
  189. callback(_data['empname']);
  190. }
  191. });
  192. }
  193. },
  194. ],
  195. mainId: 'Id',
  196. isPage: true,
  197. sord: 'CreateTime desc'
  198. });
  199. page.search();
  200. },
  201. search: function (param) {
  202. param = param || {};
  203. param.StuNo = learun.clientdata.get(['userinfo']).account;
  204. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  205. }
  206. };
  207. refreshGirdData = function () {
  208. $('#gridtable').jfGridSet('reload');
  209. };
  210. page.init();
  211. }