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.
 
 
 
 
 
 

183 lines
8.9 KiB

  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_check').on('click', function () {
  27. var keyValue = $('#gridtable').jfGridValue('Id');
  28. if (learun.checkrow(keyValue)) {
  29. //判断是否可以审核:请假天数大于2天且登录用户不是系主任,提示无法审核;
  30. var day = $('#gridtable').jfGridValue('LeaveDay');
  31. if (day > 2 && IsDeptDirector.toLowerCase() == "false") {
  32. learun.alert.warning("该请假申请大于2天,需要由系主任审核!");
  33. return false;
  34. }
  35. learun.layerForm({
  36. id: 'checkform',
  37. title: '审核',
  38. url: top.$.rootUrl + '/EducationalAdministration/StuLeaveManagement/CheckForm?keyValue=' + keyValue,
  39. width: 800,
  40. height: 600,
  41. callBack: function (id) {
  42. return top[id].acceptClick(refreshGirdData);
  43. }
  44. });
  45. }
  46. });
  47. },
  48. // 初始化列表
  49. initGird: function () {
  50. $('#gridtable').lrAuthorizeJfGrid({
  51. url: top.$.rootUrl + '/EducationalAdministration/StuLeaveManagement/GetPageList',
  52. headData: [
  53. {
  54. label: "审核状态", name: "CheckStatus", width: 100, align: "left",
  55. formatterAsync: function (callback, value, row, op, $cell) {
  56. learun.clientdata.getAsync('dataItem', {
  57. key: value,
  58. code: 'LeaveCheck',
  59. callback: function (_data) {
  60. callback(_data.text ? _data.text : "申请中");
  61. }
  62. });
  63. }
  64. },
  65. { label: "审核备注", name: "CheckRemark", width: 100, align: "left" },
  66. { label: "审核时间", name: "CheckTime", width: 130, align: "left" },
  67. {
  68. label: "审核人", name: "CheckUserNo", width: 100, align: "left",
  69. formatterAsync: function (callback, value, row, op, $cell) {
  70. learun.clientdata.getAsync('custmerData', {
  71. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo',
  72. key: value,
  73. keyId: 'empno',
  74. callback: function (_data) {
  75. callback(_data['empname']);
  76. }
  77. });
  78. }
  79. },
  80. {
  81. label: "请假类型", name: "LeaveType", width: 100, align: "left",
  82. formatterAsync: function (callback, value, row, op, $cell) {
  83. learun.clientdata.getAsync('dataItem', {
  84. key: value,
  85. code: 'LeaveType',
  86. callback: function (_data) {
  87. callback(_data.text);
  88. }
  89. });
  90. }
  91. },
  92. { label: "请假时间", name: "StartTime", width: 100, align: "left" },
  93. { label: "返校时间", name: "EndTime", width: 100, align: "left" },
  94. { label: "请假天数", name: "LeaveDay", width: 100, align: "left" },
  95. { label: "请假事由", name: "LeaveReason", width: 100, align: "left" },
  96. { label: "学号", name: "CreateUserNo", width: 100, align: "left" },
  97. { label: "姓名", name: "CreateUserName", width: 100, align: "left" },
  98. { label: "申请时间", name: "CreateTime", width: 130, align: "left" },
  99. {
  100. label: "班级", name: "ClassNo", width: 100, align: "left",
  101. formatterAsync: function (callback, value, row, op, $cell) {
  102. learun.clientdata.getAsync('custmerData', {
  103. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj',
  104. key: value,
  105. keyId: 'classno',
  106. callback: function (_data) {
  107. callback(_data['classname']);
  108. }
  109. });
  110. }
  111. },
  112. {
  113. label: "系部", name: "DeptNo", width: 100, align: "left",
  114. formatterAsync: function (callback, value, row, op, $cell) {
  115. learun.clientdata.getAsync('custmerData', {
  116. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo',
  117. key: value,
  118. keyId: 'deptno',
  119. callback: function (_data) {
  120. callback(_data['deptname']);
  121. }
  122. });
  123. }
  124. },
  125. {
  126. label: "专业", name: "MajorNo", width: 100, align: "left",
  127. formatterAsync: function (callback, value, row, op, $cell) {
  128. learun.clientdata.getAsync('custmerData', {
  129. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo',
  130. key: value,
  131. keyId: 'majorno',
  132. callback: function (_data) {
  133. callback(_data['majorname']);
  134. }
  135. });
  136. }
  137. },
  138. {
  139. label: "班主任", name: "ClassDiredctorNo", width: 100, align: "left",
  140. formatterAsync: function (callback, value, row, op, $cell) {
  141. learun.clientdata.getAsync('custmerData', {
  142. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo',
  143. key: value,
  144. keyId: 'empno',
  145. callback: function (_data) {
  146. callback(_data['empname']);
  147. }
  148. });
  149. }
  150. },
  151. {
  152. label: "辅导员", name: "ClassTutorNo", width: 100, align: "left",
  153. formatterAsync: function (callback, value, row, op, $cell) {
  154. learun.clientdata.getAsync('custmerData', {
  155. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo',
  156. key: value,
  157. keyId: 'empno',
  158. callback: function (_data) {
  159. callback(_data['empname']);
  160. }
  161. });
  162. }
  163. },
  164. ],
  165. mainId: 'Id',
  166. isPage: true,
  167. sord: 'CreateTime desc'
  168. });
  169. page.search();
  170. },
  171. search: function (param) {
  172. param = param || {};
  173. param.ClassManagerNo = learun.clientdata.get(['userinfo']).account;
  174. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  175. }
  176. };
  177. refreshGirdData = function () {
  178. $('#gridtable').jfGridSet('reload');
  179. };
  180. page.init();
  181. }