Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 
 
 

306 linhas
14 KiB

  1. /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
  2. * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2022-11-23 10:48
  5. * 描 述:我要建议
  6. */
  7. var refreshGirdData;
  8. var bootstrap = function ($, learun) {
  9. "use strict";
  10. var page = {
  11. init: function () {
  12. page.initGird();
  13. page.bind();
  14. },
  15. bind: function () {
  16. $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
  17. page.search(queryJson);
  18. }, 280, 400);
  19. $('#Status').lrselect({
  20. data: [{ text: "未受理", value: "0" }, { text: "受理中", value: "1" }, { text: "已受理", value: "2" }],
  21. text: "text",
  22. value: "value"
  23. })
  24. $('#QuestionerIdentity').lrselect({
  25. width: '150px',
  26. placeholder: "请选择提问者身份",
  27. allowSearch: true,
  28. url: top.$.rootUrl + '/EducationalAdministration/SunshineEducation/GetQuestionerIdentity?ProblemType=' + "我要建议",
  29. value: 'ID',
  30. text: 'QuestionerIdentity'
  31. });
  32. //$('#MatterType').lrselect({
  33. // width: '150px',
  34. // placeholder: "请选择事项类别",
  35. // allowSearch: true,
  36. // url: top.$.rootUrl + '/EducationalAdministration/SunshineEducation/GetMatterType',
  37. // value: 'ID',
  38. // text: 'MatterType'
  39. //});
  40. //$('#MatterTypeContent').lrselect({
  41. // width: '150px',
  42. // placeholder: "请选择类别分类",
  43. // allowSearch: true,
  44. // url: top.$.rootUrl + '/EducationalAdministration/SunshineEducation/GetMatterTypeContent',
  45. // value: 'ID',
  46. // text: 'MatterTypeContent'
  47. //});
  48. $('#AcceptanceUnit').lrDepartmentSelect();
  49. // 刷新
  50. $('#lr_refresh').on('click', function () {
  51. location.reload();
  52. });
  53. // 新增
  54. $('#lr_add').on('click', function () {
  55. learun.layerForm({
  56. id: 'form',
  57. title: '新增',
  58. url: top.$.rootUrl + '/EducationalAdministration/SunshineEducation/Form',
  59. width: 800,
  60. height: 600,
  61. callBack: function (id) {
  62. return top[id].acceptClick(refreshGirdData);
  63. }
  64. });
  65. });
  66. // 编辑
  67. $('#lr_edit').on('click', function () {
  68. var keyValue = $('#gridtable').jfGridValue('ID');
  69. if (learun.checkrow(keyValue)) {
  70. var Status = $('#gridtable').jfGridValue('Status');
  71. if (Status != 0) {
  72. learun.alert.warning("当前项已受理或受理中不可编辑!");
  73. return;
  74. }
  75. learun.layerForm({
  76. id: 'form',
  77. title: '编辑',
  78. url: top.$.rootUrl + '/EducationalAdministration/SunshineEducation/Form?keyValue=' + keyValue,
  79. width: 800,
  80. height: 400,
  81. callBack: function (id) {
  82. return top[id].acceptClick(refreshGirdData);
  83. }
  84. });
  85. }
  86. });
  87. // 删除
  88. $('#lr_delete').on('click', function () {
  89. var keyValue = $('#gridtable').jfGridValue('ID');
  90. if (learun.checkrow(keyValue)) {
  91. var Status = $('#gridtable').jfGridValue('Status');
  92. if (Status != 0) {
  93. learun.alert.warning("当前项已受理或受理中不可删除!");
  94. return;
  95. }
  96. learun.layerConfirm('是否确认删除该项!', function (res) {
  97. if (res) {
  98. learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/SunshineEducation/DeleteForm', { keyValue: keyValue }, function () {
  99. refreshGirdData();
  100. });
  101. }
  102. });
  103. }
  104. });
  105. //受理标识
  106. $('#lr_reply').on('click', function () {
  107. var keyValue = $('#gridtable').jfGridValue('ID');
  108. if (learun.checkrow(keyValue)) {
  109. var Status = $('#gridtable').jfGridValue('Status');
  110. if (Status != 0) {
  111. learun.alert.warning("当前项已受理完成!");
  112. return;
  113. }
  114. learun.layerConfirm('是否确认受理该项?', function (res) {
  115. if (res) {
  116. learun.postForm(top.$.rootUrl + '/EducationalAdministration/SunshineEducation/ReplyForm', { keyValue: keyValue }, function () {
  117. refreshGirdData();
  118. });
  119. }
  120. });
  121. }
  122. });
  123. //指派部门及人
  124. $('#lr_auditor').on('click', function () {
  125. var keyValue = $('#gridtable').jfGridValue('ID');
  126. if (learun.checkrow(keyValue)) {
  127. var Status = $('#gridtable').jfGridValue('Status');
  128. if (Status == 0) {
  129. learun.alert.warning("当前项不可回复!");
  130. return;
  131. }
  132. learun.layerForm({
  133. id: 'formReply',
  134. title: '回复',
  135. url: top.$.rootUrl + '/EducationalAdministration/SunshineEducation/UserForm?keyValue=' + keyValue,
  136. width: 400,
  137. height: 300,
  138. callBack: function (id) {
  139. return top[id].acceptClick(refreshGirdData);
  140. }
  141. });
  142. refreshGirdData();
  143. }
  144. });
  145. //回复
  146. $('#lr_acceptance').on('click', function () {
  147. var keyValue = $('#gridtable').jfGridValue('ID');
  148. if (learun.checkrow(keyValue)) {
  149. var Status = $('#gridtable').jfGridValue('Status');
  150. console.log(Status)
  151. if (Status == 0) {
  152. learun.alert.warning("当前项不可回复!");
  153. return;
  154. }
  155. learun.layerForm({
  156. id: 'formReply',
  157. title: '回复',
  158. url: top.$.rootUrl + '/EducationalAdministration/SunshineEducation/FormReply?keyValue=' + keyValue,
  159. width: 800,
  160. height: 900,
  161. callBack: function (id) {
  162. return top[id].acceptClick(refreshGirdData);
  163. }
  164. });
  165. refreshGirdData();
  166. }
  167. });
  168. },
  169. initGird: function () {
  170. $('#gridtable').lrAuthorizeJfGrid({
  171. url: top.$.rootUrl + '/EducationalAdministration/SunshineEducation/GetPageList',
  172. headData: [
  173. { label: '问题类型', name: 'ProblemType', width: 100, align: "left" },
  174. { label: '提问者身份', name: 'QuestionerIdentity', width: 100, align: "left" },
  175. //{ label: '事项类型', name: 'MatterType', width: 100, align: "left" },
  176. //{ label: '事项类别内容', name: 'MatterTypeContent', width: 150, align: "left" },
  177. { label: '标题', name: 'Title', width: 200, align: "left" },
  178. //{ label: '信件内容', name: 'Contents', width: 300, align: "left" },
  179. { label: '姓名', name: 'Name', width: 100, align: "left" },
  180. { label: '电话号码', name: 'Phone', width: 100, align: "left" },
  181. { label: 'EMail', name: 'EMail', width: 120, align: "left" },
  182. { label: '地址', name: 'Address', width: 200, align: "left" },
  183. {
  184. label: "附件", name: "Path", width: 500, align: "center",
  185. formatterAsync: function (callback, value, row, op, $cell) {
  186. $.ajax({
  187. url: '/LR_SystemModule/Annexes/GetAnnexesFileList',
  188. data: { folderId: value },
  189. type: 'GET',
  190. dataType: "json",
  191. async: false,
  192. cache: false,
  193. success: function (res) {
  194. var bb = '';
  195. //$.each(res.data, function (i, item) {
  196. // bb += '<span onclick="downLoad(\'' +
  197. // item.F_Id +
  198. // '\')" style="color:blue">' +
  199. // item.F_FileName.substring(0, item.F_FileName.indexOf(".")) +
  200. // '</span>,&nbsp;&nbsp;&nbsp;';
  201. //})
  202. $.each(res.data, function (i, item) {
  203. bb += '<span onclick="downLoad(\'' +
  204. item.F_Id +
  205. '\')" style="color:blue">' +
  206. item.F_FileName.substring(0, item.F_FileName.indexOf(".")) +
  207. '</span>,&nbsp;&nbsp;&nbsp;';
  208. })
  209. callback(bb);
  210. }
  211. });
  212. }
  213. },
  214. {
  215. label: '提交时间', name: 'Createdate', width: 140, align: "left",
  216. formatter: function (cellvalue) {
  217. return learun.formatDate(cellvalue, 'yyyy-MM-dd hh:mm:ss');
  218. },
  219. },
  220. {
  221. label: '受理状态', name: 'Status', width: 80, align: "left",
  222. formatter: function (cellvalue) {
  223. if (cellvalue == '0') {
  224. return '未受理';
  225. } else if (cellvalue == '1') {
  226. return '受理中';
  227. } else if (cellvalue == '2') {
  228. return '已受理';
  229. }
  230. },
  231. },
  232. {
  233. label: '受理单位', name: 'AcceptanceUnit', width: 200, align: "left",
  234. formatterAsync: function (callback, value, row, op, $cell) {
  235. learun.clientdata.getAsync('custmerData', {
  236. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'classdata',
  237. key: value,
  238. keyId: 'id',
  239. callback: function (_data) {
  240. callback(_data['name']);
  241. }
  242. });
  243. }
  244. },
  245. {
  246. label: '受理时间', name: 'AcceptanceTime', width: 140, align: "left",
  247. formatter: function (cellvalue) {
  248. return learun.formatDate(cellvalue, 'yyyy-MM-dd hh:mm:ss');
  249. },
  250. },
  251. { label: '受理单号', name: 'AcceptanceCode', width: 140, align: "left" },
  252. {
  253. label: '回复用户', name: 'AcceptanceId', width: 200, align: "left",
  254. formatterAsync: function (callback, value, row, op, $cell) {
  255. learun.clientdata.getAsync('user', {
  256. key: value,
  257. callback: function (_data) {
  258. callback(_data.name);
  259. }
  260. });
  261. }
  262. },
  263. { label: '评论意见', name: 'CriticalReview', width: 200, align: "left" },
  264. {
  265. label: '评论打分', name: 'RatingReview', width: 100, align: "left",
  266. formatter: function (cellvalue) {
  267. if (cellvalue == '0') {
  268. return '非常满意';
  269. } else if (cellvalue == '1') {
  270. return '满意';
  271. } else if (cellvalue == '2') {
  272. return '一般';
  273. } else if (cellvalue == '3') {
  274. return '不满意';
  275. }
  276. },
  277. },
  278. { label: '回复内容', name: 'Responses', width: 200, align: "left" },
  279. { label: '点击次数', name: 'Clicks', width: 200, align: "left" },
  280. ],
  281. mainId: 'ID',
  282. sidx: 'Createdate desc',
  283. isPage: true
  284. });
  285. page.search();
  286. },
  287. search: function (param) {
  288. param = param || {};
  289. param.SqlParam = " and ProblemType ='我要建议'";
  290. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  291. }
  292. };
  293. refreshGirdData = function () {
  294. $('#gridtable').jfGridSet('reload');
  295. };
  296. page.init();
  297. }
  298. function downLoad(fileId, fileTwo) {
  299. console.log(222);
  300. if (fileTwo) {
  301. top.learun.postFormSilence(top.$.rootUrl + '/PersonnelManagement/MP_QualityObjectives/AddRecord', { fileId: fileTwo }, function () {
  302. });
  303. }
  304. top.learun.download({ url: top.$.rootUrl + '/LR_SystemModule/Annexes/DownAnnexesFile', param: { fileId: fileId, __RequestVerificationToken: $.lrToken }, method: 'POST' });
  305. }