浏览代码

通话记录,添加工单,回拨功能

miaofuhao 4 年之前
父节点
当前提交
a3c4dbb22b

+ 2 - 0
WebUI/CallCenterWeb.UI/Appeal/AddAppeal.html

@@ -281,6 +281,7 @@
281 281
     <script>
282 282
         var submit;
283 283
         var roleCode = $.cookie("code");
284
+        var callID = helper.request.queryString("CallID");
284 285
         $(document).ready(function () {
285 286
             QY($("#sourcearea"));
286 287
             // 获取乡镇,默认文峰区
@@ -385,6 +386,7 @@
385 386
                         email: $("#email").val(),
386 387
                         zipcode: $("#zipcode").val(),
387 388
                         conphone: $("#conphone").val(),
389
+                        callid: callID,
388 390
                         title: $("#title").val(),
389 391
                         content: $("#content").val(),
390 392
                         files: $("#file").val(), // 工单附件(多个用英文逗号,隔开)

+ 5 - 9
WebUI/CallCenterWeb.UI/Script/Common/huayi.http.js

@@ -714,12 +714,8 @@ helper.getDropList = {
714 714
         return dtd.promise(); // 返回promise对象
715 715
     }
716 716
 
717
-	
718
-	
719 717
 }
720 718
 
721
-
722
-
723 719
 helper.DateFormat = {
724 720
 	d2s: function(postdate) {
725 721
 		var second = 1000;
@@ -896,15 +892,15 @@ helper.luyin = {
896 892
             maxmin: true,
897 893
             shade: 0
898 894
         });
899
-        // $(".t-shade").addClass("cx");
900
-        // $(".Ly_box").empty();
901
-        // $(".LY_box").empty();
902
-        // $('<audio  style="width:100%;"class=" " src="' + path + '"  controls="controls" ></audio>').appendTo(".Ly_box");
903
-        // setTimeout("helper.luyin.isexist()", 500);
904 895
 	},
905 896
 	isexist: function() {
906 897
 	}
907 898
 };
899
+function turnIframe(str){
900
+	$(".J_mainContent").empty();
901
+    var n = '<iframe class="J_iframe" name="iframe25" width="100%" height="100%" src="' + str + '" frameborder="0" data-id="' + str + '" seamless></iframe>';
902
+    $(".J_mainContent").append(n);
903
+}
908 904
 function download(url) {
909 905
     layer.load(2);
910 906
     var xmlResquest = new XMLHttpRequest();

+ 33 - 19
WebUI/CallCenterWeb.UI/TelCall/CallRecord.html

@@ -147,6 +147,7 @@
147 147
         .operation {
148 148
             white-space: nowrap;
149 149
         }
150
+ 
150 151
     </style>
151 152
 </head>
152 153
 
@@ -339,6 +340,7 @@
339 340
     <script src="../css/laydate/laydate.js"></script>
340 341
     <!-- <script src="../js/main.js"></script> -->
341 342
     <script src="../js/guid.js"></script>
343
+    <!--<script src="../js/contabs.min.js"></script>-->
342 344
     
343 345
     <script>
344 346
         var stype = 1;
@@ -689,29 +691,34 @@
689 691
         }
690 692
 
691 693
         // 回拨
692
-        function formatCallback(val, row) {
693
-          if (String(val) === "1") {
694
-            return "已回拨";
695
-          } else {
696
-            return "未回拨";
697
-          }
694
+        function formatCallback(val, row) { 
695
+        	if (val) {
696
+        		return "已回拨";
697
+        	} else if(row.CallType ===0&&row.CallState ===0){
698
+        		return "未回拨";
699
+        	}
700
+
698 701
         }
699 702
 
700 703
         //格式化工单号
701
-        function formatWorkOrderNum(val, row) {
702
-            if (val == null) {
703
-                val = '-'
704
-            } else {
705
-                return '<a class="xg" onclick="ckxq(\'' + val + '\')" title="点击查看工单详情">' + val + '</a>';
706
-            }
704
+        function formatWorkOrderNum(val, row) { 
705
+        	if (row.CallState ===0&&row.CallType ===0) {
706
+        		if (val == null) {
707
+	               return '<a class="xg" onclick="addWorkOrder(\'' + row.CallId + '\')" title="添加工单">添加工单</a>';
708
+	            } else {
709
+	                return '<a class="xg" onclick="ckxq(\'' + val + '\')" title="点击查看工单详情">' + val + '</a>';
710
+	            }
711
+        	}
712
+            
707 713
         }
708 714
         // 操作
709 715
         function operationFormatter(val, row) {
710
-            if (String(row.Callback) === "1") {
711
-                return "-"
712
-            } else {
713
-                return '<a class="operation" onclick="backDial(\'' + row.CallNumber + '\',\'' + row.CallId +'\')" title="">回拨</a>' + 
714
-                  '<a class="operation" onclick="callbackRecord(\'' + row.CallId + '\')" title="">回拨记录</a>';
716
+        	if (row.CallState ===0&&row.CallType ===0) {
717
+	            if (row.Callback) {
718
+	                return '<a class="operation" onclick="callbackRecord(\'' + row.CallId + '\')" title="">回拨记录</a>'
719
+	            } else {
720
+	                return '<a class="operation" onclick="backDial(\'' + row.CallNumber + '\',\'' + row.CallId +'\')" title="">回拨</a>'
721
+	            }
715 722
             }
716 723
         }
717 724
         //获取通话类型
@@ -772,10 +779,16 @@
772 779
                 });
773 780
             }
