您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  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 acceptClick;
  8. var keyValue = request('keyValue');
  9. var type = request('type');//copy代表复制,checkedit代表专业部编辑
  10. var bootstrap = function ($, learun) {
  11. "use strict";
  12. var page = {
  13. init: function () {
  14. $('.lr-form-wrap').lrscroll();
  15. page.bind();
  16. page.initData();
  17. if (type == "checkedit") {
  18. //日期、专业部、年级、班级无法编辑
  19. $("#Date").attr("readonly", "readonly");
  20. $("#DeptNo").attr("readonly", "readonly");
  21. $("#Grade").attr("readonly", "readonly");
  22. $("#Class").attr("readonly", "readonly");
  23. }
  24. },
  25. bind: function () {
  26. $('#Date').val(getnow());
  27. if (type == "checkedit") {
  28. $('#DeptNo').lrDataSourceSelect({ code: 'CdDeptInfo', value: 'deptno', text: 'deptname' });
  29. $('#Grade').lrselect({
  30. url: top.$.rootUrl + '/EducationalAdministration/ClassInfo/GenerateNearByYear',
  31. value: 'value',
  32. text: 'text'
  33. });
  34. } else {
  35. $('#DeptNo').lrselect({
  36. allowSearch: true,
  37. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdDeptInfo',
  38. value: "deptno",
  39. text: "deptname",
  40. param: { strWhere: "1=1" },
  41. select: function (item) {
  42. var Grades = $("#Grade").lrselectGet();
  43. if (Grades != null && Grades != "" && Grades != "undefined") {
  44. if (item) {
  45. $('#Class').lrselectRefresh({
  46. allowSearch: true,
  47. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  48. param: { strWhere: "deptno='" + item.deptno + "' AND CheckMark=1 AND Grade='" + Grades + "' order by classno desc" }
  49. });
  50. } else {
  51. $('#Class').lrselectRefresh({
  52. allowSearch: true,
  53. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  54. param: { strWhere: "1=1 AND CheckMark=1 order by classno desc" }
  55. });
  56. }
  57. } else {
  58. if (item) {
  59. $('#Class').lrselectRefresh({
  60. allowSearch: true,
  61. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  62. param: { strWhere: "deptno='" + item.deptno + "' AND CheckMark=1 order by classno desc" }
  63. });
  64. } else {
  65. $('#Class').lrselectRefresh({
  66. allowSearch: true,
  67. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  68. param: { strWhere: "1=1 AND CheckMark=1 order by classno desc" }
  69. });
  70. }
  71. }
  72. }
  73. });
  74. $('#Grade').lrselect({
  75. url: top.$.rootUrl + '/EducationalAdministration/ClassInfo/GenerateNearByYear',
  76. value: 'value',
  77. text: 'text',
  78. select: function (item) {
  79. var DeptNo = $("#DeptNo").lrselectGet();
  80. if (DeptNo != null && DeptNo != "" && DeptNo != "undefined") {
  81. if (item) {
  82. $('#Class').lrselectRefresh({
  83. allowSearch: true,
  84. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  85. param: {
  86. strWhere: "deptno='" + DeptNo + "' AND CheckMark=1 AND Grade='" + item.text + "' order by classno desc"
  87. }
  88. });
  89. } else {
  90. $('#Class').lrselectRefresh({
  91. allowSearch: true,
  92. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  93. param: { strWhere: "1=1 AND CheckMark=1 order by classno desc" }
  94. });
  95. }
  96. } else {
  97. if (item) {
  98. $('#Class').lrselectRefresh({
  99. allowSearch: true,
  100. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  101. param: {
  102. strWhere: "CheckMark=1 AND Grade='" + item.text + "' order by classno desc"
  103. }
  104. });
  105. } else {
  106. $('#Class').lrselectRefresh({
  107. allowSearch: true,
  108. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  109. param: { strWhere: "1=1 AND CheckMark=1 order by classno desc" }
  110. });
  111. }
  112. }
  113. }
  114. });
  115. }
  116. $('#Class').lrselect({
  117. allowSearch: true,
  118. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  119. param: { strWhere: "1=1 AND CheckMark=1 order by classno desc" },
  120. value: "classno",
  121. text: "classname"
  122. });
  123. },
  124. initData: function () {
  125. if (!!keyValue) {
  126. $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/StuArriveSchool/GetFormData?keyValue=' + keyValue, function (data) {
  127. for (var id in data) {
  128. if (!!data[id].length && data[id].length > 0) {
  129. $('#' + id ).jfGridSet('refreshdata', data[id]);
  130. }
  131. else {
  132. $('[data-table="' + id + '"]').lrSetFormData(data[id]);
  133. }
  134. if (type == "copy") {
  135. $('#Date').val(getnow());
  136. var timer = setTimeout(function () {
  137. $('#Class').lrselectSet(data[id].Class);
  138. clearTimeout(timer);
  139. }, 2000);
  140. }
  141. }
  142. });
  143. }
  144. }
  145. };
  146. // 保存数据
  147. acceptClick = function (callBack) {
  148. if (!$('body').lrValidform()) {
  149. return false;
  150. }
  151. if (type == "copy") {
  152. keyValue = "";
  153. }
  154. var postData = {
  155. strEntity: JSON.stringify($('body').lrGetFormData())
  156. };
  157. $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/StuArriveSchool/SaveForm?keyValue=' + keyValue, postData, function (res) {
  158. // 保存成功后才回调
  159. if (!!callBack) {
  160. callBack();
  161. }
  162. });
  163. };
  164. page.init();
  165. }
  166. function getnow() {
  167. var date = new Date();
  168. var result = date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate();
  169. return result;
  170. };