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.
 
 
 
 
 
 

255 lines
11 KiB

  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2019-08-08 17:21
  5. * 描 述:新生信息管理
  6. */
  7. var selectedRow;
  8. var refreshGirdData;
  9. var bootstrap = function ($, learun) {
  10. "use strict";
  11. var page = {
  12. init: function () {
  13. page.initGird();
  14. page.bind();
  15. },
  16. bind: function () {
  17. // 查询
  18. $('#btn_Search').on('click', function () {
  19. var keyword = $('#txt_Keyword').val();
  20. page.search({ keyword: keyword });
  21. });
  22. // 刷新
  23. $('#lr_refresh').on('click', function () {
  24. location.reload();
  25. });
  26. //打印报道流程单
  27. $('#lr_printlc').on('click', function () {
  28. var keyValue = $('#gridtable').jfGridValue('ID');
  29. if (learun.checkrow(keyValue)) {
  30. learun.layerForm({
  31. id: 'form',
  32. title: '打印报道流程单',
  33. url: top.$.rootUrl + '/EducationalAdministration/StuInfoFresh/PrintSignFlow?Id=' + keyValue,
  34. width: 1200,
  35. height: 800,
  36. btn: null
  37. });
  38. }
  39. });
  40. // 新增
  41. $('#lr_add').on('click', function () {
  42. selectedRow = null;
  43. learun.layerForm({
  44. id: 'form',
  45. title: '新增',
  46. url: top.$.rootUrl + '/EducationalAdministration/StuInfoFresh/FormDC',
  47. width: 1200,
  48. height: 700,
  49. callBack: function (id) {
  50. return top[id].acceptClick(refreshGirdData);
  51. }
  52. });
  53. });
  54. // 编辑
  55. $('#lr_edit').on('click', function () {
  56. var keyValue = $('#gridtable').jfGridValue('ID');
  57. selectedRow = $('#gridtable').jfGridGet('rowdata');
  58. if (learun.checkrow(keyValue)) {
  59. learun.layerForm({
  60. id: 'form',
  61. title: '编辑',
  62. url: top.$.rootUrl + '/EducationalAdministration/StuInfoFresh/FormDC?keyValue=' + keyValue,
  63. width: 1200,
  64. height: 700,
  65. callBack: function (id) {
  66. return top[id].acceptClick(refreshGirdData);
  67. }
  68. });
  69. }
  70. });
  71. // 删除
  72. $('#lr_delete').on('click', function () {
  73. var keyValue = $('#gridtable').jfGridValue('ID');
  74. if (learun.checkrow(keyValue)) {
  75. learun.layerConfirm('是否确认删除该项!', function (res) {
  76. if (res) {
  77. learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/StuInfoFresh/DeleteForm', { keyValue: keyValue }, function () {
  78. });
  79. }
  80. });
  81. }
  82. });
  83. // 查看
  84. $('#lr_view').on('click', function () {
  85. var keyValue = $('#gridtable').jfGridValue('ID');
  86. selectedRow = $('#gridtable').jfGridGet('rowdata');
  87. if (learun.checkrow(keyValue)) {
  88. learun.layerForm({
  89. id: 'form',
  90. title: '查看',
  91. url: top.$.rootUrl + '/EducationalAdministration/StuInfoFresh/FormView?keyValue=' + keyValue,
  92. width: 1200,
  93. height: 700,
  94. btn: null
  95. });
  96. }
  97. });
  98. //  分配班级
  99. $('#lr_allocationClass').on('click', function () {
  100. learun.layerFormForPercent({
  101. id: 'form',
  102. title: "分配班级",
  103. url: top.$.rootUrl + '/EducationalAdministration/StuInfoFresh/AllocationClassDC',
  104. width: '90%',
  105. height: '90%',
  106. btn: null
  107. });
  108. });
  109. //  分配宿舍
  110. $('#lr_newallocationDormitory').on('click', function () {
  111. learun.layerFormForPercent({
  112. id: 'form',
  113. title: "分配宿舍",
  114. url: top.$.rootUrl + '/EducationalAdministration/StuInfoFresh/AllocationDormitory',
  115. width: '95%',
  116. height: '95%',
  117. btn: null
  118. });
  119. });
  120. //  分配床位
  121. $('#lr_newallocationBed').on('click', function () {
  122. learun.layerFormForPercent({
  123. id: 'form',
  124. title: "分配床位",
  125. url: top.$.rootUrl + '/EducationalAdministration/StuInfoFresh/AllocationBed',
  126. width: '95%',
  127. height: '95%',
  128. btn: null
  129. });
  130. });
  131. //  导出学生宿舍
  132. $('#lr_exportBed').on('click', function () {
  133. learun.layerForm({
  134. id: 'ExportBedForm',
  135. title: '导出学生宿舍',
  136. url: top.$.rootUrl + '/EducationalAdministration/StuInfoFresh/ExportBedForm',
  137. width: 600,
  138. height: 400,
  139. btn: null
  140. });
  141. });
  142. //确认分配宿舍
  143. $('#lr_confirmDormitory').on('click', function () {
  144. learun.layerConfirm('是否确认已经分配的宿舍!', function (res) {
  145. if (res) {
  146. learun.loading(true, '分配中');
  147. learun.httpAsync('get', top.$.rootUrl + '/EducationalAdministration/StuInfoFresh/ConfirmDormitory', {}, function (val) {
  148. learun.alert.success('操作成功');
  149. learun.loading(false);
  150. });
  151. }
  152. });
  153. })
  154. },
  155. initGird: function () {
  156. $('#gridtable').jfGrid({
  157. url: top.$.rootUrl + '/EducationalAdministration/StuInfoFresh/GetPageList',
  158. headData: [
  159. { label: '编号', name: 'StuNum', width: 150, align: "left" },
  160. {
  161. label: '报名日期', name: 'SignUpTime', width: 150, align: "left", formatter: function (value) {
  162. return /\d{4}-\d{1,2}-\d{1,2}/g.exec(value);
  163. }
  164. },
  165. { label: '姓名', name: 'StuName', width: 100, align: "left" },
  166. {
  167. label: '性别', name: 'GenderNo', width: 80, align: "left", formatterAsync: function (callback, value, row, op, $cell) {
  168. learun.clientdata.getAsync('dataItem', {
  169. key: value,
  170. code: 'usersex',
  171. callback: function (_data) {
  172. callback(_data.text);
  173. }
  174. });
  175. }
  176. },
  177. {
  178. label: '民族', name: 'NationalityNo', width: 80, align: "left", formatterAsync: function (callback, value, row, op, $cell) {
  179. learun.clientdata.getAsync('dataItem', {
  180. key: value,
  181. code: 'National',
  182. callback: function (_data) {
  183. callback(_data.text);
  184. }
  185. });
  186. }
  187. },
  188. { label: '毕业学校', name: 'HighSchoolName', width: 150, align: "left" },
  189. { label: '中学班级', name: 'OldClassName', width: 100, align: "left" },
  190. { label: '中考成绩', name: 'ComprehensiveScore', width: 150, align: "left" },
  191. { label: '家庭住址', name: 'FamilyAddress', width: 150, align: "left" },
  192. { label: '户口所在地', name: 'OriginAddress', width: 150, align: "left" },
  193. { label: '身份证号', name: 'IdentityCardNo', width: 150, align: "left" },
  194. { label: '家长电话', name: 'telephone', width: 150, align: "left" },
  195. {
  196. label: '选报专业', name: 'MajorNo', width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) {
  197. learun.clientdata.getAsync('custmerData', {
  198. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo',
  199. key: value,
  200. keyId: 'majorno',
  201. callback: function (_data) {
  202. callback(_data['majorname']);
  203. }
  204. });
  205. }
  206. },
  207. { label: '学制', name: 'EducationalSystem', width: 100, align: "left" },
  208. {
  209. label: "是否住宿", name: "IsAccommodate", width: 100, align: "left",
  210. formatterAsync: function (callback, value, row, op, $cell) {
  211. learun.clientdata.getAsync('dataItem', {
  212. key: value,
  213. code: 'YesOrNoInt',
  214. callback: function (_data) {
  215. callback(_data.text);
  216. }
  217. });
  218. }
  219. },
  220. { label: "身高/体重", name: "HeightWeight", width: 100, align: "left" },
  221. {
  222. label: "当前班级", name: "ClassNo", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) {
  223. learun.clientdata.getAsync('custmerData', {
  224. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj',
  225. key: value,
  226. keyId: 'classno',
  227. callback: function (_data) {
  228. callback(_data['classname']);
  229. }
  230. });
  231. }
  232. },
  233. ],
  234. mainId: 'ID',
  235. isPage: true,
  236. sidx: 'StuNo',
  237. sord: 'desc'
  238. });
  239. page.search();
  240. },
  241. search: function (param) {
  242. param = param || {};
  243. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  244. }
  245. };
  246. refreshGirdData = function () {
  247. page.search();
  248. };
  249. page.init();
  250. }