774 781
         }
775
-
782
+		// 查看工单详情
783
+        function addWorkOrder(str) {
784
+            if (str) {
785
+            	var turnLink = "./Appeal/AddAppeal.html?CallID=" + str
786
+            	top.turnIframe(turnLink)
787
+            }
788
+        }
776 789
         // 外呼
777 790
         function backDial(phoneNumber, callId) {
778
-            beforeUpdateCallOut(callId)
791
+        	
779 792
             $.ajax({
780 793
                 type: "get",
781 794
                 url: huayi.config.callcenter_url + "CallOutOpt/GetCallOutprefix",
@@ -787,6 +800,7 @@
787 800
                 },
788 801
                 success: function (result) {
789 802
                     if (result.state.toLowerCase() == "success") {
803
+                    	top.callbackState = true
790 804
                         var guid = uuid();
791 805
                         top.obj.Type = "MakeCall";
792 806
                         top.obj.DestinationNumber = result.data.phone;

+ 19 - 4
WebUI/CallCenterWeb.UI/TelCall/callbackRecordList.html

@@ -18,6 +18,9 @@
18 18
                         <th data-field="" data-align="center" data-formatter="Code">编号</th>
19 19
                         <th data-field="CallNumber" data-align="center" data-formatter="formatterCallNum">电话号码</th>
20 20
                         <th data-field="FilePath" data-formatter="setCode" data-align="center">录音</th>
21
+                        <th data-field="CallState" data-formatter="states" data-align="center">呼叫状态</th>
22
+                        <th data-field="UserCode" data-align="center">坐席工号</th>
23
+                        <th data-field="UserName1" data-align="center">坐席姓名</th>
21 24
                         <th data-field="BeginTime" data-align="center">开始时间</th>
22 25
                         <th data-field="TalkStartTime" data-align="center">通话开始时间</th>
23 26
                         <th data-field="TalkEndTime" data-align="center">通话结束时间</th>
@@ -27,9 +30,9 @@
27 30
                 <tbody class="list"></tbody>
28 31
             </table>
29 32
         </div>
30
-        <div style="text-align: center;">
33
+        <!--<div style="text-align: center;">
31 34
             <button class="btns exportFile">导出</button>
32
-        </div>
35
+        </div>-->
33 36
     </div>
34 37
     <script>
35 38
         var callId = helper.request.queryString("callId");
@@ -95,7 +98,7 @@
95 98
         function Code(val, row, index) {
96 99
             return index + 1;
97 100
         }
98
-
101
+		
99 102
         // 电话号码
100 103
         function formatterCallNum(val, row) {
101 104
             var phoneNumber
@@ -108,7 +111,19 @@
108 111
             }
109 112
             return phoneNumber;
110 113
         }
111
-
114
+		function states(val, row) {
115
+            if (val == 0) {
116
+                if (row.CallType == 0 && !row.UserCode) {
117
+                    return '<div class="imgs">主动放弃</div>';
118
+                } else {
119
+                    return '<div class="imgs">未接通</div>';
120
+                }
121
+            } else if (val == 1) {
122
+                return '<div class="imgs">已接通</div>';
123
+            } else if (val == 2) {
124
+                return '<div class="imgs">接通未达</div>';
125
+            }
126
+        }
112 127
     </script>
113 128
 </body>
114 129
 

+ 46 - 35
WebUI/CallCenterWeb.UI/js/main.js

@@ -9,6 +9,7 @@ WEB_SOCKET_DEBUG = true;
9 9
 var ws, n = 0,
10 10
 	timer;
11 11
 var lockReconnect = false; //避免重复连接
12
+var callbackState = false;
12 13
 var obj = {};
13 14
 var Statess;
14 15
 var cls = 0;
@@ -340,6 +341,48 @@ function DropCallBack() {
340 341
     // SetStateCookie(1);
341 342
     obj.Type = "SayBusy";
342 343
     Send();
344
+    if (callbackState) {
345
+//  	console.log("当前呼出通话的id=="+$.cookie("makeCallId"))
346
+//  	console.log("当前呼入的电话id=="+obj.TaskPhoneID)
347
+    	if (String(obj.TaskType) === "2") {
348
+	        $.ajax({
349
+	            type: "get",
350
+	            url: huayi.config.callcenter_url + "Callrecords/UpdateCallbackid",
351
+	            async: true,
352
+	            dataType: "json",
353
+	            data: {
354
+	                token: $.cookie("token"),
355
+	                callid: $.cookie("makeCallId"),  //当前呼出通话的id
356
+	                p_callid: obj.TaskPhoneID,  //当前呼入的电话id
357
+	            },
358
+	            success: function (result) {
359
+	                if (result.state.toLowerCase() == "success") {
360
+	                	
361
+	                	if ($("iframe:visible").attr("data-id") == "./TelCall/CallRecord.html") {
362
+					        window.frames[$("iframe:visible").attr("name")].initTable();
363
+					    }
364
+	                }
365
+	            },
366
+	        });
367
+	        $.ajax({
368
+                type: "get",
369
+                url: huayi.config.callcenter_url + "Callrecords/UpdateCallback",
370
+                async: true,
371
+                dataType: "json",
372
+                data: {
373
+                    token: $.cookie("token"),
374
+                    callid: obj.TaskPhoneID,  //当前呼入的电话id
375
+                },
376
+                success: function (result) {
377
+                    if (result.state.toLowerCase() == "success") {
378
+//                  	if ($("iframe:visible").attr("data-id") == "./TelCall/CallRecord.html") {
379
+//					        window.frames[$("iframe:visible").attr("name")].initTable();
380
+//					    }
381
+                    }
382
+                },
383
+            });
384
+	    }
385
+    }
343 386
     //$('.ldtp-con').css("display", 'none');
344 387
     
345 388
 }
@@ -657,41 +700,9 @@ function backstageQueue(data) {
657 700
 }
658 701
 //录音返回
659 702
 function RecordPathBack(data) {
660
-    //if ($(".hidTel").val() && $(".hidCallID").val()) {
661
-    //    $.post(huayi.config.callcenter_url + 'CallInScreen/UpdateLY', { callid: $(".hidCallID").val(),path:data.RecPath, "token": $.cookie("token") }, function (result) {
662
-    //        result = JSON.parse(result);
663
-    //        if (result.state.toLowerCase() == "success") {
664
-    //        }
665
-    //    })
666
-    //}
667
-    // if ($(".hidTel").val()) {
668
-    //     $.post(huayi.config.callcenter_url + 'CallInScreen/UpdateLY', {
669
-    //         callid: data.CallID,
670
-    //         path: data.RecPath,
671
-    //         "token": $.cookie("token")
672
-    //     }, function (result) {
673
-    //         result = JSON.parse(result);
674
-    //         if (result.state.toLowerCase() == "success") { }
675
-    //     })
676
-    // }
677
-    $.cookie("makeCallId", data.CallID);
678
-    if (String(obj.TaskType) === "2") {
679
-        $.ajax({
680
-            type: "get",
681
-            url: huayi.config.callcenter_url + "Callrecords/UpdateCallbackid",
682
-            async: true,
683
-            dataType: "json",
684
-            data: {
685
-                token: $.cookie("token"),
686
-                callid: $.cookie("makeCallId"),
687
-                p_callid: obj.TaskPhoneID,
688
-            },
689
-            success: function (result) {
690
-                if (result.state.toLowerCase() == "success") {
691
-                }
692
-            },
693
-        });    
694
-    }
703
+
704
+    $.cookie("makeCallId", data.CallID); 
705
+    
695 706
 }
696 707
 
697 708
 //在线坐席信息