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.

CheckIndex.js 8.8 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  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", formatter: function (cellvalue) {
  55. 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>";
  56. }
  57. },
  58. { label: "审核备注", name: "CheckRemark", width: 100, align: "left" },
  59. { label: "审核时间", name: "CheckTime", width: 130, align: "left" },
  60. {
  61. label: "审核人", name: "CheckUserNo", width: 100, align: "left",
  62. formatterAsync: function (callback, value, row, op, $cell) {
  63. learun.clientdata.getAsync('custmerData', {
  64. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo',
  65. key: value,
  66. keyId: 'empno',
  67. callback: function (_data) {
  68. callback(_data['empname']);
  69. }
  70. });
  71. }
  72. },
  73. {
  74. label: "请假类型", name: "LeaveType", width: 100, align: "left",
  75. formatterAsync: function (callback, value, row, op, $cell) {
  76. learun.clientdata.getAsync('dataItem', {
  77. key: value,
  78. code: 'LeaveType',
  79. callback: function (_data) {
  80. callback(_data.text);
  81. }
  82. });
  83. }
  84. },
  85. { label: "请假时间", name: "StartTime", width: 100, align: "left" },
  86. { label: "返校时间", name: "EndTime", width: 100, align: "left" },
  87. { label: "请假天数", name: "LeaveDay", width: 100, align: "left" },
  88. { label: "请假事由", name: "LeaveReason", width: 100, align: "left" },
  89. { label: "学号", name: "CreateUserNo", width: 100, align: "left" },
  90. { label: "姓名", name: "CreateUserName", width: 100, align: "left" },
  91. { label: "申请时间", name: "CreateTime", width: 130, align: "left" },
  92. {
  93. label: "班级", name: "ClassNo", width: 100, align: "left",
  94. formatterAsync: function (callback, value, row, op, $cell) {
  95. learun.clientdata.getAsync('custmerData', {
  96. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj',
  97. key: value,
  98. keyId: 'classno',
  99. callback: function (_data) {
  100. callback(_data['classname']);
  101. }
  102. });
  103. }
  104. },
  105. {
  106. label: "系部", name: "DeptNo", width: 100, align: "left",
  107. formatterAsync: function (callback, value, row, op, $cell) {
  108. learun.clientdata.getAsync('custmerData', {
  109. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo',
  110. key: value,
  111. keyId: 'deptno',
  112. callback: function (_data) {
  113. callback(_data['deptname']);
  114. }
  115. });
  116. }
  117. },
  118. {
  119. label: "专业", name: "MajorNo", width: 100, align: "left",
  120. formatterAsync: function (callback, value, row, op, $cell) {
  121. learun.clientdata.getAsync('custmerData', {
  122. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo',
  123. key: value,
  124. keyId: 'majorno',
  125. callback: function (_data) {
  126. callback(_data['majorname']);
  127. }
  128. });
  129. }
  130. }
  131. //{
  132. // label: "班主任", name: "ClassDiredctorNo", width: 100, align: "left",
  133. // formatterAsync: function (callback, value, row, op, $cell) {
  134. // learun.clientdata.getAsync('custmerData', {
  135. // url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo',
  136. // key: value,
  137. // keyId: 'empno',
  138. // callback: function (_data) {
  139. // callback(_data['empname']);
  140. // }
  141. // });
  142. // }
  143. //},
  144. //{
  145. // label: "辅导员", name: "ClassTutorNo", width: 100, align: "left",
  146. // formatterAsync: function (callback, value, row, op, $cell) {
  147. // learun.clientdata.getAsync('custmerData', {
  148. // url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo',
  149. // key: value,
  150. // keyId: 'empno',
  151. // callback: function (_data) {
  152. // callback(_data['empname']);
  153. // }
  154. // });
  155. // }
  156. //},
  157. ],
  158. mainId: 'Id',
  159. isPage: true,
  160. sord: 'CreateTime desc'
  161. });
  162. page.search();
  163. },
  164. search: function (param) {
  165. param = param || {};
  166. param.ClassManagerNo = learun.clientdata.get(['userinfo']).account;
  167. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  168. }
  169. };
  170. refreshGirdData = function () {
  171. $('#gridtable').jfGridSet('reload');
  172. };
  173. page.init();
  174. }