Mini.Crm/Mini.Web/Areas/Admin/Views/QDOutHHuser/Index.cshtml

277 lines
13 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 Mini.Web.WebHelper;
@{
ViewBag.Title = "Index";
Layout = "~/Areas/Admin/Views/Shared/_content.cshtml";
}
<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[] {}
}
)*@
@await Component.InvokeAsync("ToolBarNew", new { ToolBar = ViewBag.ToolBar as ToolBar, otherToolBars = new Mini.Web.WebHelper.ToolBarNew[] {
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">
@Html.DropDownList("corp", ViewBag.Select as List<SelectListItem>, new Dictionary<string, object> {
{ "lay-filter", "corp_deptid" },
})
</div>
名称:
<div class="layui-inline">
<input type="text" style="width:130px;" 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">
<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>
//企业号的数据
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: 'remarkname', title: '备注名称' }
]], 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 active = {
other5: function () {
if (selectRow.userid == "undefined" || selectRow.userid == null) {
//layer.alert("请先选中一条记录!", { title: '提示' });
layer.msg("请先选中一条记录!", { icon: 7 });
return;
}
winindex = layer.open({
type: 2,
content: 'Remarks?userid=' + selectRow.userid + "&corp=" + selectRow.corpid,
title: '备注姓名',
area: ['500px', '400px']
});
},
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" }, "*");
},
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: '/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;
}
//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+"&isHg=@Html.Raw(ViewBag.iisHgsh)", icon: "icon-detail" }, "*");
//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 (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" }, "*");
//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', {
page: {
curr: 1 //重新从第 1 页开始
},
where: param
});
}
};
$('.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>