318 lines
13 KiB
Plaintext
318 lines
13 KiB
Plaintext
@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>
|
||
<style type="text/css">
|
||
.xm-option {
|
||
line-height: 30px;
|
||
}
|
||
</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 ToolBarNew[] {
|
||
new ToolBarNew(){ btnColor="", btnName="聊天记录" },
|
||
new ToolBarNew(){ btnColor="", btnName="外部联系人" },
|
||
new ToolBarNew(){ btnColor="", btnName="绑定企微账号" },
|
||
new ToolBarNew(){ btnColor="", btnName="解绑" },
|
||
new ToolBarNew(){ btnColor="", btnName="转绑" }
|
||
}
|
||
|
||
})
|
||
|
||
</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="name" required lay-verify="required" placeholder="ID/名称/号码" autocomplete="off" class="layui-input">
|
||
</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 table;
|
||
$(function () {
|
||
|
||
});
|
||
</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: 'GetSelfWeWorktHtmlList'
|
||
, method: 'POST'
|
||
, cellMinWidth: 80 //全局定义常规单元格的最小宽度,layui 2.2.1 新增
|
||
, page: true
|
||
, limit: 30
|
||
, height: "full-160"
|
||
//, size:"sm"
|
||
, cols: [[
|
||
{ field: 'checkobj', type: 'checkbox',fixed:'left'}
|
||
,{ field: 'numbers', type: 'numbers' }
|
||
, { field: 'corpid', title: '企业ID' }
|
||
, { field: 'corpname', title: '企业名称' }
|
||
, { field: 'userid', title: 'ID' }
|
||
, { field: 'uname', title: '名称' }
|
||
, { field: 'mobile', title: '手机号' }
|
||
, { field: 'eidAndName', title: '绑定信息' }
|
||
, { field: 'lmsgtime', title: '最后聊天时间' }
|
||
, { field: 'bindTime', title: '绑定时间' }
|
||
, { field: 'assignStatu', title: '推广状态', templet: '#assignStatuTpl' }
|
||
]], where: $("#myform").serializeFormJSON()
|
||
,
|
||
done: function (res, curr, count) {
|
||
$("#isExe").val("");
|
||
$("#fiterUser").val("");
|
||
}
|
||
});
|
||
var num = -1;
|
||
//监听行单击事件(单击事件为: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 dataIndex = obj.tr.attr("data-index");
|
||
if (dataIndex != num) {
|
||
var checkCell = obj.tr.find("td div.laytable-cell-checkbox div.layui-form-checkbox I");
|
||
if (checkCell.length > 0) {
|
||
num = dataIndex;
|
||
checkCell.click();
|
||
}
|
||
}*@
|
||
});
|
||
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 () {
|
||
var checkdata = table.checkStatus('listReload');
|
||
var uidata = checkdata.data;
|
||
if (uidata.length == 0) {
|
||
layer.msg("请至少选中一条记录!", { icon: 7 });
|
||
return;
|
||
}
|
||
var postdata = "";
|
||
for (var i = 0; i < uidata.length; i++) {
|
||
postdata += uidata[i].corpid + ':' + uidata[i].userid+';'
|
||
}
|
||
winindex = layer.open({
|
||
type: 2,
|
||
content:'/MyWork/ChangeEid?data=' + postdata,
|
||
area: ['500px', '600px']
|
||
});
|
||
},
|
||
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 checkdata = table.checkStatus('listReload');
|
||
var uidata = checkdata.data;
|
||
if (uidata.length == 0) {
|
||
layer.msg("请至少选中一条记录!", { icon: 7 });
|
||
return;
|
||
}
|
||
$.ajax({
|
||
type: "POST",
|
||
url: "ClearEid",
|
||
data: { data: JSON.stringify(uidata) } ,
|
||
dataType: "json",
|
||
success: function (da) {
|
||
if (da.result == true) {
|
||
parent.layer.msg('操作成功!', { icon: 1 });
|
||
var param = $("#myform").serializeFormJSON();
|
||
location.reload();
|
||
} else {
|
||
layer.msg(da.retmsg, { icon: 2 });
|
||
}
|
||
},
|
||
error: function () {
|
||
layer.msg('操作失败!', { icon: 2 });
|
||
}
|
||
});
|
||
},
|
||
other3: function () {
|
||
winindex = layer.open({
|
||
type: 2,
|
||
content:'/MyWork/BindEid',
|
||
area: ['1024px', '700px']
|
||
});
|
||
}, other1: function () {
|
||
if (selectRow.userid == "undefined" || selectRow.userid == null) {
|
||
//layer.alert("请先选中一条记录!", { title: '提示' });
|
||
layer.msg("请先选中一条记录!", { icon: 7 });
|
||
return;
|
||
}
|
||
parent.ChildAddTab('企微聊天记录--' + selectRow.uname, messageUrl + 'Admin/OutHHuser/Message?userid=' + selectRow.userid + "&uname=" + encodeURIComponent(selectRow.uname) + "&corp=" + selectRow.corpid+"&isHg=@Html.Raw(ViewBag.IsHg)"+ "&eid=@Html.Raw(ViewBag.wweid)" + "&appid=@Html.Raw(ViewBag.appid)", '');
|
||
}, other2: function () {
|
||
if (selectRow.userid == "undefined" || selectRow.userid == null) {
|
||
//layer.alert("请先选中一条记录!", { title: '提示' });
|
||
layer.msg("请先选中一条记录!", { icon: 7 });
|
||
return;
|
||
}
|
||
|
||
parent.ChildAddTab('外部联系人--' + selectRow.uname, messageUrl + 'Admin/OutHHuser/Outer?userid=' + selectRow.userid + "&uname=" + encodeURIComponent(selectRow.uname) + "&corp=" + selectRow.corpid, '');
|
||
|
||
}, 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', {
|
||
|
||
});
|
||
}
|
||
function GetIframeHtml(src) {
|
||
return "<iframe width='100%' height='98%' scrolling='no' frameborder='0'' src='" + src + "'></iframe>";
|
||
}
|
||
</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">{{ d.assignStatusName }}</span>
|
||
{{# } else if(d.assignStatus == '0') { }}
|
||
<span style="color:gray">{{ d.assignStatusName }}</span>
|
||
{{# } else if(d.assignStatus == '3') { }}
|
||
<span style="color:red">永久删除</span>
|
||
{{# } else if(d.assignStatus == '4') { }}
|
||
<span style="color:red">{{ d.assignStatusName }}</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>
|
||
|