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.
 
 
 
 
 
 

208 lines
9.9 KiB

  1. /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
  2. * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2021-03-26 11:35
  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. $('#CancelLeaveType').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/StuCancelLeaveManagement/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/StuCancelLeaveManagement/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/StuCancelLeaveManagement/DeleteForm', { keyValue: keyValue}, function () {
  71. refreshGirdData();
  72. });
  73. }
  74. });
  75. }
  76. });
  77. },
  78. // 初始化列表
  79. initGird: function () {
  80. $('#gridtable').lrAuthorizeJfGrid({
  81. url: top.$.rootUrl + '/EducationalAdministration/StuCancelLeaveManagement/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. { label: "销假类型", name: "CancelLeaveType", width: 100, align: "left",
  111. formatterAsync: function (callback, value, row, op,$cell) {
  112. learun.clientdata.getAsync('dataItem', {
  113. key: value,
  114. code: 'LeaveType',
  115. callback: function (_data) {
  116. callback(_data.text);
  117. }
  118. });
  119. }},
  120. { label: "到校时间", name: "WorkTime", width: 120, align: "left"},
  121. { label: "销假事由", name: "CancelLeaveReason", width: 100, align: "left" },
  122. { label: "学号", name: "CreateUserNo", width: 100, align: "left" },
  123. { label: "姓名", name: "CreateUserName", width: 100, align: "left" },
  124. { label: "申请时间", name: "CreateTime", width: 130, align: "left" },
  125. {
  126. label: "班级", name: "ClassNo", width: 100, align: "left",
  127. formatterAsync: function (callback, value, row, op, $cell) {
  128. learun.clientdata.getAsync('custmerData', {
  129. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj',
  130. key: value,
  131. keyId: 'classno',
  132. callback: function (_data) {
  133. callback(_data['classname']);
  134. }
  135. });
  136. }
  137. },
  138. {
  139. label: "系部", name: "DeptNo", width: 100, align: "left",
  140. formatterAsync: function (callback, value, row, op, $cell) {
  141. learun.clientdata.getAsync('custmerData', {
  142. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo',
  143. key: value,
  144. keyId: 'deptno',
  145. callback: function (_data) {
  146. callback(_data['deptname']);
  147. }
  148. });
  149. }
  150. },
  151. {
  152. label: "专业", name: "MajorNo", width: 100, align: "left",
  153. formatterAsync: function (callback, value, row, op, $cell) {
  154. learun.clientdata.getAsync('custmerData', {
  155. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo',
  156. key: value,
  157. keyId: 'majorno',
  158. callback: function (_data) {
  159. callback(_data['majorname']);
  160. }
  161. });
  162. }
  163. },
  164. {
  165. label: "班主任", name: "ClassDiredctorNo", width: 100, align: "left",
  166. formatterAsync: function (callback, value, row, op, $cell) {
  167. learun.clientdata.getAsync('custmerData', {
  168. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo',
  169. key: value,
  170. keyId: 'empno',
  171. callback: function (_data) {
  172. callback(_data['empname']);
  173. }
  174. });
  175. }
  176. },
  177. {
  178. label: "辅导员", name: "ClassTutorNo", width: 100, align: "left",
  179. formatterAsync: function (callback, value, row, op, $cell) {
  180. learun.clientdata.getAsync('custmerData', {
  181. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo',
  182. key: value,
  183. keyId: 'empno',
  184. callback: function (_data) {
  185. callback(_data['empname']);
  186. }
  187. });
  188. }
  189. },
  190. ],
  191. mainId:'Id',
  192. isPage: true,
  193. sord: 'CreateTime desc'
  194. });
  195. page.search();
  196. },
  197. search: function (param) {
  198. param = param || {};
  199. param.StuNo = learun.clientdata.get(['userinfo']).account;
  200. $('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) });
  201. }
  202. };
  203. refreshGirdData = function () {
  204. $('#gridtable').jfGridSet('reload');
  205. };
  206. page.init();
  207. }