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.
 
 
 
 
 
 

433 lines
18 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. //page.refreshMoney();
  15. },
  16. bind: function () {
  17. $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
  18. page.refreshMoney();
  19. page.search(queryJson);
  20. }, 380, 400);
  21. $("#IsMilitary").lrDataItemSelect({ code: "jyYewOrNot" });
  22. $('#Year').lrselect({
  23. url:top.$.rootUrl+'/EducationalAdministration/StuEnroll/GetYearListByClass',
  24. value:"year",
  25. text:"year",
  26. })
  27. $('#DeptNo').lrselect({
  28. allowSearch: true,
  29. value: "deptno",
  30. text: "deptname",
  31. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdDeptInfo',
  32. select: function (item) {
  33. if (item) {
  34. $('#MajorNo').lrselectRefresh({
  35. allowSearch: true,
  36. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo',
  37. param: { strWhere: "DeptNo='" + item.deptno + "' AND CheckMark=1" }
  38. });
  39. } else {
  40. $('#MajorNo').lrselectRefresh({
  41. allowSearch: true,
  42. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo',
  43. param: { strWhere: "1=1 AND CheckMark=1" }
  44. });
  45. }
  46. }
  47. });
  48. $('#MajorNo').lrselect({
  49. allowSearch: true,
  50. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo',
  51. value: "majorno",
  52. text: "majorname",
  53. param: { strWhere: "1=1 AND CheckMark=1" },
  54. select: function (item) {
  55. if (item) {
  56. $('#ClassNo').lrselectRefresh({
  57. allowSearch: true,
  58. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  59. param: { strWhere: "majorno='" + item.majorno + "' AND CheckMark=1" }
  60. });
  61. } else {
  62. $('#ClassNo').lrselectRefresh({
  63. allowSearch: true,
  64. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  65. param: { strWhere: "1=1 AND CheckMark=1" }
  66. });
  67. }
  68. }
  69. });
  70. $('#ClassNo').lrselect({
  71. allowSearch: true,
  72. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  73. param: { strWhere: "1=1 AND CheckMark=1" },
  74. value: "classno",
  75. text: "classname"
  76. });
  77. // 刷新
  78. $('#lr_refresh').on('click', function () {
  79. location.reload();
  80. });
  81. // 打印
  82. $('#lr_print').on('click', function () {
  83. $('#gridtable').jqprintTable();
  84. });
  85. $('#lr_view').on('click', function () {
  86. var keyValue = $('#gridtable').jfGridValue('StuId');
  87. if (learun.checkrow(keyValue)) {
  88. learun.layerForm({
  89. id: 'form',
  90. title: '查看',
  91. url: top.$.rootUrl + '/EducationalAdministration/StuEnroll/FormView?keyValue=' + keyValue,
  92. width: 800,
  93. height: 600,
  94. btn: null
  95. });
  96. }
  97. });
  98. //确认住宿
  99. $("#lr_stay").on('click', function () {
  100. var data = $('#gridtable').jfGridGet('rowdata');
  101. if (data.length > 0) {
  102. learun.layerConfirm('是否确认此学生住宿!',
  103. function (res) {
  104. if (res) {
  105. learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuEnroll/Stay',
  106. { stuId: JSON.stringify(data), status: true, payAfter: true },
  107. function (res) {
  108. refreshGirdData();
  109. });
  110. }
  111. });
  112. }
  113. });
  114. $("#lr_nostay").on("click", function () {
  115. var data = $('#gridtable').jfGridGet('rowdata');
  116. if (data.length > 0) {
  117. learun.layerConfirm('是否确认此学生走读',
  118. function (res) {
  119. if (res) {
  120. learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuEnroll/Stay',
  121. { stuId: JSON.stringify(data), status: false, payAfter: true },
  122. function (res) {
  123. refreshGirdData();
  124. });
  125. }
  126. });
  127. }
  128. });
  129. //确认资助
  130. $("#lr_help").on('click', function () {
  131. var data = $('#gridtable').jfGridGet('rowdata');
  132. if (data.length > 0) {
  133. learun.layerConfirm('是否确认资助!',
  134. function (res) {
  135. if (res) {
  136. learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuEnroll/Help',
  137. { stuId: JSON.stringify(data), status: true, payAfter: true },
  138. function (res) {
  139. refreshGirdData();
  140. });
  141. }
  142. });
  143. }
  144. });
  145. //确认资助
  146. $("#lr_nohelp").on('click', function () {
  147. var data = $('#gridtable').jfGridGet('rowdata');
  148. if (data.length > 0) {
  149. learun.layerConfirm('是否确认不资助!',
  150. function (res) {
  151. if (res) {
  152. learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuEnroll/Help',
  153. { stuId: JSON.stringify(data), status: false, payAfter: true },
  154. function (res) {
  155. refreshGirdData();
  156. });
  157. }
  158. });
  159. }
  160. });
  161. //确认军训
  162. $("#lr_military").on('click', function () {
  163. var data = $('#gridtable').jfGridGet('rowdata');
  164. if (data.length > 0) {
  165. learun.layerConfirm('是否确认军训!',
  166. function (res) {
  167. if (res) {
  168. learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuEnroll/Military',
  169. { stuId: JSON.stringify(data), status: true, payAfter: true },
  170. function (res) {
  171. refreshGirdData();
  172. });
  173. }
  174. });
  175. }
  176. });
  177. //确认军训
  178. $("#lr_nomilitary").on('click', function () {
  179. var data = $('#gridtable').jfGridGet('rowdata');
  180. if (data.length > 0) {
  181. learun.layerConfirm('是否确认不军训!',
  182. function (res) {
  183. if (res) {
  184. learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuEnroll/Military',
  185. { stuId: JSON.stringify(data), status: false, payAfter: true },
  186. function (res) {
  187. refreshGirdData();
  188. });
  189. }
  190. });
  191. }
  192. });
  193. //学生同步
  194. $("#lr_synchronization").on('click', function () {
  195. learun.layerConfirm('是否同步学生数据!',
  196. function (res) {
  197. if (res) {
  198. learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuEnroll/Synchronization',
  199. { },
  200. function (res) {
  201. refreshGirdData();
  202. });
  203. }
  204. });
  205. });
  206. },
  207. // 初始化列表
  208. initGird: function () {
  209. $('#gridtable').lrAuthorizeJfGrid({
  210. url: top.$.rootUrl + '/EducationalAdministration/StuEnroll/GetPageList',
  211. headData: [
  212. { label: "学生报名号", name: "RegistrationNo", width: 100, align: "left" },
  213. { label: "姓名", name: "StuName", width: 100, align: "left" },
  214. {
  215. label: "班级", name: "ClassNo", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) {
  216. learun.clientdata.getAsync('custmerData', {
  217. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj',
  218. key: value,
  219. keyId: 'classno',
  220. callback: function (_data) {
  221. callback(_data['classname']);
  222. }
  223. });
  224. }
  225. },
  226. {
  227. label: "是否住宿", name: "IsCheckIn2", width: 100, align: "left",
  228. formatter: function (value, row) {
  229. if (row.IsCheckIn2) {
  230. return '<span class=\"label label-success\">住宿</span>';
  231. } else if (row.IsCheckIn2 == false) {
  232. return '<span class=\"label label-warning\">走读</span>';
  233. } else {
  234. return "未处理";
  235. }
  236. }
  237. },
  238. {
  239. label: "是否资助", name: "IsSubsidize12", width: 100, align: "left", formatter: function (value, row) {
  240. if (row.IsSubsidize12) {
  241. return '<span class=\"label label-success\">资助</span>';
  242. } else if (row.IsSubsidize12 == false) {
  243. return '<span class=\"label label-warning\">不资助</span>';
  244. } else {
  245. return "未处理";
  246. }
  247. }
  248. },
  249. {
  250. label: "是否军训", name: "IsMilitary2", width: 100, align: "left",
  251. formatter: function (value, row) {
  252. if (row.IsMilitary2) {
  253. return '<span class=\"label label-success\">军训</span>';
  254. } else if (row.IsMilitary2 == false) {
  255. return '<span class=\"label label-warning\">不军训</span>';
  256. } else {
  257. return "未处理";
  258. }
  259. }
  260. },
  261. {
  262. label: "性别", name: "Gender", width: 100, align: "left", formatter: function (value) {
  263. return value == "1" ? "男" : "女";
  264. }
  265. },
  266. {
  267. label: "民族", name: "Nationals", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) {
  268. learun.clientdata.getAsync('custmerData', {
  269. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'BCdNationality',
  270. key: value,
  271. keyId: 'nationalityno',
  272. callback: function (_data) {
  273. callback(_data['nationality']);
  274. }
  275. });
  276. }
  277. },
  278. { label: "出生年月", name: "Birthday", width: 100, align: "left", formatter: function (val) { return val.substring(0, 10); } },
  279. { label: "身份证", name: "IDCard", width: 100, align: "left" },
  280. {
  281. label: "政治面貌", name: "Political", width: 100, align: "left",
  282. formatterAsync: function (callback, value, row, op, $cell) {
  283. learun.clientdata.getAsync('custmerData', {
  284. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'BCdPartyFace',
  285. key: value,
  286. keyId: 'partyfaceno',
  287. callback: function (_data) {
  288. callback(_data['partyface']);
  289. }
  290. });
  291. }
  292. },
  293. {
  294. label: "届别", name: "FreshType", width: 100, align: "left",
  295. formatterAsync: function (callback, value, row, op, $cell) {
  296. learun.clientdata.getAsync('dataItem', {
  297. key: value,
  298. code: 'timeType',
  299. callback: function (_data) {
  300. callback(_data.text);
  301. }
  302. });
  303. }
  304. },
  305. {
  306. label: "户别", name: "ResidenceType", width: 100, align: "left",
  307. formatterAsync: function (callback, value, row, op, $cell) {
  308. learun.clientdata.getAsync('dataItem', {
  309. key: value,
  310. code: 'HouseholdCategory',
  311. callback: function (_data) {
  312. callback(_data.text);
  313. }
  314. });
  315. }
  316. },
  317. {
  318. label: "考生类别", name: "StuType", width: 100, align: "left",
  319. formatterAsync: function (callback, value, row, op, $cell) {
  320. learun.clientdata.getAsync('dataItem', {
  321. key: value,
  322. code: 'stuType',
  323. callback: function (_data) {
  324. callback(_data.text);
  325. }
  326. });
  327. }
  328. },
  329. { label: "户口地", name: "ResidenceAddress", width: 100, align: "left" },
  330. { label: "非京籍报考类", name: "NonNative", width: 100, align: "left" },
  331. { label: "学籍所在学校", name: "FromSchool", width: 100, align: "left" },
  332. { label: "家庭住址", name: "HomeAddress", width: 100, align: "left" },
  333. { label: "第一监护人", name: "FirstGuardian", width: 100, align: "left" },
  334. { label: "与被监护人关系", name: "FirstRelationship", width: 100, align: "left" },
  335. { label: "录取专业代码", name: "MajorNo", width: 100, align: "left" },
  336. { label: "录取专业名称", name: "MajorName", width: 100, align: "left" },
  337. {
  338. label: "录取方式", name: "Admissions", width: 100, align: "left",
  339. formatterAsync: function (callback, value, row, op, $cell) {
  340. learun.clientdata.getAsync('dataItem', {
  341. key: value,
  342. code: 'enrollType',
  343. callback: function (_data) {
  344. callback(_data.text);
  345. }
  346. });
  347. }
  348. },
  349. { label: "准考证号", name: "ExamRegistration", width: 100, align: "left" },
  350. ],
  351. mainId: 'StuId',
  352. isMultiselect: true,
  353. isPage: true
  354. });
  355. page.search();
  356. },
  357. refreshMoney: function () {
  358. var deptNo = $("#DeptNo").lrselectGet();
  359. var majorNo = $("#MajorNo").lrselectGet();
  360. var classNo = $("#ClassNo").lrselectGet();
  361. $.post(
  362. top.$.rootUrl + '/EducationalAdministration/StuEnroll/GetMilitaryStatistics',
  363. {
  364. DeptNo: deptNo,
  365. MajorNo: majorNo,
  366. ClassNo: classNo
  367. },
  368. function (res) {
  369. $("#allAmount").html(res.data.aa);
  370. $("#isAmount").html(res.data.bb);
  371. }, "json");
  372. },
  373. search: function (param) {
  374. param = param || {};
  375. param.SqlParameter = ' AND IsReport=1';
  376. param.Grade = "20";
  377. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  378. }
  379. };
  380. refreshGirdData = function () {
  381. page.search();
  382. };
  383. page.init();
  384. }