Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

Index.js 7.8 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2020-11-07 14:08
  5. * 描 述:资格证获取情况
  6. */
  7. var refreshGirdData;
  8. var empId = request('empId');
  9. var status = false;
  10. var bootstrap = function ($, learun) {
  11. "use strict";
  12. var page = {
  13. init: function () {
  14. page.refreshStatus();
  15. page.initGird();
  16. page.bind();
  17. },
  18. refreshStatus: function () {
  19. //获取主表状态
  20. learun.httpAsyncGet(top.$.rootUrl + '/EducationalAdministration/EmpInfo/GetFormData?keyValue=' + empId, function (res) {
  21. if (res.code == 200) {
  22. if (res.data.EmpInfo != null) {
  23. status = res.data.EmpInfo.CertificateStatus;
  24. }
  25. }
  26. });
  27. },
  28. bind: function () {
  29. $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
  30. page.search(queryJson);
  31. }, 220, 400);
  32. $('#TeacherQualifications').lrDataItemSelect({ code: 'TeacherQualifications' });
  33. $('#MandarinLevel').lrDataItemSelect({ code: 'MandarinLevel' });
  34. // 刷新
  35. $('#lr_refresh').on('click', function () {
  36. location.reload();
  37. });
  38. // 新增
  39. $('#lr_add').on('click', function () {
  40. if (status == 'true') {
  41. learun.alert.warning('已提交,不能再修改!');
  42. return;
  43. }
  44. learun.layerForm({
  45. id: 'formInPM_Certificate',
  46. title: '新增',
  47. url: top.$.rootUrl + '/EducationalAdministration/PM_Certificate/Form?empId=' + empId,
  48. width: 600,
  49. height: 400,
  50. callBack: function (id) {
  51. return top[id].acceptClick(refreshGirdData);
  52. }
  53. });
  54. });
  55. // 编辑
  56. $('#lr_edit').on('click', function () {
  57. if (status == 'true') {
  58. learun.alert.warning('已提交,不能再修改!');
  59. return;
  60. }
  61. var keyValue = $('#gridtableInPM_Qualification').jfGridValue('ID');
  62. if (learun.checkrow(keyValue)) {
  63. learun.layerForm({
  64. id: 'formInPM_Certificate',
  65. title: '编辑',
  66. url: top.$.rootUrl + '/EducationalAdministration/PM_Certificate/Form?keyValue=' + keyValue + '&empId=' + empId,
  67. width: 600,
  68. height: 400,
  69. callBack: function (id) {
  70. return top[id].acceptClick(refreshGirdData);
  71. }
  72. });
  73. }
  74. });
  75. // 删除
  76. $('#lr_delete').on('click', function () {
  77. if (status == 'true') {
  78. learun.alert.warning('已提交,不能再修改!');
  79. return;
  80. }
  81. var keyValue = $('#gridtableInPM_Qualification').jfGridValue('ID');
  82. if (learun.checkrow(keyValue)) {
  83. learun.layerConfirm('是否确认删除该项!', function (res) {
  84. if (res) {
  85. learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/PM_Certificate/DeleteForm', { keyValue: keyValue }, function () {
  86. refreshGirdData();
  87. });
  88. }
  89. });
  90. }
  91. });
  92. // 提交
  93. $('#lr_check').on('click', function () {
  94. if (status == 'true') {
  95. learun.alert.warning('已提交,不能再修改!');
  96. return;
  97. }
  98. learun.layerConfirm('是否确认提交!', function (res) {
  99. if (res) {
  100. learun.postForm( top.$.rootUrl + '/EducationalAdministration/PM_Certificate/Submit', { empId: empId, status: true }, function (info) {
  101. refreshGirdData();
  102. });
  103. }
  104. });
  105. });
  106. // 取消提交
  107. $('#lr_uncheck').on('click', function () {
  108. learun.layerConfirm('是否取消提交!', function (res) {
  109. if (res) {
  110. learun.postForm(top.$.rootUrl + '/EducationalAdministration/PM_Certificate/Submit', { empId: empId, status: false }, function () {
  111. refreshGirdData();
  112. });
  113. }
  114. });
  115. });
  116. },
  117. // 初始化列表
  118. initGird: function () {
  119. $('#gridtableInPM_Qualification').jfGrid({
  120. url: top.$.rootUrl + '/EducationalAdministration/PM_Certificate/GetPageList',
  121. headData: [
  122. { label: "证书编号", name: "TeacherQualificationsNo", width: 100, align: "left" },
  123. {
  124. label: "教师资格证种类", name: "TeacherQualifications", width: 100, align: "left",
  125. formatterAsync: function (callback, value, row, op, $cell) {
  126. learun.clientdata.getAsync('dataItem', {
  127. key: value,
  128. code: 'TeacherQualifications',
  129. callback: function (_data) {
  130. callback(_data.text);
  131. }
  132. });
  133. }
  134. },
  135. { label: "其他职业资格证", name: "OtherTeacherQualifications", width: 100, align: "left" },
  136. {
  137. label: "普通话等级", name: "MandarinLevel", width: 100, align: "left",
  138. formatterAsync: function (callback, value, row, op, $cell) {
  139. learun.clientdata.getAsync('dataItem', {
  140. key: value,
  141. code: 'MandarinLevel',
  142. callback: function (_data) {
  143. callback(_data.text);
  144. }
  145. });
  146. }
  147. },
  148. { label: "备注", name: "Remark", width: 100, align: "left" },
  149. { label: "是否同步", name: "IsSync", width: 100, align: "left", formatter: function (cellvalue) { return cellvalue == true ? "是" : "否" } },
  150. {
  151. label: "提交状态", name: "SubmitStatus", width: 100, align: "left",
  152. formatter: function (cellvalue) {
  153. //return cellvalue == true ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>";
  154. return cellvalue == true ? "<span class=\"label label-success\">已提交</span>" : "<span class=\"label label-danger\">未提交</span>";
  155. }
  156. },
  157. ],
  158. mainId: 'ID',
  159. isPage: true,
  160. sidx:'UpdateTime desc'
  161. });
  162. page.search();
  163. },
  164. search: function (param) {
  165. param = param || {};
  166. param.EmpId = empId;
  167. $('#gridtableInPM_Qualification').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  168. }
  169. };
  170. refreshGirdData = function () {
  171. page.search();
  172. page.refreshStatus();
  173. };
  174. page.init();
  175. }