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.
 
 
 
 
 
 

296 lines
14 KiB

  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2019-10-28 11:48
  5. * 描 述:学籍异动
  6. */
  7. var refreshGirdData;
  8. var bootstrap = function ($, learun) {
  9. "use strict";
  10. var startTime;
  11. var endTime;
  12. var page = {
  13. init: function () {
  14. page.initGird();
  15. page.bind();
  16. },
  17. bind: function () {
  18. // 时间搜索框
  19. $('#datesearch').lrdate({
  20. dfdata: [
  21. { name: '今天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00') }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
  22. { name: '近7天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'd', -6) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
  23. { name: '近1个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -1) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
  24. { name: '近3个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -3) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }
  25. ],
  26. // 月
  27. mShow: false,
  28. premShow: false,
  29. // 季度
  30. jShow: false,
  31. prejShow: false,
  32. // 年
  33. ysShow: false,
  34. yxShow: false,
  35. preyShow: false,
  36. yShow: false,
  37. // 默认
  38. dfvalue: '1',
  39. selectfn: function (begin, end) {
  40. startTime = begin;
  41. endTime = end;
  42. page.search();
  43. }
  44. });
  45. $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
  46. page.search(queryJson);
  47. }, 300, 400);
  48. $('#DeptNo').lrDataSourceSelect({ code: 'CdDeptInfo', value: 'deptno', text: 'deptname' });
  49. $('#MajorNo').lrDataSourceSelect({ code: 'CdMajorInfo', value: 'majorno', text: 'majorname' });
  50. $('#ClassNo').lrDataSourceSelect({ code: 'bjsj', value: 'classno', text: 'classname' });
  51. $('#GenderNo').lrDataItemSelect({ code: 'usersexbit' });
  52. $('#Grade').lrselect({
  53. url: top.$.rootUrl + '/EducationalAdministration/ClassInfo/GenerateNearByYear',
  54. value: 'value',
  55. text: 'text'
  56. });
  57. $('#StuChangeType').lrDataItemSelect({ code: 'StuChangeType' });
  58. // 刷新
  59. $('#lr_refresh').on('click', function () {
  60. location.reload();
  61. });
  62. // 新增
  63. $('#lr_add').on('click', function () {
  64. learun.layerForm({
  65. id: 'form',
  66. title: '新增',
  67. url: top.$.rootUrl + '/EducationalAdministration/StuInfoBasicChange/Form',
  68. width: 1000,
  69. height: 600,
  70. callBack: function (id) {
  71. return top[id].acceptClick(refreshGirdData);
  72. }
  73. });
  74. });
  75. // 编辑
  76. $('#lr_edit').on('click', function () {
  77. var keyValue = $('#gridtable').jfGridValue('Id');
  78. if (learun.checkrow(keyValue)) {
  79. var CheckStatus = $('#gridtable').jfGridValue('CheckStatus');
  80. if (CheckStatus === 1) {
  81. learun.alert.warning("当前项目已审核不能编辑!");
  82. return;
  83. }
  84. learun.layerForm({
  85. id: 'form',
  86. title: '编辑',
  87. url: top.$.rootUrl + '/EducationalAdministration/StuInfoBasicChange/Form?keyValue=' + keyValue,
  88. width: 1000,
  89. height: 600,
  90. callBack: function (id) {
  91. return top[id].acceptClick(refreshGirdData);
  92. }
  93. });
  94. }
  95. });
  96. // 删除
  97. $('#lr_delete').on('click', function () {
  98. var keyValue = $('#gridtable').jfGridValue('Id');
  99. if (learun.checkrow(keyValue)) {
  100. var CheckStatus = $('#gridtable').jfGridValue('CheckStatus');
  101. if (CheckStatus === 1) {
  102. learun.alert.warning("当前项目已审核不能删除!");
  103. return;
  104. }
  105. learun.layerConfirm('是否确认删除该项!', function (res) {
  106. if (res) {
  107. learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/StuInfoBasicChange/DeleteForm', { keyValue: keyValue }, function () {
  108. refreshGirdData();
  109. });
  110. }
  111. });
  112. }
  113. });
  114. //审核
  115. $('#lr_check').on('click', function () {
  116. var keyValue = $('#gridtable').jfGridValue('Id');
  117. if (learun.checkrow(keyValue)) {
  118. var CheckStatus = $('#gridtable').jfGridValue('CheckStatus');
  119. if (CheckStatus === 1) {
  120. learun.alert.warning("当前项目已审核!");
  121. return;
  122. }
  123. learun.layerConfirm('是否确认审核该项!', function (res) {
  124. if (res) {
  125. learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuInfoBasicChange/CheckForm', { keyValue: keyValue }, function () {
  126. refreshGirdData();
  127. });
  128. }
  129. });
  130. }
  131. });
  132. //去审核
  133. $('#lr_uncheck').on('click', function () {
  134. var keyValue = $('#gridtable').jfGridValue('Id');
  135. if (learun.checkrow(keyValue)) {
  136. var CheckStatus = $('#gridtable').jfGridValue('CheckStatus');
  137. if (CheckStatus != 1) {
  138. learun.alert.warning("当前项目未审核无法去审!");
  139. return;
  140. }
  141. learun.layerConfirm('是否确认去审核该项!', function (res) {
  142. if (res) {
  143. learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuInfoBasicChange/UnCheckForm', { keyValue: keyValue }, function () {
  144. refreshGirdData();
  145. });
  146. }
  147. });
  148. }
  149. });
  150. },
  151. // 初始化列表
  152. initGird: function () {
  153. $('#gridtable').lrAuthorizeJfGrid({
  154. url: top.$.rootUrl + '/EducationalAdministration/StuInfoBasicChange/GetPageList',
  155. headData: [
  156. { label: "学号", name: "StuNo", width: 100, align: "left" },
  157. { label: "姓名", name: "StuName", width: 100, align: "left" },
  158. {
  159. label: "性别", name: "GenderNo", width: 80, align: "left",
  160. formatter: function (cellvalue) {
  161. return cellvalue == true ? "男" : "女";
  162. }
  163. },
  164. {
  165. label: "异动类型", name: "StuChangeType", width: 100, align: "left",
  166. formatterAsync: function (callback, value, row, op, $cell) {
  167. learun.clientdata.getAsync('dataItem', {
  168. key: value,
  169. code: 'StuChangeType',
  170. callback: function (_data) {
  171. callback(_data.text);
  172. }
  173. });
  174. }
  175. },
  176. {
  177. label: "异动原因", name: "StuChangeReason", width: 100, align: "left",
  178. formatterAsync: function (callback, value, row, op, $cell) {
  179. learun.clientdata.getAsync('dataItem', {
  180. key: value,
  181. code: 'StuChangeReason',
  182. callback: function (_data) {
  183. callback(_data.text);
  184. }
  185. });
  186. }
  187. },
  188. {
  189. label: "系部", name: "DeptNo", width: 100, align: "left",
  190. formatterAsync: function (callback, value, row, op, $cell) {
  191. learun.clientdata.getAsync('custmerData', {
  192. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo',
  193. key: value,
  194. keyId: 'deptno',
  195. callback: function (_data) {
  196. callback(_data['deptname']);
  197. }
  198. });
  199. }
  200. },
  201. {
  202. label: "专业", name: "MajorNo", width: 100, align: "left",
  203. formatterAsync: function (callback, value, row, op, $cell) {
  204. learun.clientdata.getAsync('custmerData', {
  205. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo',
  206. key: value,
  207. keyId: 'majorno',
  208. callback: function (_data) {
  209. callback(_data['majorname']);
  210. }
  211. });
  212. }
  213. },
  214. {
  215. label: "班级", name: "ClassNo", width: 100, align: "left",
  216. formatterAsync: function (callback, value, row, op, $cell) {
  217. learun.clientdata.getAsync('custmerData', {
  218. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj',
  219. key: value,
  220. keyId: 'classno',
  221. callback: function (_data) {
  222. callback(_data['classname']);
  223. }
  224. });
  225. }
  226. },
  227. {
  228. label: "新系部", name: "NewDeptNo", width: 100, align: "left",
  229. formatterAsync: function (callback, value, row, op, $cell) {
  230. learun.clientdata.getAsync('custmerData', {
  231. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo',
  232. key: value,
  233. keyId: 'deptno',
  234. callback: function (_data) {
  235. callback(_data['deptname']);
  236. }
  237. });
  238. }
  239. },
  240. {
  241. label: "新专业", name: "NewMajorNo", width: 100, align: "left",
  242. formatterAsync: function (callback, value, row, op, $cell) {
  243. learun.clientdata.getAsync('custmerData', {
  244. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo',
  245. key: value,
  246. keyId: 'majorno',
  247. callback: function (_data) {
  248. callback(_data['majorname']);
  249. }
  250. });
  251. }
  252. },
  253. {
  254. label: "新班级", name: "NewClassNo", width: 100, align: "left",
  255. formatterAsync: function (callback, value, row, op, $cell) {
  256. learun.clientdata.getAsync('custmerData', {
  257. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj',
  258. key: value,
  259. keyId: 'classno',
  260. callback: function (_data) {
  261. callback(_data['classname']);
  262. }
  263. });
  264. }
  265. },
  266. { label: "创建时间", name: "CreateTime", width: 130, align: "left" },
  267. { label: "创建用户", name: "CreateUserId", width: 100, align: "left" },
  268. { label: "审核时间", name: "CheckTime", width: 130, align: "left" },
  269. { label: "审核用户", name: "CheckUserId", width: 100, align: "left" },
  270. {
  271. label: "审核状态", name: "CheckStatus", width: 100, align: "left",
  272. formatter: function (cellvalue) {
  273. return cellvalue == "1" ? "<span class=\"label label-success\">已审核</span>" : "<span class=\"label label-danger\">未审核</span>";
  274. }
  275. },
  276. ],
  277. mainId: 'Id',
  278. isPage: true,
  279. sord: 'desc',
  280. sidx: 'CreateTime'
  281. });
  282. //page.search();
  283. },
  284. search: function (param) {
  285. param = param || {};
  286. param.StartTime = startTime;
  287. param.EndTime = endTime;
  288. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  289. }
  290. };
  291. refreshGirdData = function () {
  292. page.search();
  293. };
  294. page.init();
  295. }