25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

384 lines
19 KiB

  1. /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
  2. * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2024-03-25 17:45
  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: '0',
  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. }, 220, 400);
  48. $('#DeptNo').lrselect({
  49. allowSearch: true,
  50. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdDeptInfo',
  51. value: "deptno",
  52. text: "deptname",
  53. param: { strWhere: "1=1" },
  54. select: function (item) {
  55. var Grades = $("#Grade").lrselectGet();
  56. if (Grades != null && Grades != "" && Grades != "undefined") {
  57. if (item) {
  58. $('#Class').lrselectRefresh({
  59. allowSearch: true,
  60. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  61. param: { strWhere: "deptno='" + item.deptno + "' AND CheckMark=1 AND Grade='" + Grades + "' order by classno desc" }
  62. });
  63. } else {
  64. $('#Class').lrselectRefresh({
  65. allowSearch: true,
  66. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  67. param: { strWhere: "1=1 AND CheckMark=1 order by classno desc" }
  68. });
  69. }
  70. } else {
  71. if (item) {
  72. $('#Class').lrselectRefresh({
  73. allowSearch: true,
  74. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  75. param: { strWhere: "deptno='" + item.deptno + "' AND CheckMark=1 order by classno desc" }
  76. });
  77. } else {
  78. $('#Class').lrselectRefresh({
  79. allowSearch: true,
  80. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  81. param: { strWhere: "1=1 AND CheckMark=1 order by classno desc" }
  82. });
  83. }
  84. }
  85. }
  86. });
  87. $('#Grade').lrselect({
  88. url: top.$.rootUrl + '/EducationalAdministration/ClassInfo/GenerateNearByYear',
  89. value: 'value',
  90. text: 'text',
  91. select: function (item) {
  92. var DeptNo = $("#DeptNo").lrselectGet();
  93. if (DeptNo != null && DeptNo != "" && DeptNo != "undefined") {
  94. if (item) {
  95. $('#Class').lrselectRefresh({
  96. allowSearch: true,
  97. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  98. param: {
  99. strWhere: "deptno='" + DeptNo + "' AND CheckMark=1 AND Grade='" + item.text + "' order by classno desc"
  100. }
  101. });
  102. } else {
  103. $('#Class').lrselectRefresh({
  104. allowSearch: true,
  105. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  106. param: { strWhere: "1=1 AND CheckMark=1 order by classno desc" }
  107. });
  108. }
  109. } else {
  110. if (item) {
  111. $('#Class').lrselectRefresh({
  112. allowSearch: true,
  113. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  114. param: {
  115. strWhere: "CheckMark=1 AND Grade='" + item.text + "' order by classno desc"
  116. }
  117. });
  118. } else {
  119. $('#Class').lrselectRefresh({
  120. allowSearch: true,
  121. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  122. param: { strWhere: "1=1 AND CheckMark=1 order by classno desc" }
  123. });
  124. }
  125. }
  126. }
  127. });
  128. $('#Class').lrselect({
  129. allowSearch: true,
  130. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  131. param: { strWhere: "1=1 AND CheckMark=1 order by classno desc" },
  132. value: "classno",
  133. text: "classname"
  134. });
  135. // 刷新
  136. $('#lr_refresh').on('click', function () {
  137. location.reload();
  138. });
  139. // 新增
  140. $('#lr_add').on('click', function () {
  141. learun.layerForm({
  142. id: 'form',
  143. title: '新增',
  144. url: top.$.rootUrl + '/EducationalAdministration/StuArriveSchool/Form',
  145. width: 1000,
  146. height: 800,
  147. callBack: function (id) {
  148. return top[id].acceptClick(refreshGirdData);
  149. }
  150. });
  151. });
  152. // 编辑
  153. $('#lr_edit').on('click', function () {
  154. var keyValue = $('#gridtable').jfGridValue('Id');
  155. var Status = $('#gridtable').jfGridValue('Status');
  156. if (learun.checkrow(keyValue)) {
  157. if (keyValue.indexOf(",") != -1) {
  158. learun.alert.warning("只能选择一条记录进行操作!");
  159. return false;
  160. }
  161. if (Status == "1") {
  162. learun.alert.warning("该项已提交,无法编辑!");
  163. return false;
  164. } else if (Status == "2") {
  165. learun.alert.warning("该项已审核,无法编辑!");
  166. return false;
  167. }
  168. learun.layerForm({
  169. id: 'form',
  170. title: '编辑',
  171. url: top.$.rootUrl + '/EducationalAdministration/StuArriveSchool/Form?keyValue=' + keyValue,
  172. width: 1000,
  173. height: 800,
  174. callBack: function (id) {
  175. return top[id].acceptClick(refreshGirdData);
  176. }
  177. });
  178. }
  179. });
  180. // 复制
  181. $('#lr_copy').on('click', function () {
  182. var keyValue = $('#gridtable').jfGridValue('Id');
  183. if (learun.checkrow(keyValue)) {
  184. if (keyValue.indexOf(",") != -1) {
  185. learun.alert.warning("只能选择一条记录进行操作!");
  186. return false;
  187. }
  188. learun.layerForm({
  189. id: 'form',
  190. title: '新增',
  191. url: top.$.rootUrl + '/EducationalAdministration/StuArriveSchool/Form?type=copy&keyValue=' + keyValue,
  192. width: 1000,
  193. height: 800,
  194. callBack: function (id) {
  195. return top[id].acceptClick(refreshGirdData);
  196. }
  197. });
  198. }
  199. });
  200. // 删除
  201. $('#lr_delete').on('click', function () {
  202. var keyValue = $('#gridtable').jfGridValue('Id');
  203. var Status = $('#gridtable').jfGridValue('Status');
  204. if (learun.checkrow(keyValue)) {
  205. if (keyValue.indexOf(",") != -1) {
  206. learun.alert.warning("只能选择一条记录进行操作!");
  207. return false;
  208. }
  209. if (Status == "1") {
  210. learun.alert.warning("该项已提交,无法删除!");
  211. return false;
  212. } else if (Status == "2") {
  213. learun.alert.warning("该项已审核,无法删除!");
  214. return false;
  215. }
  216. learun.layerConfirm('是否确认删除该项!', function (res) {
  217. if (res) {
  218. learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/StuArriveSchool/DeleteForm', { keyValue: keyValue }, function () {
  219. refreshGirdData();
  220. });
  221. }
  222. });
  223. }
  224. });
  225. //提交
  226. $('#lr_submit').on('click', function () {
  227. var keyValue = $('#gridtable').jfGridValue('Id');
  228. var Status = $('#gridtable').jfGridValue('Status');
  229. if (learun.checkrow(keyValue)) {
  230. if (keyValue.indexOf(",") != -1) {
  231. learun.alert.warning("只能选择一条记录进行操作!");
  232. return false;
  233. }
  234. if (Status == "1") {
  235. learun.alert.warning("该项已提交!");
  236. return false;
  237. } else if (Status == "2") {
  238. learun.alert.warning("该项已审核!");
  239. return false;
  240. }
  241. learun.layerConfirm('是否确认提交该项!', function (res) {
  242. if (res) {
  243. learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuArriveSchool/DoSubmit', { keyValue: keyValue, status: "1" }, function () {
  244. refreshGirdData();
  245. });
  246. }
  247. });
  248. }
  249. });
  250. //审核
  251. $('#lr_check').on('click', function () {
  252. var keyValue = $('#gridtable').jfGridValue('Id');
  253. var Status = $('#gridtable').jfGridValue('Status');
  254. if (learun.checkrow(keyValue)) {
  255. if (Status.indexOf("2") != -1) {
  256. learun.alert.warning("选中项中包含已审核的数据!");
  257. return false;
  258. }
  259. if (Status.indexOf("0") != -1 || Status.indexOf(" ") != -1) {
  260. learun.alert.warning("选中项中包含未提交的数据!");
  261. return false;
  262. }
  263. learun.layerConfirm('是否确认审核选中项!', function (res) {
  264. if (res) {
  265. learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuArriveSchool/DoSubmit', { keyValue: keyValue, status: "2" }, function () {
  266. refreshGirdData();
  267. });
  268. }
  269. });
  270. }
  271. });
  272. //专业部编辑
  273. $('#lr_checkEdit').on('click', function () {
  274. var keyValue = $('#gridtable').jfGridValue('Id');
  275. var Status = $('#gridtable').jfGridValue('Status');
  276. if (learun.checkrow(keyValue)) {
  277. if (keyValue.indexOf(",") != -1) {
  278. learun.alert.warning("只能选择一条记录进行操作!");
  279. return false;
  280. }
  281. if (Status == "2") {
  282. learun.alert.warning("该项已审核!");
  283. return false;
  284. }
  285. if (Status != "1") {
  286. learun.alert.warning("该项未提交,专业部无法编辑!");
  287. return false;
  288. }
  289. learun.layerForm({
  290. id: 'form',
  291. title: '专业部编辑',
  292. url: top.$.rootUrl + '/EducationalAdministration/StuArriveSchool/Form?type=checkedit&keyValue=' + keyValue,
  293. width: 1000,
  294. height: 800,
  295. callBack: function (id) {
  296. return top[id].acceptClick(refreshGirdData);
  297. }
  298. });
  299. }
  300. });
  301. },
  302. // 初始化列表
  303. initGird: function () {
  304. $('#gridtable').jfGrid({
  305. url: top.$.rootUrl + '/EducationalAdministration/StuArriveSchool/GetPageList',
  306. headData: [
  307. {
  308. label: "状态", name: "Status", width: 60, align: "left", formatter: function (cellvalue) {
  309. if (cellvalue == "1") {
  310. return '<span class=\"label label-warning\">已提交</span>';
  311. } else if (cellvalue == "2") {
  312. return '<span class=\"label label-success\">已审核</span>';
  313. } else {
  314. return '<span class=\"label label-default\" >草稿</span>';
  315. }
  316. }
  317. },
  318. {
  319. label: "日期", name: "Date", width: 80, align: "left", formatter: function (cellvalue) {
  320. return learun.formatDate(cellvalue, 'yyyy-MM-dd');
  321. }
  322. },
  323. {
  324. label: "专业部", name: "DeptNo", width: 100, align: "left",
  325. formatterAsync: function (callback, value, row, op, $cell) {
  326. learun.clientdata.getAsync('custmerData', {
  327. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo',
  328. key: value,
  329. keyId: 'deptno',
  330. callback: function (_data) {
  331. callback(_data['deptname']);
  332. }
  333. });
  334. }
  335. },
  336. { label: "年级", name: "Grade", width: 50, align: "left" },
  337. {
  338. label: "班级", name: "Class", width: 100, align: "left",
  339. formatterAsync: function (callback, value, row, op, $cell) {
  340. learun.clientdata.getAsync('custmerData', {
  341. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj',
  342. key: value,
  343. keyId: 'classno',
  344. callback: function (_data) {
  345. callback(_data['classname']);
  346. }
  347. });
  348. }
  349. },
  350. { label: "应到人数", name: "YingDaoNum", width: 100, align: "left", statistics: true, isInt: true },
  351. { label: "实到人数", name: "ShiDaoNum", width: 100, align: "left", statistics: true, isInt: true },
  352. { label: "未到人数", name: "WeiDaoNum", width: 100, align: "left", statistics: true, isInt: true },
  353. { label: "病假人数", name: "BingJiaNum", width: 100, align: "left", statistics: true, isInt: true },
  354. { label: "病假人员", name: "BingJiaPeople", width: 100, align: "left" },
  355. { label: "事假人数", name: "ShiJiaNum", width: 100, align: "left", statistics: true, isInt: true },
  356. { label: "事假人员", name: "ShiJiaPeople", width: 100, align: "left" },
  357. { label: "拟退学人数", name: "NiTuiXueNum", width: 100, align: "left", statistics: true, isInt: true },
  358. { label: "拟退学人员", name: "NiTuiXuePeople", width: 100, align: "left" },
  359. { label: "拟休学人数", name: "NiXiuXueNum", width: 100, align: "left", statistics: true, isInt: true },
  360. { label: "拟休学人员", name: "NiXiuXuePeople", width: 100, align: "left" },
  361. { label: "拟转出人数", name: "NiZhuanChuNum", width: 100, align: "left", statistics: true, isInt: true },
  362. { label: "拟转出人员", name: "NiZhuanChuPeople", width: 100, align: "left" },
  363. ],
  364. mainId: 'Id',
  365. isPage: true,
  366. isMultiselect: true,
  367. sidx: 'Date desc,DeptNo',
  368. sord: 'asc'
  369. });
  370. },
  371. search: function (param) {
  372. param = param || {};
  373. param.StartTime = startTime;
  374. param.EndTime = endTime;
  375. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  376. }
  377. };
  378. refreshGirdData = function () {
  379. $('#gridtable').jfGridSet('reload');
  380. };
  381. page.init();
  382. }