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.
 
 
 
 
 
 

216 lines
9.7 KiB

  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2019-05-05 15:44
  5. * 描 述:宿舍卫生管理
  6. */
  7. var refreshGirdData;
  8. var selectedParent = {};
  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. $('#dataTree').lrtree({
  19. url: top.$.rootUrl + '/LogisticsManagement/Sanitation/GetTree',
  20. nodeClick: function (item) {
  21. selectedParent.ID = item.value;
  22. selectedParent.hasChildren = item.hasChildren;
  23. selectedParent.textName = item.text;
  24. page.search({ RoomID: item.value });
  25. }
  26. });
  27. // 刷新
  28. $('#lr_refresh').on('click', function () {
  29. location.reload();
  30. });
  31. // 新增
  32. $('#lr_add').on('click', function () {
  33. if (selectedParent.hasChildren || selectedParent.textName.indexOf("室") == -1) {
  34. learun.alert.warning('请选择宿舍评分');
  35. return;
  36. }
  37. learun.layerForm({
  38. id: 'form',
  39. title: '新增',
  40. url: top.$.rootUrl + '/LogisticsManagement/Sanitation/Form?roomID=' + selectedParent.ID,
  41. width: 600,
  42. height: 400,
  43. callBack: function (id) {
  44. return top[id].acceptClick(refreshGirdData);
  45. }
  46. });
  47. });
  48. // 编辑
  49. $('#lr_edit').on('click', function () {
  50. var keyValue = $('#gridtable').jfGridValue('zbid');
  51. if (learun.checkrow(keyValue)) {
  52. learun.layerForm({
  53. id: 'form',
  54. title: '编辑',
  55. url: top.$.rootUrl + '/LogisticsManagement/Sanitation/Form?keyValue=' + keyValue,
  56. width: 600,
  57. height: 400,
  58. callBack: function (id) {
  59. return top[id].acceptClick(refreshGirdData);
  60. }
  61. });
  62. }
  63. });
  64. // 删除
  65. $('#lr_delete').on('click', function () {
  66. var keyValue = $('#gridtable').jfGridValue('zbid');
  67. if (learun.checkrow(keyValue)) {
  68. learun.layerConfirm('是否确认删除该项!', function (res) {
  69. if (res) {
  70. learun.deleteForm(top.$.rootUrl + '/LogisticsManagement/Sanitation/DeleteForm', { keyValue: keyValue }, function () {
  71. refreshGirdData();
  72. });
  73. }
  74. });
  75. }
  76. });
  77. // 打印
  78. $('#lr_print').on('click', function () {
  79. $('#gridtable').jqprintTable();
  80. });
  81. },
  82. // 初始化列表
  83. initGird: function () {
  84. $('#gridtable').lrAuthorizeJfGrid({
  85. url: top.$.rootUrl + '/LogisticsManagement/Sanitation/GetPageList',
  86. headData: [
  87. {
  88. label: "类型", name: "AType", width: 80, align: "left",
  89. formatter: function (cellvalue) {
  90. if (cellvalue == 0) {
  91. return "卫生";
  92. } else {
  93. return "纪律";
  94. }
  95. }
  96. },
  97. {
  98. label: "院系", name: "dept", width: 100, align: "left",
  99. formatterAsync: function (callback, value, row, op, $cell) {
  100. learun.clientdata.getAsync('custmerData', {
  101. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo',
  102. key: value,
  103. keyId: 'deptno',
  104. callback: function (_data) {
  105. callback(_data['deptname']);
  106. }
  107. });
  108. }
  109. },
  110. {
  111. label: "专业", name: "major", width: 100, align: "left",
  112. formatterAsync: function (callback, value, row, op, $cell) {
  113. learun.clientdata.getAsync('custmerData', {
  114. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo',
  115. key: value,
  116. keyId: 'majorno',
  117. callback: function (_data) {
  118. callback(_data['majorname']);
  119. }
  120. });
  121. }
  122. },
  123. {
  124. label: "班级", name: "classno", width: 100, align: "left",
  125. formatterAsync: function (callback, value, row, op, $cell) {
  126. learun.clientdata.getAsync('custmerData', {
  127. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj',
  128. key: value,
  129. keyId: 'classno',
  130. callback: function (_data) {
  131. callback(_data['classname']);
  132. }
  133. });
  134. }
  135. },
  136. {
  137. label: "宿舍楼", name: "ApartmentId", width: 100, align: "left",
  138. formatterAsync: function (callback, value, row, op, $cell) {
  139. learun.clientdata.getAsync('custmerData', {
  140. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Acc_DormitoryData',
  141. key: value,
  142. keyId: 'id',
  143. callback: function (_data) {
  144. callback(_data['name']);
  145. }
  146. });
  147. }
  148. },
  149. {
  150. label: "评价", name: "Grade", width: 100, align: "left",
  151. formatter: function (cellvalue) {
  152. if (cellvalue == 0) {
  153. return "5-优";
  154. } else if (cellvalue == 1) {
  155. return "3-良";
  156. } else if (cellvalue == 2) {
  157. return "1-中";
  158. } else if (cellvalue == 3) {
  159. return "0-差";
  160. }
  161. }
  162. },
  163. {
  164. label: "班主任", name: "empnoone", width: 100, align: "left",
  165. formatterAsync: function (callback, value, row, op, $cell) {
  166. learun.clientdata.getAsync('custmerData', {
  167. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'teacheruserdata',
  168. key: value,
  169. keyId: 'f_encode',
  170. callback: function (_data) {
  171. callback(_data['f_realname']);
  172. }
  173. });
  174. }
  175. },
  176. { label: "电话", name: "mobileone", width: 100, align: "left" },
  177. {
  178. label: "辅导员", name: "empnotwo", width: 100, align: "left",
  179. formatterAsync: function (callback, value, row, op, $cell) {
  180. learun.clientdata.getAsync('custmerData', {
  181. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'teacheruserdata',
  182. key: value,
  183. keyId: 'f_encode',
  184. callback: function (_data) {
  185. callback(_data['f_realname']);
  186. }
  187. });
  188. }
  189. },
  190. { label: "电话", name: "mobiletwo", width: 100, align: "left" },
  191. { label: "考核人", name: "GradedUser", width: 100, align: "left" },
  192. {
  193. label: "时间", name: "GradedTime", width: 100, align: "left",
  194. formatter: function (cellvalue) {
  195. return learun.formatDate(cellvalue, 'yyyy-MM-dd');
  196. }
  197. },
  198. { label: "备注", name: "demo", width: 100, align: "left" },
  199. ],
  200. mainId: 'GradedTime',
  201. sidx: 'GradedTime desc',
  202. isPage: true
  203. });
  204. //page.search();
  205. },
  206. search: function (param) {
  207. param = param || {};
  208. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  209. }
  210. };
  211. refreshGirdData = function () {
  212. page.search({ RoomID: selectedParent.ID });
  213. };
  214. page.init();
  215. }