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.
 
 
 
 
 
 

265 lines
12 KiB

  1. /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
  2. * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2023-03-06 12:21
  5. * 描 述:心理咨询回复(班级辅导员)
  6. */
  7. var refreshGirdData;
  8. var type = request('type');
  9. var bootstrap = function ($, learun) {
  10. "use strict";
  11. var startTime;
  12. var endTime;
  13. var page = {
  14. init: function () {
  15. page.initGird();
  16. page.bind();
  17. },
  18. bind: function () {
  19. // 时间搜索框
  20. $('#datesearch').lrdate({
  21. dfdata: [
  22. { name: '今天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00') }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
  23. { 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') } },
  24. { 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') } },
  25. { 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') } }
  26. ],
  27. // 月
  28. mShow: false,
  29. premShow: false,
  30. // 季度
  31. jShow: false,
  32. prejShow: false,
  33. // 年
  34. ysShow: false,
  35. yxShow: false,
  36. preyShow: false,
  37. yShow: false,
  38. // 默认
  39. dfvalue: '1',
  40. selectfn: function (begin, end) {
  41. startTime = begin;
  42. endTime = end;
  43. page.search();
  44. }
  45. });
  46. $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
  47. page.search(queryJson);
  48. }, 220, 400);
  49. $('#DeptNo').lrDataSourceSelect({ code: 'CdDeptInfo', value: 'deptno', text: 'deptname' });
  50. $('#MajorNo').lrDataSourceSelect({ code: 'CdMajorInfo', value: 'majorno', text: 'majorname' });
  51. $('#ClassNo').lrDataSourceSelect({ code: 'bjsj', value: 'classno', text: 'classname' });
  52. $('#ReplyUser').lrDataSourceSelect({ code: 'TeacherInfo', value: 'f_account', text: 'f_realname' });
  53. // 刷新
  54. $('#lr_refresh').on('click', function () {
  55. location.reload();
  56. });
  57. // 新增
  58. $('#lr_add').on('click', function () {
  59. learun.layerForm({
  60. id: 'form',
  61. title: '新增',
  62. url: top.$.rootUrl + '/LR_Desktop/PsychologyReplyInfo/Form',
  63. width: 800,
  64. height: 750,
  65. callBack: function (id) {
  66. return top[id].acceptClick(refreshGirdData);
  67. }
  68. });
  69. });
  70. // 查看
  71. $('#lr_view').on('click', function () {
  72. var PsychologyInfoId = $('#gridtable').jfGridValue('PsychologyInfoId');
  73. var url = top.$.rootUrl + '/LR_Desktop/PsychologyReplyInfo/FormView?PsychologyInfoId=' + PsychologyInfoId + '&type=' + type;
  74. if (type == 5)
  75. url = top.$.rootUrl + '/LR_Desktop/PsychologyReplyInfo/FormFiveView?PsychologyInfoId=' + PsychologyInfoId + '&type=' + type;
  76. if (learun.checkrow(PsychologyInfoId)) {
  77. learun.layerForm({
  78. id: 'formview_PsychologyInfo',
  79. title: '查看',
  80. url: url,
  81. width: 800,
  82. height: 750,
  83. btn: null,
  84. callBack: function (id) {
  85. return top[id].acceptClick(refreshGirdData);
  86. }
  87. });
  88. }
  89. });
  90. // 编辑
  91. $('#lr_edit').on('click', function () {
  92. var keyValue = $('#gridtable').jfGridValue('Id');
  93. //主表Id
  94. var PsychologyInfoId = $('#gridtable').jfGridValue('PsychologyInfoId');
  95. var State = $('#gridtable').jfGridValue('State');
  96. if (State == 7) {
  97. learun.alert.warning('该记录已归档!');
  98. return false;
  99. }
  100. if (State != type) {
  101. learun.alert.warning('当前由其他老师审核!');
  102. return false;
  103. }
  104. var url = top.$.rootUrl + '/LR_Desktop/PsychologyReplyInfo/Form?keyValue=' + keyValue + '&type=' + State;
  105. if (type == 5)
  106. url = top.$.rootUrl + '/LR_Desktop/PsychologyReplyInfo/FormFive?keyValue=' + keyValue + '&type=' + State;
  107. if (type == 6)
  108. url = top.$.rootUrl + '/LR_Desktop/PsychologyReplyInfo/FormSix?keyValue=' + keyValue + '&type=' + State;
  109. if (learun.checkrow(PsychologyInfoId)) {
  110. learun.layerForm({
  111. id: 'form',
  112. title: '回复',
  113. url: url ,
  114. width: 800,
  115. height: 700,
  116. callBack: function (id) {
  117. return top[id].acceptClick(refreshGirdData);
  118. }
  119. });
  120. }
  121. });
  122. // 删除
  123. $('#lr_delete').on('click', function () {
  124. var keyValue = $('#gridtable').jfGridValue('Id');
  125. if (learun.checkrow(keyValue)) {
  126. learun.layerConfirm('是否确认删除该项!', function (res) {
  127. if (res) {
  128. learun.deleteForm(top.$.rootUrl + '/LR_Desktop/PsychologyReplyInfo/DeleteForm', { keyValue: keyValue }, function () {
  129. refreshGirdData();
  130. });
  131. }
  132. });
  133. }
  134. });
  135. // 打印
  136. $('#lr_print').on('click', function () {
  137. $('#gridtable').jqprintTable();
  138. });
  139. },
  140. // 初始化列表
  141. initGird: function () {
  142. $('#gridtable').jfGrid({
  143. url: top.$.rootUrl + '/LR_Desktop/PsychologyReplyInfo/GetPageListForReply',
  144. headData: [
  145. {
  146. label: "状态", name: "State", width: 100, align: "left",
  147. formatter: function (cellvalue) {
  148. if (cellvalue == type) {
  149. return "<span class=\"label label-warning\">待回复</span>";
  150. } else if (cellvalue == 7) {
  151. return "<span class=\"label label-success\">已归档</span>";
  152. //return "<span class=\"label label-danger\">未发布</span>";
  153. } else {
  154. return "<span class=\"label label-primary\">其他老师审核</span>";
  155. }
  156. }
  157. },
  158. { label: "咨询内容", name: "Concent", width: 100, align: "left" },
  159. { label: "学号", name: "StuNo", width: 100, align: "left" },
  160. { label: "学生姓名", name: "StuName", width: 100, align: "left" },
  161. { label: "提交日期", name: "SubmitTime", width: 150, align: "left" },
  162. {
  163. label: "系", name: "DeptNo", width: 100, align: "left",
  164. formatterAsync: function (callback, value, row, op, $cell) {
  165. learun.clientdata.getAsync('custmerData', {
  166. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo',
  167. key: value,
  168. keyId: 'deptno',
  169. callback: function (_data) {
  170. callback(_data['deptname']);
  171. }
  172. });
  173. }
  174. },
  175. {
  176. label: "专业", name: "MajorNo", width: 100, align: "left",
  177. formatterAsync: function (callback, value, row, op, $cell) {
  178. learun.clientdata.getAsync('custmerData', {
  179. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo',
  180. key: value,
  181. keyId: 'majorno',
  182. callback: function (_data) {
  183. callback(_data['majorname']);
  184. }
  185. });
  186. }
  187. },
  188. {
  189. label: "班级", name: "ClassNo", width: 100, align: "left",
  190. formatterAsync: function (callback, value, row, op, $cell) {
  191. learun.clientdata.getAsync('custmerData', {
  192. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj',
  193. key: value,
  194. keyId: 'classno',
  195. callback: function (_data) {
  196. callback(_data['classname']);
  197. }
  198. });
  199. }
  200. },
  201. { label: "身份证号", name: "IdentityCardNo", width: 100, align: "left" },
  202. {
  203. label: "是否单亲", name: "IsSingle", width: 100, align: "left",
  204. formatter: function (value, row) {
  205. if (value == true) {
  206. return '是';
  207. }
  208. else if (value == false) {
  209. return '否';
  210. }
  211. }
  212. },
  213. {
  214. label: "最终回复人", name: "ReplyUser", width: 100, align: "left",
  215. formatterAsync: function (callback, value, row, op, $cell) {
  216. learun.clientdata.getAsync('custmerData', {
  217. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'TeacherInfo',
  218. key: value,
  219. keyId: 'f_account',
  220. callback: function (_data) {
  221. callback(_data['f_realname']);
  222. }
  223. });
  224. }
  225. },
  226. { label: "回复内容", name: "ReplyContent", width: 100, align: "left" },
  227. {
  228. label: "回复日期", name: "ReplyTime", width: 150, align: "left",
  229. formatter: function (cellvalue) {
  230. if (cellvalue != '1900-01-01 00:00:00') {
  231. return cellvalue;
  232. }
  233. }
  234. },
  235. ],
  236. mainId: 'Id',
  237. isPage: true,
  238. sidx: 'SubmitTime',
  239. sord: 'ASC'
  240. });
  241. //page.search();
  242. },
  243. search: function (param) {
  244. param = param || {};
  245. param.StartTime = startTime;
  246. param.EndTime = endTime;
  247. if (type == 2) {
  248. param.SqlParameter = " and ClassTutorNo='" + learun.clientdata.get(['userinfo']).account + "'";
  249. }
  250. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param), type: type });
  251. }
  252. };
  253. refreshGirdData = function () {
  254. $('#gridtable').jfGridSet('reload');
  255. };
  256. page.init();
  257. }