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.
 
 
 
 
 
 

155 lines
6.3 KiB

  1. /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
  2. * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2022-05-09 11:23
  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/Sys_PsychologicalCounse/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. if (learun.checkrow(keyValue)) {
  41. learun.layerForm({
  42. id: 'form',
  43. title: '编辑',
  44. url: top.$.rootUrl + '/EducationalAdministration/Sys_PsychologicalCounse/Form?keyValue=' + keyValue,
  45. width: 600,
  46. height: 400,
  47. callBack: function (id) {
  48. return top[id].acceptClick(refreshGirdData);
  49. }
  50. });
  51. }
  52. });
  53. // 删除
  54. $('#lr_delete').on('click', function () {
  55. var keyValue = $('#gridtable').jfGridValue('Id');
  56. if (learun.checkrow(keyValue)) {
  57. learun.layerConfirm('是否确认删除该项!', function (res) {
  58. if (res) {
  59. learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/Sys_PsychologicalCounse/DeleteForm', { keyValue: keyValue }, function () {
  60. refreshGirdData();
  61. });
  62. }
  63. });
  64. }
  65. });
  66. //查看
  67. $('#lr_view').on('click', function () {
  68. var keyValue = $('#gridtable').jfGridValue('Id');
  69. if (learun.checkrow(keyValue)) {
  70. learun.layerForm({
  71. id: 'formviewreceive',
  72. title: '查看',
  73. url: top.$.rootUrl + '/EducationalAdministration/Sys_PsychologicalCounse/FormViewReceive?keyValue=' + keyValue,
  74. width: 600,
  75. height: 400,
  76. btn: null
  77. });
  78. }
  79. });
  80. // 回复
  81. $('#lr_receive').on('click', function () {
  82. var keyValue = $('#gridtable').jfGridValue('Id');
  83. selectedRow = $('#gridtable').jfGridGet('rowdata');
  84. if (learun.checkrow(keyValue)) {
  85. if (selectedRow.ReplyFlag !== false) {
  86. learun.alert.warning("当前咨询已回复!");
  87. return false;
  88. }
  89. learun.layerForm({
  90. id: 'formreceive',
  91. title: '回复',
  92. url: top.$.rootUrl + '/EducationalAdministration/Sys_PsychologicalCounse/FormReceive?keyValue=' + keyValue,
  93. width: 600,
  94. height: 400,
  95. callBack: function (id) {
  96. return top[id].acceptClick(refreshGirdData);
  97. }
  98. });
  99. }
  100. });
  101. },
  102. // 初始化列表
  103. initGird: function () {
  104. $('#gridtable').jfGrid({
  105. url: top.$.rootUrl + '/EducationalAdministration/Sys_PsychologicalCounse/GetPageList',
  106. headData: [
  107. { label: "咨询编号", name: "Code", width: 150, align: "left" },
  108. { label: "咨询内容", name: "Concent", width: 250, align: "left" },
  109. {
  110. label: "回复状态", name: "ReplyFlag", width: 100, align: "left",
  111. formatter: function (cellvalue, row) {
  112. if (cellvalue === true) {
  113. return '<span class=\"label label-success\">已回复</span>';
  114. } else {
  115. return '<span class=\"label label-default\" >未回复</span>';
  116. }
  117. }
  118. },
  119. { label: "回复时间", name: "ReplyTime", width: 150, align: "left" },
  120. {
  121. label: "回复人", name: "ReplyUserId", width: 150, align: "left",
  122. formatterAsync: function (callback, value, row, op, $cell) {
  123. learun.clientdata.getAsync('custmerData', {
  124. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'BaseUser',
  125. key: value,
  126. keyId: 'f_userid',
  127. callback: function (_data) {
  128. callback(_data['f_realname']);
  129. }
  130. });
  131. }
  132. },
  133. ],
  134. mainId: 'Id',
  135. isPage: true
  136. });
  137. page.search();
  138. },
  139. search: function (param) {
  140. param = param || {};
  141. param.SqlParameter = " and SendFlag=1 ";
  142. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  143. }
  144. };
  145. refreshGirdData = function () {
  146. $('#gridtable').jfGridSet('reload');
  147. };
  148. page.init();
  149. }