No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 
 
 
 

319 líneas
14 KiB

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