No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 
 
 
 

253 líneas
12 KiB

  1. /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
  2. * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2023-03-06 12:18
  5. * 描 述:心里预约功能
  6. */
  7. var selectedRow;
  8. var refreshGirdData;
  9. var bootstrap = function ($, learun) {
  10. "use strict";
  11. var logbegin = '';
  12. var logend = '';
  13. var page = {
  14. init: function () {
  15. page.initGird();
  16. page.bind();
  17. },
  18. bind: function () {
  19. $('#datesearch').lrdate({
  20. dfdata: [
  21. { name: '今天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00') }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
  22. { name: '近7天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'd', -6) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
  23. { name: '近1个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -1) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
  24. { name: '近3个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -3) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
  25. ],
  26. // 月
  27. mShow: false,
  28. premShow: false,
  29. // 季度
  30. jShow: false,
  31. prejShow: false,
  32. // 年
  33. ysShow: false,
  34. yxShow: false,
  35. preyShow: false,
  36. yShow: false,
  37. // 默认
  38. selectfn: function (begin, end) {
  39. logbegin = begin;
  40. logend = end;
  41. page.search();
  42. }
  43. });
  44. // 刷新
  45. $('#lr_refresh').on('click', function () {
  46. location.reload();
  47. });
  48. // 查看
  49. $('#lr_view').on('click', function () {
  50. var keyValue = $('#gridtable').jfGridValue('Id');
  51. if (learun.checkrow(keyValue)) {
  52. learun.layerForm({
  53. id: 'formview',
  54. title: '查看',
  55. url: top.$.rootUrl + '/EducationalAdministration/PsychologyInfo/FormView?keyValue=' + keyValue,
  56. width: 670,
  57. height: 550,
  58. btn: null,
  59. callBack: function (id) {
  60. return top[id].acceptClick(refreshGirdData);
  61. }
  62. });
  63. }
  64. });
  65. // 新增
  66. $('#lr_add').on('click', function () {
  67. selectedRow = null;
  68. learun.layerForm({
  69. id: 'form',
  70. title: '新增',
  71. url: top.$.rootUrl + '/EducationalAdministration/PsychologyInfo/Form',
  72. width: 700,
  73. height: 400,
  74. callBack: function (id) {
  75. return top[id].acceptClick(refreshGirdData);
  76. }
  77. });
  78. });
  79. // 编辑
  80. $('#lr_edit').on('click', function () {
  81. var keyValue = $('#gridtable').jfGridValue('Id');
  82. selectedRow = $('#gridtable').jfGridGet('rowdata');
  83. if (learun.checkrow(keyValue)) {
  84. var State = $('#gridtable').jfGridValue('State')
  85. if (State != 0) {
  86. learun.alert.warning("当前项已提交不可编辑");
  87. return false;
  88. }
  89. learun.layerForm({
  90. id: 'form',
  91. title: '编辑',
  92. url: top.$.rootUrl + '/EducationalAdministration/PsychologyInfo/Form?keyValue=' + keyValue,
  93. width: 700,
  94. height: 400,
  95. callBack: function (id) {
  96. return top[id].acceptClick(refreshGirdData);
  97. }
  98. });
  99. }
  100. });
  101. // 删除
  102. $('#lr_delete').on('click', function () {
  103. var keyValue = $('#gridtable').jfGridValue('Id');
  104. if (learun.checkrow(keyValue)) {
  105. var State = $('#gridtable').jfGridValue('State')
  106. if (State != 0) {
  107. learun.alert.warning("当前项已提交不可删除");
  108. return false;
  109. }
  110. learun.layerConfirm('是否确认删除该项!', function (res) {
  111. if (res) {
  112. learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/PsychologyInfo/DeleteForm', { keyValue: keyValue }, function () {
  113. refreshGirdData();
  114. });
  115. }
  116. });
  117. }
  118. });
  119. // 提交
  120. $('#lr_submit').on('click', function () {
  121. var keyValue = $('#gridtable').jfGridValue('Id');
  122. if (learun.checkrow(keyValue)) {
  123. var State = $('#gridtable').jfGridValue('State')
  124. if (State != 0) {
  125. learun.alert.warning("当前项已提交不可二次提交");
  126. return false;
  127. }
  128. learun.layerConfirm('是否确认提交该项!', function (res) {
  129. if (res) {
  130. learun.postForm(top.$.rootUrl + '/EducationalAdministration/PsychologyInfo/SubmitForm', { keyValue: keyValue }, function () {
  131. refreshGirdData();
  132. });
  133. }
  134. });
  135. }
  136. });
  137. },
  138. initGird: function () {
  139. $('#gridtable').lrAuthorizeJfGrid({
  140. url: top.$.rootUrl + '/EducationalAdministration/PsychologyInfo/GetPageList',
  141. headData: [
  142. { label: '学生学号', name: 'StuNo', width: 120, align: "left" },
  143. { label: '咨询内容', name: 'Concent', width: 300, align: "left" },
  144. //{
  145. // label: '附件', name: 'Url', width: 300, align: "left",
  146. // formatterAsync: function (callback, value, row, op, $cell) {
  147. // $.ajax({
  148. // url: '/LR_SystemModule/Annexes/GetAnnexesFileList',
  149. // data: { folderId: value },
  150. // type: 'GET',
  151. // dataType: "json",
  152. // async: false,
  153. // cache: false,
  154. // success: function (res) {
  155. // var bb = '';
  156. // //$.each(res.data, function (i, item) {
  157. // // bb += item.F_FileName.substring(0, item.F_FileName.indexOf(".")) + ','
  158. // //})
  159. // //bb
  160. // $.each(res.data, function (i, item) {
  161. // bb += '<span onclick="downLoad(\'' +
  162. // item.F_Id +
  163. // '\')" style="color:blue">' +
  164. // item.F_FileName.substring(0, item.F_FileName.indexOf(".")) +
  165. // '</span>,&nbsp;&nbsp;&nbsp;';
  166. // })
  167. // callback(bb);
  168. // }
  169. // });
  170. // }
  171. //},
  172. {
  173. label: '提交日期', name: 'CreateTime', width: 130, align: "left",
  174. formatter: function (cellvalue) {
  175. return learun.formatDate(cellvalue, 'yyyy-MM-dd hh:mm:ss');
  176. }
  177. },
  178. {
  179. label: '回复教师', name: 'F_RealName', width: 100, align: "left",
  180. },
  181. { label: '回复内容', name: 'ReplyContent', width: 300, align: "left" },
  182. {
  183. label: '回复时间', name: 'ReplyTime', width: 130, align: "left",
  184. formatter: function (cellvalue) {
  185. return learun.formatDate(cellvalue, 'yyyy-MM-dd hh:mm:ss');
  186. }
  187. },
  188. //{
  189. // label: '回复附件', name: 'Urls', width: 200, align: "left",
  190. // formatterAsync: function (callback, value, row, op, $cell) {
  191. // $.ajax({
  192. // url: '/LR_SystemModule/Annexes/GetAnnexesFileList',
  193. // data: { folderId: value },
  194. // type: 'GET',
  195. // dataType: "json",
  196. // async: false,
  197. // cache: false,
  198. // success: function (res) {
  199. // var bb = '';
  200. // $.each(res.data, function (i, item) {
  201. // bb += '<span onclick="downLoad(\'' +
  202. // item.F_Id +
  203. // '\')" style="color:blue">' +
  204. // item.F_FileName.substring(0, item.F_FileName.indexOf(".")) +
  205. // '</span>,&nbsp;&nbsp;&nbsp;';
  206. // })
  207. // callback(bb);
  208. // }
  209. // });
  210. // }
  211. //},
  212. {
  213. label: '状态', name: 'State', width: 80, align: "left",
  214. formatter: function (cellvalue, row) {
  215. if (cellvalue == 0) {
  216. return "<span class=\"label label-primary\">草稿</span>";
  217. } else if (cellvalue == 7) {
  218. return "<span class=\"label label-success\">已回复</span>";
  219. } else {
  220. return "<span class=\"label label-warning\">待回复</span>";
  221. }
  222. }
  223. },
  224. ],
  225. mainId: 'Id',
  226. isPage: true,
  227. sidx: 'State asc,CreateTime desc',
  228. });
  229. page.search();
  230. },
  231. search: function (param) {
  232. param = param || {};
  233. param.StartTime = logbegin;
  234. param.EndTime = logend;
  235. param.StuNo = learun.clientdata.get(['userinfo']).account;
  236. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  237. }
  238. };
  239. refreshGirdData = function () {
  240. $('#gridtable').jfGridSet('reload');
  241. };
  242. page.init();
  243. }
  244. function downLoad(fileId, fileTwo) {
  245. if (fileTwo) {
  246. top.learun.postFormSilence(top.$.rootUrl + '/PersonnelManagement/MP_QualityObjectives/AddRecord', { fileId: fileTwo }, function () {
  247. });
  248. }
  249. top.learun.download({ url: top.$.rootUrl + '/LR_SystemModule/Annexes/DownAnnexesFile', param: { fileId: fileId, __RequestVerificationToken: $.lrToken }, method: 'POST' });
  250. }