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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2020-11-06 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.YearAssessStatus;
  24. }
  25. }
  26. });
  27. },
  28. bind: function () {
  29. $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
  30. page.search(queryJson);
  31. }, 220, 400);
  32. // 刷新
  33. $('#lr_refresh').on('click', function () {
  34. location.reload();
  35. });
  36. // 新增
  37. $('#lr_add').on('click', function () {
  38. if (status == 'true') {
  39. learun.alert.warning('已提交,不能再修改!');
  40. return;
  41. }
  42. learun.layerForm({
  43. id: 'formInPM_YearAssess',
  44. title: '新增',
  45. url: top.$.rootUrl + '/EducationalAdministration/PM_YearAssess/Form?empId=' + empId,
  46. width: 600,
  47. height: 400,
  48. callBack: function (id) {
  49. return top[id].acceptClick(refreshGirdData);
  50. }
  51. });
  52. });
  53. // 编辑
  54. $('#lr_edit').on('click', function () {
  55. if (status == 'true') {
  56. learun.alert.warning('已提交,不能再修改!');
  57. return;
  58. }
  59. var keyValue = $('#gridtable').jfGridValue('ID');
  60. if (learun.checkrow(keyValue)) {
  61. learun.layerForm({
  62. id: 'formInPM_YearAssess',
  63. title: '编辑',
  64. url: top.$.rootUrl + '/EducationalAdministration/PM_YearAssess/Form?keyValue=' + keyValue + '&empId=' + empId,
  65. width: 600,
  66. height: 400,
  67. callBack: function (id) {
  68. return top[id].acceptClick(refreshGirdData);
  69. }
  70. });
  71. }
  72. });
  73. // 删除
  74. $('#lr_delete').on('click', function () {
  75. if (status == 'true') {
  76. learun.alert.warning('已提交,不能再修改!');
  77. return;
  78. }
  79. var keyValue = $('#gridtable').jfGridValue('ID');
  80. if (learun.checkrow(keyValue)) {
  81. learun.layerConfirm('是否确认删除该项!', function (res) {
  82. if (res) {
  83. learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/PM_YearAssess/DeleteForm', { keyValue: keyValue }, function () {
  84. refreshGirdData();
  85. });
  86. }
  87. });
  88. }
  89. });
  90. // 提交
  91. $('#lr_check').on('click', function () {
  92. if (status == 'true') {
  93. learun.alert.warning('已提交,不能再修改!');
  94. return;
  95. }
  96. learun.layerConfirm('是否确认提交!', function (res) {
  97. if (res) {
  98. learun.postForm( top.$.rootUrl + '/EducationalAdministration/PM_YearAssess/Submit', { empId: empId, status: true }, function (info) {
  99. refreshGirdData();
  100. });
  101. }
  102. });
  103. });
  104. // 取消提交
  105. $('#lr_uncheck').on('click', function () {
  106. learun.layerConfirm('是否取消提交!', function (res) {
  107. if (res) {
  108. learun.postForm(top.$.rootUrl + '/EducationalAdministration/PM_YearAssess/Submit', { empId: empId, status: false }, function () {
  109. refreshGirdData();
  110. });
  111. }
  112. });
  113. });
  114. },
  115. // 初始化列表
  116. initGird: function () {
  117. $('#gridtable').jfGrid({
  118. url: top.$.rootUrl + '/EducationalAdministration/PM_YearAssess/GetPageList',
  119. headData: [
  120. { label: "考核时间", name: "AssessTime", width: 100, align: "left" },
  121. { label: "考核年度", name: "AssessYear", width: 100, align: "left" },
  122. { label: "考核结果", name: "AssessResult", width: 100, align: "left" },
  123. { label: "备注", name: "Remark", width: 100, align: "left" },
  124. { label: "是否同步", name: "IsSync", width: 100, align: "left", formatter: function (cellvalue) { return cellvalue == true ? "是" : "否" } },
  125. {
  126. label: "提交状态", name: "SubmitStatus", width: 100, align: "left",
  127. formatter: function (cellvalue) {
  128. return cellvalue == true ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>";
  129. }
  130. },
  131. ],
  132. mainId: 'ID',
  133. isPage: true,
  134. sidx:'UpdateTime desc'
  135. });
  136. page.search();
  137. },
  138. search: function (param) {
  139. param = param || {};
  140. param.EmpId = empId;
  141. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  142. }
  143. };
  144. refreshGirdData = function () {
  145. page.search();
  146. page.refreshStatus();
  147. };
  148. page.init();
  149. }