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

4 years ago
4 years ago
4 years ago
4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2020-05-06 11:20
  5. * 描 述:在线报名
  6. */
  7. var refreshGirdData;
  8. var bootstrap = function ($, learun) {
  9. "use strict";
  10. var page = {
  11. init: function () {
  12. page.initGird();
  13. page.bind();
  14. },
  15. bind: function () {
  16. $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
  17. page.search(queryJson);
  18. }, 220, 400);
  19. $('#DeptNo').lrDataSourceSelect({ code: 'CdDeptInfo', value: 'deptno', text: 'deptname' });
  20. $('#MajorNo').lrDataSourceSelect({ code: 'CdMajorInfo', value: 'majorno', text: 'majorname' });
  21. // 刷新
  22. $('#lr_refresh').on('click', function () {
  23. location.reload();
  24. });
  25. // 新增
  26. $('#lr_add').on('click', function () {
  27. learun.layerForm({
  28. id: 'form',
  29. title: '新增',
  30. url: top.$.rootUrl + '/EducationalAdministration/SignUpAboutOnline/Form',
  31. width: 1000,
  32. height: 800,
  33. callBack: function (id) {
  34. return top[id].acceptClick(refreshGirdData);
  35. }
  36. });
  37. });
  38. // 编辑
  39. $('#lr_edit').on('click', function () {
  40. var keyValue = $('#gridtable').jfGridValue('Id');
  41. if (learun.checkrow(keyValue)) {
  42. var CheckStatus = $('#gridtable').jfGridValue('CheckStatus');
  43. if (CheckStatus == 1) {
  44. learun.alert.warning("当前记录已审核!");
  45. return false;
  46. }
  47. learun.layerForm({
  48. id: 'form',
  49. title: '编辑',
  50. url: top.$.rootUrl + '/EducationalAdministration/SignUpAboutOnline/Form?keyValue=' + keyValue,
  51. width: 1000,
  52. height: 800,
  53. callBack: function (id) {
  54. return top[id].acceptClick(refreshGirdData);
  55. }
  56. });
  57. }
  58. });
  59. // 删除
  60. $('#lr_delete').on('click', function () {
  61. var keyValue = $('#gridtable').jfGridValue('Id');
  62. if (learun.checkrow(keyValue)) {
  63. var CheckStatus = $('#gridtable').jfGridValue('CheckStatus');
  64. if (CheckStatus == 1) {
  65. learun.alert.warning("当前记录已审核!");
  66. return false;
  67. }
  68. learun.layerConfirm('是否确认删除该项!', function (res) {
  69. if (res) {
  70. learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/SignUpAboutOnline/DeleteForm', { keyValue: keyValue }, function () {
  71. refreshGirdData();
  72. });
  73. }
  74. });
  75. }
  76. });
  77. // 审核
  78. $('#lr_check').on('click', function () {
  79. var keyValue = $('#gridtable').jfGridValue('Id');
  80. if (learun.checkrow(keyValue)) {
  81. var CheckStatus = $('#gridtable').jfGridValue('CheckStatus');
  82. if (CheckStatus == 1) {
  83. learun.alert.warning("当前记录已审核!");
  84. return false;
  85. }
  86. learun.layerConfirm('是否确认审核该项!', function (res) {
  87. if (res) {
  88. learun.postForm(top.$.rootUrl + '/EducationalAdministration/SignUpAboutOnline/DoCheck', { keyValue: keyValue }, function () {
  89. refreshGirdData();
  90. });
  91. }
  92. });
  93. }
  94. });
  95. $('#lr_uncheck').on('click', function () {
  96. var keyValue = $('#gridtable').jfGridValue('Id');
  97. if (learun.checkrow(keyValue)) {
  98. var CheckStatus = $('#gridtable').jfGridValue('CheckStatus');
  99. if (CheckStatus == 0) {
  100. learun.alert.warning("当前记录还未审核!");
  101. return false;
  102. }
  103. learun.layerConfirm('是否确认去审核该项!', function (res) {
  104. if (res) {
  105. learun.postForm(top.$.rootUrl + '/EducationalAdministration/SignUpAboutOnline/DoUnCheck', { keyValue: keyValue }, function () {
  106. refreshGirdData();
  107. });
  108. }
  109. });
  110. }
  111. });
  112. },
  113. // 初始化列表
  114. initGird: function () {
  115. $('#gridtable').lrAuthorizeJfGrid({
  116. url: top.$.rootUrl + '/EducationalAdministration/SignUpAboutOnline/GetPageList',
  117. headData: [
  118. {
  119. label: "审核状态", name: "CheckStatus", width: 100, align: "left", formatter: function (cellvalue) {
  120. return cellvalue == 1 ? "<span class=\"label label-success\">已审核</span>" : "<span class=\"label label-warning\">未审核</span>";
  121. }
  122. },
  123. {
  124. label: "报名日期", name: "SignUpTime", width: 130, align: "left", formatter: function (cellvalue) {
  125. return cellvalue == "0001-01-01 00:00:00" ? "" : cellvalue.slice(0,10);
  126. }
  127. },
  128. { label: "姓名", name: "RealName", width: 100, align: "left" },
  129. {
  130. label: "性别", name: "Sex", width: 100, align: "left",
  131. formatterAsync: function (callback, value, row, op, $cell) {
  132. learun.clientdata.getAsync('dataItem', {
  133. key: value,
  134. code: 'usersex',
  135. callback: function (_data) {
  136. callback(_data.text);
  137. }
  138. });
  139. }
  140. },
  141. {
  142. label: "民族", name: "NationalityNo", width: 100, align: "left",
  143. formatterAsync: function (callback, value, row, op, $cell) {
  144. learun.clientdata.getAsync('dataItem', {
  145. key: value,
  146. code: 'National',
  147. callback: function (_data) {
  148. callback(_data.text);
  149. }
  150. });
  151. }
  152. },
  153. { label: "毕业学校", name: "GraduateSchool", width: 100, align: "left" },
  154. { label: "班级", name: "ClassNo", width: 100, align: "left" },
  155. { label: "中考成绩", name: "MidExamScore", width: 100, align: "left" },
  156. { label: "家庭住址", name: "HomeAddress", width: 100, align: "left" },
  157. { label: "户口所在地", name: "OriginAddress", width: 100, align: "left" },
  158. { label: "身份证号", name: "IdCard", width: 150, align: "left" },
  159. { label: "家长电话", name: "Phone", width: 100, align: "left" },
  160. //{
  161. // label: "系部", name: "DeptNo", width: 100, align: "left",
  162. // formatterAsync: function (callback, value, row, op, $cell) {
  163. // learun.clientdata.getAsync('custmerData', {
  164. // url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo',
  165. // key: value,
  166. // keyId: 'deptno',
  167. // callback: function (_data) {
  168. // callback(_data['deptname']);
  169. // }
  170. // });
  171. // }
  172. //},
  173. {
  174. label: "专业", name: "MajorNo", width: 100, align: "left",
  175. formatterAsync: function (callback, value, row, op, $cell) {
  176. learun.clientdata.getAsync('custmerData', {
  177. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo',
  178. key: value,
  179. keyId: 'majorno',
  180. callback: function (_data) {
  181. callback(_data['majorname']);
  182. }
  183. });
  184. }
  185. },
  186. //{
  187. // label: "政治面貌", name: "PartyFaceNo", width: 100, align: "left",
  188. // formatterAsync: function (callback, value, row, op, $cell) {
  189. // learun.clientdata.getAsync('custmerData', {
  190. // url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'BCdPartyFace',
  191. // key: value,
  192. // keyId: 'partyfaceno',
  193. // callback: function (_data) {
  194. // callback(_data['partyface']);
  195. // }
  196. // });
  197. // }
  198. //},
  199. //{
  200. // label: "户口性质", name: "ResidenceNo", width: 100, align: "left",
  201. // formatterAsync: function (callback, value, row, op, $cell) {
  202. // learun.clientdata.getAsync('dataItem', {
  203. // key: value,
  204. // code: 'ResidenceNo',
  205. // callback: function (_data) {
  206. // callback(_data.text);
  207. // }
  208. // });
  209. // }
  210. //},
  211. {
  212. label: "是否住宿", name: "IsAccommodate", width: 100, align: "left",
  213. formatterAsync: function (callback, value, row, op, $cell) {
  214. learun.clientdata.getAsync('dataItem', {
  215. key: value,
  216. code: 'YesOrNoInt',
  217. callback: function (_data) {
  218. callback(_data.text);
  219. }
  220. });
  221. }
  222. },
  223. { label: "身高/体重", name: "HeightWeight", width: 100, align: "left" },
  224. //{ label: "创建时间", name: "CreateTime", width: 130, align: "left" },
  225. { label: "备注", name: "Remark", width: 130, align: "left" },
  226. ],
  227. mainId: 'Id',
  228. isPage: true,
  229. sidx: 'CreateTime',
  230. sord: 'desc'
  231. });
  232. page.search();
  233. },
  234. search: function (param) {
  235. param = param || {};
  236. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  237. }
  238. };
  239. refreshGirdData = function () {
  240. page.search();
  241. };
  242. page.init();
  243. }