Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 
 
 
 

208 rader
9.4 KiB

  1. /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
  2. * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2021-03-26 15:23
  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. }, 220, 400);
  20. $('#StuNo').lrselect({
  21. allowSearch: true,
  22. url: top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/GetAllList',
  23. param: { strWhere: "1=1 " },
  24. value: "StuNo",
  25. text: "StuName"
  26. });
  27. $('#EmpNo').lrDataSourceSelect({ code: 'EmpInfo', value: 'empno', text: 'empname' });
  28. // 刷新
  29. $('#lr_refresh').on('click', function () {
  30. location.reload();
  31. });
  32. // 新增
  33. $('#lr_add').on('click', function () {
  34. learun.layerForm({
  35. id: 'form',
  36. title: '新增',
  37. url: top.$.rootUrl + '/EducationalAdministration/StuDisciplineManagement/Form',
  38. width: 1000,
  39. height: 800,
  40. callBack: function (id) {
  41. var res = false;
  42. // 验证数据
  43. res = top[id].validForm();
  44. // 保存数据
  45. if (res) {
  46. res = top[id].save('', function () {
  47. page.search();
  48. });
  49. }
  50. return res;
  51. }
  52. });
  53. });
  54. // 编辑
  55. $('#lr_edit').on('click', function () {
  56. var keyValue = $('#gridtable').jfGridValue('Id');
  57. if (learun.checkrow(keyValue)) {
  58. var CheckStatus = $('#gridtable').jfGridValue('CheckStatus');
  59. if (CheckStatus != "0") {
  60. learun.alert.warning("当前项已提交!");
  61. return false;
  62. }
  63. learun.layerForm({
  64. id: 'form',
  65. title: '编辑',
  66. url: top.$.rootUrl + '/EducationalAdministration/StuDisciplineManagement/Form?keyValue=' + keyValue,
  67. width: 1000,
  68. height: 800,
  69. callBack: function (id) {
  70. var res = false;
  71. // 验证数据
  72. res = top[id].validForm();
  73. // 保存数据
  74. if (res) {
  75. res = top[id].save('', function () {
  76. page.search();
  77. });
  78. }
  79. return res;
  80. }
  81. });
  82. }
  83. });
  84. // 删除
  85. $('#lr_delete').on('click', function () {
  86. var keyValue = $('#gridtable').jfGridValue('Id');
  87. if (learun.checkrow(keyValue)) {
  88. var CheckStatus = $('#gridtable').jfGridValue('CheckStatus');
  89. if (CheckStatus != "0") {
  90. learun.alert.warning("当前项已提交!");
  91. return false;
  92. }
  93. learun.layerConfirm('是否确认删除该项!', function (res) {
  94. if (res) {
  95. learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/StuDisciplineManagement/DeleteForm', { keyValue: keyValue }, function () {
  96. refreshGirdData();
  97. });
  98. }
  99. });
  100. }
  101. });
  102. //  查看
  103. $('#lr_view').on('click', function () {
  104. var keyValue = $('#gridtable').jfGridValue('Id');
  105. if (learun.checkrow(keyValue)) {
  106. learun.layerForm({
  107. id: 'formview',
  108. title: '查看',
  109. url: top.$.rootUrl + '/EducationalAdministration/StuDisciplineManagement/FormView?keyValue=' + keyValue,
  110. width: 1000,
  111. height: 600,
  112. btn: null
  113. });
  114. }
  115. });
  116. //  提交
  117. $('#lr_submit').on('click', function () {
  118. var keyValue = $('#gridtable').jfGridValue('Id');
  119. if (learun.checkrow(keyValue)) {
  120. var CheckStatus = $('#gridtable').jfGridValue('CheckStatus');
  121. if (CheckStatus != "0") {
  122. learun.alert.warning("当前项已提交!");
  123. return false;
  124. }
  125. learun.layerConfirm('是否确认提交该项!', function (res) {
  126. if (res) {
  127. processId = learun.newGuid();
  128. learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuDisciplineManagement/DoSubmit', { keyValue: keyValue, status: "1", processId: processId }, function (res) {
  129. refreshGirdData(res, {});
  130. });
  131. }
  132. });
  133. }
  134. });
  135. },
  136. // 初始化列表
  137. initGird: function () {
  138. $('#gridtable').lrAuthorizeJfGrid({
  139. url: top.$.rootUrl + '/EducationalAdministration/StuDisciplineManagement/GetPageList',
  140. headData: [
  141. {
  142. label: "违纪学生", name: "StuNo", width: 100, align: "left",
  143. formatterAsync: function (callback, value, row, op, $cell) {
  144. learun.clientdata.getAsync('custmerData', {
  145. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'StuInfoBasic',
  146. key: value,
  147. keyId: 'stuno',
  148. callback: function (_data) {
  149. callback(_data['stuname']);
  150. }
  151. });
  152. }
  153. },
  154. { label: "违纪时间", name: "DisciplineTime", width: 120, align: "left" },
  155. {
  156. label: "处理老师", name: "EmpNo", width: 100, align: "left",
  157. formatterAsync: function (callback, value, row, op, $cell) {
  158. learun.clientdata.getAsync('custmerData', {
  159. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo',
  160. key: value,
  161. keyId: 'empno',
  162. callback: function (_data) {
  163. callback(_data['empname']);
  164. }
  165. });
  166. }
  167. },
  168. { label: "处理时间", name: "DealTime", width: 120, align: "left" },
  169. { label: "事情经过", name: "Things", width: 200, align: "left" },
  170. { label: "学生态度", name: "StudentAttitude", width: 100, align: "left" },
  171. { label: "班主任意见", name: "TeacherOpinion", width: 100, align: "left" },
  172. { label: "家长意见", name: "ParentsOpinion", width: 100, align: "left" },
  173. {
  174. label: "审核状态", name: "CheckStatus", width: 100, align: "left", formatter: function (cellvalue) {
  175. return cellvalue == "1" ? "<span class=\"label label-warning\">审核中</span>" : cellvalue == "2" ? "<span class=\"label label-success\">审核通过</span>" : cellvalue == "3" ? "<span class=\"label label-danger\">审核未通过</span>" : "<span class=\"label label-default\">草稿</span>";
  176. }
  177. },
  178. ],
  179. mainId: 'Id',
  180. isPage: true,
  181. sidx: "CreateTime desc"
  182. });
  183. page.search();
  184. },
  185. search: function (param) {
  186. param = param || {};
  187. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  188. }
  189. };
  190. refreshGirdData = function (res, postData) {
  191. if (!!res) {
  192. if (res.code == 200) {
  193. // 发起流程
  194. var postData = {
  195. schemeCode: 'StuDisciplineManagement',// 填写流程对应模板编号
  196. processId: processId,
  197. level: '1',
  198. };
  199. learun.httpAsync('Post', top.$.rootUrl + '/LR_NewWorkFlow/NWFProcess/CreateFlow', postData, function (data) {
  200. learun.loading(false);
  201. });
  202. }
  203. page.search();
  204. }
  205. };
  206. page.init();
  207. }