300 lines
13 KiB
Plaintext
300 lines
13 KiB
Plaintext
@using Mini.Web.WebHelper;
|
||
@{
|
||
ViewBag.Title = "Index";
|
||
Layout = "~/Areas/Admin/Views/Shared/_content.cshtml";
|
||
}
|
||
<style>
|
||
a {
|
||
color: #3267c7;
|
||
text-decoration: none;
|
||
}
|
||
</style>
|
||
<div class="layui-fluid" style="padding-left:0px;padding-top:10px;">
|
||
<div class="layui-card" id="topcard" style="width:100%;padding-top:10px;">
|
||
<div class="layui-card-header layui-self-header">
|
||
<div style="float:left;position:relative;">
|
||
企微通话查询
|
||
</div>
|
||
<div style="float:right;position:relative;">
|
||
@*@Html.Action("ToolBarNew", "Control",
|
||
new {
|
||
tool= ViewBag.ToolBar as ToolBar,
|
||
otherToolBars = new Mini.Web.WebHelper.ToolBarNew[] {}
|
||
}
|
||
)*@
|
||
@await Component.InvokeAsync("ToolBarNew", new { ToolBar = ViewBag.ToolBar as ToolBar, otherToolBars = new Mini.Web.WebHelper.ToolBarNew[] {
|
||
} })
|
||
@*<input class="layui-btn layui-btn-sm layui-btn-ok" data-method="add" type="button" value="+新增" />
|
||
<input class="layui-btn layui-btn-sm layui-btn-normal" data-method="update" type="reset" value="修改" />
|
||
<input class="layui-btn layui-btn-sm layui-btn-reset" data-method="delete" type="reset" value="删除" />*@
|
||
</div>
|
||
<div class="hrclass" style="position:relative;float: left;"></div>
|
||
</div>
|
||
<div class="layui-card-body " id="contentBody">
|
||
<form class="layui-form selftopwhere" id="myform">
|
||
<div class="layui-form-item">
|
||
企业:
|
||
<div class="layui-inline">
|
||
@Html.DropDownList("corpid", ViewBag.Select as List<SelectListItem>)
|
||
</div>
|
||
客服:
|
||
<div class="layui-inline">
|
||
<input type="text" name="kefuname" required lay-verify="required" placeholder="ID/名称" autocomplete="off" class="layui-input">
|
||
<input type="hidden" name="companycode" value="@ViewBag.companycode"/>
|
||
</div>
|
||
客户:
|
||
<div class="layui-inline">
|
||
<input type="text" name="customername" required lay-verify="required" placeholder="ID/名称" autocomplete="off" class="layui-input">
|
||
</div>
|
||
通话时间:
|
||
<div class="layui-inline" style="width:150px;">
|
||
<input class="layui-input" placeholder="开始时间" name="stime" id="start" style="width:150px;">
|
||
</div>
|
||
~
|
||
<div class="layui-inline" style="width:150px;">
|
||
<input class="layui-input" placeholder="结束时间" name="etime" id="end" style="width:150px;">
|
||
</div>
|
||
<div class="layui-inline">
|
||
<input class="layui-btn layui-btn-sm layui-btn-ok" data-method="search" type="button" value="查询" /><input class="layui-btn layui-btn-sm layui-btn-reset" type="reset" value="清空" />
|
||
</div>
|
||
</div>
|
||
</form>
|
||
<table class="layui-hide" id="tab_kefuzhuangtaiyi1" lay-filter="wochao"></table>
|
||
</div>
|
||
</div>
|
||
|
||
</div>
|
||
<!--确定宽度-->
|
||
|
||
<script>
|
||
var table;
|
||
$(function () {
|
||
//var tempwidth = 1410;
|
||
//var tempheight = 1115;
|
||
//var width = $(window).width();
|
||
//var height = Math.ceil(width * (tempheight / tempwidth));
|
||
//$("body").height($(window).height() + 150);
|
||
|
||
//$(window).resize(function () {//自动适应大小
|
||
// console.log("resize");
|
||
// table.resize('tab_kefuzhuangtaiyi1');
|
||
//});
|
||
});
|
||
</script>
|
||
<script>
|
||
var httpurl = "@Html.Raw(Mini.Common.Utility.GetSettingByKey("HHMessageFile"))";
|
||
var innerhttp = "@Html.Raw(Mini.Common.Utility.GetSettingByKey("InnerFile"))";//内网获取json必须使用内网地址
|
||
var nowlocation = window.location.href;
|
||
if (nowlocation.indexOf("192.168.1.") > -1 || nowlocation.indexOf("192.168.11.") > -1 || nowlocation.indexOf("localhost") > -1) {//内网无疑
|
||
httpurl = innerhttp;
|
||
}
|
||
layui.use('laydate', function () {
|
||
var laydate = layui.laydate;
|
||
//执行一个laydate实例
|
||
laydate.render({
|
||
elem: '#start',//指定元素
|
||
type: 'datetime'
|
||
});
|
||
//执行一个laydate实例
|
||
laydate.render({
|
||
elem: '#end',//指定元素
|
||
type: 'datetime'
|
||
});
|
||
});
|
||
var selectRow = {};
|
||
var winindex;
|
||
var layer;
|
||
var rowid;
|
||
//注意:选项卡 依赖 element 模块,否则无法进行功能性操作
|
||
layui.use('element', function () {
|
||
var element = layui.element;
|
||
element.on('tab(tonghuajiankong)', function (n) {
|
||
$(".bodytable").addClass("hidden");
|
||
$("#kefuzhuangtai" + (n.index + 1)).removeClass("hidden");
|
||
});
|
||
element.on('tab(maintab)', function (n) {
|
||
if (n.index == 0)
|
||
$("#bottomcard").removeClass("hidden");
|
||
else
|
||
$("#bottomcard").addClass("hidden");
|
||
});
|
||
});
|
||
layui.use(['laypage', 'layer', 'table', 'laydate'], function () {
|
||
var laydate = layui.laydate;
|
||
layer = layui.layer;
|
||
table = layui.table;
|
||
table.render({
|
||
id: 'listReload'//列表别名ID
|
||
, elem: '#tab_kefuzhuangtaiyi1'
|
||
, url: 'GetRecordHtmlList'
|
||
, method: 'POST'
|
||
, cellMinWidth: 80 //全局定义常规单元格的最小宽度,layui 2.2.1 新增
|
||
, page: true
|
||
, limit: 10
|
||
, height: "full-160"
|
||
, cols: [[
|
||
{ field: 'numbers', type: 'numbers' }
|
||
//, { field: 'corpid', title: '企业ID' }
|
||
, { field: 'corpname', title: '企业号' }
|
||
, { field: 'fromer', title: '客服ID' }
|
||
, { field: 'kefuname', title: '客服' }
|
||
, { field: 'remarkname', title: '客服备注姓名' }
|
||
, { field: 'tolist', title: '客户ID' }
|
||
, { field: 'customername', title: '客户' }
|
||
, {
|
||
field: 'calltype', title: '类型', templet: function (d) {
|
||
if (d.calltype == 1) {
|
||
return "<font color='red'>呼入</font>";
|
||
} else {
|
||
return "<font color='green'>呼出</font>";
|
||
}
|
||
}
|
||
}
|
||
, { field: 'length', title: '时长/秒' }
|
||
, { field: 'starttimestr', title: '开始时间' }
|
||
, { field: 'endtimestr', title: '结束时间' }
|
||
, {
|
||
field: 'filename', title: '播放', templet: function (da) {
|
||
return `<a href="javascript:PalyRecord('${httpurl}playamr?corpid=${da.corpid}&fname=${da.filename}')" )">播放</a>`;
|
||
}
|
||
}
|
||
]], where: $("#myform").serializeFormJSON()
|
||
});
|
||
//监听行单击事件(单击事件为:rowDouble)
|
||
table.on('row(wochao)', function (obj) {
|
||
var data = obj.data;
|
||
//console.log(data);
|
||
//标注选中样式
|
||
obj.tr.addClass('self-table-click').siblings().removeClass('self-table-click');
|
||
selectRow = data;
|
||
});
|
||
|
||
|
||
var active = {
|
||
other4: function () {
|
||
var corp = $("#corp").val();
|
||
if (corp == "") {
|
||
layer.msg("请选择企业!", { icon: 7 });
|
||
return;
|
||
}
|
||
var corpname = $("#corp option[value='" + corp + "']").text();
|
||
window.parent.ChildAddTab('微信群--' + corpname, '/Admin/HHuser/Group?corp=' + corp, "icon-detail");
|
||
}, other3: function () {
|
||
var width = $(window).width() * 0.7;
|
||
var height = $(window).height() * 0.7;
|
||
if (width < 600)
|
||
width == 600;
|
||
if (height < 500)
|
||
height = 500;
|
||
winindex = layer.open({
|
||
type: 2,
|
||
content: '/Admin/HHuser/Find',
|
||
area: [width + 'px', height + 'px']
|
||
});
|
||
}, other1: function () {
|
||
if (selectRow.userid == "undefined" || selectRow.userid == null) {
|
||
//layer.alert("请先选中一条记录!", { title: '提示' });
|
||
layer.msg("请先选中一条记录!", { icon: 7 });
|
||
return;
|
||
}
|
||
//winindex = layer.open({
|
||
// type: 2,
|
||
// content: '/Admin/HHuser/Message?userid=' + selectRow.userid + "&uname=" + selectRow.uname + "&corp=" + selectRow.corpid,
|
||
// area: ['600px', '500px']
|
||
//});
|
||
window.parent.ChildAddTab('企微聊天记录--' + selectRow.uname, '/Admin/HHuser/Message?userid=' + selectRow.userid + "&uname=" + encodeURIComponent(selectRow.uname) + "&corp=" + selectRow.corpid, "icon-detail");
|
||
}, other2: function () {
|
||
if (selectRow.userid == "undefined" || selectRow.userid == null) {
|
||
//layer.alert("请先选中一条记录!", { title: '提示' });
|
||
layer.msg("请先选中一条记录!", { icon: 7 });
|
||
return;
|
||
}
|
||
window.parent.ChildAddTab('外部联系人--' + selectRow.uname, '/Admin/HHuser/Outer?userid=' + selectRow.userid + "&uname=" + encodeURIComponent(selectRow.uname) + "&corp=" + selectRow.corpid, "icon-detail");
|
||
//winindex = layer.open({
|
||
// type: 2,
|
||
// content: '/Admin/HHuser/Outer?userid=' + row.userid + "&uname=" + row.uname + "&corp=" + row.corpid,
|
||
// area: ['600px', '500px']
|
||
//});
|
||
}, search: function () {
|
||
//alert($("#myform").serialize());
|
||
//console.log($("#myform").serialize());
|
||
//console.log($("#myform").serializeFormJSON());
|
||
var param = $("#myform").serializeFormJSON();
|
||
table.reload('listReload', {
|
||
|
||
where: param
|
||
});
|
||
}
|
||
};
|
||
$('.layui-btn').on('click', function () {
|
||
var othis = $(this), method = othis.data('method');
|
||
console.log(method);
|
||
active[method] ? active[method].call(this, othis) : '';
|
||
|
||
});
|
||
});
|
||
function Closed() {
|
||
layer.close(winindex);
|
||
}
|
||
function TableReload() {
|
||
table.reload('listReload', {
|
||
|
||
});
|
||
}
|
||
function PalyRecord(url) {
|
||
url = url + "&nguid=" + GetGuid();
|
||
var html = "";
|
||
var browser = myBrowser();
|
||
if (browser == "IE" || browser == "Firefox") {
|
||
html = '<object id="Player" width="300" height="50" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715" standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject"hspace="5"><param name="AutoRewind" value="1"><param name="FileName" value="' + url + '"><param name="ShowControls" value="1"><param name="ShowPositionControls" value="0"><param name="ShowAudioControls" value="1"><param name="ShowTracker" value="1"><param name="ShowDisplay" value="0"><param name="ShowStatusBar" value="0"><param name="ShowGotoBar" value="0"><param name="ShowCaptioning" value="0"><param name="AutoStart" value="1"><param name="Volume" value="5000"><param name="AnimationAtStart" value="0"><param name="TransparentAtStart" value="0"><param name="AllowChangeDisplaySize" value="0"><param name="AllowScan" value="0"><param name="EnableContextMenu" value="0"><param name="ClickToPlay" value="1"> </object>'
|
||
} else {
|
||
html = '<video src=' + url + ' controls="controls" autoplay />';
|
||
}
|
||
layui.use('layer', function () {
|
||
var layer = layui.layer;
|
||
layer.open({
|
||
title: '播放通话',
|
||
type: 1,
|
||
content: html,
|
||
area: ['300px', '200px']
|
||
});
|
||
});
|
||
}
|
||
function myBrowser() {
|
||
var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串
|
||
var isOpera = userAgent.indexOf("Opera") > -1;
|
||
if (isOpera) { //判断是否Opera浏览器
|
||
return "Opera"
|
||
}
|
||
|
||
if (userAgent.indexOf("Firefox") > -1) { //判断是否Firefox浏览器
|
||
return "Firefox";
|
||
}
|
||
if (userAgent.indexOf("Chrome") > -1) {
|
||
return "Chrome";
|
||
}
|
||
if (userAgent.indexOf("Safari") > -1) { //判断是否Safari浏览器
|
||
return "Safari";
|
||
}
|
||
if (userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1 && !isOpera) { //判断是否IE浏览器
|
||
return "IE";
|
||
}
|
||
if (userAgent.indexOf('Trident') > -1) {//IE11
|
||
return "IE";
|
||
}
|
||
if (userAgent.indexOf("Edge") > -1) {//Edge
|
||
return "IE";
|
||
}
|
||
}
|
||
|
||
</script>
|
||
<script type="text/html" id="agentTpl">
|
||
{{# if(d.ISOUTERAGENT == '1'){ }}
|
||
是
|
||
{{# } else if(d.ISOUTERAGENT == '0') { }}
|
||
否
|
||
|
||
{{# } }}
|
||
</script>
|
||
|