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.
 
 
 
 
 
 

296 lines
14 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. }, 300, 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. $('#Dormitory').lrDataSourceSelect({
  54. code: 'Acc_DormitoryData', value: 'id', text: 'name', select: function (item) {
  55. if (item) {
  56. $('#Unit').lrselectRefresh({
  57. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable',
  58. param: { code: 'Acc_UnitData', strWhere: "ParentID='" + item.id + "' order by name" }
  59. });
  60. }
  61. }
  62. });
  63. $('#Unit').lrselect({
  64. text: 'name',
  65. value: 'id',
  66. select: function (item) {
  67. if (item) {
  68. $('#Floor').lrselectRefresh({
  69. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable',
  70. param: { code: 'Acc_FloorData', strWhere: "ParentID='" + item.id + "' order by name" }
  71. });
  72. }
  73. }
  74. });
  75. $('#Floor').lrselect({
  76. text: 'name',
  77. value: 'id',
  78. select: function (item) {
  79. if (item) {
  80. $('#RId').lrselectRefresh({
  81. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable',
  82. param: { code: 'Acc_RoomData', strWhere: "ParentID='" + item.id + "' order by name" }
  83. });
  84. }
  85. }
  86. });
  87. $('#RId').lrselect({
  88. text: 'name',
  89. value: 'id',
  90. allowSearch: true
  91. });
  92. $('#DeptNo').lrselect({
  93. allowSearch: true,
  94. value: "deptno",
  95. text: "deptname",
  96. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdDeptInfo',
  97. select: function (item) {
  98. if (item) {
  99. $('#MajorNo').lrselectRefresh({
  100. allowSearch: true,
  101. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo',
  102. param: { strWhere: "DeptNo='" + item.deptno + "' AND CheckMark=1" }
  103. });
  104. } else {
  105. $('#MajorNo').lrselectRefresh({
  106. allowSearch: true,
  107. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo',
  108. param: { strWhere: "1=1 AND CheckMark=1" }
  109. });
  110. }
  111. }
  112. });
  113. $('#MajorNo').lrselect({
  114. allowSearch: true,
  115. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo',
  116. value: "majorno",
  117. text: "majorname",
  118. param: { strWhere: "1=1 AND CheckMark=1" },
  119. select: function (item) {
  120. if (item) {
  121. $('#ClassNo').lrselectRefresh({
  122. allowSearch: true,
  123. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  124. param: { strWhere: "majorno='" + item.majorno + "' AND CheckMark=1" }
  125. });
  126. } else {
  127. $('#ClassNo').lrselectRefresh({
  128. allowSearch: true,
  129. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  130. param: { strWhere: "1=1 AND CheckMark=1" }
  131. });
  132. }
  133. }
  134. });
  135. $('#ClassNo').lrselect({
  136. allowSearch: true,
  137. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  138. param: { strWhere: "1=1 AND CheckMark=1" },
  139. value: "classno",
  140. text: "classname"
  141. });
  142. // 快速新增
  143. $('#lr_addQuickly').on('click', function () {
  144. var keyValue = $('#gridtable').jfGridValue('Id');
  145. if (learun.checkrow(keyValue)) {
  146. selectedRow = $('#gridtable').jfGridGet('rowdata');
  147. //console.log(selectedRow);
  148. learun.layerForm({
  149. id: 'form',
  150. title: '快速新增',
  151. url: top.$.rootUrl + '/LogisticsManagement/Acc_DailyAssess/Form',
  152. width: 800,
  153. height: 600,
  154. callBack: function (id) {
  155. return top[id].acceptClick(refreshGirdData);
  156. }
  157. });
  158. }
  159. });
  160. },
  161. // 初始化列表
  162. initGird: function () {
  163. $('#gridtable').jfGrid({
  164. url: top.$.rootUrl + '/LogisticsManagement/Acc_DailyAssess/GetPageList',
  165. headData: [
  166. {
  167. label: "专业部", name: "DeptNo", width: 100, align: "left",
  168. formatterAsync: function (callback, value, row, op, $cell) {
  169. learun.clientdata.getAsync('custmerData', {
  170. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo',
  171. key: value,
  172. keyId: 'deptno',
  173. callback: function (_data) {
  174. callback(_data['deptname']);
  175. }
  176. });
  177. }
  178. },
  179. {
  180. label: "专业", name: "MajorNo", width: 100, align: "left",
  181. formatterAsync: function (callback, value, row, op, $cell) {
  182. learun.clientdata.getAsync('custmerData', {
  183. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo',
  184. key: value,
  185. keyId: 'majorno',
  186. callback: function (_data) {
  187. callback(_data['majorname']);
  188. }
  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. {
  206. label: "宿舍楼", name: "Dormitory", width: 100, align: "left",
  207. formatterAsync: function (callback, value, row, op, $cell) {
  208. learun.clientdata.getAsync('custmerData', {
  209. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Acc_DormitoryData',
  210. key: value,
  211. keyId: 'id',
  212. callback: function (_data) {
  213. callback(_data['name']);
  214. }
  215. });
  216. }
  217. },
  218. {
  219. label: "单元", name: "Unit", width: 100, align: "left",
  220. formatterAsync: function (callback, value, row, op, $cell) {
  221. learun.clientdata.getAsync('custmerData', {
  222. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Acc_UnitData',
  223. key: value,
  224. keyId: 'id',
  225. callback: function (_data) {
  226. callback(_data['name']);
  227. }
  228. });
  229. }
  230. },
  231. {
  232. label: "楼层", name: "Floor", width: 100, align: "left",
  233. formatterAsync: function (callback, value, row, op, $cell) {
  234. learun.clientdata.getAsync('custmerData', {
  235. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Acc_FloorData',
  236. key: value,
  237. keyId: 'id',
  238. callback: function (_data) {
  239. callback(_data['name']);
  240. }
  241. });
  242. }
  243. },
  244. {
  245. label: "寝室号", name: "RId", width: 100, align: "left",
  246. formatterAsync: function (callback, value, row, op, $cell) {
  247. learun.clientdata.getAsync('custmerData', {
  248. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Acc_RoomData',
  249. key: value,
  250. keyId: 'id',
  251. callback: function (_data) {
  252. callback(_data['name']);
  253. }
  254. });
  255. }
  256. },
  257. {
  258. label: "学生姓名", name: "StuNo", width: 100, align: "left",
  259. formatterAsync: function (callback, value, row, op, $cell) {
  260. learun.clientdata.getAsync('custmerData', {
  261. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'StuInfoBasic',
  262. key: value,
  263. keyId: 'stuno',
  264. callback: function (_data) {
  265. callback(_data['stuname']);
  266. }
  267. });
  268. }
  269. },
  270. { label: "日期", name: "Date", width: 130, align: "left" },
  271. { label: "卫生奖分", name: "AddScoreHealth", width: 100, align: "left" },
  272. { label: "卫生扣分", name: "MinusScoreHealth", width: 100, align: "left" },
  273. { label: "纪律奖分", name: "AddScore", width: 100, align: "left" },
  274. { label: "纪律扣分", name: "MinusScore", width: 100, align: "left" },
  275. { label: "奖扣分原因", name: "Reason", width: 200, align: "left" },
  276. ],
  277. mainId: 'Id',
  278. isPage: true,
  279. sidx: 'Date desc'
  280. });
  281. page.search();
  282. },
  283. search: function (param) {
  284. param = param || {};
  285. param.StartTime = startTime;
  286. param.EndTime = endTime;
  287. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  288. }
  289. };
  290. refreshGirdData = function () {
  291. page.search();
  292. };
  293. page.init();
  294. }