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.

Index.js 4.9 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
  2. * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2022-08-25 11:16
  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. }, 220, 400);
  19. $('#EmpNo').lrDataSourceSelect({ code: 'EmpInfo',value: 'empno',text: 'empname' });
  20. $('#LessonNo').lrDataSourceSelect({ code: 'LessonInfo',value: 'lessonno',text: 'lessonname' });
  21. // 刷新
  22. $('#lr_refresh').on('click', function () {
  23. location.reload();
  24. });
  25. // 新增
  26. $('#lr_add').on('click', function () {
  27. learun.layerForm({
  28. id: 'form',
  29. title: '新增',
  30. url: top.$.rootUrl + '/PersonnelManagement/ClassPatrol/Form',
  31. width: 600,
  32. height: 400,
  33. callBack: function (id) {
  34. return top[id].acceptClick(refreshGirdData);
  35. }
  36. });
  37. });
  38. // 编辑
  39. $('#lr_edit').on('click', function () {
  40. var keyValue = $('#gridtable').jfGridValue('Id');
  41. if (learun.checkrow(keyValue)) {
  42. learun.layerForm({
  43. id: 'form',
  44. title: '编辑',
  45. url: top.$.rootUrl + '/PersonnelManagement/ClassPatrol/Form?keyValue=' + keyValue,
  46. width: 600,
  47. height: 400,
  48. callBack: function (id) {
  49. return top[id].acceptClick(refreshGirdData);
  50. }
  51. });
  52. }
  53. });
  54. // 删除
  55. $('#lr_delete').on('click', function () {
  56. var keyValue = $('#gridtable').jfGridValue('Id');
  57. if (learun.checkrow(keyValue)) {
  58. learun.layerConfirm('是否确认删除该项!', function (res) {
  59. if (res) {
  60. learun.deleteForm(top.$.rootUrl + '/PersonnelManagement/ClassPatrol/DeleteForm', { keyValue: keyValue}, function () {
  61. refreshGirdData();
  62. });
  63. }
  64. });
  65. }
  66. });
  67. },
  68. // 初始化列表
  69. initGird: function () {
  70. $('#gridtable').lrAuthorizeJfGrid({
  71. url: top.$.rootUrl + '/PersonnelManagement/ClassPatrol/GetPageList',
  72. headData: [
  73. { label: "时间", name: "Time", width: 100, align: "left"},
  74. { label: "课节", name: "Section", width: 100, align: "left"},
  75. { label: "教师", name: "EmpNo", width: 100, align: "left",
  76. formatterAsync: function (callback, value, row, op,$cell) {
  77. learun.clientdata.getAsync('custmerData', {
  78. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo',
  79. key: value,
  80. keyId: 'empno',
  81. callback: function (_data) {
  82. callback(_data['empname']);
  83. }
  84. });
  85. }},
  86. { label: "科目", name: "LessonNo", width: 100, align: "left",
  87. formatterAsync: function (callback, value, row, op,$cell) {
  88. learun.clientdata.getAsync('custmerData', {
  89. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'LessonInfo',
  90. key: value,
  91. keyId: 'lessonno',
  92. callback: function (_data) {
  93. callback(_data['lessonname']);
  94. }
  95. });
  96. }},
  97. { label: "情况记载", name: "Records", width: 100, align: "left"},
  98. { label: "备注", name: "Remark", width: 100, align: "left"},
  99. ],
  100. mainId:'Id',
  101. isPage: true
  102. });
  103. page.search();
  104. },
  105. search: function (param) {
  106. param = param || {};
  107. $('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) });
  108. }
  109. };
  110. refreshGirdData = function () {
  111. $('#gridtable').jfGridSet('reload');
  112. };
  113. page.init();
  114. }