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.

Index.js 6.6 KiB

4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2020-08-12 14:37
  5. * 描 述:校服补订管理
  6. */
  7. var refreshGirdData;
  8. var stuId = request('StuId');
  9. var bootstrap = function ($, learun) {
  10. "use strict";
  11. var page = {
  12. init: function () {
  13. page.initGird();
  14. page.bind();
  15. },
  16. bind: function () {
  17. // 刷新
  18. $('#lr_refresh').on('click', function () {
  19. location.reload();
  20. });
  21. // 新增
  22. $('#lr_add').on('click', function () {
  23. learun.layerForm({
  24. id: 'form1',
  25. title: '新增',
  26. url: top.$.rootUrl + '/EducationalAdministration/StuInfoFreshSus/Form?stuId=' + stuId,
  27. width: 600,
  28. height: 400,
  29. callBack: function (id) {
  30. return top[id].acceptClick(refreshGirdData);
  31. }
  32. });
  33. });
  34. // 编辑
  35. $('#lr_edit').on('click', function () {
  36. var keyValue = $('#gridtable').jfGridValue('ID');
  37. if (learun.checkrow(keyValue)) {
  38. learun.layerForm({
  39. id: 'form1',
  40. title: '编辑',
  41. url: top.$.rootUrl + '/EducationalAdministration/StuInfoFreshSus/Form?keyValue=' + keyValue,
  42. width: 600,
  43. height: 400,
  44. callBack: function (id) {
  45. return top[id].acceptClick(refreshGirdData);
  46. }
  47. });
  48. }
  49. });
  50. // 删除
  51. $('#lr_delete').on('click', function () {
  52. var keyValue = $('#gridtable').jfGridValue('ID');
  53. if (learun.checkrow(keyValue)) {
  54. learun.layerConfirm('是否确认删除该项!', function (res) {
  55. if (res) {
  56. learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/StuInfoFreshSus/DeleteForm', { keyValue: keyValue }, function () {
  57. refreshGirdData();
  58. });
  59. }
  60. });
  61. }
  62. });
  63. //领取校服
  64. $('#lr_get').on('click', function () {
  65. var keyValue = $('#gridtable').jfGridValue('ID');
  66. if (learun.checkrow(keyValue)) {
  67. learun.layerConfirm('是否确认领取校服!', function (res) {
  68. if (res) {
  69. learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuInfoFreshSus/GetUniform', { keyValue: keyValue, status: true }, function () {
  70. refreshGirdData();
  71. });
  72. }
  73. });
  74. }
  75. })
  76. //未领取校服
  77. $('#lr_unGet').on('click', function () {
  78. var keyValue = $('#gridtable').jfGridValue('ID');
  79. if (learun.checkrow(keyValue)) {
  80. learun.layerConfirm('是否确认未领取校服!', function (res) {
  81. if (res) {
  82. learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuInfoFreshSus/GetUniform', { keyValue: keyValue, status: false }, function () {
  83. refreshGirdData();
  84. });
  85. }
  86. });
  87. }
  88. })
  89. //校服缴费
  90. $('#lr_pay').on('click', function () {
  91. var keyValue = $('#gridtable').jfGridValue('ID');
  92. if (learun.checkrow(keyValue)) {
  93. learun.layerConfirm('是否确认缴费!', function (res) {
  94. if (res) {
  95. learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuInfoFreshSus/PayUniform', { keyValue: keyValue, status: true }, function () {
  96. refreshGirdData();
  97. });
  98. }
  99. });
  100. }
  101. })
  102. //校服未缴费
  103. $('#lr_unPay').on('click', function () {
  104. var keyValue = $('#gridtable').jfGridValue('ID');
  105. if (learun.checkrow(keyValue)) {
  106. learun.layerConfirm('是否确认未缴费!', function (res) {
  107. if (res) {
  108. learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuInfoFreshSus/PayUniform', { keyValue: keyValue, status: false }, function () {
  109. refreshGirdData();
  110. });
  111. }
  112. });
  113. }
  114. })
  115. },
  116. // 初始化列表
  117. initGird: function () {
  118. $('#gridtable').lrAuthorizeJfGrid({
  119. url: top.$.rootUrl + '/EducationalAdministration/StuInfoFreshSus/GetPageList',
  120. headData: [
  121. { label: "身高体重", name: "HighWeight", width: 100, align: "left" },
  122. { label: "校服尺寸", name: "CSize", width: 100, align: "left" },
  123. { label: "补订时间", name: "ApplyTime", width: 100, align: "left" },
  124. {
  125. label: "是否领取", name: "IsGet", width: 100, align: "left", formatter: function (val) {
  126. return val == '1' ? "<span class=\"label label-success\">已领取</span>" : "<span class=\"label label-warning\">未领取</span>";
  127. }
  128. },
  129. {
  130. label: "是否支付", name: "IsPay", width: 100, align: "left", formatter: function (val) {
  131. return val == '1' ? "<span class=\"label label-success\">已支付</span>" : "<span class=\"label label-warning\">未支付</span>";
  132. }
  133. },
  134. ],
  135. mainId: 'ID',
  136. isPage: true
  137. });
  138. page.search();
  139. },
  140. search: function (param) {
  141. param = param || {};
  142. if (stuId) {
  143. param.StuID = stuId;
  144. }
  145. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  146. }
  147. };
  148. refreshGirdData = function () {
  149. page.search();
  150. };
  151. page.init();
  152. }