Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 
 
 

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