ComplianceServer/oldcode/WEB/Views/TS/WebChatQun/Index.cshtml

145 lines
4.4 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.WebHelper
@{
ViewBag.Title = "微信群发助手";
Layout = "~/Views/Shared/_Index_Layout2.cshtml";
}
<script src="~/Scripts/jquery.cookie.js"></script>
<div class="mvctool">
@Html.ToolButton("btnQuery", "icon-search", "刷新", true)
</div>
<table style="width: 100%; ">
<tr>
<td>
<div class="bas_datagrid">
<div id="tb" style="padding:5px;height:auto" class="grid_toolbar">
请选择服务微信号:
</div>
@Html.Raw(ViewBag.gridTable2)
<div id="foot">
<br />
</div>
</div>
<br />
<span style="color:red">提示:上面可以选择多个微信</span>
</td>
</tr>
<tr>
<td style="height:50px;">&nbsp;</td>
</tr>
<tr>
<td>发送内容:</td>
</tr>
<tr>
<td>
<form id="CreateForm">
<input id="alias" name="alias" type="hidden"/>
<textarea id="addResTxt" name="msg" cols="70" rows="10"></textarea>
</form>
</td>
</tr>
<tr>
<td>
<input type="button" value="发送" id="AddRes" />
<br />
<span style="color:red">提示:上面填写内容,点击发送会自动推送到对应的服务微信的手机中,进行自动的群发消息。</span>
<br />
</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
</table>
<script type="text/javascript">
var eid = "@Html.Raw(ViewBag.Eid)";
var cookieName = "WebChatAssistant_" + eid;
$(function () {
$('#tablis1').tablegrid({
url: '/TS/WebChatQun/GetHtmlList',
height: $(window).height() - 460,
loadNow: true,
isCheckMore: true,
onLoadSuccess: function (data) {
//成功
}, onLoadError: function (ex) {
//失败
}
});
$("#btnQuery").click(function () {//搜索按钮点击事件
var cookieName = "WebChatAssistant_" + eid;
var cookieValue = $.cookie(cookieName);
//alert("获取ResId:" + cookieValue);
$('#tablis1').tablegrid("Search");
});
$("#DeleteItem").click(function () {
var selectRow = $('#tablis1').tablegrid('getSelections');
$(selectRow).each(function (i, row) {
DeleteCookies(row.resid);
});
$('#tablis1').tablegrid("Search");
});
$("#AddRes").click(function () {
var alias = GetAlias();
if (alias.length == 0) {
$.messager.alert('提醒', "请选择服务微信号!", 'info');
return;
}
$("#alias").val(alias);
$.r_ajax({
url: "/TS/WebChatQun/SendMsg",
type: "Post",
data: $("#CreateForm").serialize(),
dataType: "json",
loading: true,
success: function (data) {
if (data.type == 1) {
$("#addResTxt").val("");
$.cookie(cookieName, data.okResid, {
expires: 7,
path: '/',
})
$.messager.alert('提醒', "发送成功!", 'info');
}
}
});
});
});
//获取员工ID 获取被选中的员工ID
function GetAlias() {
var selects = $("#tablis1").tablegrid("getSelections");
var pkids = "";
$(selects).each(function (i, n) {
pkids += "" + n.alias + ",";
});
if (pkids.length > 0)
pkids = pkids.substr(0, pkids.length - 1);
return pkids;
}
function GetIframeHtml(src) {
return "<iframe width='100%' height='98%' scrolling='no' frameborder='0'' src='" + src + "'></iframe>";
}
function frameReturnByMes(mes) {
$.messageBox5s('提示', mes);
}
function frameReturnByClose() {
$("#modalwindow").window('close');
}
function frameReturnByReload(flag) {
$("#tablis1").tablegrid("Load");
}
//重建序号
function RebuildIndex() {
$("#tablis2").find("tbody tr").each(function (i, n) {
$(this).find("td:first-child").html(i + 1);
});
}
</script>