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.
 
 
 
 
 
 

519 lines
26 KiB

  1. var refreshGirdData;
  2. var StuId;
  3. var tempdatra = new Array();
  4. var list = [];
  5. var bootstrap = function ($, learun) {
  6. "use strict";
  7. var page = {
  8. init: function () {
  9. page.initGird();
  10. page.bind();
  11. },
  12. bind: function () {
  13. $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
  14. page.search(queryJson);
  15. }, 280, 400);
  16. $('#SubmitBtn').on('click', function () {
  17. if (!$('body').lrValidform()) {
  18. return false;
  19. }
  20. var entity = $('body').lrGetFormData();
  21. entity.AnomalousType = entity.NewAnomalousType;
  22. var selgridtab = $('#selgridtab').jfGridGet('rowdatas');
  23. $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/StuTransferInfo/SaveAgainEntity', { entity: entity, strStuTranEntity: JSON.stringify(selgridtab) },
  24. function (res) {
  25. //console.log(res)
  26. if (res.code == 200) {
  27. setTimeout(function () {
  28. location.reload();
  29. }, 100)
  30. }
  31. // 保存成功后才回调
  32. //if (!!callBack) {
  33. // callBack(res);
  34. //}
  35. }
  36. );
  37. })
  38. $('#DeptNo').lrselect({
  39. allowSearch: true,
  40. value: "deptno",
  41. text: "deptname",
  42. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdDeptInfo',
  43. select: function (item) {
  44. if (item) {
  45. $('#MajorNo').lrselectRefresh({
  46. allowSearch: true,
  47. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo',
  48. param: { strWhere: "DeptNo='" + item.deptno + "' AND CheckMark=1" }
  49. });
  50. } else {
  51. $('#MajorNo').lrselectRefresh({
  52. allowSearch: true,
  53. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo',
  54. param: { strWhere: "1=1 AND CheckMark=1" }
  55. });
  56. }
  57. }
  58. });
  59. $('#MajorNo').lrselect({
  60. allowSearch: true,
  61. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo',
  62. value: "majorno",
  63. text: "majorname",
  64. param: { strWhere: "1=1 AND CheckMark=1" },
  65. select: function (item) {
  66. var Grades = $("#Grade").lrselectGet();
  67. if (Grades != null && Grades != "" && Grades != "undefined") {
  68. if (item) {
  69. $('#ClassNo').lrselectRefresh({
  70. allowSearch: true,
  71. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  72. param: { strWhere: "majorno='" + item.majorno + "' AND CheckMark=1 AND Grade='" + Grades + "' order by classno desc" }
  73. });
  74. } else {
  75. $('#ClassNo').lrselectRefresh({
  76. allowSearch: true,
  77. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  78. param: { strWhere: "1=1 AND CheckMark=1 order by classno desc" }
  79. });
  80. }
  81. } else {
  82. if (item) {
  83. $('#ClassNo').lrselectRefresh({
  84. allowSearch: true,
  85. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  86. param: { strWhere: "majorno='" + item.majorno + "' AND CheckMark=1 order by classno desc" }
  87. });
  88. } else {
  89. $('#ClassNo').lrselectRefresh({
  90. allowSearch: true,
  91. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  92. param: { strWhere: "1=1 AND CheckMark=1 order by classno desc" }
  93. });
  94. }
  95. }
  96. }
  97. });
  98. $('#Grade').lrselect({
  99. url: top.$.rootUrl + '/EducationalAdministration/ClassInfo/GenerateNearByYear',
  100. value: "value",
  101. text: "text",
  102. select: function (item) {
  103. var MajorNos = $("#MajorNo").lrselectGet();
  104. if (MajorNos != null && MajorNos != "" && MajorNos != "undefined") {
  105. if (item) {
  106. $('#ClassNo').lrselectRefresh({
  107. allowSearch: true,
  108. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  109. param: {
  110. strWhere: "majorno='" + MajorNos + "' AND CheckMark=1 AND Grade='" + item.text + "' order by classno desc"
  111. }
  112. });
  113. } else {
  114. $('#ClassNo').lrselectRefresh({
  115. allowSearch: true,
  116. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  117. param: { strWhere: "1=1 AND CheckMark=1 order by classno desc" }
  118. });
  119. }
  120. } else {
  121. if (item) {
  122. $('#ClassNo').lrselectRefresh({
  123. allowSearch: true,
  124. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  125. param: {
  126. strWhere: "CheckMark=1 AND Grade='" + item.text + "' order by classno desc"
  127. }
  128. });
  129. } else {
  130. $('#ClassNo').lrselectRefresh({
  131. allowSearch: true,
  132. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  133. param: { strWhere: "1=1 AND CheckMark=1 order by classno desc" }
  134. });
  135. }
  136. }
  137. }
  138. });
  139. $('#ClassNo').lrselect({
  140. allowSearch: true,
  141. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  142. param: { strWhere: "1=1 AND CheckMark=1 order by classno desc" },
  143. value: "classno",
  144. text: "classname"
  145. });
  146. //提交下拉框
  147. $('#AnomalousType').lrDataItemSelect({ code: 'StuChangeType' });
  148. $('#NewDeptNo').lrselect({
  149. allowSearch: true,
  150. value: "deptno",
  151. text: "deptname",
  152. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdDeptInfo',
  153. select: function (item) {
  154. if (item) {
  155. $('#NewMajorNo').lrselectRefresh({
  156. allowSearch: true,
  157. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo',
  158. param: { strWhere: "DeptNo='" + item.deptno + "' AND CheckMark=1" }
  159. });
  160. } else {
  161. $('#NewMajorNo').lrselectRefresh({
  162. allowSearch: true,
  163. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo',
  164. param: { strWhere: "1=1 AND CheckMark=1" }
  165. });
  166. }
  167. }
  168. });
  169. $('#NewMajorNo').lrselect({
  170. allowSearch: true,
  171. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo',
  172. value: "majorno",
  173. text: "majorname",
  174. param: { strWhere: "1=1 AND CheckMark=1" },
  175. select: function (item) {
  176. var Grades = $("#NewGrade").lrselectGet();
  177. if (Grades != null && Grades != "" && Grades != "undefined") {
  178. if (item) {
  179. $('#NewClassNo').lrselectRefresh({
  180. allowSearch: true,
  181. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  182. param: { strWhere: "majorno='" + item.majorno + "' AND CheckMark=1 AND Grade='" + Grades + "' order by classno desc" }
  183. });
  184. } else {
  185. $('#NewClassNo').lrselectRefresh({
  186. allowSearch: true,
  187. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  188. param: { strWhere: "1=1 AND CheckMark=1 order by classno desc" }
  189. });
  190. }
  191. } else {
  192. if (item) {
  193. $('#NewClassNo').lrselectRefresh({
  194. allowSearch: true,
  195. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  196. param: { strWhere: "majorno='" + item.majorno + "' AND CheckMark=1 order by classno desc" }
  197. });
  198. } else {
  199. $('#NewClassNo').lrselectRefresh({
  200. allowSearch: true,
  201. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  202. param: { strWhere: "1=1 AND CheckMark=1 order by classno desc" }
  203. });
  204. }
  205. }
  206. }
  207. });
  208. $('#NewGrade').lrselect({
  209. url: top.$.rootUrl + '/EducationalAdministration/ClassInfo/GenerateNearByYear',
  210. value: "value",
  211. text: "text",
  212. select: function (item) {
  213. var MajorNos = $("#NewMajorNo").lrselectGet();
  214. if (MajorNos != null && MajorNos != "" && MajorNos != "undefined") {
  215. if (item) {
  216. $('#NewClassNo').lrselectRefresh({
  217. allowSearch: true,
  218. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  219. param: {
  220. strWhere: "majorno='" + MajorNos + "' AND CheckMark=1 AND Grade='" + item.text + "' order by classno desc"
  221. }
  222. });
  223. } else {
  224. $('#NewClassNo').lrselectRefresh({
  225. allowSearch: true,
  226. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  227. param: { strWhere: "1=1 AND CheckMark=1 order by classno desc" }
  228. });
  229. }
  230. } else {
  231. if (item) {
  232. $('#NewClassNo').lrselectRefresh({
  233. allowSearch: true,
  234. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  235. param: {
  236. strWhere: "CheckMark=1 AND Grade='" + item.text + "' order by classno desc"
  237. }
  238. });
  239. } else {
  240. $('#NewClassNo').lrselectRefresh({
  241. allowSearch: true,
  242. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  243. param: { strWhere: "1=1 AND CheckMark=1 order by classno desc" }
  244. });
  245. }
  246. }
  247. }
  248. });
  249. $('#NewClassNo').lrselect({
  250. allowSearch: true,
  251. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  252. param: { strWhere: "1=1 AND CheckMark=1 order by classno desc" },
  253. value: "classno",
  254. text: "classname"
  255. });
  256. $('#RecoverWriteMark').lrDataItemSelect({ code: 'YesOrNoInt' });
  257. $('#RecoverStuStatus').lrDataItemSelect({ code: 'YesOrNoInt' });
  258. $('#NewAnomalousType').lrDataItemSelect({ code: 'StuChangeType' });
  259. $('#NewAnomalousType').lrselectSet("16");
  260. // 刷新
  261. $('#lr_refresh').on('click', function () {
  262. location.reload();
  263. });
  264. //查看
  265. $('#lr_view').on('click', function () {
  266. var keyValue = $('#gridtable').jfGridValue('StuId');
  267. if (learun.checkrow(keyValue)) {
  268. if (keyValue.indexOf(',') != -1) {
  269. learun.alert.warning("只能选择一条记录进行查看!");
  270. return;
  271. }
  272. learun.layerForm({
  273. id: 'form',
  274. title: '查看',
  275. url: top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/FormView?keyValue=' + keyValue,
  276. width: 1162,
  277. height: 600,
  278. btn: null
  279. });
  280. }
  281. });
  282. $('#selgridtab').jfGrid({
  283. headData: [
  284. { label: "学号", name: "StuNo", width: 100, align: "left" },
  285. { label: "姓名", name: "StuName", width: 100, align: "left" },
  286. {
  287. label: "性别", name: "Gender", width: 80, align: "left",
  288. formatter: function (cellvalue) {
  289. return cellvalue == true ? "男" : "女";
  290. }
  291. },
  292. {
  293. label: "出生日期", name: "Birthday", width: 100, align: "left", ishide: true,
  294. formatter: function (value) {
  295. return learun.formatDate(value, 'yyyy-MM-dd');
  296. }
  297. },
  298. { label: "身份证号", name: "IdentityCardNo", width: 100, align: "left" },
  299. {
  300. label: "民族", name: "NationalityNo", width: 100, align: "left",
  301. formatterAsync: function (callback, value, row, op, $cell) {
  302. learun.clientdata.getAsync('dataItem', {
  303. key: value,
  304. code: 'National',
  305. callback: function (_data) {
  306. callback(_data.text);
  307. }
  308. });
  309. }
  310. },
  311. { label: "年级", name: "Grade", width: 100, align: "left" },
  312. {
  313. label: "系所", name: "DeptNo", width: 100, align: "left",
  314. formatterAsync: function (callback, value, row, op, $cell) {
  315. learun.clientdata.getAsync('custmerData', {
  316. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo',
  317. key: value,
  318. keyId: 'deptno',
  319. callback: function (_data) {
  320. callback(_data['deptname']);
  321. }
  322. });
  323. }
  324. },
  325. {
  326. label: "专业", name: "MajorNo", width: 100, align: "left",
  327. formatterAsync: function (callback, value, row, op, $cell) {
  328. learun.clientdata.getAsync('custmerData', {
  329. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo',
  330. key: value,
  331. keyId: 'majorno',
  332. callback: function (_data) {
  333. callback(_data['majorname']);
  334. }
  335. });
  336. }
  337. },
  338. {
  339. label: "班级", name: "ClassNo", width: 100, align: "left",
  340. formatterAsync: function (callback, value, row, op, $cell) {
  341. learun.clientdata.getAsync('custmerData', {
  342. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj',
  343. key: value,
  344. keyId: 'classno',
  345. callback: function (_data) {
  346. callback(_data['classname']);
  347. }
  348. });
  349. }
  350. },
  351. {
  352. label: "学制", name: "EduSystem", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) {
  353. learun.clientdata.getAsync('dataItem', {
  354. key: value,
  355. code: 'EduSystem',
  356. callback: function (_data) {
  357. callback(_data.text);
  358. }
  359. });
  360. }
  361. },
  362. { label: "家庭地址", name: "MailAddress", width: 100, align: "left" },
  363. { label: "联系电话", name: "Mobile", width: 100, align: "left" },
  364. { label: "户口所在地", name: "ResidencePlace", width: 100, align: "left" },
  365. { label: "档案所在地", name: "LocationFile", width: 100, align: "left" },
  366. {
  367. label: "操作", name: "Delete", width: 100, align: "center",
  368. formatter: function (callback, cellvalue, row, op, $cell) {
  369. var $div = $('<div></div>');
  370. var $hbtn = $('<span class="label label-info" style="cursor: pointer;margin-right:8px;"> 移除</span>');
  371. $hbtn.on('click', function () {
  372. tempdatra.map((item, index) => {
  373. if (item.StuNo == cellvalue.StuNo) {
  374. tempdatra.splice(index, 1)
  375. }
  376. });
  377. //console.log(tempdatra)
  378. $('#selgridtab').jfGridSet('refreshdata', tempdatra);
  379. });
  380. $div.append($hbtn);
  381. return $div;
  382. }
  383. },
  384. ],
  385. mainId: 'AAIId',
  386. });
  387. },
  388. // 初始化列表
  389. initGird: function () {
  390. $('#gridtable').lrAuthorizeJfGridLei({
  391. url: top.$.rootUrl + '/EducationalAdministration/StuTransferInfo/GetPageList',
  392. headData: [
  393. { label: "学号", name: "StuNo", width: 100, align: "left" },
  394. { label: "姓名", name: "StuName", width: 100, align: "left" },
  395. {
  396. label: "性别", name: "Gender", width: 80, align: "left",
  397. formatter: function (cellvalue) {
  398. return cellvalue == true ? "男" : "女";
  399. }
  400. },
  401. {
  402. label: "出生日期", name: "Birthday", width: 100, align: "left", ishide: true,
  403. formatter: function (value) {
  404. return learun.formatDate(value, 'yyyy-MM-dd');
  405. }
  406. },
  407. { label: "身份证号", name: "IdentityCardNo", width: 100, align: "left" },
  408. {
  409. label: "民族", name: "NationalityNo", width: 100, align: "left",
  410. formatterAsync: function (callback, value, row, op, $cell) {
  411. learun.clientdata.getAsync('dataItem', {
  412. key: value,
  413. code: 'National',
  414. callback: function (_data) {
  415. callback(_data.text);
  416. }
  417. });
  418. }
  419. },
  420. { label: "年级", name: "Grade", width: 100, align: "left" },
  421. {
  422. label: "系所", name: "DeptNo", width: 100, align: "left",
  423. formatterAsync: function (callback, value, row, op, $cell) {
  424. learun.clientdata.getAsync('custmerData', {
  425. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo',
  426. key: value,
  427. keyId: 'deptno',
  428. callback: function (_data) {
  429. callback(_data['deptname']);
  430. }
  431. });
  432. }
  433. },
  434. {
  435. label: "专业", name: "MajorNo", width: 100, align: "left",
  436. formatterAsync: function (callback, value, row, op, $cell) {
  437. learun.clientdata.getAsync('custmerData', {
  438. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo',
  439. key: value,
  440. keyId: 'majorno',
  441. callback: function (_data) {
  442. callback(_data['majorname']);
  443. }
  444. });
  445. }
  446. },
  447. {
  448. label: "班级", name: "ClassNo", width: 100, align: "left",
  449. formatterAsync: function (callback, value, row, op, $cell) {
  450. learun.clientdata.getAsync('custmerData', {
  451. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj',
  452. key: value,
  453. keyId: 'classno',
  454. callback: function (_data) {
  455. callback(_data['classname']);
  456. }
  457. });
  458. }
  459. },
  460. {
  461. label: "学制", name: "EduSystem", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) {
  462. learun.clientdata.getAsync('dataItem', {
  463. key: value,
  464. code: 'EduSystem',
  465. callback: function (_data) {
  466. callback(_data.text);
  467. }
  468. });
  469. }
  470. },
  471. { label: "家庭地址", name: "MailAddress", width: 100, align: "left" },
  472. { label: "联系电话", name: "Mobile", width: 100, align: "left" },
  473. { label: "户口所在地", name: "ResidencePlace", width: 100, align: "left" },
  474. { label: "档案所在地", name: "LocationFile", width: 100, align: "left" },
  475. ],
  476. mainId: 'StuId',
  477. isPage: true,
  478. rows: 100,
  479. isMultiselect: true,
  480. onSelectRow: function (rowdata, type) {
  481. if (type) {
  482. list.push(rowdata)
  483. let temp = {}
  484. list = list.reduce((prev, curv) => {
  485. if (temp[curv.StuNo]) { }
  486. else {
  487. temp[curv.StuNo] = true
  488. prev.push(curv)
  489. }
  490. return prev
  491. }, [])
  492. //var selectedRow = $('#gridtable').jfGridGet('rowdata');
  493. tempdatra = list
  494. $('#selgridtab').jfGridSet('refreshdata', tempdatra);
  495. }
  496. }
  497. });
  498. page.search();
  499. },
  500. search: function (param) {
  501. param = param || {};
  502. param.SqlParameter = ' and (AnomalousType=05 or AnomalousType=10 or AnomalousType= 13 or AnomalousType= 14) and IsReturnSchool=0 and F_EnabledMark=1 and id not in(select ReturnSchoolId from StuTransferInfo where ReturnSchoolId is not null ) ';
  503. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  504. }
  505. };
  506. refreshGirdData = function () {
  507. page.search();
  508. };
  509. page.init();
  510. }