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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  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. if (Status != 0) {
  150. learun.alert.warning("当前项目已提交,不可编辑!");
  151. return;
  152. }
  153. learun.layerConfirm('是否确认删除该项!', function (res) {
  154. if (res) {
  155. learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/StudentCertificate/DeleteForm', { keyValue: keyValue }, function () {
  156. refreshGirdData();
  157. });
  158. }
  159. });
  160. }
  161. });
  162. // 提交
  163. $('#lr_submit').on('click', function () {
  164. var keyValue = $('#gridtable').jfGridValue('Id');
  165. if (learun.checkrow(keyValue)) {
  166. var Status = $('#gridtable').jfGridValue('Status');
  167. if (Status != '0') {
  168. learun.alert.warning("当前项目已提交,请耐心等待审批!");
  169. return;
  170. }
  171. learun.layerConfirm('是否确认提交该项!', function (res) {
  172. if (res) {
  173. processId = learun.newGuid();
  174. learun.postForm(top.$.rootUrl + '/EducationalAdministration/StudentCertificate/ChangeStatusById', { keyValue: keyValue, processId: processId }, function (res) {
  175. refreshGirdData(res, {});
  176. });
  177. }
  178. });
  179. }
  180. });
  181. // 打印
  182. $('#lr_print').on('click', function () {
  183. $('#gridtable').jqprintTable();
  184. });
  185. },
  186. // 初始化列表
  187. initGird: function () {
  188. $('#gridtable').jfGrid({
  189. url: top.$.rootUrl + '/EducationalAdministration/StudentCertificate/GetPageList',
  190. headData: [
  191. { label: "学年", name: "AcademicYearNo", width: 80, align: "left" },
  192. { label: "学期", name: "Semester", width: 80, align: "left" },
  193. { label: "学生学号", name: "StuNo", width: 150, align: "left" },
  194. { label: "学生姓名", name: "StuName", width: 100, align: "left" },
  195. {
  196. label: "专业部", name: "DeptNo", width: 100, align: "left",
  197. formatterAsync: function (callback, value, row, op, $cell) {
  198. learun.clientdata.getAsync('custmerData', {
  199. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo',
  200. key: value,
  201. keyId: 'deptno',
  202. callback: function (_data) {
  203. callback(_data['deptname']);
  204. }
  205. });
  206. }
  207. },
  208. {
  209. label: "专业", name: "MajorNo", width: 100, align: "left",
  210. formatterAsync: function (callback, value, row, op, $cell) {
  211. learun.clientdata.getAsync('custmerData', {
  212. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo',
  213. key: value,
  214. keyId: 'majorno',
  215. callback: function (_data) {
  216. callback(_data['majorname']);
  217. }
  218. });
  219. }
  220. },
  221. {
  222. label: "班级", name: "ClassNo", width: 100, align: "left",
  223. formatterAsync: function (callback, value, row, op, $cell) {
  224. learun.clientdata.getAsync('custmerData', {
  225. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj',
  226. key: value,
  227. keyId: 'classno',
  228. callback: function (_data) {
  229. callback(_data['classname']);
  230. }
  231. });
  232. }
  233. },
  234. { label: "证书名称", name: "SCName", width: 100, align: "left" },
  235. { label: "证书级别", name: "SCLevel", width: 100, align: "left" },
  236. { label: "证书种类", name: "SCType", width: 100, align: "left" },
  237. { label: "分值", name: "SCScore", width: 100, align: "left" },
  238. {
  239. label: "获取时间", name: "SCTime", width: 100, align: "left",
  240. formatter: function (cellvalue, row) {
  241. return learun.formatDate(cellvalue, 'yyyy-MM-dd');
  242. }
  243. },
  244. {
  245. label: "状态", name: "Status", width: 100, align: "left",
  246. formatter: function (cellvalue, row) {
  247. if (cellvalue === 1) {
  248. return '<span class=\"label label-warning\">审批中</span>';
  249. } else if (cellvalue === 2) {
  250. return '<span class=\"label label-success\">审核通过</span>';
  251. } else {
  252. return '<span class=\"label label-default\" >草稿</span>';
  253. }
  254. }
  255. },
  256. ],
  257. mainId: 'Id',
  258. isPage: true
  259. });
  260. page.search();
  261. },
  262. search: function (param) {
  263. param = param || {};
  264. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  265. }
  266. };
  267. refreshGirdData = function (res, postData) {
  268. if (res && res.code && res.code == 200) {
  269. var postData = {
  270. schemeCode: 'LC_StudentCertificate',// 填写流程对应模板编号
  271. processId: processId,
  272. level: '1',
  273. };
  274. learun.httpAsync('Post', top.$.rootUrl + '/LR_NewWorkFlow/NWFProcess/CreateFlow', postData, function (data) {
  275. learun.loading(false);
  276. });
  277. }
  278. page.search();
  279. };
  280. page.init();
  281. }