TG.WXCRM.V4/WEB/Views/WeiXin/Message/ComplianceIndex.cshtml

404 lines
20 KiB
Plaintext
Raw Permalink 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.WebHelper;
@using WX.CRM.Model.Entity;
@{
ViewBag.Title = "违规聊天记录";
Layout = "~/Views/Shared/_Index_Layout2.cshtml";
}
<script src="~/Scripts/op/tablegrid.sort.js"></script>
<script src="~/Scripts/op/jquery.highlight.js"></script>
<style>
.highlight {background-color: #ffff88; }
</style>
<div class="mvctool">
@Html.ToolButton("btnQuery", "icon-search", "查询", true)
@Html.Action("ToolBar", "Control", ViewBag.ToolBar as ToolBar)
</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 = "", currentRight = WX.CRM.WebHelper.InitRights.CONST_微信聊天违规信息 })</li>
<li>添加违规信息时间:@Html.WdatePickerText("txt_stime","")-@Html.WdatePickerText("txt_etime","")</li>
<li>工作微信用户名:<input type="text" name="txt_jobUserName" style="width:150px" /></li>
<li>客户微信昵称:<input type="text" name="txt_nickName" style="width:150px" /></li>
<li>客户微信备注:<input type="text" name="txt_conRemark" style="width:150px" /></li>
<li><select id="bigType" name="slt_bigType" style="width:150px;height:22px" onChange="changeselect(this.value)">
<option value="0">--请选择大类--</option>
@foreach (var item in ViewBag.BigTypeList as List<SelectListItem>)
{
<option value="@item.Value">@item.Text</option>
}
</select>&nbsp;&nbsp;
<select id="subType" name="slt_subType" style="width:220px;height:22px">
<option value="0">--请选择小类--</option>
</select>
</li>
</ul>
</div>
@Html.Raw(ViewBag.gridTable)
</div>
<div id="recordPlayerWin"></div>
<script type="text/JavaScript" language="javascript">
var face = [{ name: "[微笑]", imgpath: "0.png" }, { name: "[撇嘴]", imgpath: "1.png" }, { name: "[色]", imgpath: "2.png" }, { name: "[发呆]", imgpath: "3.png" },
{ name: "[得意]", imgpath: "4.png" }, { name: "[流泪]", imgpath: "5.png" }, { name: "[害羞]", imgpath: "6.png" }, { name: "[闭嘴]", imgpath: "7.png" }, { name: "[睡]", imgpath: "8.png" },
{ name: "[大哭]", imgpath: "9.png" }, { name: "[尴尬]", imgpath: "10.png" }, { name: "[发怒]", imgpath: "11.png" }, { name: "[调皮]", imgpath: "12.png" },
{ name: "[呲牙]", imgpath: "13.png" }, { name: "[惊讶]", imgpath: "14.png" }, { name: "[难过]", imgpath: "15.png" }, { name: "[酷]", imgpath: "16.png" },
{ name: "[囧]", imgpath: "17.png" }, { name: "[抓狂]", imgpath: "18.png" }, { name: "[吐]", imgpath: "19.png" }, { name: "[偷笑]", imgpath: "20.png" },
{ name: "[愉快]", imgpath: "21.png" }, { name: "[白眼]", imgpath: "22.png" }, { name: "[傲慢]", imgpath: "23.png" },
{ name: "[饿]", imgpath: "24.png" }, { name: "[困]", imgpath: "25.png" }, { name: "[惊恐]", imgpath: "26.png" },
{ name: "[流汗]", imgpath: "27.png" }, { name: "[憨笑]", imgpath: "28.png" }, { name: "[悠闲]", imgpath: "29.png" }, { name: "[奋斗]", imgpath: "30.png" },
{ name: "[咒骂]", imgpath: "31.png" }, { name: "[疑问]", imgpath: "32.png" }, { name: "[嘘]", imgpath: "33.png" }, { name: "[晕]", imgpath: "34.png" },
{ name: "[疯]", imgpath: "35.png" }, { name: "[衰]", imgpath: "36.png" }, { name: "[骷髅]", imgpath: "37.png" },
{ name: "[敲打]", imgpath: "38.png" }, { name: "[再见]", imgpath: "39.png" }, { name: "[擦汗]", imgpath: "40.png" },
{ name: "[抠鼻]", imgpath: "41.png" }, { name: "[鼓掌]", imgpath: "42.png" }, { name: "[糟糕]", imgpath: "43.png" },
{ name: "[坏笑]", imgpath: "44.png" }, { name: "[左哼哼]", imgpath: "45.png" },
{ name: "[右哼哼]", imgpath: "46.png" }, { name: "[哈欠]", imgpath: "47.png" },
{ name: "[鄙视]", imgpath: "48.png" }, { name: "[委屈]", imgpath: "49.png" },
{ name: "[快哭了]", imgpath: "50.png" }, { name: "[阴险]", imgpath: "51.png" },
{ name: "[亲亲]", imgpath: "52.png" }, { name: "[吓]", imgpath: "53.png" },
{ name: "[可怜]", imgpath: "54.png" }, { name: "[菜刀]", imgpath: "55.png" },
{ name: "[西瓜]", imgpath: "56.png" }, { name: "[啤酒]", imgpath: "57.png" },
{ name: "[篮球]", imgpath: "58.png" }, { name: "[乒乓]", imgpath: "59.png" },
{ name: "[咖啡]", imgpath: "60.png" }, { name: "[美食]", imgpath: "61.png" },
{ name: "[猪头]", imgpath: "62.png" }, { name: "[玫瑰]", imgpath: "63.png" },
{ name: "[凋谢]", imgpath: "64.png" }, { name: "[嘴唇]", imgpath: "65.png" },
{ name: "[爱心]", imgpath: "66.png" }, { name: "[心碎]", imgpath: "67.png" },
{ name: "[蛋糕]", imgpath: "68.png" }, { name: "[电]", imgpath: "69.png" }, { name: "[炸弹]", imgpath: "70.gif" }, { name: "[便便]", imgpath: "71.gif" },
{ name: "[月亮]", imgpath: "72.gif" }, { name: "[太阳]", imgpath: "73.gif" }, { name: "[拥抱]", imgpath: "74.png" }, { name: "[强]", imgpath: "75.gif" }, { name: "[弱]", imgpath: "76.gif" },
{ name: "[握手]", imgpath: "77.gif" }, { name: "[胜利]", imgpath: "78.gif" }, { name: "[抱拳]", imgpath: "79.gif" }, { name: "[勾引]", imgpath: "80.gif" },
{ name: "[拳头]", imgpath: "81.gif" }, { name: "[OK]", imgpath: "82.gif" }, { name: "[跳跳]", imgpath: "83.gif" }, { name: "[发抖]", imgpath: "84.gif" },
{ name: "[怄火]", imgpath: "85.png" }, { name: "[转圈]", imgpath: "86.gif" }
];
//替换表情
function replaceFace(cotent) {
var txt = cotent;
$(face).each(function (i, n) {
while (txt.indexOf(n.name) > -1) {
txt = txt.replace(n.name, "<img src=\"/Face/" + n.imgpath + "\">");
}
});
return txt;
}
</script>
<script type="text/javascript">
var keywords = "@ViewBag.keyword";
var keywordArray = keywords.split(';');
var requestSubType = "@Request["subType"]";
var requestStime = "@Request["stime"]";
var requestEtime = "@Request["etime"]";
$(function () {
loadtablegrid();
$(window).resize(function () {//自动适应大小
$('#tablist').tablegrid('resize', {
height: $(window).height() - 110
});
});
$("#btnQuery").click(function () {
$('#tablist').tablegrid("Search");
});
if (requestStime) {
$("#txt_stime").val(requestStime);
}
if (requestEtime) {
$("#txt_etime").val(requestEtime);
}
if (requestSubType) {
var requestBigType = requestSubType.replace(/\d+/g, '')
$("#bigType").val(requestBigType);
changeselect2(requestBigType, requestSubType);
}
});
function frameReturnByClose() {
$("#modalwindow").window('close');
}
function frameReturnByReload(flag) {
$("#tablist").tablegrid("Load");
}
function frameReturnByMes(mes) {
$.messageBox5s('提示', mes);
}
function loadtablegrid() {
$('#tablist').tablegrid({
url: '/WeiXin/Message/GetComplianceIndexHtmlList',
height: $(window).height() - 110,
loadNow: false,
data: GetControlValue,
onLoadSuccess: function (data) {
//alert(data.rowsList);
},
onLoadError: function () {
$.messager.alert("警告", "信息加载失败!", "error");
}
});
}
function onLoadSucced() {
$('#tablist').tablegrid("Search");
}
</script>
@*ToolBar事件处理*@
<script type="text/javascript">
function GetIframeHtml(src) {
return "<iframe width='100%' height='98%' scrolling='no' frameborder='0'' src='" + src + "'></iframe>";
}
//获取datagrid头部及字段
function getDataGridHeader() {
var columns = $('#tablist').tablegrid("getAllHead");
return columns;
}
function GetControlValue() {
return { saleDeptId: $("#nb1_uc_org_depts").val(), groupId: $("#nb1_uc_org_groups").val(), userId: $("#nb1_uc_org_ids").val(), dayType: $("#txt_Daytype").val() };
}
function GetImage(msgSvrId,type) {
$.ajax({
url: "@Html.Raw(System.Configuration.ConfigurationManager.AppSettings["WeiXinFilePath"])" + msgSvrId + "?i=" + GetGuid(),
type: "GET",
dataType: "json",
loading: true,
success: function (data) {
if (data.retmsg != null) {
var index = data.retmsg.indexOf("_");
var msgsId = data.retmsg.substring(0, index);
var path = data.retmsg.substring(index + 1, data.retmsg.length);
if (type != 34) {
$("#file_" + msgsId).attr("src", path);
$("#file_" + msgsId).attr("href", path);
$("#file_" + msgsId).attr("target", "_blank");
} else {
$("#file_" + msgsId).attr("href", "javascript:void(0);").attr("onclick", "WxPalyRecord('" + path + "');");
}
}
}, error: function () {
}
});
}
function changeselect(bigType) {
var nb1defaultIndex = 0;
if (bigType == 0) {
$("#subType").unbind();
$("#subType").html("<option value='0'>--请选择小类--</option>");
return;
}
$.r_post("/WeiXin/Message/GetSubTypeList?bigType=" + bigType, function (data) {
$("#subType").unbind();
$("#subType").html("<option value='0'>--请选择小类--</option>");
$(data).each(function (n, m) {
/*if (nb1defaultIndex == 0) {
$("#slt_subProductId").append("<option value='" + m.Value + "' selected='selected'>" + m.Text + "</option>");
}
else {*/
$("#subType").append("<option value='" + m.Value + "'>" + m.Text + "</option>");
//}
});
nb1defaultIndex++;
}, "json");
}
function changeselect2(bigType, selectValue) {
var nb1defaultIndex = 0;
if (bigType == 0) {
$("#subType").unbind();
$("#subType").html("<option value='0'>--请选择小类--</option>");
return;
}
$.r_post("/WeiXin/Message/GetSubTypeList?bigType=" + bigType, function (data) {
$("#subType").unbind();
$("#subType").html("<option value='0'>--请选择小类--</option>");
$(data).each(function (n, m) {
if (selectValue == m.Value) {
$("#subType").append("<option value='" + m.Value + "' selected='selected'>" + m.Text + "</option>");
}
else {
$("#subType").append("<option value='" + m.Value + "'>" + m.Text + "</option>");
}
});
nb1defaultIndex++;
}, "json");
}
function keyHighLight(msgSvrId) {
var body = $("#txt_" + msgSvrId);
//alert($("#txt_" + msgSvrId).val());
//body.html(replaceFace(body.val()));
body.highlight(keywordArray);
}
function PalyRecord(url, objDiv, ctiver) {
$('#recordPlayerWin').window({
title: '播放录音', width: 330, height: 180, iconCls: 'icon-add', shadow: true,
modal: true,
closed: true,
minimizable: false,
maximizable: false,
collapsible: false,
onBeforeClose: function () { //当面板关闭之前触发的事件
//document.getElementById("Player").stop();
}
}).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) {
$('#recordPlayerWin').html("<video controls=\"\" src=\"" + url + "\" style=\"width:300px; height:50px;\" autoplay=\"autoplay\" />");
}
else {
$('#recordPlayerWin').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 {
$.ajax({
url: url + "&jsoncallback=?",
success: function (recordurl) {
$('#recordPlayerWin').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);
}
}
function WxPalyRecord(url) {
$.post("/Weixin/WorkAccount/Audio", { url: url }, function (result) {
if (result.result === "ok") {
var data = result.data;
$('#recordPlayerWin').window({ title: '播放录音', width: 330, height: 180, iconCls: 'icon-add', shadow: true, modal: true, closed: true, minimizable: false, maximizable: false, collapsible: false }).window('open');
var isChrome = window.navigator.userAgent.indexOf("Chrome") !== -1;
if (isChrome) {
$('#recordPlayerWin').html("<video controls=\"\" src=\"" + data + "\" style=\"width:300px; height:50px;\" autoplay=\"autoplay\" />");
} else {
$('#recordPlayerWin').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="' + data + '"><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 {
alert("转换失败,请稍后重试!");
}
});
}
function Delete_Click() {
var row = $('#tablist').tablegrid('getSelected');
if (row != null) {
$.messager.confirm('提示', '@Suggestion.YouWantToDeleteTheSelectedRecords', function (r) {
if (r) {
$.r_post("Delete?id=" + row.PKID, function (data) {
if (data.type == 1) {
$("#tablist").tablegrid('Load');
}
$.messageBox5s('提示', data.message);
}, "json");
}
});
} else { $.messageBox5s('提示', '@Suggestion.PlaseChooseToOperatingRecords'); }
}
</script>