Ei kuvausta

orderDetail.js 4.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. //回访信息
  2. function detialVisit(result) {
  3. var html= '';
  4. var html1 = '';
  5. var html2 = '';
  6. var visitRole = ['GLY','ZXLD']
  7. if(result.data.length < 0) {
  8. html = '<tr>' +
  9. '<td class="text-center">' + n.UserName + '</td>' +
  10. '</tr>';
  11. } else {
  12. $(".HGXX").empty();
  13. $(result.data).each(function(i, n) {
  14. var a;
  15. var b;
  16. if(String(n.F_IsSatisfie) === "0") {
  17. a = "不满意";
  18. } else if(String(n.F_IsSatisfie) == "1") {
  19. a = "满意";
  20. }
  21. if(n.F_Type == 0) {
  22. b = "电话";
  23. } else if(n.F_Type == 1) {
  24. b = "微信";
  25. } else if(n.F_Type == 2) {
  26. b = "智能回访";
  27. } else if(n.F_Type == 3) {
  28. b = "网站";
  29. } else if(n.F_Type == 4) {
  30. b = "微博";
  31. } else if(n.F_Type == 5) {
  32. b = "信箱";
  33. }
  34. html+= '<tr>' +
  35. '<td class="text-center">' + (i + 1) +
  36. '</td>' +
  37. '<td class="text-center">' + n.F_VisitUser +
  38. '</td>' +
  39. '<td class="text-center">' + b + '</td>' +
  40. '<td class="text-center">' + n.F_Result +
  41. '</td>' +
  42. '<td class="text-center">' + a + '</td>' +
  43. '<td class="text-center">' + n.F_CreateTime +
  44. '</td>' +
  45. '<td class="text-center phoneTitle3"><a href="#">' + encryptPhoneNumber +
  46. '</a></td>'
  47. html += '<td class="text-center">'
  48. var audioFile = '';
  49. console.log(n.File)
  50. if(n.File && n.File.length>0) {
  51. audioFile += '<div class="imgs">' +
  52. '<img src="../img/vice.png" alt="" onclick="recordingFun(this)" item="' +
  53. n.File[0].F_FileUrl + '" />' +
  54. '</div>';
  55. } else if(n.FilePath) {
  56. audioFile += '<div class="imgs">' +
  57. '<img src="../img/vice.png" alt="" onclick="recordingFun(this)" item="' +
  58. n.FilePath + '" />' +
  59. '</div>';
  60. }
  61. html += audioFile
  62. html1 = html
  63. html1 += '</tr>'
  64. html2 = html
  65. if (visitRole.indexOf(roleCode)!== -1) {
  66. $(".visitLimit").show()
  67. var itemHf = JSON.stringify(n).replace(/"/g, "'")
  68. html2 += '</td>'
  69. html2 += '<td class="text-center">' +
  70. '<a class="xg" onclick="visitHandle('+itemHf+')" title="修改">修改</a>' +
  71. "<a class='xg' onclick='deleteVisit(\""+n.F_Id+"\")' title='删除'>删除</a>" +
  72. '</td>';
  73. }
  74. html2 += '</tr>'
  75. })
  76. $(html2).appendTo($(".HGXX"));
  77. $(html1).appendTo($(".HGXX1"));
  78. $(".phoneTitle3").click(function() {
  79. var isSecret
  80. if($('.MJ').text() == "普通") {
  81. isSecret = 1
  82. } else {
  83. isSecret = 2
  84. }
  85. layer.open({
  86. type: 2,
  87. content: "./callerNumber.html?phoneNumber=" + encodeURIComponent(phoneNumber) + "&wid=" + wid + "&isSecret=" + isSecret + "&type=1", //iframe的url,no代表不显示滚动条
  88. title: "回访号码",
  89. area: ["40%", "25%"], //宽高
  90. });
  91. })
  92. }
  93. }
  94. //var title =item?'编辑':'添加'
  95. //var contentUrl=item?"./addOrEditUser.html?item="+encodeURIComponent(JSON.stringify(item)):"./addOrEditUser.html"
  96. function visitHandle(item) {
  97. var title =item?'编辑回访记录':'添加回访记录'
  98. var contentUrl
  99. var visitUrl = "./cpns/detailEditVisit.html?wid="+wid
  100. if (item) {
  101. contentUrl = visitUrl+"&item="+encodeURIComponent(JSON.stringify(item))
  102. } else {
  103. contentUrl = visitUrl
  104. }
  105. layer.open({
  106. type: 2,
  107. content: contentUrl,
  108. title: title,
  109. area: ["80%", "60%"], //宽高
  110. });
  111. }
  112. function deleteVisit (id) {
  113. layer.confirm(
  114. "确定删除?", {
  115. btn: ["是", "否"], //按钮
  116. },
  117. function () {
  118. $.post(
  119. huayi.config.callcenter_url +
  120. "WorkOrder/DeleteVisitInfoByAdmin", {
  121. id: id,
  122. token: $.cookie("token"),
  123. },
  124. function (result) {
  125. result = JSON.parse(result);
  126. if (result.state.toLowerCase() == "success") {
  127. layer.msg("删除成功");
  128. load('6')
  129. }
  130. }
  131. );
  132. }
  133. );
  134. // layer.confirm(
  135. // "确定删除?", {
  136. // btn: ["是", "否"], //按钮
  137. // },
  138. // function () {
  139. // console.log('删除')
  140. // $.ajax({
  141. // type:'post',
  142. // dataType: 'json',
  143. // url:huayi.config.callcenter_url + "DeleteVisitInfoByAdmin",
  144. // async:true,
  145. // success:function(data){
  146. // if(data.state == "success") {
  147. // layer.msg("删除成功");
  148. // load('6')
  149. // }
  150. // }
  151. // });
  152. // }
  153. // );
  154. }
  155. function recordingFun(htmlstr) {
  156. var path = $(htmlstr).attr("item");
  157. layer.open({
  158. type: 2,
  159. content: "../CommonHtml/recording.html?path=" + path, //iframe的url,no代表不显示滚动条
  160. title: '录音',
  161. area: ['30%', '20%'], //宽高
  162. maxmin: true,
  163. shade: 0
  164. });
  165. }