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.
 
 
 
 
 
 

217 lines
9.9 KiB

  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2019-03-19 10:52
  5. * 描 述:教师证书信息
  6. */
  7. var refreshGirdData;
  8. var empId = request('empId');
  9. var bootstrap = function ($, learun) {
  10. "use strict";
  11. var startTime;
  12. var endTime;
  13. var page = {
  14. init: function () {
  15. if (!!empId) {
  16. $('#TCNameDiv').hide();
  17. $('#btnDiv > a').hide();
  18. }
  19. page.initGird();
  20. page.bind();
  21. },
  22. bind: function () {
  23. $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
  24. page.search(queryJson);
  25. }, 220, 400);
  26. // 时间搜索框
  27. $('#datesearch').lrdate({
  28. dfdata: [
  29. { name: '今天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00') }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
  30. { name: '近7天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'd', -6) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
  31. { name: '近1个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -1) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
  32. { name: '近3个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -3) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }
  33. ],
  34. // 月
  35. mShow: false,
  36. premShow: false,
  37. // 季度
  38. jShow: false,
  39. prejShow: false,
  40. // 年
  41. ysShow: false,
  42. yxShow: false,
  43. preyShow: false,
  44. yShow: false,
  45. // 默认
  46. dfvalue: '1',
  47. selectfn: function (begin, end) {
  48. startTime = begin;
  49. endTime = end;
  50. page.search();
  51. }
  52. });
  53. $('#TCName').lrselect({
  54. allowSearch: true,
  55. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=EmpInfo',
  56. param: { strWhere: "1=1 " },
  57. value: "empid",
  58. text: "empname"
  59. });
  60. $('#TCTypeID').lrDataItemSelect({ code: 'jszgzl' });
  61. // 刷新
  62. $('#lr_refresh').on('click', function () {
  63. location.reload();
  64. });
  65. // 新增
  66. $('#lr_add').on('click', function () {
  67. learun.layerForm({
  68. id: 'formInTeacherCertificate',
  69. title: '新增',
  70. url: top.$.rootUrl + '/PersonnelManagement/TeacherCertificate/Form',
  71. width: 600,
  72. height: 400,
  73. callBack: function (id) {
  74. return top[id].acceptClick(refreshGirdData);
  75. }
  76. });
  77. });
  78. // 编辑
  79. $('#lr_edit').on('click', function () {
  80. var keyValue = $('#gridtable').jfGridValue('TCID');
  81. if (learun.checkrow(keyValue)) {
  82. var CheckStatus = $('#gridtable').jfGridValue('CheckStatus');
  83. if (CheckStatus == "1" || CheckStatus == "2") {
  84. learun.alert.warning("当前项已审核!");
  85. return false;
  86. }
  87. learun.layerForm({
  88. id: 'formInTeacherCertificate',
  89. title: '编辑',
  90. url: top.$.rootUrl + '/PersonnelManagement/TeacherCertificate/Form?keyValue=' + keyValue,
  91. width: 600,
  92. height: 400,
  93. callBack: function (id) {
  94. return top[id].acceptClick(refreshGirdData);
  95. }
  96. });
  97. }
  98. });
  99. // 删除
  100. $('#lr_delete').on('click', function () {
  101. var keyValue = $('#gridtable').jfGridValue('TCID');
  102. if (learun.checkrow(keyValue)) {
  103. var CheckStatus = $('#gridtable').jfGridValue('CheckStatus');
  104. if (CheckStatus == "1" || CheckStatus == "2") {
  105. learun.alert.warning("当前项已审核!");
  106. return false;
  107. }
  108. learun.layerConfirm('是否确认删除该项!', function (res) {
  109. if (res) {
  110. learun.deleteForm(top.$.rootUrl + '/PersonnelManagement/TeacherCertificate/DeleteForm', { keyValue: keyValue }, function () {
  111. refreshGirdData();
  112. });
  113. }
  114. });
  115. }
  116. });
  117. // 审核通过
  118. $('#lr_checkYes').on('click', function () {
  119. var keyValue = $('#gridtable').jfGridValue('TCID');
  120. if (learun.checkrow(keyValue)) {
  121. var CheckStatus = $('#gridtable').jfGridValue('CheckStatus');
  122. if (CheckStatus == "1" || CheckStatus == "2") {
  123. learun.alert.warning("当前项已审核!");
  124. return false;
  125. }
  126. learun.layerConfirm('是否确认审核通过该项!', function (res) {
  127. if (res) {
  128. learun.postForm(top.$.rootUrl + '/PersonnelManagement/TeacherCertificate/DoCheck', { keyValue: keyValue, status: "1" }, function () {
  129. refreshGirdData();
  130. });
  131. }
  132. });
  133. }
  134. });
  135. // 审核不通过
  136. $('#lr_checkNo').on('click', function () {
  137. var keyValue = $('#gridtable').jfGridValue('TCID');
  138. if (learun.checkrow(keyValue)) {
  139. var CheckStatus = $('#gridtable').jfGridValue('CheckStatus');
  140. if (CheckStatus == "1" || CheckStatus == "2") {
  141. learun.alert.warning("当前项已审核!");
  142. return false;
  143. }
  144. learun.layerConfirm('是否确认审核不通过该项!', function (res) {
  145. if (res) {
  146. learun.postForm(top.$.rootUrl + '/PersonnelManagement/TeacherCertificate/DoCheck', { keyValue: keyValue, status: "2" }, function () {
  147. refreshGirdData();
  148. });
  149. }
  150. });
  151. }
  152. });
  153. },
  154. // 初始化列表
  155. initGird: function () {
  156. $('#gridtable').lrAuthorizeJfGrid({
  157. url: top.$.rootUrl + '/PersonnelManagement/TeacherCertificate/GetPageList',
  158. headData: [
  159. {
  160. label: "教师姓名", name: "TCName", width: 100, align: "left",
  161. formatterAsync: function (callback, value, row, op, $cell) {
  162. learun.clientdata.getAsync('custmerData', {
  163. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo',
  164. key: value,
  165. keyId: 'empid',
  166. callback: function (_data) {
  167. callback(_data['empname']);
  168. }
  169. });
  170. }
  171. },
  172. { label: "证书名称", name: "TCType", width: 150, align: "left" },
  173. { label: "证书编号", name: "TCCode", width: 150, align: "left" },
  174. { label: "发证机关", name: "TCVisaOffice", width: 150, align: "left" },
  175. {
  176. label: "资格种类", name: "TCTypeID", width: 100, align: "left",
  177. formatterAsync: function (callback, value, row, op, $cell) {
  178. learun.clientdata.getAsync('dataItem', {
  179. key: value,
  180. code: 'jszgzl',
  181. callback: function (_data) {
  182. callback(_data.text);
  183. }
  184. });
  185. }
  186. },
  187. { label: "任教学科", name: "TCClass", width: 100, align: "left" },
  188. { label: "取得时间", name: "TCTime", width: 100, align: "left" },
  189. {
  190. label: "审核状态", name: "CheckStatus", width: 100, align: "left", formatter: function (cellvalue) {
  191. return cellvalue == "1" ? "<span class=\"label label-success\">已通过</span>" : cellvalue == "2" ? "<span class=\"label label-danger\">未通过</span>" : "<span class=\"label label-default\">未审核</span>";
  192. }
  193. },
  194. ],
  195. mainId: 'TCID',
  196. isPage: true,
  197. sidx: 'TCTime desc'
  198. });
  199. page.search();
  200. },
  201. search: function (param) {
  202. param = param || {};
  203. //param.StartTime = startTime;
  204. //param.EndTime = endTime;
  205. if (!!empId) {
  206. param.TCName = empId;
  207. param.CheckStatus = "1";
  208. }
  209. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  210. }
  211. };
  212. refreshGirdData = function () {
  213. page.search();
  214. };
  215. page.init();
  216. }