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.
 
 
 
 
 
 

248 lines
11 KiB

  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_StuDayRoutine/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_StuDayRoutine/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_StuDayRoutine/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_StuDayRoutine/Form',
  157. width: 800,
  158. height: 600,
  159. callBack: function (id) {
  160. return top[id].acceptClick(refreshGirdData);
  161. }
  162. });
  163. }
  164. });
  165. },
  166. // 初始化列表
  167. initGird: function () {
  168. $('#gridtable').jfGrid({
  169. url: top.$.rootUrl + '/LogisticsManagement/Acc_StuDayRoutine/GetPageList',
  170. headData: [
  171. {
  172. label: "专业部", name: "DeptNo", width: 100, align: "left",
  173. formatterAsync: function (callback, value, row, op, $cell) {
  174. learun.clientdata.getAsync('custmerData', {
  175. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo',
  176. key: value,
  177. keyId: 'deptno',
  178. callback: function (_data) {
  179. callback(_data['deptname']);
  180. }
  181. });
  182. }
  183. },
  184. {
  185. label: "专业", name: "MajorNo", width: 100, align: "left",
  186. formatterAsync: function (callback, value, row, op, $cell) {
  187. learun.clientdata.getAsync('custmerData', {
  188. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo',
  189. key: value,
  190. keyId: 'majorno',
  191. callback: function (_data) {
  192. callback(_data['majorname']);
  193. }
  194. });
  195. }
  196. },
  197. {
  198. label: "班级", name: "ClassNo", width: 100, align: "left",
  199. formatterAsync: function (callback, value, row, op, $cell) {
  200. learun.clientdata.getAsync('custmerData', {
  201. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj',
  202. key: value,
  203. keyId: 'classno',
  204. callback: function (_data) {
  205. callback(_data['classname']);
  206. }
  207. });
  208. }
  209. },
  210. {
  211. label: "学生姓名", name: "StuNo", width: 100, align: "left",
  212. formatterAsync: function (callback, value, row, op, $cell) {
  213. learun.clientdata.getAsync('custmerData', {
  214. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'StuInfoBasic',
  215. key: value,
  216. keyId: 'stuno',
  217. callback: function (_data) {
  218. callback(_data['stuname']);
  219. }
  220. });
  221. }
  222. },
  223. { label: "日期", name: "Date", width: 130, align: "left" },
  224. { label: "奖分", name: "AddScore", width: 100, align: "left" },
  225. { label: "扣分", name: "MinusScore", width: 100, align: "left" },
  226. { label: "奖扣分原因", name: "Reason", width: 200, align: "left" },
  227. ],
  228. mainId: 'Id',
  229. isPage: true
  230. });
  231. page.search();
  232. },
  233. search: function (param) {
  234. param = param || {};
  235. param.StartTime = startTime;
  236. param.EndTime = endTime;
  237. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  238. }
  239. };
  240. refreshGirdData = function () {
  241. page.search();
  242. };
  243. page.init();
  244. }