ComplianceServer/oldcode/WEB/Views/Csvr/CustomerUC/CustomerCallRecord.cshtml

310 lines
14 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@using WX.CRM.Common
@using WX.CRM.Model.Entity
@using WX.CRM.Model.QueryMap
@using WX.CRM.WebHelper
@{
Layout = null;
}
<style type="text/css">
.DisTable {
display: block;
}
.NoneTable {
display: none;
}
.td {
border: 1px solid #ff0000;
}
.curshow {
padding: 0 20px 5px;
background-color: #F7FAFE;
}
.curshow2 {
padding: 0 20px 5px;
background-color: #F7FAFE;
}
.curhide {
padding: 0 20px 5px;
}
</style>
<div class="group content_title_width">
<span class="csicon LuyinIcon"></span>
<span>录音</span>
</div>
<div class="content_div" style="margin-top:5px;">
<input type="hidden" id="hidRecordId" />
<div style="margin-top: 5px;">
<table class="layui-table content_width" id="recordList">
<thead>
<tr>
<td width="3%"></td>
<td width="">编号</td>
<td width="">事业部</td>
<td width="">呼叫类型</td>
<td width="">主叫号码</td>
<td width="">被叫号码</td>
<td width="">时长(秒)</td>
<td width="">开始时间</td>
<td width="">结束时间</td>
<td width="">受理人</td>
<td width="">来源渠道</td>
<td width="">播放</td>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
<div id="recordPlayerWin">
<div id="viedoDiv" style="width:100%; height:50px;"></div>
</div>
<script type="text/javascript">
function ShowWindowBoxZxOrder(comName, linkUrl) {
$("#modalwindow").html(GetIframeHtml(linkUrl));
$("#modalwindow").window({ title: comName, width: 690, height: 600, iconCls: 'icon-add', resizable: false }).window('open');
}
var curRow; //全局行号
var curColor;
function selectRow(tr) {
//alert(tr.rowIndex);
if (curRow) {
curRow.bgColor = curColor;
curColor = tr.bgColor;
tr.bgColor = "#FFE9B3";
} else {
curColor = tr.bgColor;
tr.bgColor = "FFE9B3";
}
curRow = tr;
}
function getSelectRowOrderId() {
if (curRow) {
if (window.navigator.userAgent.toLowerCase().indexOf("firefox") != -1) {
return curRow.cells[1].innerContent;
}
else {
return curRow.cells[1].innerText;
}
} else {
$.messageBox5s('提示', '@Suggestion.PlaseChooseToOperatingRecords');
}
}
function GetRecordList() {
$.r_ajax({
url: "/Csvr/CustomerUC/GetRecordListHtml",
type: "Post",
data: {resId: "@Model.CustomerId" },
dataType: "json",
loading: true,
success: function (data) {
$("#recordList").attr("AlreadyLoad", "true");
$("#recordList tbody").html(data.rowsList);
$("[id='BtnPlayer']").addClass("layui-btn layui-btn-sm layui-btn-primary");
/*var rownum = 0;
$("#orderList tbody tr").each(function () {
rownum++;
$(this).find("td").eq(0).html(rownum);
});*/
/*$("#orderList tbody tr").each(function () {
//$(this).cells[0].innerText;
onclick = function () {
selectRow(this);
}
});*/
//alert($("#orderList tbody").html());
}, error: function () {
$.messager.alert('警告', '数据加载失败!', "error");
}
});
}
$(function () {
//GetRecordList();
});
function PalyAiRecord(url) {
var height = 150;
//替换url
url = url.replace("http://10.1.11.10:18081", "http://rec.xunfei.tcfortune.com:8282");
$('#recordPlayerWin').window({
title: '播放录音', width: 350, height: height, iconCls: 'icon-add', shadow: true,
modal: true,
closed: true,
minimizable: false,
maximizable: false,
collapsible: false,
onBeforeClose: function () { //当面板关闭之前触发的事件
$("#viedoDiv").html("");
$("#qcContent").val('');
$("#qcType").val('');
}
}).window('open');
var isChrome = window.navigator.userAgent.indexOf("Chrome") !== -1
if (isChrome) {
$('#viedoDiv').html("<audio controls=\"\" src=\"" + url + "\" style=\"width:300px; height:50px;\" autoplay=\"autoplay\" />");
}
else {
$('#viedoDiv').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>');
}
}
function AiAudioDetail(id) {
var url = "@ViewBag.audioUrl/AiAudioList/AudioDetail?Id="+id;
$("#modalwindow").html(GetIframeHtml(url));
$("#modalwindow").window({ title: '录音列表', width: 1340, height: 650, iconCls: 'icon-edit' }).window('open');
}
function PalyRecord(url, objDiv, ctiver, recordid) {
var height = 150;
$("#hidRecordId").val(recordid);
$.r_ajax({
url: "/Csvr/CallRecord/GetRecordQC?recordid=" + recordid,
type: "get",
dataType: "json",
loading: true,
success: function (res) {
if (res.model != null) {
$("#qcType").val(res.model.QCTYPE);
$("#qcType").change();
$("#qcSubType").val(res.model.QCSUBTYPE);
$("#qcContent").val(res.model.QCCONTENT);
}
else
$("#qcType").change();
}, error: function () {
$.messager.alert('警告', '数据加载失败!', "error");
}
});
$('#recordPlayerWin').window({
title: '播放录音', width: 350, height: height, iconCls: 'icon-add', shadow: true,
modal: true,
closed: true,
minimizable: false,
maximizable: false,
collapsible: false,
onBeforeClose: function () { //当面板关闭之前触发的事件
//document.getElementById("Player").stop();
$("#viedoDiv").html("");
$("#qcContent").val('');
$("#qcType").val('');
}
}).window('open');
if (ctiver == "@(((int)WX.CRM.Model.Enum.CTI_VER.深海捷固定坐席).ToString())"
|| ctiver == "@(((int)WX.CRM.Model.Enum.CTI_VER.艾讯).ToString())"
|| ctiver == "@(((int)WX.CRM.Model.Enum.CTI_VER.艾讯new).ToString())"
) {
var isChrome = window.navigator.userAgent.indexOf("Chrome") !== -1
if (isChrome) {
$('#viedoDiv').html("<audio controls=\"\" src=\"" + url + "\" style=\"width:300px; height:50px;\" autoplay=\"autoplay\" />");
}
else {
$('#viedoDiv').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>');
}
//$('#viedoDiv').html("<audio controls=\"\" src=\"" + url + "\" style=\"width:300px; height:50px;\" autoplay=\"autoplay\" ><embed src=\"" + url + "\" /></audio>");
}
else {
$.ajax({
url: url + "&jsoncallback=?",
success: function (recordurl) {
$('#viedoDiv').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="' + recordurl + '"><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>');
},
error: function () {
$.messager.alert("错误", "获取录音地址出错!", "error");
},
dataType: 'json'
});
}
}
function StopRecord(objDiv) {
try {
//document.getElementById("Player").stop();
} catch (e) {
}
$('#' + objDiv).hide();
$('#' + objDiv).html('');
}
function getExt(importUrl) {
var d = /\.[^\.]+$/.exec(importUrl);
return d;
}
//录音下载(在新窗口打开,不能另存,直接打开播放)
function CallRecord_Download1() {
var row = $('#tablist').tablegrid('getSelected');
if (row != null) {
var r = $("#tablist .tr_onclick #hidRecordUrl");
var url = r.val();
window.open(url);
} else { $.messageBox5s('提示', '@Suggestion.PlaseChooseToOperatingRecords'); }
}
//录音下载(通过action可以完美另存为)
function CallRecord_Download2() {
var row = $('#tablist').tablegrid('getSelected');
if (row != null) {
var r = $("#tablist .tr_onclick #hidRecordUrl");
var url = r.val();
var FILENAME = row.PKID + getExt(url);
var urlPost = "/CSVR/CallRecord/CallRecordDownload";
var data = "url=" + url + "&filename=" + FILENAME;
var method = null;
filedown(urlPost, data, method);
} else { $.messageBox5s('提示', '@Suggestion.PlaseChooseToOperatingRecords'); }
}
function CallRecord_Download() {
var row = $('#tablist').tablegrid('getSelected');
if (row != null) {
var r = $("#tablist .tr_onclick #hidRecordUrl");
var url = r.val();
var FILENAME = row.PKID + getExt(url);
var isChrome = window.navigator.userAgent.indexOf("Chrome") !== -1
if (isChrome)
filedown2(url, FILENAME);
else
window.open(url);
} else { $.messageBox5s('提示', '@Suggestion.PlaseChooseToOperatingRecords'); }
}
function filedown(urlPost, data, method) {
if (urlPost && data) {
// data 是 string 或者 array/object
data = typeof data == 'string' ? data : jQuery.param(data);
var inputs = '';
jQuery.each(data.split('&'), function () {
var pair = this.split('=');
inputs += '<input type="hidden" name="' + pair[0] + '" value="' + pair[1] + '"/>';
});
jQuery('<form action="' + urlPost + '" method="' + (method || 'post') + '">' + inputs + '</form>').appendTo('body').submit().remove();
}
}
function filedown2(url, filename) {
//alert(url); alert(filename);
var contentType = 'application/octet-stream';
var a = document.createElement('a');
a.href = url;
a.download = filename;
a.click();
}
function downloadFile(url) {
try {
window.open(url);
} catch (e) {
$.messageBox5s('提示', "录音下载失败:" + e.message);
}
}
</script>