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.

Detail.js 5.2 KiB

4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. var refreshGirdData;
  2. var bootstrap = function ($, learun) {
  3. "use strict";
  4. var startTime;
  5. var endTime;
  6. var page = {
  7. init: function () {
  8. page.initGird();
  9. page.bind();
  10. },
  11. bind: function () {
  12. //学年
  13. $('#AcademicYearNo').lrselect({
  14. placeholder: "请选择学年",
  15. allowSearch: true,
  16. url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetAcademicYearNoData',
  17. value: 'value',
  18. text: 'text'
  19. });
  20. //学期
  21. $('#Semester').lrselect({
  22. placeholder: "请选择学期",
  23. allowSearch: true,
  24. url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetSemesterData',
  25. value: 'value',
  26. text: 'text'
  27. });
  28. //课程
  29. $('#LessonNo').lrselect({
  30. placeholder: "请选择课程",
  31. allowSearch: true,
  32. url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetLessonNoDataOfAllWithNo',
  33. value: 'value',
  34. text: 'text'
  35. });
  36. //查询
  37. $('#btn_Search').on('click', function () {
  38. var AcademicYearNo = $("#AcademicYearNo").lrselectGet();
  39. var Semester = $("#Semester").lrselectGet();
  40. var LessonNo = $("#LessonNo").lrselectGet();
  41. if (!AcademicYearNo) {
  42. learun.alert.warning("请选择学年");
  43. return false;
  44. }
  45. if (!Semester) {
  46. learun.alert.warning("请选择学期");
  47. return false;
  48. }
  49. if (!LessonNo) {
  50. learun.alert.warning("请选择课程");
  51. return false;
  52. }
  53. page.search();
  54. });
  55. //确认上报
  56. $('#btn_Apply').on('click',
  57. function () {
  58. var rowData = $('#gridtable').jfGridGet('rowdata');
  59. if (rowData.length > 0) {
  60. learun.layerConfirm('是否确认上报选中学生?',
  61. function (res) {
  62. if (res) {
  63. learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuCancelExam/SaveApply', { dataJson: JSON.stringify(rowData) }, function () {
  64. refreshGirdData();
  65. });
  66. }
  67. });
  68. } else {
  69. learun.alert.warning("您没有选中任何数据项,请选中后再操作!");
  70. }
  71. });
  72. },
  73. // 初始化列表
  74. initGird: function () {
  75. $('#gridtable').jfGrid({
  76. url: top.$.rootUrl + '/EducationalAdministration/StuCancelExam/GetStudentPageList',
  77. headData: [
  78. { label: "学号", name: "StuNo", width: 100, align: "left" },
  79. { label: "姓名", name: "StuName", width: 100, align: "left" },
  80. {
  81. label: "班级", name: "ClassNo", width: 100, align: "left",
  82. formatterAsync: function (callback, value, row, op, $cell) {
  83. learun.clientdata.getAsync('custmerData', {
  84. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj',
  85. key: value,
  86. keyId: 'classno',
  87. callback: function (_data) {
  88. callback(_data['classname']);
  89. }
  90. });
  91. }
  92. },
  93. {
  94. label: "教师", name: "EmpNo", width: 100, align: "left",
  95. formatterAsync: function (callback, value, row, op, $cell) {
  96. learun.clientdata.getAsync('custmerData', {
  97. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo',
  98. key: value,
  99. keyId: 'empno',
  100. callback: function (_data) {
  101. callback(_data['empname']);
  102. }
  103. });
  104. }
  105. },
  106. ],
  107. isMultiselect: true,
  108. mainId: 'SelectId',
  109. isPage: true
  110. });
  111. //page.search();
  112. },
  113. search: function (param) {
  114. param = param || {};
  115. param.AcademicYearNo = $("#AcademicYearNo").lrselectGet();
  116. param.Semester = $("#Semester").lrselectGet();
  117. param.LessonNo = $("#LessonNo").lrselectGet();
  118. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  119. }
  120. };
  121. refreshGirdData = function () {
  122. page.search();
  123. };
  124. page.init();
  125. };