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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
  2. * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2022-08-30 11:05
  5. * 描 述:学生证书管理
  6. */
  7. var refreshGirdData;
  8. var bootstrap = function ($, learun) {
  9. "use strict";
  10. var processId = '';
  11. var page = {
  12. init: function () {
  13. page.initGird();
  14. page.bind();
  15. },
  16. bind: function () {
  17. $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
  18. page.search(queryJson);
  19. }, 240, 400);
  20. $('#DeptNo').lrDataSourceSelect({ code: 'CdDeptInfo',value: 'deptno',text: 'deptname' });
  21. $('#MajorNo').lrDataSourceSelect({ code: 'CdMajorInfo',value: 'majorno',text: 'majorname' });
  22. $('#ClassNo').lrDataSourceSelect({ code: 'bjsj',value: 'classno',text: 'classname' });
  23. // 刷新
  24. $('#lr_refresh').on('click', function () {
  25. location.reload();
  26. });
  27. // 新增
  28. $('#lr_add').on('click', function () {
  29. learun.layerForm({
  30. id: 'form',
  31. title: '新增',
  32. url: top.$.rootUrl + '/EducationalAdministration/StudentCertificate/Form',
  33. width: 720,
  34. height: 550,
  35. callBack: function (id) {
  36. var res = false;
  37. // 验证数据
  38. res = top[id].validForm();
  39. // 保存数据
  40. if (res) {
  41. processId = learun.newGuid();
  42. res = top[id].save(processId, refreshGirdData);
  43. }
  44. return res;
  45. }
  46. });
  47. });
  48. // 编辑
  49. $('#lr_edit').on('click', function () {
  50. var keyValue = $('#gridtable').jfGridValue('Id');
  51. if (learun.checkrow(keyValue)) {
  52. learun.layerForm({
  53. id: 'form',
  54. title: '编辑',
  55. url: top.$.rootUrl + '/EducationalAdministration/StudentCertificate/Form?keyValue=' + keyValue,
  56. width: 720,
  57. height: 550,
  58. callBack: function (id) {
  59. var res = false;
  60. // 验证数据
  61. res = top[id].validForm();
  62. // 保存数据
  63. if (res) {
  64. res = top[id].save('', function () {
  65. page.search();
  66. });
  67. }
  68. return res;
  69. }
  70. });
  71. }
  72. });
  73. //复制
  74. $('#lr_copy').on('click', function () {
  75. var keyValue = $('#gridtable').jfGridValue('Id');
  76. if (learun.checkrow(keyValue)) {
  77. learun.layerForm({
  78. id: 'form',
  79. title: '新增',
  80. url: top.$.rootUrl + '/EducationalAdministration/StudentCertificate/Form?keyValue=' + keyValue+'&type=copy',
  81. width: 720,
  82. height: 550,
  83. callBack: function (id) {
  84. var res = false;
  85. // 验证数据
  86. res = top[id].validForm();
  87. // 保存数据
  88. if (res) {
  89. res = top[id].save('', function () {
  90. page.search();
  91. });
  92. }
  93. return res;
  94. }
  95. });
  96. }
  97. });
  98. // 删除
  99. $('#lr_delete').on('click', function () {
  100. var keyValue = $('#gridtable').jfGridValue('Id');
  101. if (learun.checkrow(keyValue)) {
  102. learun.layerConfirm('是否确认删除该项!', function (res) {
  103. if (res) {
  104. learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/StudentCertificate/DeleteForm', { keyValue: keyValue}, function () {
  105. refreshGirdData();
  106. });
  107. }
  108. });
  109. }
  110. });
  111. // 打印
  112. $('#lr_print').on('click', function () {
  113. $('#gridtable').jqprintTable();
  114. });
  115. },
  116. // 初始化列表
  117. initGird: function () {
  118. $('#gridtable').lrAuthorizeJfGrid({
  119. url: top.$.rootUrl + '/EducationalAdministration/StudentCertificate/GetPageList',
  120. headData: [
  121. { label: "学生学号", name: "StuNo", width: 100, align: "left"},
  122. { label: "学生姓名", name: "StuName", width: 100, align: "left"},
  123. { label: "专业部", name: "DeptNo", width: 100, align: "left",
  124. formatterAsync: function (callback, value, row, op,$cell) {
  125. learun.clientdata.getAsync('custmerData', {
  126. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo',
  127. key: value,
  128. keyId: 'deptno',
  129. callback: function (_data) {
  130. callback(_data['deptname']);
  131. }
  132. });
  133. }},
  134. { label: "专业", name: "MajorNo", width: 100, align: "left",
  135. formatterAsync: function (callback, value, row, op,$cell) {
  136. learun.clientdata.getAsync('custmerData', {
  137. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo',
  138. key: value,
  139. keyId: 'majorno',
  140. callback: function (_data) {
  141. callback(_data['majorname']);
  142. }
  143. });
  144. }},
  145. { label: "班级", name: "ClassNo", width: 100, align: "left",
  146. formatterAsync: function (callback, value, row, op,$cell) {
  147. learun.clientdata.getAsync('custmerData', {
  148. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj',
  149. key: value,
  150. keyId: 'classno',
  151. callback: function (_data) {
  152. callback(_data['classname']);
  153. }
  154. });
  155. }},
  156. { label: "证书名称", name: "SCName", width: 100, align: "left"},
  157. { label: "证书级别", name: "SCLevel", width: 100, align: "left"},
  158. { label: "证书种类", name: "SCType", width: 100, align: "left"},
  159. { label: "分值", name: "SCScore", width: 100, align: "left"},
  160. { label: "获取时间", name: "SCTime", width: 100, align: "left"},
  161. ],
  162. mainId:'Id',
  163. isPage: true
  164. });
  165. page.search();
  166. },
  167. search: function (param) {
  168. param = param || {};
  169. $('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) });
  170. }
  171. };
  172. refreshGirdData = function (res, postData) {
  173. if (!!res)
  174. {
  175. if (res.code == 200)
  176. {
  177. // 发起流程
  178. var postData = {
  179. schemeCode:'',// 填写流程对应模板编号
  180. processId:processId,
  181. level:'1',
  182. };
  183. learun.httpAsync('Post', top.$.rootUrl + '/LR_NewWorkFlow/NWFProcess/CreateFlow', postData, function(data) {
  184. learun.loading(false);
  185. });
  186. }
  187. page.search();
  188. }
  189. };
  190. page.init();
  191. }