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.
 
 
 
 
 
 

335 lines
17 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_filetransfer').on('click', function () {
  132. var keyValue = $('#gridtable').jfGridValue('StuId');
  133. var FileTransferStatus = $('#gridtable').jfGridValue('FileTransferStatus');
  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 (FileTransferStatus.indexOf('1') != -1) {
  140. return learun.alert.warning("选中项包括已转出数据!");
  141. }
  142. learun.layerConfirm('是否确认转出档案关系!', function (res) {
  143. if (res) {
  144. learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/IsFileTransfer', { keyValue: keyValue, status: '1', fort: '0' }, function () {
  145. refreshGirdData();
  146. });
  147. }
  148. });
  149. }
  150. })
  151. //取消档案关系转出
  152. $('#lr_cancelfiletransfer').on('click', function () {
  153. var keyValue = $('#gridtable').jfGridValue('StuId');
  154. var FileTransferStatus = $('#gridtable').jfGridValue('FileTransferStatus');
  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 < FileTransferStatus.split(',').length; i++) {
  161. if (FileTransferStatus.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/IsFileTransfer', { keyValue: keyValue, status: '0', fort: '0' }, function () {
  168. refreshGirdData();
  169. });
  170. }
  171. });
  172. }
  173. })
  174. //组织关系转出
  175. $('#lr_Tissue').on('click', function () {
  176. var keyValue = $('#gridtable').jfGridValue('StuId');
  177. var FileTransferStatus = $('#gridtable').jfGridValue('TissueStatus');
  178. var FinishSchoolMark = $('#gridtable').jfGridValue('FinishSchoolMark');
  179. if (learun.checkrow(keyValue)) {
  180. if (FinishSchoolMark.indexOf('2') != -1) {
  181. return learun.alert.warning("选中项包括已毕业数据,无法操作!");
  182. }
  183. if (FileTransferStatus.indexOf('1') != -1) {
  184. return learun.alert.warning("选中项包括已转出数据!");
  185. }
  186. learun.layerConfirm('是否确认转出组织关系!', function (res) {
  187. if (res) {
  188. learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/IsFileTransfer', { keyValue: keyValue, status: '1', fort: '1' }, function () {
  189. refreshGirdData();
  190. });
  191. }
  192. });
  193. }
  194. })
  195. //取消组织关系转出
  196. $('#lr_cancelTissue').on('click', function () {
  197. var keyValue = $('#gridtable').jfGridValue('StuId');
  198. var FileTransferStatus = $('#gridtable').jfGridValue('TissueStatus');
  199. var FinishSchoolMark = $('#gridtable').jfGridValue('FinishSchoolMark');
  200. if (learun.checkrow(keyValue)) {
  201. if (FinishSchoolMark.indexOf('2') != -1) {
  202. return learun.alert.warning("选中项包括已毕业数据,无法操作!");
  203. }
  204. for (var i = 0; i < FileTransferStatus.split(',').length; i++) {
  205. if (FileTransferStatus.split(',')[i] != 1) {
  206. return learun.alert.warning("选中项包括未转出数据!");
  207. }
  208. }
  209. learun.layerConfirm('是否确认取消转出组织关系!', function (res) {
  210. if (res) {
  211. learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/IsFileTransfer', { keyValue: keyValue, status: '0', fort: '1' }, function () {
  212. refreshGirdData();
  213. });
  214. }
  215. });
  216. }
  217. })
  218. },
  219. // 初始化列表
  220. initGird: function () {
  221. $('#gridtable').jfGrid({
  222. url: top.$.rootUrl + '/EducationalAdministration/StuInfoGraduate/GetPageList',
  223. headData: [
  224. { label: "学号", name: "StuNo", width: 130, align: "left" },
  225. { label: "姓名", name: "StuName", width: 100, align: "left" },
  226. {
  227. label: "性别", name: "GenderNo", width: 50, align: "left",
  228. formatter: function (cellvalue) {
  229. return cellvalue == true ? "男" : "女";
  230. }
  231. },
  232. {
  233. label: "系所", name: "DeptNo", width: 100, align: "left",
  234. formatterAsync: function (callback, value, row, op, $cell) {
  235. learun.clientdata.getAsync('custmerData', {
  236. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo',
  237. key: value,
  238. keyId: 'deptno',
  239. callback: function (_data) {
  240. callback(_data['deptname']);
  241. }
  242. });
  243. }
  244. },
  245. {
  246. label: "专业", name: "MajorNo", width: 100, align: "left",
  247. formatterAsync: function (callback, value, row, op, $cell) {
  248. learun.clientdata.getAsync('custmerData', {
  249. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo',
  250. key: value,
  251. keyId: 'majorno',
  252. callback: function (_data) {
  253. callback(_data['majorname']);
  254. }
  255. });
  256. }
  257. },
  258. {
  259. label: "班级", name: "ClassNo", width: 100, align: "left",
  260. formatterAsync: function (callback, value, row, op, $cell) {
  261. learun.clientdata.getAsync('custmerData', {
  262. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'allbjqj',
  263. key: value,
  264. keyId: 'classno',
  265. callback: function (_data) {
  266. callback(_data['classname']);
  267. }
  268. });
  269. }
  270. },
  271. { label: "年级", name: "Grade", width: 50, align: "left" },
  272. {
  273. label: "学制", name: "EduSystem", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) {
  274. learun.clientdata.getAsync('dataItem', {
  275. key: value,
  276. code: 'EduSystem',
  277. callback: function (_data) {
  278. callback(_data.text);
  279. }
  280. });
  281. }
  282. },
  283. { label: "毕业证书号", name: "DiplomaNo", width: 100, align: "left" },
  284. {
  285. label: '毕业状态', name: 'FinishSchoolMark', width: 100, align: "left", formatter: function (val) {
  286. if (val == '0') {
  287. return '待准许';
  288. } else if (val == "1") {
  289. return '准许毕业';
  290. } else if (val == '2') {
  291. return '已毕业';
  292. } else {
  293. return '待准许';
  294. }
  295. }
  296. },
  297. { label: "毕业时间", name: "FinishSchoolDate", width: 130, align: "left" },
  298. {
  299. label: "档案转出状态", name: "FileTransferStatus", width: 100, align: "left",
  300. formatter: function (cellvalue) {
  301. return cellvalue == "1" ? "已转出" : "未转出"
  302. }
  303. },
  304. { label: "档案转出时间", name: "FileTransferDate", width: 130, align: "left" },
  305. {
  306. label: "组织关系转出状态", name: "TissueStatus", width: 110, align: "left",
  307. formatter: function (cellvalue) {
  308. return cellvalue == "1" ? "已转出" : "未转出"
  309. }
  310. },
  311. { label: "组织关系转出时间", name: "TissueDate", width: 130, align: "left" },
  312. ],
  313. mainId: 'StuId',
  314. isPage: true,
  315. rows: 100,
  316. isMultiselect: true,
  317. sidx: "FinishSchoolMark,StuNo",
  318. sord: "asc"
  319. });
  320. page.search();
  321. },
  322. search: function (param) {
  323. param = param || {};
  324. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  325. }
  326. };
  327. refreshGirdData = function () {
  328. page.search();
  329. };
  330. page.init();
  331. }