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.
 
 
 
 
 
 

194 lines
9.0 KiB

  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2019-05-24 15:40
  5. * 描 述:学生请假记录
  6. */
  7. var refreshGirdData;
  8. var bootstrap = function ($, learun) {
  9. "use strict";
  10. var startTime;
  11. var endTime;
  12. var page = {
  13. init: function () {
  14. page.initGird();
  15. page.bind();
  16. },
  17. bind: function () {
  18. page.search();
  19. // 时间搜索框
  20. $('#datesearch').lrdate({
  21. dfdata: [
  22. { name: '今天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00') }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
  23. { name: '近7天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'd', -6) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
  24. { name: '近1个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -1) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
  25. { name: '近3个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -3) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }
  26. ],
  27. // 月
  28. mShow: false,
  29. premShow: false,
  30. // 季度
  31. jShow: false,
  32. prejShow: false,
  33. // 年
  34. ysShow: false,
  35. yxShow: false,
  36. preyShow: false,
  37. yShow: false,
  38. // 默认
  39. dfvalue: '1',
  40. selectfn: function (begin, end) {
  41. startTime = begin;
  42. endTime = end;
  43. page.search();
  44. }
  45. });
  46. $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
  47. page.search(queryJson);
  48. }, 220, 400);
  49. // 刷新
  50. $('#lr_refresh').on('click', function () {
  51. location.reload();
  52. });
  53. // 新增
  54. $('#lr_add').on('click', function () {
  55. learun.layerForm({
  56. id: 'form',
  57. title: '新增',
  58. url: top.$.rootUrl + '/EducationalAdministration/StuAttendanceLeave/Form',
  59. width: 600,
  60. height: 400,
  61. callBack: function (id) {
  62. return top[id].acceptClick(refreshGirdData);
  63. }
  64. });
  65. });
  66. // 编辑
  67. $('#lr_edit').on('click', function () {
  68. var keyValue = $('#gridtable').jfGridValue('ID');
  69. if (learun.checkrow(keyValue)) {
  70. learun.layerForm({
  71. id: 'form',
  72. title: '编辑',
  73. url: top.$.rootUrl + '/EducationalAdministration/StuAttendanceLeave/Form?keyValue=' + keyValue,
  74. width: 600,
  75. height: 400,
  76. callBack: function (id) {
  77. return top[id].acceptClick(refreshGirdData);
  78. }
  79. });
  80. }
  81. });
  82. // 删除
  83. $('#lr_delete').on('click', function () {
  84. var keyValue = $('#gridtable').jfGridValue('ID');
  85. if (learun.checkrow(keyValue)) {
  86. learun.layerConfirm('是否确认删除该项!', function (res) {
  87. if (res) {
  88. learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/StuAttendanceLeave/DeleteForm', { keyValue: keyValue }, function () {
  89. refreshGirdData();
  90. });
  91. }
  92. });
  93. }
  94. });
  95. //审核
  96. $("#lr_check").on('click', function () {
  97. var keyValue = $("#gridtable").jfGridValue('ID');
  98. if (learun.checkrow(keyValue)) {
  99. var check = $("#gridtable").jfGridValue('IsCheck');
  100. if (check == "1") {
  101. learun.alert.warning("该项已审核同意!");
  102. return false;
  103. } else {
  104. learun.layerForm({
  105. id: 'checkform',
  106. title: '审核',
  107. url: top.$.rootUrl + '/EducationalAdministration/StuAttendanceLeave/CheckForm?keyValue=' + keyValue,
  108. width: 1200,
  109. height: 800,
  110. callBack: function (id) {
  111. return top[id].acceptClick(refreshGirdData);
  112. }
  113. });
  114. }
  115. }
  116. })
  117. // 打印
  118. $('#lr_print').on('click', function () {
  119. $('#gridtable').jqprintTable();
  120. });
  121. },
  122. // 初始化列表
  123. initGird: function () {
  124. $('#gridtable').lrAuthorizeJfGrid({
  125. url: top.$.rootUrl + '/EducationalAdministration/StuAttendanceLeave/GetPageList',
  126. headData: [
  127. { label: "申请时间", name: "UpdateDate", width: 100, align: "left" },
  128. {
  129. label: "审核状态", name: "IsCheck", width: 100, align: "left",
  130. formatterAsync: function (callback, value, row, op, $cell) {
  131. learun.clientdata.getAsync('dataItem', {
  132. key: value,
  133. code: 'LeaveCheck',
  134. callback: function (_data) {
  135. callback(_data.text ? _data.text : "申请中");
  136. }
  137. });
  138. }
  139. },
  140. { label: "审核备注", name: "TecRemark", width: 100, align: "left" },
  141. {
  142. label: "请假类型", name: "LeaveType", width: 100, align: "left",
  143. formatterAsync: function (callback, value, row, op, $cell) {
  144. learun.clientdata.getAsync('dataItem', {
  145. key: value,
  146. code: 'LeaveType',
  147. callback: function (_data) {
  148. callback(_data.text);
  149. }
  150. });
  151. }
  152. },
  153. { label: "学年", name: "AcademicYearNo", width: 100, align: "left" },
  154. { label: "学期", name: "Semester", width: 100, align: "left" },
  155. { label: "学号", name: "StuNo", width: 100, align: "left" },
  156. { label: "姓名", name: "StuName", width: 100, align: "left" },
  157. { label: "年级", name: "Grade", width: 100, align: "left" },
  158. { label: "系所码", name: "DeptNo", width: 100, align: "left" },
  159. { label: "系名", name: "DeptName", width: 100, align: "left" },
  160. { label: "专业码", name: "MajorNo", width: 100, align: "left" },
  161. { label: "专业名", name: "MajorName", width: 100, align: "left" },
  162. { label: "所在行政班号 ", name: "ClassNo", width: 100, align: "left" },
  163. { label: "班级名称", name: "ClassName", width: 100, align: "left" },
  164. { label: "课程号", name: "LessonNo", width: 100, align: "left" },
  165. { label: "课程名称", name: "LessonName", width: 100, align: "left" },
  166. { label: "课程类别码", name: "LessonSortNo", width: 100, align: "left" },
  167. { label: "课程类别", name: "LessonSortName", width: 100, align: "left" },
  168. { label: "原上课日期", name: "LessonDate", width: 100, align: "left" },
  169. { label: "上课时间", name: "LessonTime", width: 100, align: "left" },
  170. { label: "教师号", name: "EmpNo", width: 100, align: "left" },
  171. { label: "备注", name: "Remark", width: 100, align: "left" },
  172. ],
  173. mainId: 'ID',
  174. isPage: true,
  175. sord: 'UpdateDate desc'
  176. });
  177. page.search();
  178. },
  179. search: function (param) {
  180. param = param || {};
  181. param.StartTime = startTime;
  182. param.EndTime = endTime;
  183. param.ClassManagerNo = learun.clientdata.get(['userinfo']).account;
  184. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  185. }
  186. };
  187. refreshGirdData = function () {
  188. page.search();
  189. };
  190. page.init();
  191. }