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.

EnrollIndexTJ.js 14 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299
  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. }, 500, 400);
  19. //地市
  20. $('#City').lrselect({
  21. allowSearch: true,
  22. //type: 'multiple',
  23. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=DIC_CITY',
  24. param: { strWhere: "1=1 and cparent='650000'" },
  25. value: "ccode",
  26. text: "cname",
  27. maxHeight: 200,
  28. select: function (item) {
  29. if (item) {
  30. var code = $("#City").lrselectGet();
  31. //县区
  32. $('#County').lrselectRefresh({
  33. allowSearch: true,
  34. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=DIC_AREA',
  35. param: { strWhere: "1=1 and charindex(aparent,('" + code + "'))>0 " },
  36. value: "acode",
  37. text: "aname",
  38. maxHeight: 200,
  39. //select: function(item) {
  40. // if (item) {
  41. // var countyCode = $("#County").lrselectGet();
  42. // //专业
  43. // $('#MajorNo').lrselectRefresh({
  44. // type: 'multiple',
  45. // url: top.$.rootUrl +
  46. // '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo',
  47. // param: {
  48. // strWhere: "1=1 and City='" + code + "' and Area='" + countyCode + "'"
  49. // },
  50. // value: "majorno",
  51. // text: "majorname",
  52. // maxHeight: 200,
  53. // });
  54. // }
  55. //}
  56. });
  57. }
  58. }
  59. });
  60. //县区
  61. $('#County').lrselect({
  62. allowSearch: true,
  63. //type: 'multiple',
  64. //url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=DIC_AREA',
  65. //param: { strWhere: "1=1 " },
  66. value: "acode",
  67. text: "aname",
  68. maxHeight: 200,
  69. });
  70. //专业
  71. $('#MajorNo').lrselect({
  72. allowSearch: true,
  73. //type: 'multiple',
  74. url: top.$.rootUrl +
  75. '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo',
  76. param: {
  77. strWhere: "1=1 "
  78. },
  79. value: "id",
  80. text: "majorname",
  81. maxHeight: 200,
  82. });
  83. //老师
  84. $('#EmpNo').lrselect({
  85. //type: 'multiple',
  86. allowSearch: true,
  87. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=EmpInfo',
  88. param: { strWhere: "1=1 " },
  89. value: "empno",
  90. text: "empname",
  91. maxHeight: 200,
  92. });
  93. //年度
  94. $('#Year').lrselect({
  95. // type: 'multiple',
  96. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorYear',
  97. param: { strWhere: "1=1 " },
  98. value: "year",
  99. text: "year",
  100. maxHeight: 200,
  101. });
  102. // 刷新
  103. $('#lr_refresh').on('click', function () {
  104. location.reload();
  105. });
  106. // 打印
  107. $('#lr_print').on('click', function () {
  108. $('#gridtable').jqprintTable();
  109. });
  110. },
  111. // 初始化列表
  112. initGird: function () {
  113. $('#gridtable').jfGrid({
  114. url: top.$.rootUrl + '/EducationalAdministration/StuEnroll/GetPageListForTJ',
  115. headData: [
  116. { label: "姓名", name: "StuName", width: 100, align: "left" },
  117. {
  118. label: "性别", name: "Gender", width: 100, align: "left",
  119. formatter: function (value) {
  120. if (value == '0') {
  121. return '女';
  122. } else {
  123. return '男';
  124. }
  125. }
  126. },
  127. {
  128. label: "民族", name: "Nationals", width: 100, align: "left",
  129. formatterAsync: function (callback, value, row, op, $cell) {
  130. learun.clientdata.getAsync('dataItem', {
  131. key: value,
  132. code: 'National',
  133. callback: function (_data) {
  134. callback(_data.text);
  135. }
  136. });
  137. }
  138. },
  139. { label: "身份证号", name: "IDCard", width: 100, align: "left" },
  140. { label: "住址", name: "HomeAddress", width: 100, align: "left" },
  141. { label: "手机号", name: "StuMobile", width: 100, align: "left" },
  142. { label: "中考总分", name: "MidTermExam", width: 100, align: "left" },
  143. { label: "语文", name: "chinese", width: 100, align: "left" },
  144. { label: "数学", name: "math", width: 100, align: "left" },
  145. { label: "英语", name: "english", width: 100, align: "left" },
  146. { label: "物理与化学", name: "physicsAndChemistry", width: 100, align: "left" },
  147. { label: "政治与历史", name: "politicsAndHistory", width: 100, align: "left" },
  148. { label: "体育", name: "physicalEducation", width: 100, align: "left" },
  149. { label: "毕业学校", name: "FromSchool", width: 100, align: "left" },
  150. { label: "特长", name: "Specialty", width: 100, align: "left" },
  151. {
  152. label: "地市", name: "City", width: 100, align: "left",
  153. formatterAsync: function (callback, value, row, op, $cell) {
  154. learun.clientdata.getAsync('custmerData', {
  155. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'DIC_CITY',
  156. key: value,
  157. keyId: 'ccode',
  158. callback: function (_data) {
  159. callback(_data['cname']);
  160. }
  161. });
  162. }
  163. },
  164. {
  165. label: "县区", name: "County", width: 100, align: "left",
  166. formatterAsync: function (callback, value, row, op, $cell) {
  167. learun.clientdata.getAsync('custmerData', {
  168. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'DIC_AREA',
  169. key: value,
  170. keyId: 'acode',
  171. callback: function (_data) {
  172. callback(_data['aname']);
  173. }
  174. });
  175. }
  176. },
  177. {
  178. label: "专业", name: "MajorNo", width: 100, align: "left",
  179. formatterAsync: function (callback, value, row, op, $cell) {
  180. learun.clientdata.getAsync('custmerData', {
  181. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo',
  182. key: value,
  183. keyId: 'id',
  184. callback: function (_data) {
  185. callback(_data['majorname']);
  186. }
  187. });
  188. }
  189. },
  190. {
  191. label: "推荐教师", name: "EmpNo", width: 100, align: "left",
  192. formatterAsync: function (callback, value, row, op, $cell) {
  193. learun.clientdata.getAsync('custmerData', {
  194. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo',
  195. key: value,
  196. keyId: 'empno',
  197. callback: function (_data) {
  198. callback(_data['empname']);
  199. }
  200. });
  201. }
  202. }
  203. ],
  204. //isMultiselect: true,
  205. mainId: 'StuId',
  206. isPage: true
  207. });
  208. //$('#gridtable').jfGrid({
  209. // url: top.$.rootUrl + '/EducationalAdministration/StuEnroll/GetTJList',
  210. // headData: [
  211. // { label: "教师编号", name: "empno", width: 100, align: "left" },
  212. // {
  213. // label: "教师姓名", name: "empno", width: 100, align: "left",
  214. // formatterAsync: function (callback, value, row, op, $cell) {
  215. // learun.clientdata.getAsync('custmerData', {
  216. // url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo',
  217. // key: value,
  218. // keyId: 'empno',
  219. // callback: function (_data) {
  220. // callback(_data['empname']);
  221. // }
  222. // });
  223. // }
  224. // },
  225. // { label: "人数", name: "num", width: 100, align: "left" },
  226. // ],
  227. // mainId: 'StuId',
  228. // isPage: false
  229. //});
  230. page.search();
  231. },
  232. search: function (param) {
  233. param = param || {};
  234. //录取=是
  235. param.SqlParameter = " and t.IsAdmission=1";
  236. //中考总分
  237. if (!!$('#MidTermExam1').val()) {
  238. param.SqlParameter += " and isnull(t.MidTermExam,0)>=" + $('#MidTermExam1').val();
  239. }
  240. if (!!$('#MidTermExam2').val()) {
  241. param.SqlParameter += " and isnull(t.MidTermExam,0)<=" + $('#MidTermExam2').val();
  242. }
  243. //语文
  244. if (!!$('#chinese1').val()) {
  245. param.SqlParameter += " and isnull(s.chinese,0)>=" + $('#chinese1').val();
  246. }
  247. if (!!$('#chinese2').val()) {
  248. param.SqlParameter += " and isnull(s.chinese,0)<=" + $('#chinese2').val();
  249. }
  250. //数学
  251. if (!!$('#math1').val()) {
  252. param.SqlParameter += " and isnull(s.math,0)>=" + $('#math1').val();
  253. }
  254. if (!!$('#math2').val()) {
  255. param.SqlParameter += " and isnull(s.math,0)<=" + $('#math2').val();
  256. }
  257. //英语
  258. if (!!$('#english1').val()) {
  259. param.SqlParameter += " and isnull(s.english,0)>=" + $('#english1').val();
  260. }
  261. if (!!$('#english2').val()) {
  262. param.SqlParameter += " and isnull(s.english,0)<=" + $('#english2').val();
  263. }
  264. //物理与化学
  265. if (!!$('#physicsAndChemistry1').val()) {
  266. param.SqlParameter += " and isnull(s.physicsAndChemistry,0)>=" + $('#physicsAndChemistry1').val();
  267. }
  268. if (!!$('#physicsAndChemistry2').val()) {
  269. param.SqlParameter += " and isnull(s.physicsAndChemistry,0)<=" + $('#physicsAndChemistry2').val();
  270. }
  271. //政治与历史
  272. if (!!$('#politicsAndHistory1').val()) {
  273. param.SqlParameter += " and isnull(s.politicsAndHistory,0)>=" + $('#politicsAndHistory1').val();
  274. }
  275. if (!!$('#politicsAndHistory2').val()) {
  276. param.SqlParameter += " and isnull(s.politicsAndHistory,0)<=" + $('#politicsAndHistory2').val();
  277. }
  278. //体育
  279. if (!!$('#physicalEducation1').val()) {
  280. param.SqlParameter += " and isnull(s.physicalEducation,0)>=" + $('#physicalEducation1').val();
  281. }
  282. if (!!$('#physicalEducation2').val()) {
  283. param.SqlParameter += " and isnull(s.physicalEducation,0)<=" + $('#physicalEducation2').val();
  284. }
  285. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  286. }
  287. };
  288. refreshGirdData = function () {
  289. page.search();
  290. };
  291. page.init();
  292. }