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

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