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.
 
 
 
 
 
 

219 lines
9.8 KiB

  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2020-08-11 16:27
  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. // 刷新
  17. $('#lr_refresh').on('click', function () {
  18. location.reload();
  19. });
  20. // 新增
  21. $('#lr_add').on('click', function () {
  22. learun.layerForm({
  23. id: 'form',
  24. title: '新增',
  25. url: top.$.rootUrl + '/LogisticsManagement/Acc_CleanManagement/Form',
  26. width: 800,
  27. height: 400,
  28. callBack: function (id) {
  29. return top[id].acceptClick(refreshGirdData);
  30. }
  31. });
  32. });
  33. // 编辑
  34. $('#lr_edit').on('click', function () {
  35. var keyValue = $('#gridtable').jfGridValue('ID');
  36. if (learun.checkrow(keyValue)) {
  37. learun.layerForm({
  38. id: 'form',
  39. title: '编辑',
  40. url: top.$.rootUrl + '/LogisticsManagement/Acc_CleanManagement/Form?keyValue=' + keyValue,
  41. width: 800,
  42. height: 400,
  43. callBack: function (id) {
  44. return top[id].acceptClick(refreshGirdData);
  45. }
  46. });
  47. }
  48. });
  49. // 删除
  50. $('#lr_delete').on('click', function () {
  51. var keyValue = $('#gridtable').jfGridValue('ID');
  52. if (learun.checkrow(keyValue)) {
  53. learun.layerConfirm('是否确认删除该项!', function (res) {
  54. if (res) {
  55. learun.deleteForm(top.$.rootUrl + '/LogisticsManagement/Acc_CleanManagement/DeleteForm', { keyValue: keyValue }, function () {
  56. refreshGirdData();
  57. });
  58. }
  59. });
  60. }
  61. });
  62. //合格
  63. $('#lr_check').on('click', function () {
  64. var keyValue = $('#gridtable').jfGridValue('ID');
  65. if (learun.checkrow(keyValue)) {
  66. learun.layerConfirm('是否确认合格?', function (res) {
  67. if (res) {
  68. learun.postForm(top.$.rootUrl + '/LogisticsManagement/Acc_CleanManagement/check', { keyValue: keyValue, status: true }, function () {
  69. refreshGirdData();
  70. });
  71. }
  72. })
  73. }
  74. })
  75. //不合格
  76. $('#lr_uncheck').on('click', function () {
  77. var keyValue = $('#gridtable').jfGridValue('ID');
  78. if (learun.checkrow(keyValue)) {
  79. learun.layerConfirm('是否确认不合格?', function (res) {
  80. if (res) {
  81. learun.postForm(top.$.rootUrl + '/LogisticsManagement/Acc_CleanManagement/check', { keyValue: keyValue, status: false }, function () {
  82. refreshGirdData();
  83. });
  84. }
  85. })
  86. }
  87. })
  88. },
  89. // 初始化列表
  90. initGird: function () {
  91. $('#gridtable').lrAuthorizeJfGrid({
  92. url: top.$.rootUrl + '/LogisticsManagement/Acc_CleanManagement/GetPageList',
  93. headData: [
  94. { label: "开始时间", name: "BeginTime", width: 100, align: "left" },
  95. { label: "结束时间", name: "EndTime", width: 100, align: "left" },
  96. {
  97. label: "打扫宿舍楼", name: "FDormitory", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) {
  98. learun.clientdata.getAsync('custmerData', {
  99. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Acc_DormitoryData',
  100. key: value,
  101. keyId: 'id',
  102. callback: function (_data) {
  103. callback(_data['name']);
  104. }
  105. });
  106. }
  107. },
  108. {
  109. label: "打扫单元", name: "FUnit", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) {
  110. learun.clientdata.getAsync('custmerData', {
  111. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Acc_UnitData',
  112. key: value,
  113. keyId: 'id',
  114. callback: function (_data) {
  115. callback(_data['name']);
  116. }
  117. });
  118. }
  119. },
  120. {
  121. label: "打扫楼层", name: "FId", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) {
  122. learun.clientdata.getAsync('custmerData', {
  123. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Acc_FloorData',
  124. key: value,
  125. keyId: 'id',
  126. callback: function (_data) {
  127. callback(_data['name']);
  128. }
  129. });
  130. }
  131. },
  132. {
  133. label: "值日宿舍楼", name: "RDormitory", width: 100, align: "left",
  134. formatterAsync: function (callback, value, row, op, $cell) {
  135. learun.clientdata.getAsync('custmerData', {
  136. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Acc_DormitoryData',
  137. key: value,
  138. keyId: 'id',
  139. callback: function (_data) {
  140. callback(_data['name']);
  141. }
  142. });
  143. }
  144. },
  145. {
  146. label: "值日单元", name: "RUnit", width: 100, align: "left",
  147. formatterAsync: function (callback, value, row, op, $cell) {
  148. learun.clientdata.getAsync('custmerData', {
  149. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Acc_UnitData',
  150. key: value,
  151. keyId: 'id',
  152. callback: function (_data) {
  153. callback(_data['name']);
  154. }
  155. });
  156. }
  157. },
  158. {
  159. label: "值日楼层", name: "RFloor", width: 100, align: "left",
  160. formatterAsync: function (callback, value, row, op, $cell) {
  161. learun.clientdata.getAsync('custmerData', {
  162. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Acc_FloorData',
  163. key: value,
  164. keyId: 'id',
  165. callback: function (_data) {
  166. callback(_data['name']);
  167. }
  168. });
  169. }
  170. },
  171. {
  172. label: "值日宿舍", name: "RId", width: 100, align: "left",
  173. formatterAsync: function (callback, value, row, op, $cell) {
  174. learun.clientdata.getAsync('custmerData', {
  175. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Acc_RoomData',
  176. key: value,
  177. keyId: 'id',
  178. callback: function (_data) {
  179. callback(_data['name']);
  180. }
  181. });
  182. }
  183. },
  184. {
  185. label: "状态", name: "Status", width: 100, align: "left", formatter: function (val) {
  186. switch (val) {
  187. case "1":
  188. return '合格';
  189. break;
  190. case "2":
  191. return '不合格';
  192. break;
  193. default:
  194. return '未检查';
  195. }
  196. }
  197. },
  198. ],
  199. mainId: 'ID',
  200. isPage: true
  201. });
  202. page.search();
  203. },
  204. search: function (param) {
  205. param = param || {};
  206. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  207. }
  208. };
  209. refreshGirdData = function () {
  210. page.search();
  211. };
  212. page.init();
  213. }