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 11 KiB

4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2019-04-23 15:50
  5. * 描 述:问卷管理
  6. */
  7. var refreshGirdData;
  8. var ATId;
  9. var bootstrap = function ($, learun) {
  10. "use strict";
  11. var page = {
  12. init: function () {
  13. page.inittree();
  14. page.initGird();
  15. page.bind();
  16. },
  17. bind: function () {
  18. $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
  19. page.search(queryJson);
  20. }, 220, 400);
  21. // 刷新
  22. $('#lr_refresh').on('click', function () {
  23. location.reload();
  24. });
  25. // 新增
  26. $('#lr_add').on('click', function () {
  27. if (!ATId) {
  28. learun.alert.warning('请选择分类!');
  29. return false;
  30. }
  31. learun.layerForm({
  32. id: 'form',
  33. title: '新增',
  34. url: top.$.rootUrl + '/Ask/Ask_Main/Form?ATId=' + ATId,
  35. width: 780,
  36. height: 560,
  37. callBack: function (id) {
  38. return top[id].acceptClick(refreshGirdData);
  39. }
  40. });
  41. });
  42. // 编辑
  43. $('#lr_edit').on('click', function () {
  44. var keyValue = $('#gridtable').jfGridValue('VID');
  45. if (learun.checkrow(keyValue)) {
  46. var Status = $('#gridtable').jfGridValue('Status');
  47. if (Status === true || Status == 'true') {
  48. learun.alert.warning("当前项目已审核不能修改!");
  49. return;
  50. }
  51. learun.layerForm({
  52. id: 'form',
  53. title: '编辑',
  54. url: top.$.rootUrl + '/Ask/Ask_Main/Form?keyValue=' + keyValue,
  55. width: 780,
  56. height: 560,
  57. callBack: function (id) {
  58. return top[id].acceptClick(refreshGirdData);
  59. }
  60. });
  61. }
  62. });
  63. // 删除
  64. $('#lr_delete').on('click', function () {
  65. var keyValue = $('#gridtable').jfGridValue('VID');
  66. if (learun.checkrow(keyValue)) {
  67. var Status = $('#gridtable').jfGridValue('Status');
  68. if (Status === true || Status == 'true') {
  69. learun.alert.warning("当前项目已审核不能删除!");
  70. return;
  71. }
  72. learun.layerConfirm('是否确认删除该项!', function (res) {
  73. if (res) {
  74. learun.deleteForm(top.$.rootUrl + '/Ask/Ask_Main/DeleteForm', { keyValue: keyValue }, function () {
  75. refreshGirdData();
  76. });
  77. }
  78. });
  79. }
  80. });
  81. // 管理问题
  82. $('#lr_question').on('click', function () {
  83. var keyValue = $('#gridtable').jfGridValue('VID');
  84. if (learun.checkrow(keyValue)) {
  85. var Status = $('#gridtable').jfGridValue('Status');
  86. if (Status === true || Status == 'true') {
  87. learun.alert.warning("当前项目已审核不能修改!");
  88. return;
  89. }
  90. learun.layerForm({
  91. id: 'formquestion',
  92. title: '管理问题',
  93. url: top.$.rootUrl + '/Ask/Ask_Question/Index?VID=' + keyValue,
  94. width: 980,
  95. height: 760,
  96. btn: null
  97. });
  98. }
  99. });
  100. // 结果分析
  101. $('#lr_analysis').on('click', function () {
  102. var keyValue = $('#gridtable').jfGridValue('VID');
  103. if (learun.checkrow(keyValue)) {
  104. learun.layerForm({
  105. id: 'formanalysis',
  106. title: '结果分析',
  107. url: top.$.rootUrl + '/Ask/Ask_Question/AnalysisIndex?VID=' + keyValue,
  108. width: 1000,
  109. height: 760,
  110. btn: null
  111. });
  112. }
  113. });
  114. // 答题情况
  115. $('#lr_answer').on('click', function () {
  116. var keyValue = $('#gridtable').jfGridValue('VID');
  117. if (learun.checkrow(keyValue)) {
  118. learun.layerForm({
  119. id: 'formanswer',
  120. title: '答题情况',
  121. url: top.$.rootUrl + '/Ask/Ask_Main/AnswerIndex?VID=' + keyValue,
  122. width: 980,
  123. height: 760,
  124. btn: null
  125. });
  126. }
  127. });
  128. $('#lr_view').on('click', function () {
  129. var keyValue = $('#gridtable').jfGridValue('VID');
  130. if (learun.checkrow(keyValue)) {
  131. top.learun.frameTab.open({ F_ModuleId: 'paper' + keyValue, F_Icon: 'fa fa-window-maximize', F_FullName: '量表考核答卷', F_UrlAddress: '/Ask/Ask_Main/PaperAdminView?VID=' + keyValue });
  132. }
  133. });
  134. //  审核
  135. $('#lr_submit').on('click', function () {
  136. var keyValue = $('#gridtable').jfGridValue('VID');
  137. if (learun.checkrow(keyValue)) {
  138. var Status = $('#gridtable').jfGridValue('Status');
  139. if (Status === true || Status == 'true') {
  140. learun.alert.warning("当前项目已审核!");
  141. return;
  142. }
  143. learun.layerConfirm('是否确认审核该项!', function (res) {
  144. if (res) {
  145. learun.postForm(top.$.rootUrl + '/Ask/Ask_Main/SubmitForm', { keyValue: keyValue }, function () {
  146. refreshGirdData();
  147. });
  148. }
  149. });
  150. }
  151. });
  152. //  去审核
  153. $('#lr_unsubmit').on('click', function () {
  154. var keyValue = $('#gridtable').jfGridValue('VID');
  155. if (learun.checkrow(keyValue)) {
  156. var Status = $('#gridtable').jfGridValue('Status');
  157. if (Status !== true && Status !== 'true') {
  158. learun.alert.warning("当前项目已去审核!");
  159. return;
  160. }
  161. learun.layerConfirm('是否确认去审核该项!', function (res) {
  162. if (res) {
  163. learun.postForm(top.$.rootUrl + '/Ask/Ask_Main/UnSubmitForm', { keyValue: keyValue }, function () {
  164. refreshGirdData();
  165. });
  166. }
  167. });
  168. }
  169. });
  170. },
  171. inittree: function () {
  172. $('#companyTree').lrtree({
  173. url: top.$.rootUrl + '/Ask/Ask_Type/GetAllTree',
  174. nodeClick: page.treeNodeClick
  175. });
  176. },
  177. treeNodeClick: function (item) {
  178. ATId = item.id;
  179. $('#titleinfo').text(item.text);
  180. page.search();
  181. },
  182. // 初始化列表
  183. initGird: function () {
  184. $('#gridtable').lrAuthorizeJfGrid({
  185. url: top.$.rootUrl + '/Ask/Ask_Main/GetPageList',
  186. headData: [
  187. { label: "问卷编号", name: "VSerial", width: 180, align: "left" },
  188. { label: "标题", name: "VTitle", width: 200, align: "left" },
  189. {
  190. label: "类别", name: "ATId", width: 100, align: "left",
  191. formatterAsync: function (callback, value, row, op, $cell) {
  192. learun.clientdata.getAsync('custmerData', {
  193. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Ask_Type',
  194. key: value,
  195. keyId: 'atid',
  196. callback: function (_data) {
  197. callback(_data['atname']);
  198. }
  199. });
  200. }
  201. },
  202. { label: "开始时间", name: "VStartTime", width: 100, align: "left" },
  203. { label: "结束时间", name: "VStopTime", width: 100, align: "left" },
  204. { label: "考核学年", name: "AcademicYearNo", width: 80, align: "left" },
  205. { label: "考核学期", name: "Semester", width: 80, align: "left" },
  206. {
  207. label: "考核系部", name: "DeptNosName", width: 150, align: "left"
  208. },
  209. {
  210. label: "考核专业", name: "MajorNosName", width: 150, align: "left"
  211. },
  212. {
  213. label: "考核课程", name: "LessonNosName", width: 150, align: "left"
  214. },
  215. {
  216. label: "考核班级", name: "ClassNosName", width: 150, align: "left"
  217. },
  218. { label: "考核年级", name: "GradeNosName", width: 80, align: "left" },
  219. { label: "考核人数", name: "SPVNum", width: 80, align: "left" },
  220. { label: "填写人数", name: "SPNum", width: 80, align: "left" },
  221. { label: "点击热度", name: "SClick", width: 80, align: "left" },
  222. { label: "排序", name: "VOrder", width: 80, align: "left" },
  223. {
  224. label: "是否匿名", name: "VHide", width: 100, align: "left",
  225. formatter: function (cellvalue) {
  226. return cellvalue == true ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>";
  227. }
  228. },
  229. {
  230. label: "审核标志", name: "Status", width: 100, align: "left", formatter: function (cellvalue) {
  231. return cellvalue == true ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>";
  232. }
  233. }
  234. ],
  235. mainId: 'VID',
  236. isPage: true,
  237. sidx: 'VOrder'
  238. });
  239. page.search();
  240. },
  241. search: function (param) {
  242. param = param || {};
  243. param.ATId = ATId;
  244. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  245. }
  246. };
  247. refreshGirdData = function () {
  248. page.search();
  249. };
  250. page.init();
  251. }