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.
 
 
 
 
 
 

283 lines
14 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=allbjqj',
  47. param: { strWhere: "majorno='" + item.majorno + "' AND (CheckMark=1 or (CheckMark != 1 and ClassStatus='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=allbjqj',
  53. param: { strWhere: "1=1 AND (CheckMark=1 or (CheckMark != 1 and ClassStatus='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=allbjqj',
  61. param: { strWhere: "majorno='" + item.majorno + "' AND (CheckMark=1 or (CheckMark != 1 and ClassStatus='1')) order by classno desc" }
  62. });
  63. } else {
  64. $('#ClassNo').lrselectRefresh({
  65. allowSearch: true,
  66. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=allbjqj',
  67. param: { strWhere: "1=1 AND (CheckMark=1 or (CheckMark != 1 and ClassStatus='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=allbjqj',
  84. param: {
  85. strWhere: "majorno='" + MajorNos + "' AND (CheckMark=1 or (CheckMark != 1 and ClassStatus='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=allbjqj',
  92. param: { strWhere: "1=1 AND (CheckMark=1 or (CheckMark != 1 and ClassStatus='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=allbjqj',
  100. param: {
  101. strWhere: "1=1 AND (CheckMark=1 or (CheckMark != 1 and ClassStatus='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=allbjqj',
  108. param: { strWhere: "1=1 AND (CheckMark=1 or (CheckMark != 1 and ClassStatus='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=allbjqj',
  117. param: { strWhere: "1=1 AND (CheckMark=1 or (CheckMark != 1 and ClassStatus='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_feesettle').on('click', function () {
  132. var keyValue = $('#gridtable').jfGridValue('StuId');
  133. var FeeSettleStatus = $('#gridtable').jfGridValue('FeeSettleStatus');
  134. var FinishSchoolMark = $('#gridtable').jfGridValue('FinishSchoolMark');
  135. if (learun.checkrow(keyValue)) {
  136. if (FinishSchoolMark.indexOf('2') != -1) {
  137. return learun.alert.warning("选中项包括已毕业数据,无法操作!");
  138. }
  139. if (FeeSettleStatus.indexOf('1') != -1) {
  140. return learun.alert.warning("选中项包括已结算数据!");
  141. }
  142. learun.layerConfirm('是否确认结算学杂费!', function (res) {
  143. if (res) {
  144. learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/IsFeeSettle', { keyValue: keyValue, status: '1' }, function () {
  145. refreshGirdData();
  146. });
  147. }
  148. });
  149. }
  150. })
  151. //取消学杂费结算
  152. $('#lr_cancelfeesettle').on('click', function () {
  153. var keyValue = $('#gridtable').jfGridValue('StuId');
  154. var FeeSettleStatus = $('#gridtable').jfGridValue('FeeSettleStatus');
  155. var FinishSchoolMark = $('#gridtable').jfGridValue('FinishSchoolMark');
  156. if (learun.checkrow(keyValue)) {
  157. if (FinishSchoolMark.indexOf('2') != -1) {
  158. return learun.alert.warning("选中项包括已毕业数据,无法操作!");
  159. }
  160. for (var i = 0; i < FeeSettleStatus.split(',').length; i++) {
  161. if (FeeSettleStatus.split(',')[i] != 1) {
  162. return learun.alert.warning("选中项包括未结算数据!");
  163. }
  164. }
  165. learun.layerConfirm('是否确认取消结算学杂费!', function (res) {
  166. if (res) {
  167. learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/IsFeeSettle', { keyValue: keyValue, status: '0' }, function () {
  168. refreshGirdData();
  169. });
  170. }
  171. });
  172. }
  173. })
  174. },
  175. // 初始化列表
  176. initGird: function () {
  177. $('#gridtable').jfGrid({
  178. url: top.$.rootUrl + '/EducationalAdministration/StuInfoGraduate/GetPageList',
  179. headData: [
  180. { label: "学号", name: "StuNo", width: 130, align: "left" },
  181. { label: "姓名", name: "StuName", width: 100, align: "left" },
  182. {
  183. label: "性别", name: "GenderNo", width: 50, align: "left",
  184. formatter: function (cellvalue) {
  185. return cellvalue == true ? "男" : "女";
  186. }
  187. },
  188. {
  189. label: "系所", name: "DeptNo", width: 100, align: "left",
  190. formatterAsync: function (callback, value, row, op, $cell) {
  191. learun.clientdata.getAsync('custmerData', {
  192. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo',
  193. key: value,
  194. keyId: 'deptno',
  195. callback: function (_data) {
  196. callback(_data['deptname']);
  197. }
  198. });
  199. }
  200. },
  201. {
  202. label: "专业", name: "MajorNo", width: 100, align: "left",
  203. formatterAsync: function (callback, value, row, op, $cell) {
  204. learun.clientdata.getAsync('custmerData', {
  205. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo',
  206. key: value,
  207. keyId: 'majorno',
  208. callback: function (_data) {
  209. callback(_data['majorname']);
  210. }
  211. });
  212. }
  213. },
  214. {
  215. label: "班级", name: "ClassNo", width: 100, align: "left",
  216. formatterAsync: function (callback, value, row, op, $cell) {
  217. learun.clientdata.getAsync('custmerData', {
  218. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'allbjqj',
  219. key: value,
  220. keyId: 'classno',
  221. callback: function (_data) {
  222. callback(_data['classname']);
  223. }
  224. });
  225. }
  226. },
  227. { label: "年级", name: "Grade", width: 50, align: "left" },
  228. {
  229. label: "学制", name: "EduSystem", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) {
  230. learun.clientdata.getAsync('dataItem', {
  231. key: value,
  232. code: 'EduSystem',
  233. callback: function (_data) {
  234. callback(_data.text);
  235. }
  236. });
  237. }
  238. },
  239. { label: "毕业证书号", name: "DiplomaNo", width: 100, align: "left" },
  240. {
  241. label: '毕业状态', name: 'FinishSchoolMark', width: 100, align: "left", formatter: function (val) {
  242. if (val == '0') {
  243. return '待准许';
  244. } else if (val == "1") {
  245. return '准许毕业';
  246. } else if (val == '2') {
  247. return '已毕业';
  248. } else {
  249. return '待准许';
  250. }
  251. }
  252. },
  253. { label: "毕业时间", name: "FinishSchoolDate", width: 130, align: "left" },
  254. {
  255. label: "学杂费结算状态", name: "FeeSettleStatus", width: 100, align: "left", formatter: function (cellvalue) {
  256. return cellvalue == "1" ? "已结算" : "未结算"
  257. }
  258. },
  259. { label: "学杂费结算时间", name: "FeeSettleDate", width: 100, align: "left" },
  260. ],
  261. mainId: 'StuId',
  262. isPage: true,
  263. rows: 100,
  264. isMultiselect: true,
  265. sidx: "FinishSchoolMark,FeeSettleStatus,StuNo",
  266. sord: "asc"
  267. });
  268. page.search();
  269. },
  270. search: function (param) {
  271. param = param || {};
  272. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  273. }
  274. };
  275. refreshGirdData = function () {
  276. page.search();
  277. };
  278. page.init();
  279. }