ComplaintDeatil.module.js 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. var t;
  2. function Load() {
  3. t = mui.showLoading("加载中...", "div");
  4. ///获取详情信息
  5. $.post("/Complaint/GetComplaintDetail/" + id, {}, function (data) {
  6. $.each(data, function (idx, json) {
  7. document.getElementById("Name").innerHTML = json.用户姓名;
  8. $("#Time").html(json.登记时间);
  9. $("#Departments").html(json.部门名);
  10. $("#ComplaintType").html(json.显示名);
  11. $("#Events").html(json.投诉事件);
  12. $("#Elaborate").html(json.投诉描述);
  13. $("#Current").html(json.描述);
  14. var Status = "";
  15. switch (json.状态) {
  16. case 0:
  17. Status = "未处理";
  18. break;
  19. case 1:
  20. Status = "处理中";
  21. break;
  22. case 2:
  23. Status = "已处理";
  24. break;
  25. }
  26. $("#status").html(Status);
  27. });
  28. });
  29. ///获取图片
  30. $.post("/ComplaintManage/GetComplaintFileFromFTP/" + id, {}, function (data) {
  31. $.each(data, function (idx, json) {
  32. $("#fileList").append("<li class='mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3' style='padding-left: 3px;'><img data-preview-src='' data-preview-group='1' src='" + json.base64ToImage + "' style='width:100px;height:100px'></li>")
  33. });
  34. mui.hideLoading(t);
  35. });
  36. ///获取处理流程
  37. $.post("/ComplaintManage/GetDealProcess/" + id, {}, function (data) {
  38. $("#mitem1").append("<section id='cd-timeline' class='cd-container'></section>")
  39. $.each(data, function (idx, json) {
  40. var det = "暂无描述";
  41. if (json.描述 != null) {
  42. det = json.描述;
  43. }
  44. $("#cd-timeline").append("<div class='cd-timeline-block'><div class='cd-timeline-img cd-picture'><img src='/Content/Scripts/plugins/mui/fonts/cd-icon-picture.svg' alt='Picture' /></div><div class='cd-timeline-content'><h2 id='ProcessStatus'>" + json.变更状态 + "</h2><p id='ProcessDescribe'>" + det + "</p><p id='ProcessPerson'>" + json.职务 + "-" + json.记录人 + "</p><span id='ProcessTime' class='cd-date'>" + json.记录时间 + "</span></div></div>");
  45. });
  46. });
  47. GetCommunicate();
  48. }
  49. ////获取过程沟通
  50. function GetCommunicate() {
  51. $("#MyCommunicate").empty();
  52. $.post("/ComplaintManage/GetCommunicate/" + id, {}, function (data) {
  53. if (data.length == 0) {
  54. $("#MyCommunicate").append("<h5 style='display:flex;flex-direction:column;justify-content:center;align-items:center;height:100px;;font-size:20px '>暂无沟通内容</h5>");
  55. return;
  56. }
  57. $.each(data, function (idx, json) {
  58. $("#MyCommunicate").append("<div class='mui-card'><div class='mui-card-header mui-card-media' style='height:100px ;'><img src='/Content/Images/Account/wtx.jpg' style='border-radius: 80px; height: 50px; width: 50px;'><p style='float: right;' >" + json.沟通时间 + "</p><div class='mui-media-body' style='margin-left: 60px'><h4 id=''>" + json.沟通人 + "</h4><h5 id='' style='margin-top:10px'>" + json.沟通内容 + "</h5><h5 id='' style='float:right;'>" + json.沟通人职务 + "</h5></div></div></div>")
  59. });
  60. })
  61. }
  62. ///撤销投诉
  63. function DeleteComplaint() {
  64. var btnArray = ['否', '是'];
  65. mui.confirm('是否确认撤销投诉?', '提示', btnArray, function (e) {
  66. if (e.index == 1) {
  67. $.post("/Complaint/DeleteComplaint/" + id, {}, function (data) {
  68. if (data.code == 200) {
  69. mui.alert("您所提交的投诉已撤销!", "撤销成功", "确定", function () { window.location.href = "/Complaint/QueryComplaint"; }, 'div');
  70. } else {
  71. mui.alert("您所提交的投诉正在处理中!", "撤销失败", "确定", function () { return; }, 'div');
  72. }
  73. })
  74. } else {
  75. }
  76. })
  77. }
  78. ///提交过程沟通
  79. function SubmitCmt() {
  80. var Content = $("#textarea").val();
  81. if (Content == "" || Content == null) {
  82. mui.toast('请输入内容', { duration: 'long', type: 'div' });
  83. return;
  84. }
  85. var url = "/ComplaintManage/SubmitCmt/" + id + "?Content=" + Content;
  86. $.post(url, {}, function (data) {
  87. if (data.code == 200) {
  88. GetCommunicate();
  89. } else {
  90. mui.toast('提交错误!请查看日志!', { duration: 'long', type: 'div' });
  91. }
  92. })
  93. }