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.
 
 
 
 
 
 

396 lines
19 KiB

  1. /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
  2. * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2023-02-14 11:09
  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. }, 350, 450);
  19. $('#Gender').lrRadioCheckbox({
  20. type: 'radio',
  21. code: 'usersex',
  22. });
  23. $('#Nationals').lrDataItemSelect({ code: 'National' });
  24. $('#Province').lrDataSourceSelect({ code: 'DIC_PROVINCE', value: 'pcode', text: 'pname' });
  25. $('#MajorNo').lrDataSourceSelect({ code: 'CdMajorInfo', value: 'majorno', text: 'majorname' });
  26. $('#StuType').lrDataItemSelect({ code: 'ExamineeType_tlm' });
  27. $('#GraduateType').lrDataItemSelect({ code: 'StuGraduateType' });
  28. $('#HomeProvince').lrDataSourceSelect({
  29. code: 'DIC_PROVINCE', value: 'pcode', text: 'pname',
  30. select: function (item) {
  31. if (!!item) {
  32. var code = $("#HomeProvince").lrselectGet();
  33. $('#HomeCity').lrselectRefresh({
  34. allowSearch: true,
  35. //type: 'multiple',
  36. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=DIC_CITY',
  37. param: { strWhere: "1=1 and charindex(cparent,('" + code + "'))>0 " },
  38. value: "ccode",
  39. text: "cname",
  40. maxHeight: 200,
  41. select: function (item) {
  42. if (!!item) {
  43. var code = $("#HomeCity").lrselectGet();
  44. $('#HomeCounty').lrselectRefresh({
  45. allowSearch: true,
  46. //type: 'multiple',
  47. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=DIC_AREA',
  48. param: { strWhere: "1=1 and charindex(aparent,('" + code + "'))>0 " },
  49. value: "acode",
  50. text: "aname",
  51. maxHeight: 200,
  52. });
  53. }
  54. }
  55. });
  56. }
  57. }
  58. });
  59. $('#HomeCity').lrselect();
  60. $('#HomeCounty').lrselect();
  61. //$('#HomeCity').lrDataSourceSelect({ code: 'DIC_CITY', value: 'ccode', text: 'cname' });
  62. //$('#HomeCounty').lrDataSourceSelect({ code: 'DIC_AREA', value: 'acode', text: 'aname' });
  63. $('#IsAdjust').lrRadioCheckbox({
  64. type: 'radio',
  65. code: 'YesOrNoInt',
  66. });
  67. // 刷新
  68. $('#lr_refresh').on('click', function () {
  69. location.reload();
  70. });
  71. // 新增
  72. $('#lr_add').on('click', function () {
  73. learun.layerForm({
  74. id: 'form',
  75. title: '新增',
  76. url: top.$.rootUrl + '/EducationalAdministration/StuEnrollOfficial/Form',
  77. width: 960,
  78. height: 650,
  79. callBack: function (id) {
  80. return top[id].acceptClick(refreshGirdData);
  81. }
  82. });
  83. });
  84. // 查看
  85. $('#lr_view').on('click', function () {
  86. var keyValue = $('#gridtable').jfGridValue('Id');
  87. if (learun.checkrow(keyValue)) {
  88. learun.layerForm({
  89. id: 'form',
  90. title: '查看',
  91. url: top.$.rootUrl + '/EducationalAdministration/StuEnrollOfficial/Form?keyValue=' + keyValue,
  92. width: 960,
  93. height: 750,
  94. btn: null,
  95. callBack: function (id) {
  96. return top[id].acceptClick(refreshGirdData);
  97. }
  98. });
  99. }
  100. });
  101. // 编辑
  102. $('#lr_edit').on('click', function () {
  103. var keyValue = $('#gridtable').jfGridValue('Id');
  104. if (learun.checkrow(keyValue)) {
  105. learun.layerForm({
  106. id: 'form',
  107. title: '编辑',
  108. url: top.$.rootUrl + '/EducationalAdministration/StuEnrollOfficial/Form?keyValue=' + keyValue,
  109. width: 960,
  110. height: 650,
  111. callBack: function (id) {
  112. return top[id].acceptClick(refreshGirdData);
  113. }
  114. });
  115. }
  116. });
  117. // 删除
  118. $('#lr_delete').on('click', function () {
  119. var keyValue = $('#gridtable').jfGridValue('Id');
  120. if (learun.checkrow(keyValue)) {
  121. learun.layerConfirm('是否确认删除该项!', function (res) {
  122. if (res) {
  123. learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/StuEnrollOfficial/DeleteForm', { keyValue: keyValue }, function () {
  124. refreshGirdData();
  125. });
  126. }
  127. });
  128. }
  129. });
  130. // 打印
  131. $('#lr_print').on('click', function () {
  132. $('#gridtable').jqprintTable();
  133. });
  134. },
  135. // 初始化列表
  136. initGird: function () {
  137. $('#gridtable').jfGrid({
  138. url: top.$.rootUrl + '/EducationalAdministration/StuEnrollOfficial/GetPageList',
  139. headData: [
  140. {
  141. label: "提交时间", name: "CreateTime", width: 150, align: "left"
  142. },
  143. { label: "姓名", name: "StuName", width: 100, align: "left" },
  144. {
  145. label: "性别", name: "Gender", width: 100, align: "left",
  146. formatterAsync: function (callback, value, row, op, $cell) {
  147. learun.clientdata.getAsync('dataItem', {
  148. key: value,
  149. code: 'usersex',
  150. callback: function (_data) {
  151. callback(_data.text);
  152. }
  153. });
  154. }
  155. },
  156. {
  157. label: "民族", name: "Nationals", width: 100, align: "left",
  158. formatterAsync: function (callback, value, row, op, $cell) {
  159. learun.clientdata.getAsync('dataItem', {
  160. key: value,
  161. code: 'National',
  162. callback: function (_data) {
  163. callback(_data.text);
  164. }
  165. });
  166. }
  167. },
  168. {
  169. label: "出生日期", name: "Birthday", width: 100, align: "left",
  170. formatter: function (value, row) {
  171. return learun.formatDate(value, 'yyyy-MM-dd');
  172. }
  173. },
  174. {
  175. label: "政治面貌", name: "Political", width: 100, align: "left",
  176. formatterAsync: function (callback, value, row, op, $cell) {
  177. learun.clientdata.getAsync('dataItem', {
  178. key: value,
  179. code: 'PolityStatus',
  180. callback: function (_data) {
  181. callback(_data.text);
  182. }
  183. });
  184. }
  185. },
  186. { label: "身份证号码", name: "IDCard", width: 100, align: "left" },
  187. {
  188. label: "考生科类", name: "SubjectType", width: 100, align: "left",
  189. formatterAsync: function (callback, value, row, op, $cell) {
  190. learun.clientdata.getAsync('dataItem', {
  191. key: value,
  192. code: 'StuSubjectType',
  193. callback: function (_data) {
  194. callback(_data.text);
  195. }
  196. });
  197. }
  198. },
  199. {
  200. label: "考生类别", name: "StuType", width: 100, align: "left",
  201. formatterAsync: function (callback, value, row, op, $cell) {
  202. learun.clientdata.getAsync('dataItem', {
  203. key: value,
  204. code: 'ExamineeType_tlm',
  205. callback: function (_data) {
  206. callback(_data.text);
  207. }
  208. });
  209. }
  210. },
  211. {
  212. label: "毕业类别", name: "GraduateType", width: 100, align: "left",
  213. formatterAsync: function (callback, value, row, op, $cell) {
  214. learun.clientdata.getAsync('dataItem', {
  215. key: value,
  216. code: 'StuGraduateType',
  217. callback: function (_data) {
  218. callback(_data.text);
  219. }
  220. });
  221. }
  222. },
  223. { label: "应试外语语种", name: "English", width: 100, align: "left" },
  224. { label: "毕业学校", name: "FromSchool", width: 100, align: "left" },
  225. {
  226. label: "高考报名省份", name: "Province", width: 100, align: "left",
  227. formatterAsync: function (callback, value, row, op, $cell) {
  228. learun.clientdata.getAsync('custmerData', {
  229. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'DIC_PROVINCE',
  230. key: value,
  231. keyId: 'pcode',
  232. callback: function (_data) {
  233. callback(_data['pname']);
  234. }
  235. });
  236. }
  237. },
  238. {
  239. label: "第一志愿", name: "MajorNo", width: 100, align: "left",
  240. formatterAsync: function (callback, value, row, op, $cell) {
  241. learun.clientdata.getAsync('custmerData', {
  242. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo',
  243. key: value,
  244. keyId: 'majorno',
  245. callback: function (_data) {
  246. callback(_data['majorname']);
  247. }
  248. });
  249. }
  250. },
  251. {
  252. label: "第二志愿", name: "MajorNo2", width: 100, align: "left",
  253. formatterAsync: function (callback, value, row, op, $cell) {
  254. learun.clientdata.getAsync('custmerData', {
  255. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo',
  256. key: value,
  257. keyId: 'majorno',
  258. callback: function (_data) {
  259. callback(_data['majorname']);
  260. }
  261. });
  262. }
  263. },
  264. {
  265. label: "第三志愿", name: "MajorNo3", width: 100, align: "left",
  266. formatterAsync: function (callback, value, row, op, $cell) {
  267. learun.clientdata.getAsync('custmerData', {
  268. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo',
  269. key: value,
  270. keyId: 'majorno',
  271. callback: function (_data) {
  272. callback(_data['majorname']);
  273. }
  274. });
  275. }
  276. },
  277. {
  278. label: "户籍所在地", name: "HomeProvince", width: 200, align: "left",
  279. formatter: function (value, row) {
  280. var str = '';
  281. if (!!value) {
  282. learun.clientdata.getAsync('custmerData', {
  283. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'DIC_PROVINCE',
  284. key: value,
  285. keyId: 'pcode',
  286. callback: function (_data) {
  287. str += _data['pname'];
  288. }
  289. });
  290. }
  291. if (!!row.HomeCity) {
  292. learun.clientdata.getAsync('custmerData', {
  293. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'DIC_CITY',
  294. key: row.HomeCity,
  295. keyId: 'ccode',
  296. callback: function (_data) {
  297. str += _data['cname'];
  298. }
  299. });
  300. }
  301. if (!!row.HomeCounty) {
  302. learun.clientdata.getAsync('custmerData', {
  303. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'DIC_AREA',
  304. key: row.HomeCounty,
  305. keyId: 'acode',
  306. callback: function (_data) {
  307. str += _data['aname'];
  308. }
  309. });
  310. }
  311. if (!!row.HomeAddr) {
  312. str += row.HomeAddr;
  313. }
  314. return str;
  315. }
  316. },
  317. { label: "高考报名序号", name: "StuCode", width: 100, align: "left" },
  318. { label: "收件人姓名", name: "Recipient", width: 100, align: "left" },
  319. {
  320. label: "录取通知书邮寄地址", name: "AcceptanceProvince", width: 200, align: "left",
  321. formatter: function (value, row) {
  322. var str = '';
  323. if (!!value) {
  324. learun.clientdata.getAsync('custmerData', {
  325. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'DIC_PROVINCE',
  326. key: value,
  327. keyId: 'pcode',
  328. callback: function (_data) {
  329. str += _data['pname'];
  330. }
  331. });
  332. }
  333. if (!!row.AcceptanceCity) {
  334. learun.clientdata.getAsync('custmerData', {
  335. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'DIC_CITY',
  336. key: row.AcceptanceCity,
  337. keyId: 'ccode',
  338. callback: function (_data) {
  339. str += _data['cname'];
  340. }
  341. });
  342. }
  343. if (!!row.AcceptanceCounty) {
  344. learun.clientdata.getAsync('custmerData', {
  345. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'DIC_AREA',
  346. key: row.AcceptanceCounty,
  347. keyId: 'acode',
  348. callback: function (_data) {
  349. str += _data['aname'];
  350. }
  351. });
  352. }
  353. if (!!row.AcceptanceAddr) {
  354. str += row.AcceptanceAddr;
  355. }
  356. return str;
  357. }
  358. },
  359. { label: "邮政编码", name: "ZipCode", width: 100, align: "left" },
  360. { label: "收件人电话", name: "RecipientPhone", width: 100, align: "left" },
  361. { label: "家长联系电话", name: "ParentPhone", width: 100, align: "left" },
  362. {
  363. label: "是否服从调剂", name: "IsAdjust", width: 100, align: "left",
  364. formatterAsync: function (callback, value, row, op, $cell) {
  365. learun.clientdata.getAsync('dataItem', {
  366. key: value,
  367. code: 'YesOrNoInt',
  368. callback: function (_data) {
  369. callback(_data.text);
  370. }
  371. });
  372. }
  373. },
  374. ],
  375. mainId: 'Id',
  376. isPage: true,
  377. sidx: 'CreateTime',
  378. sord: 'ASC'
  379. });
  380. page.search();
  381. },
  382. search: function (param) {
  383. param = param || {};
  384. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  385. }
  386. };
  387. refreshGirdData = function () {
  388. $('#gridtable').jfGridSet('reload');
  389. };
  390. page.init();
  391. }