| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178 |
- //回访信息
- function detialVisit(result) {
- var html= '';
- var html1 = '';
- var html2 = '';
- var visitRole = ['GLY','ZXLD']
-
- if(result.data.length < 0) {
- html = '<tr>' +
- '<td class="text-center">' + n.UserName + '</td>' +
- '</tr>';
- } else {
- $(".HGXX").empty();
- $(result.data).each(function(i, n) {
- var a;
- var b;
- if(String(n.F_IsSatisfie) === "0") {
- a = "不满意";
- } else if(String(n.F_IsSatisfie) == "1") {
- a = "满意";
- }
- if(n.F_Type == 0) {
- b = "电话";
- } else if(n.F_Type == 1) {
- b = "微信";
- } else if(n.F_Type == 2) {
- b = "智能回访";
- } else if(n.F_Type == 3) {
- b = "网站";
- } else if(n.F_Type == 4) {
- b = "微博";
- } else if(n.F_Type == 5) {
- b = "信箱";
- }
- html+= '<tr>' +
- '<td class="text-center">' + (i + 1) +
- '</td>' +
- '<td class="text-center">' + n.F_VisitUser +
- '</td>' +
- '<td class="text-center">' + b + '</td>' +
- '<td class="text-center">' + n.F_Result +
- '</td>' +
- '<td class="text-center">' + a + '</td>' +
- '<td class="text-center">' + n.F_CreateTime +
- '</td>' +
- '<td class="text-center phoneTitle3"><a href="#">' + encryptPhoneNumber +
- '</a></td>'
-
- html += '<td class="text-center">'
- var audioFile = '';
-
- console.log(n.File)
- if(n.File && n.File.length>0) {
- audioFile += '<div class="imgs">' +
- '<img src="../img/vice.png" alt="" onclick="recordingFun(this)" item="' +
- n.File[0].F_FileUrl + '" />' +
- '</div>';
- } else if(n.FilePath) {
- audioFile += '<div class="imgs">' +
- '<img src="../img/vice.png" alt="" onclick="recordingFun(this)" item="' +
- n.FilePath + '" />' +
- '</div>';
- }
- html += audioFile
- html1 = html
- html1 += '</tr>'
-
- html2 = html
- if (visitRole.indexOf(roleCode)!== -1) {
- $(".visitLimit").show()
- var itemHf = JSON.stringify(n).replace(/"/g, "'")
- html2 += '</td>'
- html2 += '<td class="text-center">' +
- '<a class="xg" onclick="visitHandle('+itemHf+')" title="修改">修改</a>' +
- "<a class='xg' onclick='deleteVisit(\""+n.F_Id+"\")' title='删除'>删除</a>" +
- '</td>';
- }
-
- html2 += '</tr>'
- })
- $(html2).appendTo($(".HGXX"));
- $(html1).appendTo($(".HGXX1"));
-
-
- $(".phoneTitle3").click(function() {
- var isSecret
- if($('.MJ').text() == "普通") {
- isSecret = 1
- } else {
- isSecret = 2
- }
- layer.open({
- type: 2,
- content: "./callerNumber.html?phoneNumber=" + encodeURIComponent(phoneNumber) + "&wid=" + wid + "&isSecret=" + isSecret + "&type=1", //iframe的url,no代表不显示滚动条
- title: "回访号码",
- area: ["40%", "25%"], //宽高
- });
- })
- }
- }
- //var title =item?'编辑':'添加'
- //var contentUrl=item?"./addOrEditUser.html?item="+encodeURIComponent(JSON.stringify(item)):"./addOrEditUser.html"
- function visitHandle(item) {
- var title =item?'编辑回访记录':'添加回访记录'
- var contentUrl
- var visitUrl = "./cpns/detailEditVisit.html?wid="+wid
- if (item) {
- contentUrl = visitUrl+"&item="+encodeURIComponent(JSON.stringify(item))
- } else {
- contentUrl = visitUrl
- }
- layer.open({
- type: 2,
- content: contentUrl,
- title: title,
- area: ["80%", "60%"], //宽高
- });
- }
- function deleteVisit (id) {
- layer.confirm(
- "确定删除?", {
- btn: ["是", "否"], //按钮
- },
- function () {
- $.post(
- huayi.config.callcenter_url +
- "WorkOrder/DeleteVisitInfoByAdmin", {
- id: id,
- token: $.cookie("token"),
- },
- function (result) {
- result = JSON.parse(result);
- if (result.state.toLowerCase() == "success") {
- layer.msg("删除成功");
- load('6')
- }
- }
- );
- }
- );
- // layer.confirm(
- // "确定删除?", {
- // btn: ["是", "否"], //按钮
- // },
- // function () {
- // console.log('删除')
- // $.ajax({
- // type:'post',
- // dataType: 'json',
- // url:huayi.config.callcenter_url + "DeleteVisitInfoByAdmin",
- // async:true,
- // success:function(data){
- // if(data.state == "success") {
- // layer.msg("删除成功");
- // load('6')
- // }
- // }
- // });
- // }
- // );
- }
- function recordingFun(htmlstr) {
- var path = $(htmlstr).attr("item");
- layer.open({
- type: 2,
- content: "../CommonHtml/recording.html?path=" + path, //iframe的url,no代表不显示滚动条
- title: '录音',
- area: ['30%', '20%'], //宽高
- maxmin: true,
- shade: 0
- });
- }
|