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 11 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2020-08-11 16:55
  5. * 描 述:公共区域卫生管理
  6. */
  7. var selectedRow;
  8. var refreshGirdData;
  9. var bootstrap = function ($, learun) {
  10. "use strict";
  11. var startTime;
  12. var endTime;
  13. var page = {
  14. init: function () {
  15. page.initGird();
  16. page.bind();
  17. },
  18. bind: function () {
  19. $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
  20. page.search(queryJson);
  21. }, 220, 400);
  22. // 时间搜索框
  23. $('#datesearch').lrdate({
  24. dfdata: [
  25. { name: '今天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00') }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
  26. { 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') } },
  27. { 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') } },
  28. { 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') } }
  29. ],
  30. // 月
  31. mShow: false,
  32. premShow: false,
  33. // 季度
  34. jShow: false,
  35. prejShow: false,
  36. // 年
  37. ysShow: false,
  38. yxShow: false,
  39. preyShow: false,
  40. yShow: false,
  41. // 默认
  42. dfvalue: '1',
  43. selectfn: function (begin, end) {
  44. startTime = begin;
  45. endTime = end;
  46. page.search();
  47. }
  48. });
  49. // 刷新
  50. $('#lr_refresh').on('click', function () {
  51. location.reload();
  52. });
  53. $('#DeptNo').lrselect({
  54. allowSearch: true,
  55. value: "deptno",
  56. text: "deptname",
  57. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdDeptInfo',
  58. select: function (item) {
  59. if (item) {
  60. $('#MajorNo').lrselectRefresh({
  61. allowSearch: true,
  62. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo',
  63. param: { strWhere: "DeptNo='" + item.deptno + "' AND CheckMark=1" }
  64. });
  65. } else {
  66. $('#MajorNo').lrselectRefresh({
  67. allowSearch: true,
  68. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo',
  69. param: { strWhere: "1=1 AND CheckMark=1" }
  70. });
  71. }
  72. }
  73. });
  74. $('#MajorNo').lrselect({
  75. allowSearch: true,
  76. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo',
  77. value: "majorno",
  78. text: "majorname",
  79. param: { strWhere: "1=1 AND CheckMark=1" },
  80. select: function (item) {
  81. if (item) {
  82. $('#ClassNo').lrselectRefresh({
  83. allowSearch: true,
  84. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  85. param: { strWhere: "majorno='" + item.majorno + "' AND CheckMark=1" }
  86. });
  87. } else {
  88. $('#ClassNo').lrselectRefresh({
  89. allowSearch: true,
  90. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  91. param: { strWhere: "1=1 AND CheckMark=1" }
  92. });
  93. }
  94. }
  95. });
  96. $('#ClassNo').lrselect({
  97. allowSearch: true,
  98. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  99. param: { strWhere: "1=1 AND CheckMark=1" },
  100. value: "classno",
  101. text: "classname"
  102. });
  103. // 新增
  104. $('#lr_add').on('click', function () {
  105. selectedRow = null;
  106. learun.layerForm({
  107. id: 'form',
  108. title: '新增',
  109. url: top.$.rootUrl + '/LogisticsManagement/Acc_PublicAreaHealth/Form',
  110. width: 800,
  111. height: 600,
  112. callBack: function (id) {
  113. return top[id].acceptClick(refreshGirdData);
  114. }
  115. });
  116. });
  117. // 编辑
  118. $('#lr_edit').on('click', function () {
  119. selectedRow = null;
  120. var keyValue = $('#gridtable').jfGridValue('Id');
  121. if (learun.checkrow(keyValue)) {
  122. learun.layerForm({
  123. id: 'form',
  124. title: '编辑',
  125. url: top.$.rootUrl + '/LogisticsManagement/Acc_PublicAreaHealth/Form?keyValue=' + keyValue,
  126. width: 800,
  127. height: 600,
  128. callBack: function (id) {
  129. return top[id].acceptClick(refreshGirdData);
  130. }
  131. });
  132. }
  133. });
  134. // 删除
  135. $('#lr_delete').on('click', function () {
  136. var keyValue = $('#gridtable').jfGridValue('Id');
  137. if (learun.checkrow(keyValue)) {
  138. learun.layerConfirm('是否确认删除该项!', function (res) {
  139. if (res) {
  140. learun.deleteForm(top.$.rootUrl + '/LogisticsManagement/Acc_PublicAreaHealth/DeleteForm', { keyValue: keyValue }, function () {
  141. refreshGirdData();
  142. });
  143. }
  144. });
  145. }
  146. });
  147. // 快速新增
  148. $('#lr_addQuickly').on('click', function () {
  149. var keyValue = $('#gridtable').jfGridValue('Id');
  150. if (learun.checkrow(keyValue)) {
  151. selectedRow = $('#gridtable').jfGridGet('rowdata');
  152. //console.log(selectedRow);
  153. learun.layerForm({
  154. id: 'form',
  155. title: '快速新增',
  156. url: top.$.rootUrl + '/LogisticsManagement/Acc_PublicAreaHealth/Form',
  157. width: 800,
  158. height: 600,
  159. callBack: function (id) {
  160. return top[id].acceptClick(refreshGirdData);
  161. }
  162. });
  163. }
  164. });
  165. // 打印
  166. $('#lr_print').on('click', function () {
  167. $('#gridtable').jqprintTable();
  168. });
  169. },
  170. // 初始化列表
  171. initGird: function () {
  172. $('#gridtable').jfGrid({
  173. url: top.$.rootUrl + '/LogisticsManagement/Acc_PublicAreaHealth/GetPageList',
  174. headData: [
  175. {
  176. label: "专业部", name: "DeptNo", width: 100, align: "left",
  177. formatterAsync: function (callback, value, row, op, $cell) {
  178. learun.clientdata.getAsync('custmerData', {
  179. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo',
  180. key: value,
  181. keyId: 'deptno',
  182. callback: function (_data) {
  183. callback(_data['deptname']);
  184. }
  185. });
  186. }
  187. },
  188. {
  189. label: "专业", name: "MajorNo", width: 100, align: "left",
  190. formatterAsync: function (callback, value, row, op, $cell) {
  191. learun.clientdata.getAsync('custmerData', {
  192. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo',
  193. key: value,
  194. keyId: 'majorno',
  195. callback: function (_data) {
  196. callback(_data['majorname']);
  197. }
  198. });
  199. }
  200. },
  201. {
  202. label: "班级", name: "ClassNo", width: 100, align: "left",
  203. formatterAsync: function (callback, value, row, op, $cell) {
  204. learun.clientdata.getAsync('custmerData', {
  205. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj',
  206. key: value,
  207. keyId: 'classno',
  208. callback: function (_data) {
  209. callback(_data['classname']);
  210. }
  211. });
  212. }
  213. },
  214. {
  215. label: "学生姓名", name: "StuNo", width: 100, align: "left",
  216. formatterAsync: function (callback, value, row, op, $cell) {
  217. learun.clientdata.getAsync('custmerData', {
  218. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'StuInfoBasic',
  219. key: value,
  220. keyId: 'stuno',
  221. callback: function (_data) {
  222. callback(_data['stuname']);
  223. }
  224. });
  225. }
  226. },
  227. { label: "日期", name: "Date", width: 130, align: "left" },
  228. { label: "奖分", name: "AddScore", width: 100, align: "left" },
  229. { label: "扣分", name: "MinusScore", width: 100, align: "left" },
  230. { label: "奖扣分原因", name: "Reason", width: 200, align: "left" },
  231. ],
  232. mainId: 'Id',
  233. isPage: true
  234. });
  235. page.search();
  236. },
  237. search: function (param) {
  238. param = param || {};
  239. param.StartTime = startTime;
  240. param.EndTime = endTime;
  241. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  242. }
  243. };
  244. refreshGirdData = function () {
  245. page.search();
  246. };
  247. page.init();
  248. }