111 lines
4.2 KiB
Plaintext
111 lines
4.2 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">
|
||
@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">
|
||
//获取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: 'Get_AXAgentMonitorListHtml?v3',
|
||
height: $(window).height() - 110,
|
||
loadNow: false,
|
||
data: {
|
||
saleDeptId: $("#nb1_uc_org_depts").val(), groupId: $("#nb1_uc_org_groups").val(), userId: $("#nb1_uc_org_ids").val()
|
||
},
|
||
onLoadError: function () {
|
||
$.messager.alert("警告", "数据加载失败!", "error");
|
||
},
|
||
onLoadSuccess: function () {
|
||
handlerAgentState();
|
||
}
|
||
});
|
||
$("#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 handlerAgentState()
|
||
{
|
||
$.getJSON("@(Utility.GetSettingByKey("shj"))" + "getExtenStatusAll?callback=?", 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))
|
||
}
|
||
}
|
||
|
||
}
|
||
}
|
||
});
|
||
}
|
||
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>
|