ComplianceServer/oldcode/WEB/Views/Ww/MyWork/Index.cshtml

391 lines
18 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;
@{
ViewBag.Title = "Index";
Layout = "~/Views/Shared/_content.cshtml";
}
<script src="/Scripts/jquery.easyui.min.js" type="text/javascript"></script>
<link href="/Content/themes/blue/easyui.css" rel="stylesheet" />
<link href="/Content/Site.css" rel="stylesheet" />
<script src="/Scripts/common.js"></script>
<link href="/Content/data_grid_list.css" rel="stylesheet" />
<script src="/Scripts/op/jquery.rewrite.js"></script>
<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[] {}
}
)*@
@Html.Action("ToolBarNew", "Control", new
{
tool = ViewBag.ToolBar as ToolBar,
otherToolBars = new ToolBarNew[] {
new ToolBarNew(){ btnColor="", btnName="聊天记录" },
new ToolBarNew(){ btnColor="", btnName="外部联系人" },
new ToolBarNew(){ btnColor="", btnName="查找客户" },
new ToolBarNew(){ btnColor="", btnName="群管理" },
new ToolBarNew(){ btnColor="", btnName="设置" },
new ToolBarNew(){ btnColor="", btnName="测试企微" }
}
})
@*<input class="layui-btn layui-btn-sm layui-btn-normal" data-method="other4" type="button" value="选择客户" />*@
@*<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" style="width:460px;">
@Html.Action("UserSSOComBox", "Control", new { currentRight = WX.CRM.WebHelper.InitRights.CONST_付费企业微信 })
</div>
客服工号:
<div class="layui-inline">
<input type="text" name="seid" required lay-verify="required" placeholder="客服工号" autocomplete="off" class="layui-input">
</div>
企业:
<div class="layui-inline">
@Html.DropDownList("corp", ViewBag.Select as List<SelectListItem>, new Dictionary<string, object> {
{ "lay-filter", "corp_deptid" },
})
</div>
名称:
<div class="layui-inline">
<input type="text" name="name" required lay-verify="required" placeholder="ID/名称/号码" autocomplete="off" class="layui-input">
<input type="hidden" name="deptid" id="deptid" value="">
</div>
是否推广:
<div class="layui-inline">
<select name="assignStatus">
<option value="-1">全部</option>
<option value="1">是</option>
<option value="0">否</option>
<option value="3">永久删除</option>
<option value="4">暂停</option>
</select>
</div>
排序:
<div class="layui-inline">
<select name="orderType">
<option value="1">本部门优先</option>
<option value="2">非本部门优先</option>
</select>
</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>
function onLoadSucced() { }
//企业号的数据
var mydata=@Html.Raw(ViewBag.DataList);
var table;
$(function () {
var myrequest = "@Html.Raw(ViewBag.companycode)";
if (myrequest != "") {
let mydeptid = "";
$(mydata.filter(m => m.corpid == $("#corp").val())).each(function (is, sw) {
mydeptid = sw.deptid;
});
$("#deptid").val(mydeptid);
}
//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>
layui.use('laydate', function () {
var laydate = layui.laydate;
//执行一个laydate实例
laydate.render({
elem: '#start' //指定元素
});
//执行一个laydate实例
laydate.render({
elem: '#end' //指定元素
});
});
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', 'form'], function () {
var form = layui.form;
var laydate = layui.laydate;
layer = layui.layer;
table = layui.table;
table.render({
id: 'listReload'//列表别名ID
, elem: '#tab_kefuzhuangtaiyi1'
, url: 'GetWeWorktHtmlList'
, method: 'POST'
, cellMinWidth: 80 //全局定义常规单元格的最小宽度layui 2.2.1 新增
, page: true
, limit: 30
, height: "full-160"
//, size:"sm"
, cols: [[
{ field: 'numbers', type: 'numbers' }
, { field: 'corpid', title: '企业ID' }
, { field: 'corpname', title: '企业号' }
, { field: 'userid', title: 'ID' }
, { field: 'uname', title: '名称' }
, { field: 'lmsgtime', title: '最后聊天时间' }
, { field: 'eidAndName', title: '工号/姓名' }
, { field: 'gname', title: '组别' }
, { field: 'assignStatu', title: '是否推广', templet: '#assignStatuTpl' }
, { field: 'deptname', title: '部门信息', templet: '#DeptTpl', width: 200 }
, { field: 'mobile', title: '号码' }
, { field: 'email', title: '邮箱' }
, { field: 'newAdd', title: '今日新增' }
, { field: 'myExtuser', title: '客户总数', width: 100 }
]], 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;
});
form.on('select(corp_deptid)', function (data) {
console.log(data);
let mydeptid = "";
$(mydata.filter(m => m.corpid == data.value)).each(function (is, sw) {
mydeptid = sw.deptid;
});
$("#deptid").val(mydeptid);
});
var messageUrl = "@Html.Raw(ViewBag.WwMessage_Url)";
if (messageUrl.indexOf("$") > -1) {
messageUrl = messageUrl.split("$")[0];
}
if (messageUrl.indexOf("|") > -1) {//分内外网
var ssw = window.location.href;
if (ssw.indexOf("192.168.") > -1 || ssw.indexOf("localhost") > -1) {//内网无疑
messageUrl = messageUrl.split('|')[0];
} else {
messageUrl = messageUrl.split('|')[1];
}
}
if (messageUrl.charAt(messageUrl.length - 1) != '/') {
messageUrl = messageUrl + "/"
}
var active = {
other5: function () {
if (selectRow.userid == "undefined" || selectRow.userid == null) {
layer.msg("请先选中一条记录!", { icon: 7 });
return;
}
if (selectRow.isMyController != 1) {
//layer.alert("请先选中一条记录!", { title: '提示' });
layer.msg("非本部门的企业微信不能被操作!", { icon: 7 });
return;
}
winindex = layer.open({
type: 2,
content: '/Ww/MyWork/SetEid?corp=' + selectRow.corpid + '&userid=' + selectRow.userid,
area: [ '500px','300px']
});
},
other6: function () {
if (selectRow.userid == "undefined" || selectRow.userid == null) {
layer.msg("请先选中一条记录!", { icon: 7 });
return;
}
$.get("check?appid=" + selectRow.corpid + "&userid=" + selectRow.userid, function (rsp) {
if (rsp.resutl) {
layer.msg('账号可用');
}
else {
layer.msg('账号不可用');
}
});
},
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");
//if (window["context"] == undefined) {
// if (!window.location.origin) {
// window.location.origin = window.location.protocol + "//" + window.location.hostname + (window.location.port ? ':' + window.location.port : '');
// }
// window["context"] = location.origin + "/V6.0";
//}
//window.top.postMessage({ name: '微信群--' + corpname, url: location.origin + '/Admin/OutHHuser/Group?corp=' + corp, icon: "icon-detail" }, "*");
parent.ChildAddTab('微信群--' + corpname, messageUrl + 'Admin/OutHHuser/Group?corp=' + corp, '');
},
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: messageUrl+ 'Admin/OutHHuser/Find?companycode=@Html.Raw(ViewBag.companycode)',
area: [width + 'px', height + 'px']
});
}, other1: function () {
if (selectRow.userid == "undefined" || selectRow.userid == null) {
//layer.alert("请先选中一条记录!", { title: '提示' });
layer.msg("请先选中一条记录!", { icon: 7 });
return;
}
if (selectRow.isMyController != 1) {
//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']
//});
//if (window["context"] == undefined) {
// if (!window.location.origin) {
// window.location.origin = window.location.protocol + "//" + window.location.hostname + (window.location.port ? ':' + window.location.port : '');
// }
// window["context"] = location.origin + "/V6.0";
//}
//window.top.postMessage({ name: '企微聊天记录--' + selectRow.uname, url: location.origin + '/Admin/OutHHuser/Message?userid=' + selectRow.userid + "&uname=" + encodeURIComponent(selectRow.uname) + "&corp=" + selectRow.corpid, icon: "icon-detail" }, "*");
parent.ChildAddTab('企微聊天记录--' + selectRow.uname, messageUrl + 'Admin/OutHHuser/Message?userid=' + selectRow.userid + "&uname=" + encodeURIComponent(selectRow.uname) + "&corp=" + selectRow.corpid+"&isHg=@Html.Raw(ViewBag.IsHg)", '');
//window.parent.ChildAddTab('企微聊天记录--' + selectRow.uname, '/Admin/HHuser/Message?userid=' + selectRow.userid + "&uname=" + selectRow.uname + "&corp=" + selectRow.corpid, "icon-detail");
}, other2: function () {
if (selectRow.userid == "undefined" || selectRow.userid == null) {
//layer.alert("请先选中一条记录!", { title: '提示' });
layer.msg("请先选中一条记录!", { icon: 7 });
return;
}
if (selectRow.isMyController != 1) {
//layer.alert("请先选中一条记录!", { title: '提示' });
layer.msg("非本部门的企业微信不能被操作!", { icon: 7 });
return;
}
//if (window["context"] == undefined) {
// if (!window.location.origin) {
// window.location.origin = window.location.protocol + "//" + window.location.hostname + (window.location.port ? ':' + window.location.port : '');
// }
// window["context"] = location.origin + "/V6.0";
//}
//window.top.postMessage({ name: '企微聊天记录--' + selectRow.uname, url: location.origin + '/Admin/OutHHuser/Outer?userid=' + selectRow.userid + "&uname=" + encodeURIComponent(selectRow.uname) + "&corp=" + selectRow.corpid, icon: "icon-detail" }, "*");
parent.ChildAddTab('外部联系人--' + selectRow.uname, messageUrl + 'Admin/OutHHuser/Outer?userid=' + selectRow.userid + "&uname=" + encodeURIComponent(selectRow.uname) + "&corp=" + selectRow.corpid, '');
//window.parent.ChildAddTab('外部联系人--' + selectRow.uname, '/Admin/HHuser/Outer?userid=' + selectRow.userid + "&uname=" + 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,
page: {
curr: 1
}
});
}
};
$('.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', {
});
}
</script>
<script type="text/html" id="agentTpl">
{{# if(d.ISOUTERAGENT == '1'){ }}
{{# } else if(d.ISOUTERAGENT == '0') { }}
{{# } }}
</script>
<script type="text/html" id="assignStatuTpl">
{{# if(d.assignStatus == '1'){ }}
<span style="color:green">是</span>
{{# } else if(d.assignStatus == '0') { }}
<span style="color:gray">否</span>
{{# } else if(d.assignStatus == '3') { }}
<span style="color:red">永久删除</span>
{{# } else if(d.assignStatus == '4') { }}
<span style="color:red">暂停</span>
<a style="padding-left:10px;" href="https://open.work.weixin.qq.com/devtool/query?e={{d.errorcode}}" target="_blank">查看原因</a>
{{# } }}
</script>
<script type="text/html" id="DeptTpl">
{{# if(d.isMyController == '1'){ }}
<span style="color:green">{{ d.deptname }}</span>
{{# } else { }}
<span style="color:gray">{{ d.deptname }}</span>
{{# } }}
</script>