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.
 
 
 
 
 
 

216 lines
9.3 KiB

  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2019-11-20 11:37
  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. }, 220, 400);
  19. // 刷新
  20. $('#lr_refresh').on('click', function () {
  21. location.reload();
  22. });
  23. $('#EDept').lrselect({
  24. value: "deptno",
  25. text: "deptname",
  26. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdDeptInfo',
  27. select: function (item) {
  28. if (item) {
  29. $('#EMajor').lrselectRefresh({
  30. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable',
  31. param: { code: "CdMajorInfo", strWhere: "DeptNo='" + item.deptno + "'" }
  32. });
  33. }
  34. else {
  35. $('#EMajor').lrselectRefresh({
  36. url: "",
  37. data: []
  38. });
  39. }
  40. $('#EClass').lrselectRefresh({
  41. url: "",
  42. data: []
  43. });
  44. }
  45. });
  46. $('#EMajor').lrselect({
  47. value: "majorno",
  48. text: "majorname",
  49. select: function (item) {
  50. if (item) {
  51. $('#EClass').lrselectRefresh({
  52. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable',
  53. param: { code: "bjsj", strWhere: "DeptNo='" + item.deptno + "' and majorno='" + item.majorno + "'" }
  54. });
  55. }
  56. }
  57. });
  58. $('#EMajor').on("click",
  59. function () {
  60. var data = $('#EDept').lrselectGet();
  61. if (!data) {
  62. learun.alert.error('请先选择系');
  63. }
  64. });
  65. $('#EClass').on("click",
  66. function () {
  67. var data1 = $('#EDept').lrselectGet();
  68. var data2 = $('#EMajor').lrselectGet();
  69. if (!data1 || !data2) {
  70. learun.alert.error('请先选择系和专业');
  71. }
  72. });
  73. $('#EClass').lrselect({
  74. value: "classno",
  75. text: "classname"
  76. });
  77. // 新增
  78. $('#lr_add').on('click', function () {
  79. learun.layerForm({
  80. id: 'form',
  81. title: '新增',
  82. url: top.$.rootUrl + '/EducationalAdministration/EvaCodeOfContuct/Form',
  83. width: 600,
  84. height: 500,
  85. callBack: function (id) {
  86. return top[id].acceptClick(refreshGirdData);
  87. }
  88. });
  89. });
  90. // 编辑
  91. $('#lr_edit').on('click', function () {
  92. var keyValue = $('#gridtable').jfGridValue('ID');
  93. if (learun.checkrow(keyValue)) {
  94. learun.layerForm({
  95. id: 'form',
  96. title: '编辑',
  97. url: top.$.rootUrl + '/EducationalAdministration/EvaCodeOfContuct/Form?keyValue=' + keyValue,
  98. width: 600,
  99. height: 500,
  100. callBack: function (id) {
  101. return top[id].acceptClick(refreshGirdData);
  102. }
  103. });
  104. }
  105. });
  106. // 删除
  107. $('#lr_delete').on('click', function () {
  108. var keyValue = $('#gridtable').jfGridValue('ID');
  109. if (learun.checkrow(keyValue)) {
  110. learun.layerConfirm('是否确认删除该项!', function (res) {
  111. if (res) {
  112. learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/EvaCodeOfContuct/DeleteForm', { keyValue: keyValue }, function () {
  113. refreshGirdData();
  114. });
  115. }
  116. });
  117. }
  118. });
  119. },
  120. // 初始化列表
  121. initGird: function () {
  122. $('#gridtable').jfGrid({
  123. url: top.$.rootUrl + '/EducationalAdministration/EvaCodeOfContuct/GetPageList',
  124. headData: [
  125. {
  126. label: "院系", name: "EDept", width: 100, align: "left",
  127. formatterAsync: function (callback, value, row, op, $cell) {
  128. learun.clientdata.getAsync('custmerData', {
  129. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo',
  130. key: value,
  131. keyId: 'deptno',
  132. callback: function (_data) {
  133. callback(_data['deptname']);
  134. }
  135. });
  136. }
  137. },
  138. {
  139. label: "专业", name: "EMajor", width: 100, align: "left",
  140. formatterAsync: function (callback, value, row, op, $cell) {
  141. learun.clientdata.getAsync('custmerData', {
  142. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo',
  143. key: value,
  144. keyId: 'majorno',
  145. callback: function (_data) {
  146. callback(_data['majorname']);
  147. }
  148. });
  149. }
  150. },
  151. {
  152. label: "班级", name: "EClass", width: 100, align: "left",
  153. formatterAsync: function (callback, value, row, op, $cell) {
  154. learun.clientdata.getAsync('custmerData', {
  155. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj',
  156. key: value,
  157. keyId: 'classno',
  158. callback: function (_data) {
  159. callback(_data['classname']);
  160. }
  161. });
  162. }
  163. },
  164. {
  165. label: "班主任", name: "ClassTeach", width: 100, align: "left",
  166. formatterAsync: function (callback, value, row, op, $cell) {
  167. learun.clientdata.getAsync('custmerData', {
  168. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'teacheruserdata',
  169. key: value,
  170. keyId: 'f_encode',
  171. callback: function (_data) {
  172. callback(_data['f_realname']);
  173. }
  174. });
  175. }
  176. },
  177. {
  178. label: "辅导员", name: "CoachTeach", width: 100, align: "left",
  179. formatterAsync: function (callback, value, row, op, $cell) {
  180. learun.clientdata.getAsync('custmerData', {
  181. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'teacheruserdata',
  182. key: value,
  183. keyId: 'f_encode',
  184. callback: function (_data) {
  185. callback(_data['f_realname']);
  186. }
  187. });
  188. }
  189. },
  190. { label: "学号", name: "StuNo", width: 100, align: "left" },
  191. { label: "姓名", name: "StuName", width: 100, align: "left" },
  192. { label: "电话", name: "Mobile", width: 100, align: "left" },
  193. { label: "违纪行为地点", name: "EAddress", width: 200, align: "left" },
  194. { label: "分数", name: "Fraction", width: 100, align: "left" },
  195. { label: "日期", name: "Data", width: 130, align: "left" },
  196. { label: "备注", name: "Remark", width: 100, align: "left" },
  197. ],
  198. mainId: 'ID',
  199. isPage: true
  200. });
  201. page.search();
  202. },
  203. search: function (param) {
  204. param = param || {};
  205. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  206. }
  207. };
  208. refreshGirdData = function () {
  209. page.search();
  210. };
  211. page.init();
  212. }