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.

Index.js 7.8 KiB

4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2019-08-11 09:51
  5. * 描 述:新生在线咨询
  6. */
  7. var refreshGirdData;
  8. var selectedRow;
  9. var bootstrap = function ($, learun) {
  10. "use strict";
  11. var page = {
  12. init: function () {
  13. page.initGird();
  14. page.bind();
  15. },
  16. bind: function () {
  17. $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
  18. page.search(queryJson);
  19. }, 220, 400);
  20. // 刷新
  21. $('#lr_refresh').on('click', function () {
  22. location.reload();
  23. });
  24. // 新增
  25. $('#lr_add').on('click', function () {
  26. learun.layerForm({
  27. id: 'form',
  28. title: '新增',
  29. url: top.$.rootUrl + '/EducationalAdministration/StuInfoFreshOnlineService/Form',
  30. width: 600,
  31. height: 400,
  32. callBack: function (id) {
  33. return top[id].acceptClick(refreshGirdData);
  34. }
  35. });
  36. });
  37. // 编辑
  38. $('#lr_edit').on('click', function () {
  39. var keyValue = $('#gridtable').jfGridValue('Id');
  40. selectedRow = $('#gridtable').jfGridGet('rowdata');
  41. if (learun.checkrow(keyValue)) {
  42. if (selectedRow.QuestionStatus == 1) {
  43. learun.alert.warning("当前咨询问题已提交,不能编辑!");
  44. return false;
  45. }
  46. learun.layerForm({
  47. id: 'form',
  48. title: '编辑',
  49. url: top.$.rootUrl + '/EducationalAdministration/StuInfoFreshOnlineService/Form?keyValue=' + keyValue,
  50. width: 600,
  51. height: 400,
  52. callBack: function (id) {
  53. return top[id].acceptClick(refreshGirdData);
  54. }
  55. });
  56. }
  57. });
  58. // 删除
  59. $('#lr_delete').on('click', function () {
  60. var keyValue = $('#gridtable').jfGridValue('Id');
  61. selectedRow = $('#gridtable').jfGridGet('rowdata');
  62. if (learun.checkrow(keyValue)) {
  63. if (selectedRow.QuestionStatus == 1) {
  64. learun.alert.warning("当前咨询问题已提交,不能删除!");
  65. return false;
  66. }
  67. learun.layerConfirm('是否确认删除该项!', function (res) {
  68. if (res) {
  69. learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/StuInfoFreshOnlineService/DeleteForm', { keyValue: keyValue }, function () {
  70. refreshGirdData();
  71. });
  72. }
  73. });
  74. }
  75. });
  76. // 查看
  77. $('#lr_view').on('click', function () {
  78. var keyValue = $('#gridtable').jfGridValue('Id');
  79. selectedRow = $('#gridtable').jfGridGet('rowdata');
  80. if (learun.checkrow(keyValue)) {
  81. learun.layerForm({
  82. id: 'form',
  83. title: '查看',
  84. url: top.$.rootUrl + '/EducationalAdministration/StuInfoFreshOnlineService/FormView?keyValue=' + keyValue,
  85. width: 600,
  86. height: 400,
  87. btn: null
  88. });
  89. }
  90. });
  91. //  提交
  92. $('#lr_sumbit').on('click', function () {
  93. var keyValue = $('#gridtable').jfGridValue('Id');
  94. selectedRow = $('#gridtable').jfGridGet('rowdata');
  95. if (learun.checkrow(keyValue)) {
  96. if (selectedRow.QuestionStatus == 1) {
  97. learun.alert.warning("当前咨询问题已提交!");
  98. return false;
  99. }
  100. learun.layerConfirm('是否确认提交该咨询问题!', function (res) {
  101. if (res) {
  102. learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuInfoFreshOnlineService/SubmitQuestion', { keyValue: keyValue }, function () {
  103. refreshGirdData();
  104. });
  105. }
  106. });
  107. }
  108. });
  109. // 回复信息
  110. $('#lr_answer').on('click', function () {
  111. var keyValue = $('#gridtable').jfGridValue('Id');
  112. selectedRow = $('#gridtable').jfGridGet('rowdata');
  113. if (learun.checkrow(keyValue)) {
  114. if (selectedRow.QuestionStatus != 1) {
  115. learun.alert.warning("当前咨询问题未提交,无法查看回复!");
  116. return false;
  117. }
  118. learun.layerForm({
  119. id: 'form',
  120. title: '回复信息',
  121. url: top.$.rootUrl + '/EducationalAdministration/StuInfoFreshOnlineService/AnswerFormView?keyValue=' + keyValue,
  122. width: 600,
  123. height: 400,
  124. btn: null
  125. });
  126. }
  127. });
  128. // 常见咨询问题
  129. $('#lr_questList').on('click', function () {
  130. learun.layerForm({
  131. id: 'IndexList',
  132. title: '常见咨询问题',
  133. url: top.$.rootUrl + '/EducationalAdministration/StuInfoFreshOnlineService/IndexList',
  134. width: 1000,
  135. height: 800,
  136. btn: null
  137. });
  138. });
  139. },
  140. // 初始化列表
  141. initGird: function () {
  142. $('#gridtable').lrAuthorizeJfGrid({
  143. url: top.$.rootUrl + '/EducationalAdministration/StuInfoFreshOnlineService/GetPageList',
  144. headData: [
  145. { label: "咨询编号", name: "QuestionCode", width: 200, align: "left" },
  146. { label: "咨询主题", name: "QuestionTitle", width: 200, align: "left" },
  147. {
  148. label: "提交状态", name: "QuestionStatus", width: 100, align: "left", formatter: function (value) {
  149. return value == 1 ? "<span class=\"label label-success\">已提交</span>" : "<span class=\"label label-warning\">未提交</span>";
  150. }
  151. },
  152. { label: "提交时间", name: "QuestionSubmitTime", width: 130, align: "left" },
  153. {
  154. label: "回复状态", name: "AnswerStatus", width: 100, align: "left", formatter: function (value) {
  155. return value == 1 ? "<span class=\"label label-success\">已回复</span>" : "<span class=\"label label-warning\">未回复</span>";
  156. }
  157. },
  158. ],
  159. mainId: 'Id',
  160. isPage: true,
  161. sidx: 'QuestionCreateTime',
  162. sord: 'desc'
  163. });
  164. page.search();
  165. },
  166. search: function (param) {
  167. param = param || {};
  168. param.QuestionUserId = learun.clientdata.get(['userinfo']).userId;
  169. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  170. }
  171. };
  172. refreshGirdData = function () {
  173. page.search();
  174. };
  175. page.init();
  176. }