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.
 
 
 
 
 
 

182 lines
8.2 KiB

  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2020-05-19 12:01
  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. }, 250, 400);
  19. $('#YearNo').lrselect({
  20. placeholder: "请选择学年",
  21. allowSearch: true,
  22. url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetAcademicYearNo',
  23. value: 'value',
  24. text: 'text'
  25. });
  26. $('#DeptNo').lrDataSourceSelect({
  27. code: 'CdDeptInfo', value: 'deptno', text: 'deptname', select: function (val) {
  28. var deptno = "";
  29. if (val) {
  30. deptno = val.deptno;
  31. }
  32. $('#MajorNo').lrselectRefresh({
  33. url: top.$.rootUrl + '/EducationalAdministration/CdMajor/GetListByDeptNo?DeptNo=' + deptno,
  34. text: "MajorName",
  35. value: "MajorNo"
  36. })
  37. }
  38. });
  39. $('#MajorNo').lrDataSourceSelect({
  40. code: 'CdMajorInfo', value: 'majorno', text: 'majorname', select:
  41. function (val) {
  42. var majorNo = '';
  43. if (val) {
  44. majorNo = val.MajorNo;
  45. }
  46. $('#ClassNo').lrselectRefresh({
  47. url: top.$.rootUrl + '/EducationalAdministration/ClassInfo/GetClassByMajorNo?majorNo=' + majorNo,
  48. text: "ClassName",
  49. value: "ClassNo"
  50. })
  51. }
  52. });
  53. $('#ClassNo').lrDataSourceSelect({
  54. code: 'bjsj', value: 'classno', text: 'classname', select: function (val) {
  55. var classNo = '';
  56. if (val) {
  57. classNo = val.ClassNo;
  58. }
  59. $('#StuNo').lrselectRefresh({
  60. url: top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/GetStuInfoByClassNo?classNo=' + classNo,
  61. text: "StuName",
  62. value: "StuNo"
  63. })
  64. }
  65. });
  66. $('#StuNo').lrDataSourceSelect({ code: 'StuInfoBasic', value: 'stuno', text: 'stuname' }); // 刷新
  67. // 刷新
  68. $('#lr_refresh').on('click', function () {
  69. location.reload();
  70. });
  71. // 新增
  72. $('#lr_add').on('click', function () {
  73. learun.layerForm({
  74. id: 'form',
  75. title: '新增',
  76. url: top.$.rootUrl + '/LogisticsManagement/MSRMilitaryServiceRegistration/Form',
  77. width: 600,
  78. height: 400,
  79. callBack: function (id) {
  80. return top[id].acceptClick(refreshGirdData);
  81. }
  82. });
  83. });
  84. // 编辑
  85. $('#lr_edit').on('click', function () {
  86. var keyValue = $('#gridtable').jfGridValue('ID');
  87. if (learun.checkrow(keyValue)) {
  88. learun.layerForm({
  89. id: 'form',
  90. title: '编辑',
  91. url: top.$.rootUrl + '/LogisticsManagement/MSRMilitaryServiceRegistration/Form?keyValue=' + keyValue,
  92. width: 600,
  93. height: 400,
  94. callBack: function (id) {
  95. return top[id].acceptClick(refreshGirdData);
  96. }
  97. });
  98. }
  99. });
  100. // 删除
  101. $('#lr_delete').on('click', function () {
  102. var keyValue = $('#gridtable').jfGridValue('ID');
  103. if (learun.checkrow(keyValue)) {
  104. learun.layerConfirm('是否确认删除该项!', function (res) {
  105. if (res) {
  106. learun.deleteForm(top.$.rootUrl + '/LogisticsManagement/MSRMilitaryServiceRegistration/DeleteForm', { keyValue: keyValue}, function () {
  107. refreshGirdData();
  108. });
  109. }
  110. });
  111. }
  112. });
  113. },
  114. // 初始化列表
  115. initGird: function () {
  116. $('#gridtable').lrAuthorizeJfGrid({
  117. url: top.$.rootUrl + '/LogisticsManagement/MSRMilitaryServiceRegistration/GetPageList',
  118. headData: [
  119. { label: "学年", name: "YearNo", width: 100, align: "left"},
  120. { label: "系部", name: "DeptNo", width: 100, align: "left",
  121. formatterAsync: function (callback, value, row, op,$cell) {
  122. learun.clientdata.getAsync('custmerData', {
  123. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo',
  124. key: value,
  125. keyId: 'deptno',
  126. callback: function (_data) {
  127. callback(_data['deptname']);
  128. }
  129. });
  130. }},
  131. { label: "专业", name: "MajorNo", width: 100, align: "left",
  132. formatterAsync: function (callback, value, row, op,$cell) {
  133. learun.clientdata.getAsync('custmerData', {
  134. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo',
  135. key: value,
  136. keyId: 'majorno',
  137. callback: function (_data) {
  138. callback(_data['majorname']);
  139. }
  140. });
  141. }},
  142. { label: "班级", name: "ClassNo", width: 100, align: "left",
  143. formatterAsync: function (callback, value, row, op,$cell) {
  144. learun.clientdata.getAsync('custmerData', {
  145. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj',
  146. key: value,
  147. keyId: 'classno',
  148. callback: function (_data) {
  149. callback(_data['classname']);
  150. }
  151. });
  152. }},
  153. { label: "学生", name: "StuNo", width: 100, align: "left",
  154. formatterAsync: function (callback, value, row, op,$cell) {
  155. learun.clientdata.getAsync('custmerData', {
  156. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'StuInfoBasic',
  157. key: value,
  158. keyId: 'stuno',
  159. callback: function (_data) {
  160. callback(_data['stuname']);
  161. }
  162. });
  163. }},
  164. { label: "截图上传", name: "Screenshot", width: 100, align: "left"},
  165. { label: "备注", name: "Remark", width: 100, align: "left"},
  166. ],
  167. mainId:'ID',
  168. isPage: true
  169. });
  170. page.search();
  171. },
  172. search: function (param) {
  173. param = param || {};
  174. $('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) });
  175. }
  176. };
  177. refreshGirdData = function () {
  178. page.search();
  179. };
  180. page.init();
  181. }