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.
 
 
 
 
 
 

268 lines
12 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. //$('#StuNo').lrDataSourceSelect({ code: 'StuInfoBasic',value: 'stuno',text: 'stuname' });
  28. $('#EmpNo').lrDataSourceSelect({ code: 'EmpInfo', value: 'empno', text: 'empname' });
  29. // 刷新
  30. $('#lr_refresh').on('click', function () {
  31. location.reload();
  32. });
  33. // 新增
  34. $('#lr_add').on('click', function () {
  35. learun.layerForm({
  36. id: 'form',
  37. title: '新增',
  38. url: top.$.rootUrl + '/EducationalAdministration/StuDisciplineManagement/Form',
  39. width: 1000,
  40. height: 800,
  41. callBack: function (id) {
  42. var res = false;
  43. // 验证数据
  44. res = top[id].validForm();
  45. // 保存数据
  46. if (res) {
  47. res = top[id].save('', function () {
  48. page.search();
  49. });
  50. }
  51. return res;
  52. }
  53. });
  54. });
  55. // 编辑
  56. $('#lr_edit').on('click', function () {
  57. var keyValue = $('#gridtable').jfGridValue('Id');
  58. if (learun.checkrow(keyValue)) {
  59. var CheckStatus = $('#gridtable').jfGridValue('CheckStatus');
  60. if (CheckStatus != "0") {
  61. learun.alert.warning("当前项已提交!");
  62. return false;
  63. }
  64. learun.layerForm({
  65. id: 'form',
  66. title: '编辑',
  67. url: top.$.rootUrl + '/EducationalAdministration/StuDisciplineManagement/Form?keyValue=' + keyValue,
  68. width: 1000,
  69. height: 800,
  70. callBack: function (id) {
  71. var res = false;
  72. // 验证数据
  73. res = top[id].validForm();
  74. // 保存数据
  75. if (res) {
  76. res = top[id].save('', function () {
  77. page.search();
  78. });
  79. }
  80. return res;
  81. }
  82. });
  83. }
  84. });
  85. // 删除
  86. $('#lr_delete').on('click', function () {
  87. var keyValue = $('#gridtable').jfGridValue('Id');
  88. if (learun.checkrow(keyValue)) {
  89. var CheckStatus = $('#gridtable').jfGridValue('CheckStatus');
  90. if (CheckStatus != "0") {
  91. learun.alert.warning("当前项已提交!");
  92. return false;
  93. }
  94. learun.layerConfirm('是否确认删除该项!', function (res) {
  95. if (res) {
  96. learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/StuDisciplineManagement/DeleteForm', { keyValue: keyValue }, function () {
  97. refreshGirdData();
  98. });
  99. }
  100. });
  101. }
  102. });
  103. //  查看
  104. $('#lr_view').on('click', function () {
  105. var keyValue = $('#gridtable').jfGridValue('Id');
  106. if (learun.checkrow(keyValue)) {
  107. learun.layerForm({
  108. id: 'formview',
  109. title: '查看',
  110. url: top.$.rootUrl + '/EducationalAdministration/StuDisciplineManagement/FormView?keyValue=' + keyValue,
  111. width: 1000,
  112. height: 600,
  113. btn: null
  114. });
  115. }
  116. });
  117. //  提交
  118. $('#lr_submit').on('click', function () {
  119. var keyValue = $('#gridtable').jfGridValue('Id');
  120. if (learun.checkrow(keyValue)) {
  121. var CheckStatus = $('#gridtable').jfGridValue('CheckStatus');
  122. if (CheckStatus != "0") {
  123. learun.alert.warning("当前项已提交!");
  124. return false;
  125. }
  126. learun.layerConfirm('是否确认提交该项!', function (res) {
  127. if (res) {
  128. processId = learun.newGuid();
  129. learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuDisciplineManagement/DoSubmit', { keyValue: keyValue, status: "1", processId: processId }, function (res) {
  130. refreshGirdData(res, {});
  131. });
  132. }
  133. });
  134. }
  135. });
  136. },
  137. // 初始化列表
  138. initGird: function () {
  139. $('#gridtable').jfGrid({
  140. url: top.$.rootUrl + '/EducationalAdministration/StuDisciplineManagement/GetPageList',
  141. headData: [
  142. { label: "学号", name: "StuNo", width: 100, align: "left" },
  143. {
  144. label: "处分类别", name: "SType", width: 80, align: "left" ,
  145. formatterAsync: function (callback, value, row, op, $cell) {
  146. learun.clientdata.getAsync('dataItem', {
  147. key: value,
  148. code: 'DisType',
  149. callback: function (_data) {
  150. callback(_data.text);
  151. }
  152. });
  153. }
  154. },
  155. {
  156. label: "违纪学生", name: "StuNo", width: 100, align: "left",
  157. formatterAsync: function (callback, value, row, op, $cell) {
  158. learun.clientdata.getAsync('custmerData', {
  159. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'StuInfoBasic',
  160. key: value,
  161. keyId: 'stuno',
  162. callback: function (_data) {
  163. callback(_data['stuname']);
  164. }
  165. });
  166. }
  167. },
  168. {
  169. label: "性别", name: "GenderNo", width: 50, align: "left",
  170. formatter: function (cellvalue) {
  171. return cellvalue == true ? "男" : "女";
  172. }
  173. },
  174. { label: "电话", name: "Mobile", width: 100, align: "left" },
  175. {
  176. label: "院系", name: "DeptNo", width: 100, align: "left",
  177. formatterAsync: function (callback, value, row, op, $cell) {
  178. learun.clientdata.getAsync('custmerData', {
  179. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo',
  180. key: value,
  181. keyId: 'deptno',
  182. callback: function (_data) {
  183. callback(_data['deptname']);
  184. }
  185. });
  186. }
  187. },
  188. {
  189. label: "专业", name: "majorno", width: 100, align: "left",
  190. formatterAsync: function (callback, value, row, op, $cell) {
  191. learun.clientdata.getAsync('custmerData', {
  192. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo',
  193. key: value,
  194. keyId: 'majorno',
  195. callback: function (_data) {
  196. callback(_data['majorname']);
  197. }
  198. });
  199. }
  200. },
  201. {
  202. label: "班级", name: "classno", width: 100, align: "left",
  203. formatterAsync: function (callback, value, row, op, $cell) {
  204. learun.clientdata.getAsync('custmerData', {
  205. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj',
  206. key: value,
  207. keyId: 'classno',
  208. callback: function (_data) {
  209. callback(_data['classname']);
  210. }
  211. });
  212. }
  213. },
  214. {
  215. label: "处理老师", name: "EmpNo", width: 100, align: "left",
  216. formatterAsync: function (callback, value, row, op, $cell) {
  217. learun.clientdata.getAsync('custmerData', {
  218. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo',
  219. key: value,
  220. keyId: 'empno',
  221. callback: function (_data) {
  222. callback(_data['empname']);
  223. }
  224. });
  225. }
  226. },
  227. { label: "处理时间", name: "DealTime", width: 120, align: "left" },
  228. { label: "事情经过", name: "Things", width: 200, align: "left" },
  229. { label: "学生态度", name: "StudentAttitude", width: 100, align: "left" },
  230. { label: "班主任意见", name: "TeacherOpinion", width: 100, align: "left" },
  231. { label: "家长意见", name: "ParentsOpinion", width: 100, align: "left" },
  232. { label: "学院意见", name: "SchoolOpinion", width: 100, align: "left" },
  233. {
  234. label: "审核状态", name: "CheckStatus", width: 100, align: "left", formatter: function (cellvalue) {
  235. 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>";
  236. }
  237. },
  238. ],
  239. mainId: 'Id',
  240. isPage: true,
  241. sidx: "CreateTime desc"
  242. });
  243. page.search();
  244. },
  245. search: function (param) {
  246. param = param || {};
  247. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  248. }
  249. };
  250. refreshGirdData = function (res, postData) {
  251. if (!!res) {
  252. if (res.code == 200) {
  253. // 发起流程
  254. var postData = {
  255. schemeCode: 'StuDisciplineManagement',// 填写流程对应模板编号
  256. processId: processId,
  257. level: '1',
  258. };
  259. learun.httpAsync('Post', top.$.rootUrl + '/LR_NewWorkFlow/NWFProcess/CreateFlow', postData, function (data) {
  260. learun.loading(false);
  261. });
  262. }
  263. page.search();
  264. }
  265. };
  266. page.init();
  267. }