134 lines
5.0 KiB
Plaintext
134 lines
5.0 KiB
Plaintext
@using System.Collections.Generic
|
||
@using System.Web.UI.WebControls
|
||
@using WX.CRM.WebHelper;
|
||
@using WX.CRM.Common;
|
||
@{
|
||
ViewBag.Title = "录音查询";
|
||
Layout = "~/Views/Shared/_Index_Layout2.cshtml";
|
||
}
|
||
<script src="~/Scripts/op/tablegrid.sort.js"></script>
|
||
<link href="~/Content/main.css" rel="stylesheet" />
|
||
<div>
|
||
<div class="mvctool">
|
||
<div class="mvctool_mytitle">坐席监控</div>
|
||
@Html.ToolButton("btnQuery", "icon-search", "查询", true)
|
||
<input type="checkbox" id="cbrefresh" />自动刷新(10秒)
|
||
</div>
|
||
<div class="bas_datagrid">
|
||
<div id="tb" style="padding:5px;height:auto" class="grid_toolbar">
|
||
<ul class="toolBar_ul">
|
||
<li>@Html.Action("UserComBoxByRole", "Control", new { onLoadSucced = "onLoadSucced()", controlName = "nb1", roleCodes = ViewBag.roleCodes, saledeptid = "", salegroupid = ViewBag.userGroupId, iseid = "0", inneruserid = "" })</li>
|
||
</ul>
|
||
</div>
|
||
@Html.Raw(ViewBag.gridTable)
|
||
</div>
|
||
<script type="text/javascript">
|
||
window.console = window.console || (function () {
|
||
var c = {}; c.log = c.warn = c.debug = c.info = c.error = c.time = c.dir = c.profile
|
||
= c.clear = c.exception = c.trace = c.assert = function () { };
|
||
return c;
|
||
})();
|
||
|
||
//获取datagrid头部及字段
|
||
function getDataGridHeader() {
|
||
var columns = $('#tablist').tablegrid("getHead");
|
||
return columns;
|
||
}
|
||
function GetIframeHtml(src) {
|
||
return "<iframe width='100%' height='98%' scrolling='no' frameborder='0'' src='" + src + "'></iframe>";
|
||
}
|
||
function onLoadSucced() {
|
||
$('#tablist').tablegrid("Search");
|
||
}
|
||
|
||
|
||
$(function () {
|
||
$('#tablist').tablegrid({
|
||
url: '/CallRecord/Get_AXAgentMonitorListHtml?v3',
|
||
height: $(window).height() - 110,
|
||
loadNow: false,
|
||
data: GetControlValue,
|
||
onLoadError: function () {
|
||
$.messager.alert("警告", "数据加载失败!", "error");
|
||
},
|
||
onLoadSuccess: function () {
|
||
handlerAgentState();
|
||
}
|
||
});
|
||
function GetControlValue() {
|
||
return { saleDeptId: $("#nb1_uc_org_depts").val(), groupId: $("#nb1_uc_org_groups").val(), userId: $("#nb1_uc_org_ids").val(), fjh: $("#txtfjh").val() };
|
||
}
|
||
$("#btnQuery").click(function () {
|
||
$('#tablist').tablegrid("Search");
|
||
});
|
||
$("#btnReport").click(function () {
|
||
parent.ChildAddTab("监控统计", "/CallRecord/AgentMonitorReport", "");
|
||
});
|
||
$(window).resize(function () {//自动适应大小
|
||
$('#tablist').tablegrid('resize', {
|
||
height: $(window).height() - 110
|
||
});
|
||
});
|
||
$("#cbrefresh").bind("click", refleshagentlist);
|
||
function refleshagentlist() {
|
||
if ($("#cbrefresh").attr("checked") == "checked") {
|
||
$('#tablist').tablegrid("Load");
|
||
window.setTimeout(refleshagentlist, 10 * 1000);
|
||
}
|
||
}
|
||
});
|
||
function jsonp_callback() {
|
||
|
||
}
|
||
function handlerAgentState()
|
||
{
|
||
var flightHandler = function (data) {
|
||
};
|
||
var url = "@(ViewBag.CtiInterface)" + "getExtenStatusAll";
|
||
$.ajax({
|
||
type: "get",
|
||
async: false,
|
||
url: url,
|
||
dataType: "jsonp",
|
||
jsonp: "callback",
|
||
jsonpCallback: "flightHandler",
|
||
success: function (res) {
|
||
var trs = $("#tablist").find("tr");
|
||
for (var i = 0; i < trs.length; i++) {
|
||
var currow = trs[i];
|
||
var td = $(currow).find("td")[4];
|
||
var tel = $(td).text();
|
||
if (tel != '' && tel != ' ') {
|
||
for (var j = 0; j < res.length; j++) {
|
||
if (res[j].tel == tel) {
|
||
$(td).next().html(getstatus(res[j].state))
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
error: function () {
|
||
}
|
||
});
|
||
}
|
||
function getstatus(stats) {
|
||
if (stats == "Logged Out")
|
||
return "未登录";
|
||
if (stats == "Available") {
|
||
return "空闲";
|
||
}
|
||
if (stats == "CALLING") {
|
||
return "通话中";
|
||
}
|
||
if (stats == "Available (On Demand)") {
|
||
return "小结";
|
||
} if (stats == "RINGING") {
|
||
return "振铃";
|
||
}
|
||
if (stats == "On Break")
|
||
return "小休";
|
||
return "失败";
|
||
}
|
||
</script>
|
||
</div>
|