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.
 
 
 
 
 
 

292 lines
15 KiB

  1. var refreshGirdData;
  2. var bootstrap = function ($, learun) {
  3. "use strict";
  4. var page = {
  5. init: function () {
  6. page.initGird();
  7. page.bind();
  8. },
  9. bind: function () {
  10. $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
  11. page.search(queryJson);
  12. }, 290, 400);
  13. $('#DeptNo').lrselect({
  14. allowSearch: true,
  15. value: "deptno",
  16. text: "deptname",
  17. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdDeptInfo',
  18. select: function (item) {
  19. if (item) {
  20. $('#MajorNo').lrselectRefresh({
  21. allowSearch: true,
  22. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo',
  23. param: { strWhere: "DeptNo='" + item.deptno + "' AND CheckMark=1" }
  24. });
  25. } else {
  26. $('#MajorNo').lrselectRefresh({
  27. allowSearch: true,
  28. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo',
  29. param: { strWhere: "1=1 AND CheckMark=1" }
  30. });
  31. }
  32. }
  33. });
  34. $('#MajorNo').lrselect({
  35. allowSearch: true,
  36. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo',
  37. value: "majorno",
  38. text: "majorname",
  39. param: { strWhere: "1=1 AND CheckMark=1" },
  40. select: function (item) {
  41. var Grades = $("#Grade").lrselectGet();
  42. if (Grades != null && Grades != "" && Grades != "undefined") {
  43. if (item) {
  44. $('#ClassNo').lrselectRefresh({
  45. allowSearch: true,
  46. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  47. param: { strWhere: "majorno='" + item.majorno + "' AND CheckMark=1 AND Grade='" + Grades + "' order by classno desc" }
  48. });
  49. } else {
  50. $('#ClassNo').lrselectRefresh({
  51. allowSearch: true,
  52. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  53. param: { strWhere: "1=1 AND CheckMark=1 order by classno desc" }
  54. });
  55. }
  56. } else {
  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 order by classno desc" }
  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 order by classno desc" }
  68. });
  69. }
  70. }
  71. }
  72. });
  73. $('#Grade').lrselect({
  74. url: top.$.rootUrl + '/EducationalAdministration/ClassInfo/GenerateNearByYear',
  75. value: "value",
  76. text: "text",
  77. select: function (item) {
  78. var MajorNos = $("#MajorNo").lrselectGet();
  79. if (MajorNos != null && MajorNos != "" && MajorNos != "undefined") {
  80. if (item) {
  81. $('#ClassNo').lrselectRefresh({
  82. allowSearch: true,
  83. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  84. param: {
  85. strWhere: "majorno='" + MajorNos + "' AND CheckMark=1 AND Grade='" + item.text + "' order by classno desc"
  86. }
  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. } else {
  96. if (item) {
  97. $('#ClassNo').lrselectRefresh({
  98. allowSearch: true,
  99. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  100. param: {
  101. strWhere: "CheckMark=1 AND Grade='" + item.text + "' order by classno desc"
  102. }
  103. });
  104. } else {
  105. $('#ClassNo').lrselectRefresh({
  106. allowSearch: true,
  107. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  108. param: { strWhere: "1=1 AND CheckMark=1 order by classno desc" }
  109. });
  110. }
  111. }
  112. }
  113. });
  114. $('#ClassNo').lrselect({
  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. value: "classno",
  119. text: "classname"
  120. });
  121. $('#FinishSchoolMark').lrselect({
  122. data: [{ text: "已毕业", value: "2" }, { text: "准许毕业", value: "1" }, { text: "待准许", value: "0" }],
  123. text: "text",
  124. value: "value"
  125. })
  126. // 刷新
  127. $('#lr_refresh').on('click', function () {
  128. location.reload();
  129. });
  130. //毕业证领取
  131. $('#lr_getcard').on('click', function () {
  132. var keyValue = $('#gridtable').jfGridValue('StuId');
  133. var DiplomaReceiveStatus = $('#gridtable').jfGridValue('DiplomaReceiveStatus');
  134. if (learun.checkrow(keyValue)) {
  135. //if (DiplomaReceiveStatus.indexOf('1') != -1) {
  136. // return learun.alert.warning("选中项包括已领取数据!");
  137. //}
  138. //learun.layerConfirm('是否确认领取毕业证!', function (res) {
  139. // if (res) {
  140. // learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/GetCard', { keyValue: keyValue, status: '1' }, function () {
  141. // refreshGirdData();
  142. // });
  143. // }
  144. //});
  145. if (keyValue.split(',').length > 1) {
  146. return learun.alert.warning("只能选择一条记录进行操作!");
  147. }
  148. if (DiplomaReceiveStatus == "1") {
  149. return learun.alert.warning("当前记录毕业证已领取!");
  150. }
  151. learun.layerForm({
  152. id: 'form',
  153. title: '毕业证领取',
  154. url: top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/GraduateDiplomaReceiveForm?keyValue=' + keyValue,
  155. width: 600,
  156. height: 400,
  157. callBack: function (id) {
  158. return top[id].acceptClick(refreshGirdData);
  159. }
  160. });
  161. }
  162. })
  163. //取消毕业证领取
  164. $('#lr_cancelgetcard').on('click', function () {
  165. var keyValue = $('#gridtable').jfGridValue('StuId');
  166. var DiplomaReceiveStatus = $('#gridtable').jfGridValue('DiplomaReceiveStatus');
  167. if (learun.checkrow(keyValue)) {
  168. for (var i = 0; i < DiplomaReceiveStatus.split(',').length; i++) {
  169. if (DiplomaReceiveStatus.split(',')[i] != 1) {
  170. return learun.alert.warning("选中项包括未领取数据!");
  171. }
  172. }
  173. learun.layerConfirm('是否确认取消领取毕业证!', function (res) {
  174. if (res) {
  175. learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/GetCard', { keyValue: keyValue, status: '0' }, function () {
  176. refreshGirdData();
  177. });
  178. }
  179. });
  180. }
  181. })
  182. },
  183. // 初始化列表
  184. initGird: function () {
  185. $('#gridtable').jfGrid({
  186. url: top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/GetPageList',
  187. headData: [
  188. { label: "学号", name: "StuNo", width: 130, align: "left" },
  189. { label: "姓名", name: "StuName", width: 100, align: "left" },
  190. {
  191. label: "性别", name: "GenderNo", width: 50, align: "left",
  192. formatter: function (cellvalue) {
  193. return cellvalue == true ? "男" : "女";
  194. }
  195. },
  196. {
  197. label: "系所", name: "DeptNo", width: 100, align: "left",
  198. formatterAsync: function (callback, value, row, op, $cell) {
  199. learun.clientdata.getAsync('custmerData', {
  200. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo',
  201. key: value,
  202. keyId: 'deptno',
  203. callback: function (_data) {
  204. callback(_data['deptname']);
  205. }
  206. });
  207. }
  208. },
  209. {
  210. label: "专业", name: "MajorNo", width: 100, align: "left",
  211. formatterAsync: function (callback, value, row, op, $cell) {
  212. learun.clientdata.getAsync('custmerData', {
  213. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo',
  214. key: value,
  215. keyId: 'majorno',
  216. callback: function (_data) {
  217. callback(_data['majorname']);
  218. }
  219. });
  220. }
  221. },
  222. {
  223. label: "班级", name: "ClassNo", width: 100, align: "left",
  224. formatterAsync: function (callback, value, row, op, $cell) {
  225. learun.clientdata.getAsync('custmerData', {
  226. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj',
  227. key: value,
  228. keyId: 'classno',
  229. callback: function (_data) {
  230. callback(_data['classname']);
  231. }
  232. });
  233. }
  234. },
  235. { label: "年级", name: "Grade", width: 50, align: "left" },
  236. {
  237. label: "学制", name: "EduSystem", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) {
  238. learun.clientdata.getAsync('dataItem', {
  239. key: value,
  240. code: 'EduSystem',
  241. callback: function (_data) {
  242. callback(_data.text);
  243. }
  244. });
  245. }
  246. },
  247. { label: "毕业证书号", name: "DiplomaNo", width: 100, align: "left" },
  248. {
  249. label: '毕业状态', name: 'FinishSchoolMark', width: 100, align: "left", formatter: function (val) {
  250. if (val == '0') {
  251. return '待准许';
  252. } else if (val == "1") {
  253. return '准许毕业';
  254. } else if (val == '2') {
  255. return '已毕业';
  256. } else {
  257. return '待准许';
  258. }
  259. }
  260. },
  261. { label: "毕业时间", name: "FinishSchoolDate", width: 130, align: "left" },
  262. {
  263. label: "毕业证领取状态", name: "DiplomaReceiveStatus", width: 100, align: "left", formatter: function (cellvalue) {
  264. return cellvalue == "1" ? "已领取" : "未领取"
  265. }
  266. },
  267. { label: "毕业证领取时间", name: "DiplomaReceiveDate", width: 120, align: "left" },
  268. { label: "领取人签名", name: "DiplomaReceiveSign", width: 100, align: "left" },
  269. { label: "代领人身份证号", name: "DiplomaReceiveIdcard", width: 130, align: "left" },
  270. { label: "代领备注", name: "DiplomaReceiveRemark", width: 100, align: "left" },
  271. ],
  272. mainId: 'StuId',
  273. isPage: true,
  274. rows: 100,
  275. isMultiselect: true,
  276. });
  277. page.search();
  278. },
  279. search: function (param) {
  280. param = param || {};
  281. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  282. }
  283. };
  284. refreshGirdData = function () {
  285. page.search();
  286. };
  287. page.init();
  288. }