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 5.6 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2019-03-19 11:34
  5. * 描 述:教师培训信息
  6. */
  7. var refreshGirdData;
  8. var empId = request('empId');
  9. var bootstrap = function ($, learun) {
  10. "use strict";
  11. var page = {
  12. init: function () {
  13. if (!!empId) {
  14. $('#multiple_condition_query').hide();
  15. $('#btnDiv > a').hide();
  16. }
  17. page.initGird();
  18. page.bind();
  19. },
  20. bind: function () {
  21. $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
  22. page.search(queryJson);
  23. }, 220, 400);
  24. $('#EID').lrselect({
  25. allowSearch: true,
  26. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=EmpInfo',
  27. param: { strWhere: "1=1 " },
  28. value: "empid",
  29. text: "empname"
  30. });
  31. // 刷新
  32. $('#lr_refresh').on('click', function () {
  33. location.reload();
  34. });
  35. // 新增
  36. $('#lr_add').on('click', function () {
  37. learun.layerForm({
  38. id: 'formInTeacherTrain',
  39. title: '新增',
  40. url: top.$.rootUrl + '/PersonnelManagement/TeacherTrain/Form',
  41. width: 800,
  42. height: 600,
  43. callBack: function (id) {
  44. return top[id].acceptClick(refreshGirdData);
  45. }
  46. });
  47. });
  48. // 编辑
  49. $('#lr_edit').on('click', function () {
  50. var keyValue = $('#gridtable').jfGridValue('TTID');
  51. if (learun.checkrow(keyValue)) {
  52. learun.layerForm({
  53. id: 'formInTeacherTrain',
  54. title: '编辑',
  55. url: top.$.rootUrl + '/PersonnelManagement/TeacherTrain/Form?keyValue=' + keyValue,
  56. width: 800,
  57. height: 600,
  58. callBack: function (id) {
  59. return top[id].acceptClick(refreshGirdData);
  60. }
  61. });
  62. }
  63. });
  64. // 删除
  65. $('#lr_delete').on('click', function () {
  66. var keyValue = $('#gridtable').jfGridValue('TTID');
  67. if (learun.checkrow(keyValue)) {
  68. learun.layerConfirm('是否确认删除该项!', function (res) {
  69. if (res) {
  70. learun.deleteForm(top.$.rootUrl + '/PersonnelManagement/TeacherTrain/DeleteForm', { keyValue: keyValue }, function () {
  71. refreshGirdData();
  72. });
  73. }
  74. });
  75. }
  76. });
  77. },
  78. // 初始化列表
  79. initGird: function () {
  80. $('#gridtable').lrAuthorizeJfGrid({
  81. url: top.$.rootUrl + '/PersonnelManagement/TeacherTrain/GetPageList',
  82. headData: [
  83. {
  84. label: "教师姓名", name: "EID", width: 100, align: "left",
  85. formatterAsync: function (callback, value, row, op, $cell) {
  86. learun.clientdata.getAsync('custmerData', {
  87. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo',
  88. key: value,
  89. keyId: 'empid',
  90. callback: function (_data) {
  91. callback(_data['empname']);
  92. }
  93. });
  94. }
  95. },
  96. { label: "培训开始时间", name: "TTStartTime", width: 100, align: "left" },
  97. { label: "培训结束时间", name: "TTEndTime", width: 100, align: "left" },
  98. { label: "培训内容", name: "TTContent", width: 100, align: "left" },
  99. { label: "培训机构", name: "TTOrganization", width: 100, align: "left" },
  100. { label: "培训方式", name: "TTWay", width: 100, align: "left" },
  101. { label: "所获证数", name: "TTCertificates", width: 100, align: "left" },
  102. {
  103. label: "培训级别", name: "TTLevel", width: 100, align: "left",
  104. formatterAsync: function (callback, value, row, op, $cell) {
  105. learun.clientdata.getAsync('dataItem', {
  106. key: value,
  107. code: 'TrainLevel',
  108. callback: function (_data) {
  109. callback(_data.text);
  110. }
  111. });
  112. }
  113. },
  114. { label: "备注", name: "TTComment", width: 100, align: "left" },
  115. ],
  116. mainId: 'TTID',
  117. isPage: true
  118. });
  119. page.search();
  120. },
  121. search: function (param) {
  122. param = param || {};
  123. if (!!empId) {
  124. param.EID = empId;
  125. }
  126. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  127. }
  128. };
  129. refreshGirdData = function () {
  130. page.search();
  131. };
  132. page.init();
  133. }