Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 
 
 
 

286 wiersze
13 KiB

  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. $('#AcademicYearNo').lrselect({
  25. placeholder: "请选择学年",
  26. allowSearch: true,
  27. url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetAcademicYearNo',
  28. value: 'value',
  29. text: 'text'
  30. });
  31. //学期
  32. $('#Semester').lrselect({
  33. placeholder: "请选择学期",
  34. allowSearch: true,
  35. url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetSemester',
  36. value: 'value',
  37. text: 'text'
  38. });
  39. // 刷新
  40. $('#lr_refresh').on('click', function () {
  41. location.reload();
  42. });
  43. // 新增
  44. $('#lr_add').on('click', function () {
  45. learun.layerForm({
  46. id: 'form',
  47. title: '新增',
  48. url: top.$.rootUrl + '/EducationalAdministration/StudentCertificate/Form',
  49. width: 800,
  50. height: 600,
  51. callBack: function (id) {
  52. var res = false;
  53. // 验证数据
  54. res = top[id].validForm();
  55. // 保存数据
  56. if (res) {
  57. res = top[id].save('', function () {
  58. page.search();
  59. });
  60. }
  61. return res;
  62. }
  63. });
  64. });
  65. // 编辑
  66. $('#lr_edit').on('click', function () {
  67. var keyValue = $('#gridtable').jfGridValue('Id');
  68. if (learun.checkrow(keyValue)) {
  69. var Status = $('#gridtable').jfGridValue('Status');
  70. if (Status != 0) {
  71. learun.alert.warning("当前项目已提交,不可编辑!");
  72. return;
  73. }
  74. learun.layerForm({
  75. id: 'form',
  76. title: '编辑',
  77. url: top.$.rootUrl + '/EducationalAdministration/StudentCertificate/Form?keyValue=' + keyValue,
  78. width: 800,
  79. height: 600,
  80. callBack: function (id) {
  81. var res = false;
  82. // 验证数据
  83. res = top[id].validForm();
  84. // 保存数据
  85. if (res) {
  86. res = top[id].save('', function () {
  87. page.search();
  88. });
  89. }
  90. return res;
  91. }
  92. });
  93. }
  94. });
  95. //修改分值
  96. $('#lr_updscore').on('click', function () {
  97. var keyValue = $('#gridtable').jfGridValue('Id');
  98. if (learun.checkrow(keyValue)) {
  99. learun.layerForm({
  100. id: 'form_updscore',
  101. title: '修改分值',
  102. url: top.$.rootUrl + '/EducationalAdministration/StudentCertificate/FormScore?keyValue=' + keyValue,
  103. width: 500,
  104. height: 350,
  105. callBack: function (id) {
  106. var res = false;
  107. // 验证数据
  108. res = top[id].validForm();
  109. // 保存数据
  110. if (res) {
  111. res = top[id].save('', function () {
  112. page.search();
  113. });
  114. }
  115. return res;
  116. }
  117. });
  118. }
  119. });
  120. //复制
  121. $('#lr_copy').on('click', function () {
  122. var keyValue = $('#gridtable').jfGridValue('Id');
  123. if (learun.checkrow(keyValue)) {
  124. learun.layerForm({
  125. id: 'form',
  126. title: '新增',
  127. url: top.$.rootUrl + '/EducationalAdministration/StudentCertificate/Form?keyValue=' + keyValue + '&type=copy',
  128. width: 720,
  129. height: 550,
  130. callBack: function (id) {
  131. var res = false;
  132. // 验证数据
  133. res = top[id].validForm();
  134. // 保存数据
  135. if (res) {
  136. res = top[id].save('', function () {
  137. page.search();
  138. });
  139. }
  140. return res;
  141. }
  142. });
  143. }
  144. });
  145. // 删除
  146. $('#lr_delete').on('click', function () {
  147. var keyValue = $('#gridtable').jfGridValue('Id');
  148. if (learun.checkrow(keyValue)) {
  149. var Status = $('#gridtable').jfGridValue('Status');
  150. if (Status != 0) {
  151. learun.alert.warning("当前项目已提交,不可编辑!");
  152. return;
  153. }
  154. learun.layerConfirm('是否确认删除该项!', function (res) {
  155. if (res) {
  156. learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/StudentCertificate/DeleteForm', { keyValue: keyValue }, function () {
  157. refreshGirdData();
  158. });
  159. }
  160. });
  161. }
  162. });
  163. // 提交
  164. $('#lr_submit').on('click', function () {
  165. var keyValue = $('#gridtable').jfGridValue('Id');
  166. if (learun.checkrow(keyValue)) {
  167. var Status = $('#gridtable').jfGridValue('Status');
  168. if (Status != '0') {
  169. learun.alert.warning("当前项目已提交,请耐心等待审批!");
  170. return;
  171. }
  172. learun.layerConfirm('是否确认提交该项!', function (res) {
  173. if (res) {
  174. processId = learun.newGuid();
  175. learun.postForm(top.$.rootUrl + '/EducationalAdministration/StudentCertificate/ChangeStatusById', { keyValue: keyValue, processId: processId }, function (res) {
  176. refreshGirdData(res, {});
  177. });
  178. }
  179. });
  180. }
  181. });
  182. // 打印
  183. $('#lr_print').on('click', function () {
  184. $('#gridtable').jqprintTable();
  185. });
  186. },
  187. // 初始化列表
  188. initGird: function () {
  189. $('#gridtable').jfGrid({
  190. url: top.$.rootUrl + '/EducationalAdministration/StudentCertificate/GetPageList',
  191. headData: [
  192. { label: "学年", name: "AcademicYearNo", width: 80, align: "left" },
  193. { label: "学期", name: "Semester", width: 80, align: "left" },
  194. { label: "学生学号", name: "StuNo", width: 150, align: "left" },
  195. { label: "学生姓名", name: "StuName", width: 100, align: "left" },
  196. {
  197. label: "专业部", name: "DeptNo", width: 100, align: "left",
  198. formatterAsync: function (callback, value, row, op, $cell) {
  199. learun.clientdata.getAsync('custmerData', {
  200. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo',
  201. key: value,
  202. keyId: 'deptno',
  203. callback: function (_data) {
  204. callback(_data['deptname']);
  205. }
  206. });
  207. }
  208. },
  209. {
  210. label: "专业", name: "MajorNo", width: 100, align: "left",
  211. formatterAsync: function (callback, value, row, op, $cell) {
  212. learun.clientdata.getAsync('custmerData', {
  213. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo',
  214. key: value,
  215. keyId: 'majorno',
  216. callback: function (_data) {
  217. callback(_data['majorname']);
  218. }
  219. });
  220. }
  221. },
  222. {
  223. label: "班级", name: "ClassNo", width: 100, align: "left",
  224. formatterAsync: function (callback, value, row, op, $cell) {
  225. learun.clientdata.getAsync('custmerData', {
  226. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj',
  227. key: value,
  228. keyId: 'classno',
  229. callback: function (_data) {
  230. callback(_data['classname']);
  231. }
  232. });
  233. }
  234. },
  235. { label: "证书名称", name: "SCName", width: 100, align: "left" },
  236. { label: "证书级别", name: "SCLevel", width: 100, align: "left" },
  237. { label: "证书种类", name: "SCType", width: 100, align: "left" },
  238. { label: "分值", name: "SCScore", width: 100, align: "left" },
  239. {
  240. label: "获取时间", name: "SCTime", width: 100, align: "left",
  241. formatter: function (cellvalue, row) {
  242. return learun.formatDate(cellvalue, 'yyyy-MM-dd');
  243. }
  244. },
  245. {
  246. label: "状态", name: "Status", width: 100, align: "left",
  247. formatter: function (cellvalue, row) {
  248. if (cellvalue === 1) {
  249. return '<span class=\"label label-warning\">审批中</span>';
  250. } else if (cellvalue === 2) {
  251. return '<span class=\"label label-success\">审核通过</span>';
  252. } else {
  253. return '<span class=\"label label-default\" >草稿</span>';
  254. }
  255. }
  256. },
  257. ],
  258. mainId: 'Id',
  259. isPage: true
  260. });
  261. page.search();
  262. },
  263. search: function (param) {
  264. param = param || {};
  265. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  266. }
  267. };
  268. refreshGirdData = function (res, postData) {
  269. if (res && res.code && res.code == 200) {
  270. var postData = {
  271. schemeCode: 'LC_StudentCertificate',// 填写流程对应模板编号
  272. processId: processId,
  273. level: '1',
  274. };
  275. learun.httpAsync('Post', top.$.rootUrl + '/LR_NewWorkFlow/NWFProcess/CreateFlow', postData, function (data) {
  276. learun.loading(false);
  277. });
  278. }
  279. page.search();
  280. };
  281. page.init();
  282. }