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.
 
 
 
 
 
 

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