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.
 
 
 
 
 
 

348 lines
16 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 HkeyValue = request('keyValue');
  10. var Dormitory = request('Dormitory');
  11. var Unit = request('Unit');
  12. var Floor = request('Floor');
  13. var RId = request('RId');
  14. var bootstrap = function ($, learun) {
  15. "use strict";
  16. var startTime;
  17. var endTime;
  18. var page = {
  19. init: function () {
  20. page.initGird();
  21. page.bind();
  22. },
  23. bind: function () {
  24. $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
  25. page.search(queryJson);
  26. }, 300, 400);
  27. // 时间搜索框
  28. $('#datesearch').lrdate({
  29. dfdata: [
  30. { name: '今天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00') }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
  31. { 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') } },
  32. { 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') } },
  33. { 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') } }
  34. ],
  35. // 月
  36. mShow: false,
  37. premShow: false,
  38. // 季度
  39. jShow: false,
  40. prejShow: false,
  41. // 年
  42. ysShow: false,
  43. yxShow: false,
  44. preyShow: false,
  45. yShow: false,
  46. // 默认
  47. dfvalue: '1',
  48. selectfn: function (begin, end) {
  49. startTime = begin;
  50. endTime = end;
  51. page.search();
  52. }
  53. });
  54. // 刷新
  55. $('#lr_refresh').on('click', function () {
  56. location.reload();
  57. });
  58. //$('#Dormitory').lrDataSourceSelect({
  59. // code: 'Acc_DormitoryData', value: 'id', text: 'name', select: function (item) {
  60. // if (item) {
  61. // $('#Unit').lrselectRefresh({
  62. // url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable',
  63. // param: { code: 'Acc_UnitData', strWhere: "ParentID='" + item.id + "' order by name" }
  64. //});
  65. //}
  66. //}
  67. //});
  68. //$('#Unit').lrselect({
  69. // text: 'name',
  70. //value: 'id',
  71. //select: function (item) {
  72. // if (item) {
  73. // $('#Floor').lrselectRefresh({
  74. // url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable',
  75. // param: { code: 'Acc_FloorData', strWhere: "ParentID='" + item.id + "' order by name" }
  76. //});
  77. //}
  78. //}
  79. //});
  80. //$('#Floor').lrselect({
  81. // text: 'name',
  82. //value: 'id',
  83. //select: function (item) {
  84. // if (item) {
  85. // $('#RId').lrselectRefresh({
  86. // url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable',
  87. // param: { code: 'Acc_RoomData', strWhere: "ParentID='" + item.id + "' order by name" }
  88. //});
  89. //}
  90. //}
  91. //});
  92. //$('#RId').lrselect({
  93. // text: 'name',
  94. //value: 'id',
  95. //allowSearch: true
  96. //});
  97. $('#DeptNo').lrselect({
  98. allowSearch: true,
  99. value: "deptno",
  100. text: "deptname",
  101. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdDeptInfo',
  102. select: function (item) {
  103. if (item) {
  104. $('#MajorNo').lrselectRefresh({
  105. allowSearch: true,
  106. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo',
  107. param: { strWhere: "DeptNo='" + item.deptno + "' AND CheckMark=1" }
  108. });
  109. } else {
  110. $('#MajorNo').lrselectRefresh({
  111. allowSearch: true,
  112. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo',
  113. param: { strWhere: "1=1 AND CheckMark=1" }
  114. });
  115. }
  116. }
  117. });
  118. $('#MajorNo').lrselect({
  119. allowSearch: true,
  120. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo',
  121. value: "majorno",
  122. text: "majorname",
  123. param: { strWhere: "1=1 AND CheckMark=1" },
  124. select: function (item) {
  125. if (item) {
  126. $('#ClassNo').lrselectRefresh({
  127. allowSearch: true,
  128. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  129. param: { strWhere: "majorno='" + item.majorno + "' AND CheckMark=1" }
  130. });
  131. } else {
  132. $('#ClassNo').lrselectRefresh({
  133. allowSearch: true,
  134. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  135. param: { strWhere: "1=1 AND CheckMark=1" }
  136. });
  137. }
  138. }
  139. });
  140. $('#ClassNo').lrselect({
  141. allowSearch: true,
  142. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  143. param: { strWhere: "1=1 AND CheckMark=1" },
  144. value: "classno",
  145. text: "classname"
  146. });
  147. // 新增
  148. $('#lr_add').on('click', function () {
  149. selectedRow = null;
  150. learun.layerForm({
  151. id: 'form',
  152. title: '新增',
  153. url: top.$.rootUrl + '/LogisticsManagement/Acc_DailyAssess/Form?HkeyValue=' + HkeyValue + '&Dormitory=' + Dormitory + '&Unit=' + Unit + '&Floor=' + Floor + '&RId=' + RId,
  154. width: 800,
  155. height: 600,
  156. callBack: function (id) {
  157. return top[id].acceptClick(refreshGirdData);
  158. }
  159. });
  160. });
  161. // 编辑
  162. $('#lr_edit').on('click', function () {
  163. selectedRow = null;
  164. var keyValue = $('#gridtable').jfGridValue('Id');
  165. if (learun.checkrow(keyValue)) {
  166. learun.layerForm({
  167. id: 'form',
  168. title: '编辑',
  169. url: top.$.rootUrl + '/LogisticsManagement/Acc_DailyAssess/Form?keyValue=' + keyValue + '&HkeyValue=' + HkeyValue + '&Dormitory=' + Dormitory + '&Unit=' + Unit + '&Floor=' + Floor + '&RId=' + RId,
  170. width: 800,
  171. height: 600,
  172. callBack: function (id) {
  173. return top[id].acceptClick(refreshGirdData);
  174. }
  175. });
  176. }
  177. });
  178. // 删除
  179. $('#lr_delete').on('click', function () {
  180. var keyValue = $('#gridtable').jfGridValue('Id');
  181. if (learun.checkrow(keyValue)) {
  182. learun.layerConfirm('是否确认删除该项!', function (res) {
  183. if (res) {
  184. learun.deleteForm(top.$.rootUrl + '/LogisticsManagement/Acc_DailyAssess/DeleteForm', { keyValue: keyValue }, function () {
  185. refreshGirdData();
  186. });
  187. }
  188. });
  189. }
  190. });
  191. // 快速新增
  192. $('#lr_addQuickly').on('click', function () {
  193. var keyValue = $('#gridtable').jfGridValue('Id');
  194. if (learun.checkrow(keyValue)) {
  195. selectedRow = $('#gridtable').jfGridGet('rowdata');
  196. //console.log(selectedRow);
  197. learun.layerForm({
  198. id: 'form',
  199. title: '快速新增',
  200. url: top.$.rootUrl + '/LogisticsManagement/Acc_DailyAssess/Form',
  201. width: 800,
  202. height: 600,
  203. callBack: function (id) {
  204. return top[id].acceptClick(refreshGirdData);
  205. }
  206. });
  207. }
  208. });
  209. },
  210. // 初始化列表
  211. initGird: function () {
  212. $('#gridtable').jfGrid({
  213. url: top.$.rootUrl + '/LogisticsManagement/Acc_DailyAssess/GetPageList',
  214. headData: [
  215. {
  216. label: "专业部", name: "DeptNo", width: 100, align: "left",
  217. formatterAsync: function (callback, value, row, op, $cell) {
  218. learun.clientdata.getAsync('custmerData', {
  219. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo',
  220. key: value,
  221. keyId: 'deptno',
  222. callback: function (_data) {
  223. callback(_data['deptname']);
  224. }
  225. });
  226. }
  227. },
  228. {
  229. label: "专业", name: "MajorNo", width: 100, align: "left",
  230. formatterAsync: function (callback, value, row, op, $cell) {
  231. learun.clientdata.getAsync('custmerData', {
  232. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo',
  233. key: value,
  234. keyId: 'majorno',
  235. callback: function (_data) {
  236. callback(_data['majorname']);
  237. }
  238. });
  239. }
  240. },
  241. {
  242. label: "班级", name: "ClassNo", width: 100, align: "left",
  243. formatterAsync: function (callback, value, row, op, $cell) {
  244. learun.clientdata.getAsync('custmerData', {
  245. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj',
  246. key: value,
  247. keyId: 'classno',
  248. callback: function (_data) {
  249. callback(_data['classname']);
  250. }
  251. });
  252. }
  253. },
  254. {
  255. label: "宿舍楼", name: "Dormitory", width: 100, align: "left",
  256. formatterAsync: function (callback, value, row, op, $cell) {
  257. learun.clientdata.getAsync('custmerData', {
  258. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Acc_DormitoryData',
  259. key: value,
  260. keyId: 'id',
  261. callback: function (_data) {
  262. callback(_data['name']);
  263. }
  264. });
  265. }
  266. },
  267. {
  268. label: "单元", name: "Unit", width: 100, align: "left",
  269. formatterAsync: function (callback, value, row, op, $cell) {
  270. learun.clientdata.getAsync('custmerData', {
  271. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Acc_UnitData',
  272. key: value,
  273. keyId: 'id',
  274. callback: function (_data) {
  275. callback(_data['name']);
  276. }
  277. });
  278. }
  279. },
  280. {
  281. label: "楼层", name: "Floor", width: 100, align: "left",
  282. formatterAsync: function (callback, value, row, op, $cell) {
  283. learun.clientdata.getAsync('custmerData', {
  284. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Acc_FloorData',
  285. key: value,
  286. keyId: 'id',
  287. callback: function (_data) {
  288. callback(_data['name']);
  289. }
  290. });
  291. }
  292. },
  293. {
  294. label: "寝室号", name: "RId", width: 100, align: "left",
  295. formatterAsync: function (callback, value, row, op, $cell) {
  296. learun.clientdata.getAsync('custmerData', {
  297. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Acc_RoomData',
  298. key: value,
  299. keyId: 'id',
  300. callback: function (_data) {
  301. callback(_data['name']);
  302. }
  303. });
  304. }
  305. },
  306. {
  307. label: "学生姓名", name: "StuNo", width: 100, align: "left",
  308. formatterAsync: function (callback, value, row, op, $cell) {
  309. learun.clientdata.getAsync('custmerData', {
  310. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'StuInfoBasic',
  311. key: value,
  312. keyId: 'stuno',
  313. callback: function (_data) {
  314. callback(_data['stuname']);
  315. }
  316. });
  317. }
  318. },
  319. { label: "日期", name: "Date", width: 130, align: "left" },
  320. { label: "卫生奖分", name: "AddScoreHealth", width: 100, align: "left" },
  321. { label: "卫生扣分", name: "MinusScoreHealth", width: 100, align: "left" },
  322. { label: "纪律奖分", name: "AddScore", width: 100, align: "left" },
  323. { label: "纪律扣分", name: "MinusScore", width: 100, align: "left" },
  324. { label: "奖扣分原因", name: "Reason", width: 200, align: "left" },
  325. ],
  326. mainId: 'Id',
  327. isPage: true,
  328. sidx: 'Date desc'
  329. });
  330. page.search();
  331. },
  332. search: function (param) {
  333. param = param || {};
  334. param.StartTime = startTime;
  335. param.EndTime = endTime;
  336. param.SqlParameter = "and BuildId ='" + HkeyValue + "'";
  337. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  338. }
  339. };
  340. refreshGirdData = function () {
  341. page.search();
  342. };
  343. page.init();
  344. }