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.
 
 
 
 
 
 

379 lines
16 KiB

  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2019-07-17 11:20
  5. * 描 述:新生录取管理
  6. */
  7. var refreshGirdData;
  8. var NowGrade;
  9. var bootstrap = function ($, learun) {
  10. "use strict";
  11. var page = {
  12. init: function () {
  13. var data_grade = learun.httpGet(top.$.rootUrl + '/EducationalAdministration/StuEnroll/GetYearListByMaxClass',
  14. {});
  15. NowGrade = data_grade.info;
  16. page.initGird();
  17. page.bind();
  18. },
  19. bind: function () {
  20. $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
  21. page.search(queryJson);
  22. }, 380, 400, true,
  23. function () {
  24. var cardobj = idcardreader.readcard("lr_btn_readcard");
  25. if (cardobj.resultFlag == 0) {
  26. learun.alert.success("身份证信息读取成功");
  27. $("#StuName").val(cardobj.resultContent.partyName);
  28. $("#IDCard").val(cardobj.resultContent.certNumber);
  29. } else {
  30. learun.alert.error('读取错误!未检测到身份证或设备连接错误,请调整身份证位置并重新读取,多次未读取到身份证信息则可能是身份证芯片已损坏!');
  31. }
  32. });
  33. $('#DeptNo').lrselect({
  34. allowSearch: true,
  35. value: "deptno",
  36. text: "deptname",
  37. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdDeptInfo',
  38. select: function (item) {
  39. if (item) {
  40. $('#MajorNo').lrselectRefresh({
  41. allowSearch: true,
  42. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo',
  43. param: { strWhere: "DeptNo='" + item.deptno + "' AND CheckMark=1" }
  44. });
  45. } else {
  46. $('#MajorNo').lrselectRefresh({
  47. allowSearch: true,
  48. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo',
  49. param: { strWhere: "1=1 AND CheckMark=1" }
  50. });
  51. }
  52. }
  53. });
  54. $('#MajorNo').lrselect({
  55. allowSearch: true,
  56. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo',
  57. value: "majorno",
  58. text: "majorname",
  59. param: { strWhere: "1=1 AND CheckMark=1" },
  60. select: function (item) {
  61. if (item) {
  62. $('#ClassNo').lrselectRefresh({
  63. allowSearch: true,
  64. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  65. param: { strWhere: "majorno='" + item.majorno + "' AND CheckMark=1" }
  66. });
  67. } else {
  68. $('#ClassNo').lrselectRefresh({
  69. allowSearch: true,
  70. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  71. param: { strWhere: "1=1 AND CheckMark=1" }
  72. });
  73. }
  74. }
  75. });
  76. $('#ClassNo').lrselect({
  77. allowSearch: true,
  78. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  79. param: { strWhere: "1=1 AND CheckMark=1" },
  80. value: "classno",
  81. text: "classname"
  82. });
  83. $('#Grade').lrselect({
  84. url: top.$.rootUrl + '/EducationalAdministration/StuEnroll/GetYearListByClass',
  85. value: "year",
  86. text: "year",
  87. });
  88. $('#Grade').lrselectSet(NowGrade);
  89. //刷新
  90. $('#lr_refresh').on('click', function () {
  91. location.reload();
  92. });
  93. // 新增
  94. $('#lr_add').on('click', function () {
  95. learun.layerForm({
  96. id: 'form',
  97. title: '新增',
  98. url: top.$.rootUrl + '/EducationalAdministration/StuEnroll/Form',
  99. width: 800,
  100. height: 600,
  101. callBack: function (id) {
  102. return top[id].acceptClick(refreshGirdData);
  103. }
  104. });
  105. });
  106. // 编辑
  107. $('#lr_edit').on('click', function () {
  108. var keyValue = $('#gridtable').jfGridValue('StuId');
  109. if (learun.checkrow(keyValue)) {
  110. learun.layerForm({
  111. id: 'form',
  112. title: '编辑',
  113. url: top.$.rootUrl + '/EducationalAdministration/StuEnroll/Form?keyValue=' + keyValue,
  114. width: 800,
  115. height: 600,
  116. callBack: function (id) {
  117. return top[id].acceptClick(refreshGirdData);
  118. }
  119. });
  120. }
  121. });
  122. $('#lr_view').on('click', function () {
  123. var keyValue = $('#gridtable').jfGridValue('StuId');
  124. if (learun.checkrow(keyValue)) {
  125. learun.layerForm({
  126. id: 'form',
  127. title: '查看',
  128. url: top.$.rootUrl + '/EducationalAdministration/StuEnroll/FormView?keyValue=' + keyValue,
  129. width: 800,
  130. height: 600,
  131. btn: null
  132. });
  133. }
  134. });
  135. // 删除
  136. $('#lr_delete').on('click', function () {
  137. var keyValue = $('#gridtable').jfGridValue('StuId');
  138. if (learun.checkrow(keyValue)) {
  139. learun.layerConfirm('是否确认删除该项!', function (res) {
  140. if (res) {
  141. learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/StuEnroll/DeleteForm', { keyValue: keyValue }, function () {
  142. refreshGirdData();
  143. });
  144. }
  145. });
  146. }
  147. });
  148. // 同步系部
  149. $('#lr_syn').on('click', function () {
  150. learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuEnroll/SyncDept', function () {
  151. refreshGirdData();
  152. });
  153. });
  154. // 打印
  155. $('#lr_print').on('click', function () {
  156. $('#gridtable').jqprintTable();
  157. });
  158. //  分配班级
  159. $('#lr_allocationClass').on('click', function () {
  160. learun.layerForm({
  161. id: 'form',
  162. title: "分配班级",
  163. url: top.$.rootUrl + '/EducationalAdministration/StuEnroll/AllocationClass',
  164. width: 1300,
  165. height: 600,
  166. btn: null
  167. });
  168. });
  169. //  分配宿舍
  170. $('#lr_allocationDormitory').on('click', function () {
  171. learun.layerFormForPercent({
  172. id: 'form',
  173. title: "分配宿舍",
  174. url: top.$.rootUrl + '/EducationalAdministration/StuEnroll/AllocationDormitory',
  175. width: '90%',
  176. height: '90%',
  177. btn: null
  178. });
  179. });
  180. //  分配宿舍
  181. $('#lr_newallocationDormitory').on('click', function () {
  182. learun.layerFormForPercent({
  183. id: 'form',
  184. title: "分配宿舍",
  185. url: top.$.rootUrl + '/EducationalAdministration/StuEnroll/NewAllocationDormitory',
  186. width: '90%',
  187. height: '90%',
  188. btn: null
  189. });
  190. });
  191. //  分配宿舍
  192. $('#lr_newallocationBed').on('click', function () {
  193. learun.layerFormForPercent({
  194. id: 'form',
  195. title: "分配床位",
  196. url: top.$.rootUrl + '/EducationalAdministration/StuEnroll/NewAllocationBed',
  197. width: '90%',
  198. height: '90%',
  199. btn: null
  200. });
  201. });
  202. $("#demaxiya").on("click", function () {
  203. alert(123);
  204. })
  205. },
  206. // 初始化列表
  207. initGird: function () {
  208. $('#gridtable').lrAuthorizeJfGrid({
  209. url: top.$.rootUrl + '/EducationalAdministration/StuEnroll/GetPageList',
  210. headData: [
  211. { label: "学生报名号", name: "RegistrationNo", width: 100, align: "left" },
  212. { label: "姓名", name: "StuName", width: 100, align: "left" },
  213. {
  214. label: "性别", name: "Gender", width: 100, align: "left", formatter: function (value) {
  215. return value == "1" ? "男" : "女";
  216. }
  217. },
  218. {
  219. label: "班级", name: "ClassNo", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) {
  220. learun.clientdata.getAsync('custmerData', {
  221. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj',
  222. key: value,
  223. keyId: 'classno',
  224. callback: function (_data) {
  225. callback(_data['classname']);
  226. }
  227. });
  228. }
  229. },
  230. {
  231. label: "是否报到", name: "IsReport", width: 100, align: "left",
  232. formatter: function (value, row, drop) {
  233. if (row.IsReport) {
  234. return '<span class=\"label label-success\">报到</span>';
  235. } else if (row.IsReport == false) {
  236. return '<span class=\"label label-warning\">未报到</span>';
  237. }
  238. else {
  239. return "未处理";
  240. }
  241. }
  242. },
  243. {
  244. label: "是否住宿", name: "IsCheckIn", width: 100, align: "left",
  245. formatter: function (value, row) {
  246. if (row.IsCheckIn) {
  247. return '<span class=\"label label-success\">住宿</span>';
  248. } else if (row.IsCheckIn == false) {
  249. return '<span class=\"label label-warning\">走读</span>';
  250. } else {
  251. return "未处理";
  252. }
  253. }
  254. },
  255. {
  256. label: "是否资助", name: "IsSubsidize1", width: 100, align: "left", formatter: function (value, row) {
  257. if (row.IsSubsidize1) {
  258. return '<span class=\"label label-success\">资助</span>';
  259. } else if (row.IsSubsidize1 == false) {
  260. return '<span class=\"label label-warning\">不资助</span>';
  261. } else {
  262. return "未处理";
  263. }
  264. }
  265. },
  266. {
  267. label: "是否军训", name: "IsMilitary", width: 100, align: "left",
  268. formatter: function (value, row) {
  269. if (row.IsMilitary) {
  270. return '<span class=\"label label-success\">军训</span>';
  271. } else if (row.IsMilitary == false) {
  272. return '<span class=\"label label-warning\">不军训</span>';
  273. } else {
  274. return "未处理";
  275. }
  276. }
  277. },
  278. {
  279. label: "缴费状态", name: "IsPay", width: 60, align: "left", formatter: function (val, row) {
  280. if (row.IsPay) {
  281. return '<span class=\"label label-success\">缴费</span>';
  282. } else if (row.IsPay == false) {
  283. return '<span class=\"label label-warning\">未缴费</span>';
  284. }
  285. else {
  286. return "未处理";
  287. }
  288. }
  289. },
  290. {
  291. label: "拍照", name: "IsMug", width: 100, align: "left",
  292. formatter: function (value, row) {
  293. if (row.IsMug) {
  294. return '<span class=\"label label-success\">已拍照</span>';
  295. } else if (row.IsMug == false) {
  296. return '<span class=\"label label-warning\">未拍照</span>';
  297. } else {
  298. return '未处理';
  299. }
  300. }
  301. },
  302. {
  303. label: "领取军训服", name: "IsTakeCloths", width: 100, align: "left", formatter: function (value, row) {
  304. if (row.IsTakeCloths) {
  305. return '<span class=\"label label-success\">已领取</span>';
  306. } else if (row.IsTakeCloths == false) {
  307. return '<span class=\"label label-warning\">未领取</span>';
  308. } else {
  309. return '未处理';
  310. }
  311. }
  312. },
  313. {
  314. label: "量取校服尺寸", name: "IsQuantity", width: 100, align: "left", formatter: function (value, row) {
  315. if (row.IsQuantity) {
  316. return '<span class=\"label label-success\">已量</span>';
  317. } else if (row.IsQuantity == false) {
  318. return '<span class=\"label label-warning\">未量</span>';
  319. } else {
  320. return '未处理';
  321. }
  322. }
  323. },
  324. {
  325. label: "领取床上用品", name: "IsGetBeddingArticle", width: 100, align: "left", formatter: function (value, row) {
  326. if (row.IsGetBeddingArticle) {
  327. return '<span class=\"label label-success\">已领取</span>';
  328. } else if (row.IsGetBeddingArticle == false) {
  329. return '<span class=\"label label-warning\">未领取</span>';
  330. } else {
  331. return '未处理';
  332. }
  333. }
  334. },
  335. ],
  336. mainId: 'StuId',
  337. isPage: true
  338. });
  339. page.search();
  340. },
  341. search: function (param) {
  342. param = param || {};
  343. if (!param.Grade && param.Grade == undefined) {
  344. param.Grade = NowGrade;
  345. }
  346. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  347. }
  348. };
  349. refreshGirdData = function () {
  350. page.search();
  351. };
  352. //refreshGirdDatas = function () {
  353. // alert(2222);
  354. //};
  355. page.init();
  356. }