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.
 
 
 
 
 
 

357 lines
17 KiB

  1. /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
  2. * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2022-04-12 15:47
  5. * 描 述:考试课程表
  6. */
  7. var refreshGirdData;
  8. var bootstrap = function ($, learun) {
  9. "use strict";
  10. var page = {
  11. init: function () {
  12. page.initGird();
  13. page.bind();
  14. },
  15. bind: function () {
  16. $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
  17. page.search(queryJson);
  18. }, 320, 400);
  19. $('#AcademicYearNo').lrselect({
  20. placeholder: "学年",
  21. allowSearch: true,
  22. url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetAcademicYearNo',
  23. value: 'value',
  24. text: 'text'
  25. });
  26. //学期
  27. $('#Semester').lrselect({
  28. placeholder: "学期",
  29. url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetSemester',
  30. value: 'value',
  31. text: 'text'
  32. });
  33. $('#DeptNo').lrselect({
  34. allowSearch: true,
  35. value: "deptno",
  36. text: "deptname",
  37. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdDeptInfo',
  38. select: function (item) {
  39. if (item) {
  40. $('#MajorNo').lrselectRefresh({
  41. allowSearch: true,
  42. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo',
  43. param: { strWhere: "DeptNo='" + item.deptno + "' AND CheckMark=1" }
  44. });
  45. } else {
  46. $('#MajorNo').lrselectRefresh({
  47. allowSearch: true,
  48. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo',
  49. param: { strWhere: "1=1 AND CheckMark=1" }
  50. });
  51. }
  52. }
  53. });
  54. $('#MajorNo').lrselect({
  55. allowSearch: true,
  56. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo',
  57. value: "majorno",
  58. text: "majorname",
  59. param: { strWhere: "1=1 AND CheckMark=1" },
  60. select: function (item) {
  61. var Grades = $("#Grade").lrselectGet();
  62. if (Grades != null && Grades != "" && Grades != "undefined") {
  63. if (item) {
  64. $('#ClassNo').lrselectRefresh({
  65. allowSearch: true,
  66. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  67. param: { strWhere: "majorno='" + item.majorno + "' AND CheckMark=1 AND Grade='" + Grades + "' order by classno desc" }
  68. });
  69. } else {
  70. $('#ClassNo').lrselectRefresh({
  71. allowSearch: true,
  72. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  73. param: { strWhere: "1=1 AND CheckMark=1 order by classno desc" }
  74. });
  75. }
  76. } else {
  77. if (item) {
  78. $('#ClassNo').lrselectRefresh({
  79. allowSearch: true,
  80. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  81. param: { strWhere: "majorno='" + item.majorno + "' AND CheckMark=1 order by classno desc" }
  82. });
  83. } else {
  84. $('#ClassNo').lrselectRefresh({
  85. allowSearch: true,
  86. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  87. param: { strWhere: "1=1 AND CheckMark=1 order by classno desc" }
  88. });
  89. }
  90. }
  91. }
  92. });
  93. $('#Grade').lrselect({
  94. url: top.$.rootUrl + '/EducationalAdministration/ClassInfo/GenerateNearByYear',
  95. value: "value",
  96. text: "text",
  97. select: function (item) {
  98. var MajorNos = $("#MajorNo").lrselectGet();
  99. if (MajorNos != null && MajorNos != "" && MajorNos != "undefined") {
  100. if (item) {
  101. $('#ClassNo').lrselectRefresh({
  102. allowSearch: true,
  103. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  104. param: {
  105. strWhere: "majorno='" + MajorNos + "' AND CheckMark=1 AND Grade='" + item.text + "' order by classno desc"
  106. }
  107. });
  108. } else {
  109. $('#ClassNo').lrselectRefresh({
  110. allowSearch: true,
  111. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  112. param: { strWhere: "1=1 AND CheckMark=1 order by classno desc" }
  113. });
  114. }
  115. } else {
  116. if (item) {
  117. $('#ClassNo').lrselectRefresh({
  118. allowSearch: true,
  119. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  120. param: {
  121. strWhere: "CheckMark=1 AND Grade='" + item.text + "' order by classno desc"
  122. }
  123. });
  124. } else {
  125. $('#ClassNo').lrselectRefresh({
  126. allowSearch: true,
  127. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  128. param: { strWhere: "1=1 AND CheckMark=1 order by classno desc" }
  129. });
  130. }
  131. }
  132. }
  133. });
  134. $('#ClassNo').lrselect({
  135. allowSearch: true,
  136. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  137. param: { strWhere: "1=1 AND CheckMark=1 order by classno desc" },
  138. value: "classno",
  139. text: "classname"
  140. });
  141. $('#ESType').lrDataItemSelect({ code: 'StudentType' });
  142. // 刷新
  143. $('#lr_refresh').on('click', function () {
  144. location.reload();
  145. });
  146. $('#ClassNo').lrDataSourceSelect({ code: 'bjsj', value: 'classno', text: 'classname' });
  147. // 新增
  148. $('#lr_add').on('click', function () {
  149. learun.layerForm({
  150. id: 'form',
  151. title: '新增',
  152. url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamStudent/Form',
  153. width: 600,
  154. height: 400,
  155. callBack: function (id) {
  156. return top[id].acceptClick(refreshGirdData);
  157. }
  158. });
  159. });
  160. // 编辑
  161. $('#lr_edit').on('click', function () {
  162. var keyValue = $('#gridtable').jfGridValue('ESId');
  163. if (learun.checkrow(keyValue)) {
  164. if (keyValue.indexOf(',') != -1) {
  165. learun.alert.warning("只能选择一条记录进行编辑!");
  166. return false;
  167. }
  168. learun.layerForm({
  169. id: 'form',
  170. title: '编辑',
  171. url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamStudent/Form?keyValue=' + keyValue,
  172. width: 600,
  173. height: 400,
  174. callBack: function (id) {
  175. return top[id].acceptClick(refreshGirdData);
  176. }
  177. });
  178. }
  179. });
  180. // 删除
  181. $('#lr_delete').on('click', function () {
  182. var keyValue = $('#gridtable').jfGridValue('ESId');
  183. if (learun.checkrow(keyValue)) {
  184. var ESEnabled = $('#gridtable').jfGridValue('ESEnabled');
  185. if (ESEnabled.indexOf('true') != -1) {
  186. learun.alert.warning("选中记录中包含已启用项目!");
  187. return;
  188. }
  189. learun.layerConfirm('是否确认删除该项!', function (res) {
  190. if (res) {
  191. learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamStudent/DeleteForm', { keyValue: keyValue }, function () {
  192. refreshGirdData();
  193. });
  194. }
  195. });
  196. }
  197. });
  198. //启用
  199. $('#lr_lock').on('click', function () {
  200. var keyValue = $('#gridtable').jfGridValue('ESId');
  201. if (learun.checkrow(keyValue)) {
  202. var ESEnabled = $('#gridtable').jfGridValue('ESEnabled');
  203. if (ESEnabled.indexOf('true') != -1) {
  204. learun.alert.warning("选中记录中包含已启用项目!");
  205. return;
  206. }
  207. learun.layerConfirm('是否确认启用选中记录!', function (res) {
  208. if (res) {
  209. learun.postForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamStudent/Lock', { keyValue: keyValue, ESEnabled: 1 }, function () {
  210. refreshGirdData();
  211. });
  212. }
  213. });
  214. }
  215. });
  216. //禁用
  217. $('#lr_unlock').on('click', function () {
  218. var keyValue = $('#gridtable').jfGridValue('ESId');
  219. if (learun.checkrow(keyValue)) {
  220. var ESEnabled = $('#gridtable').jfGridValue('ESEnabled');
  221. if (ESEnabled.indexOf('false') != -1) {
  222. learun.alert.warning("选中记录中包含已停用项目!");
  223. return;
  224. }
  225. learun.layerConfirm('是否确认停用选中记录!', function (res) {
  226. if (res) {
  227. learun.postForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamStudent/Lock', { keyValue: keyValue, ESEnabled: 0 }, function () {
  228. refreshGirdData();
  229. });
  230. }
  231. });
  232. }
  233. });
  234. // 打印
  235. $('#lr_print').on('click', function () {
  236. $('#gridtable').jqprintTable();
  237. });
  238. // 一键生成
  239. $('#lr_importBy').on('click', function () {
  240. learun.layerForm({
  241. id: 'form_import',
  242. title: '生成考生信息',
  243. url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamStudent/FormImport',
  244. width: 500,
  245. height: 300,
  246. btn: ['一键生成', '关闭'],
  247. callBack: function (id) {
  248. return top[id].acceptClick(refreshGirdData);
  249. }
  250. });
  251. });
  252. // 导入
  253. $('#lr_clearBy').on('click', function () {
  254. learun.layerForm({
  255. id: 'form_clear',
  256. title: '按条件清空学生考试信息',
  257. url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamStudent/FormClear',
  258. width: 500,
  259. height: 300,
  260. btn: ['确定', '关闭'],
  261. callBack: function (id) {
  262. return top[id].acceptClick(refreshGirdData);
  263. }
  264. });
  265. });
  266. },
  267. // 初始化列表
  268. initGird: function () {
  269. $('#gridtable').jfGrid({
  270. url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamStudent/GetPageList',
  271. headData: [
  272. { label: "学年", name: "AcademicYearNo", width: 100, align: "left" },
  273. { label: "学期", name: "Semester", width: 100, align: "left" },
  274. {
  275. label: "系部", name: "DeptNo", width: 100, align: "left",
  276. formatterAsync: function (callback, value, row, op, $cell) {
  277. learun.clientdata.getAsync('custmerData', {
  278. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo',
  279. key: value,
  280. keyId: 'deptno',
  281. callback: function (_data) {
  282. callback(_data['deptname']);
  283. }
  284. });
  285. }
  286. },
  287. {
  288. label: "专业", name: "MajorNo", width: 140, align: "left",
  289. formatterAsync: function (callback, value, row, op, $cell) {
  290. learun.clientdata.getAsync('custmerData', {
  291. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo',
  292. key: value,
  293. keyId: 'majorno',
  294. callback: function (_data) {
  295. callback(_data['majorname']);
  296. }
  297. });
  298. }
  299. },
  300. {
  301. label: "班级", name: "ClassNo", width: 100, align: "left",
  302. formatterAsync: function (callback, value, row, op, $cell) {
  303. learun.clientdata.getAsync('custmerData', {
  304. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj',
  305. key: value,
  306. keyId: 'classno',
  307. callback: function (_data) {
  308. callback(_data['classname']);
  309. }
  310. });
  311. }
  312. },
  313. { label: "学生编号", name: "StuNo", width: 140, align: "left" },
  314. { label: "学籍号", name: "StuCode", width: 140, align: "left" },
  315. { label: "学生姓名", name: "StuName", width: 100, align: "left" },
  316. { label: "身份证号", name: "IdentityCardNo", width: 140, align: "left" },
  317. { label: "年级", name: "Grade", width: 100, align: "left" },
  318. {
  319. label: "考试类型", name: "ESType", width: 100, align: "left",
  320. formatterAsync: function (callback, value, row, op, $cell) {
  321. learun.clientdata.getAsync('dataItem', {
  322. key: value,
  323. code: 'StudentType',
  324. callback: function (_data) {
  325. callback(_data.text);
  326. }
  327. });
  328. }
  329. },
  330. {
  331. label: "是否启用", name: "ESEnabled", width: 100, align: "left",
  332. formatter: function (cellvalue) {
  333. return cellvalue == 1 ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>";
  334. }
  335. },
  336. ],
  337. mainId: 'ESId',
  338. isMultiselect: true,
  339. isPage: true,
  340. sidx: 'AcademicYearNo desc,Semester desc ,Grade desc,DeptNo desc, MajorNo desc, ClassNo desc',
  341. sord: 'ASC'
  342. });
  343. page.search();
  344. },
  345. search: function (param) {
  346. param = param || {};
  347. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  348. }
  349. };
  350. refreshGirdData = function () {
  351. $('#gridtable').jfGridSet('reload');
  352. };
  353. page.init();
  354. }