688 lines
30 KiB
Plaintext
688 lines
30 KiB
Plaintext
@using model;
|
||
@using model.viewmodel;
|
||
@{
|
||
ViewBag.Title = "我的企业微信";
|
||
Layout = "~/Views/Shared/_content.cshtml";
|
||
wwUserinfoView myinfo = (wwUserinfoView)ViewBag.MyUser;
|
||
Dictionary<string, List<string>> diclist = ViewBag.YearMonthList;
|
||
List<wwExtuserView> datalist = ViewBag.DataList;
|
||
}
|
||
|
||
<!--确定宽度-->
|
||
<style type="text/css">
|
||
.myUL li {
|
||
line-height: 25px;
|
||
display: inline-block;
|
||
width: 170px;
|
||
overflow: hidden;
|
||
text-overflow: ellipsis;
|
||
white-space: nowrap;
|
||
}
|
||
|
||
input[type='checkbox'] {
|
||
cursor: pointer;
|
||
}
|
||
|
||
.myChooseUL li {
|
||
line-height: 35px;
|
||
display: inline-block;
|
||
width: 35px;
|
||
overflow: hidden;
|
||
text-overflow: ellipsis;
|
||
white-space: nowrap;
|
||
cursor: pointer;
|
||
}
|
||
|
||
.layui-table-body .layui-table-cell {
|
||
height: auto;
|
||
line-height: 30px;
|
||
}
|
||
|
||
.mycheckbox {
|
||
display: inline-block;
|
||
width: 18px;
|
||
height: 18px;
|
||
vertical-align: middle;
|
||
}
|
||
|
||
.layui-form-item {
|
||
margin-bottom: 0px;
|
||
}
|
||
|
||
.layui-table[lay-even] tr:nth-child(even) {
|
||
background-color: #f2f2f2;
|
||
}
|
||
|
||
.layui-table td, .layui-table th, .layui-table[lay-skin=line], .layui-table[lay-skin=row] {
|
||
border-width: 1px !important;
|
||
border-style: solid;
|
||
border-color: #e6e6e6;
|
||
}
|
||
|
||
.mxxx input, .mxxx a {
|
||
margin-right: 0px;
|
||
margin-left: 0px;
|
||
width: 35px;
|
||
padding: 0 3px;
|
||
line-height: 28px;
|
||
}
|
||
|
||
.mxxx .layui-btn + .layui-btn {
|
||
margin-left: 0px;
|
||
}
|
||
|
||
</style>
|
||
<style>
|
||
.XuanFuTop {
|
||
position: fixed;
|
||
/* right: 15px;
|
||
bottom: 15px;*/
|
||
z-index: 999979;
|
||
width: 100%;
|
||
background-color: white;
|
||
bottom: 0px;
|
||
border-top: 1px solid #cac7c7;
|
||
}
|
||
|
||
.PointClass {
|
||
padding-top: 0px;
|
||
margin-top: 0px;
|
||
}
|
||
|
||
.hgguanjianci {
|
||
background-color: #FF9800;
|
||
color: white
|
||
}
|
||
|
||
.LiClas {
|
||
background-color: #08af0a;
|
||
color: white;
|
||
font-weight: bold;
|
||
}
|
||
|
||
.MyUL2 {
|
||
float: right;
|
||
padding-left: 10px;
|
||
}
|
||
|
||
.MyUL2 li {
|
||
line-height: 16px;
|
||
width: 200px;
|
||
text-align: left;
|
||
font-size: 14px;
|
||
font-weight: normal;
|
||
}
|
||
|
||
.selftopwhere {
|
||
padding-top: 3px !important;
|
||
}
|
||
|
||
.mxxx a {
|
||
margin-bottom: 3px;
|
||
}
|
||
|
||
.layui-tab-title .layui-this {
|
||
color: #01AAED !important;
|
||
}
|
||
|
||
.layui-tab-title .layui-this:after {
|
||
border-bottom: 2px solid #01AAED !important;
|
||
}
|
||
|
||
.MyUL2 a {
|
||
color: #01AAED;
|
||
}
|
||
|
||
.MyUL2 a:hover {
|
||
color: #01AAED !important;
|
||
text-decoration: underline !important;
|
||
}
|
||
|
||
.myUL a {
|
||
color: #01AAED !important;
|
||
}
|
||
|
||
.myUL a:hover {
|
||
color: #01AAED !important;
|
||
text-decoration: underline !important;
|
||
}
|
||
|
||
|
||
.hiddenLi {
|
||
display: none !important;
|
||
}
|
||
</style>
|
||
<div id="XuanFuTop" class="XuanFuTop" style="display:none;">
|
||
<form class="layui-form selftopwhere" id="myform" style="padding-top: 5px;">
|
||
<div class="layui-form-item">
|
||
名称:
|
||
<div class="layui-inline">
|
||
<input id="searchname2" type="text" style="width:130px;" name="name" required lay-verify="required" autocomplete="off" class="layui-input">
|
||
</div>
|
||
<div class="layui-inline" style="width:250px">
|
||
<input class="layui-btn layui-btn-sm layui-btn-ok" data-method="search2" type="button" value="查询" />
|
||
<input class="layui-btn layui-btn-sm layui-btn-primary layui-border-blue" data-method="searchAndCheck2" style="margin-left:0px;padding: 0 4px;" type="button" value="✔匹配勾选" />
|
||
<input class="layui-btn layui-btn-sm layui-btn-primary layui-border-blue" data-method="searchAndUnCheck2" style="margin-left:0px;padding: 0 4px;" type="button" value="✖匹配去除" />
|
||
</div>
|
||
</div>
|
||
</form>
|
||
</div>
|
||
<script>
|
||
var table;
|
||
$(function () {
|
||
var xx=0;
|
||
$(window).scroll(function(){
|
||
//console.log($(window).scrollTop());
|
||
if($(window).scrollTop() >= 224){
|
||
$("#XuanFuTop").fadeIn(800); // 开始淡入
|
||
}
|
||
//else{
|
||
// $("#XuanFuTop").stop(true,true).fadeOut(800); // 如果小于等于 300 淡出
|
||
//}
|
||
|
||
if($(window).scrollTop() >= 50){
|
||
$("#ShowChoose").fadeIn(500); // 开始淡入
|
||
}
|
||
else{
|
||
$("#ShowChoose").stop(true,true).fadeOut(500); // 如果小于等于 300 淡出
|
||
}
|
||
});
|
||
$(".layui-fixbar-top").click(function(){
|
||
$('html, body').animate({scrollTop:0}, 'slow');
|
||
});
|
||
});
|
||
</script>
|
||
<div class="layui-fluid" style="padding-left:0px;padding-top:10px;">
|
||
<div class="layui-card" id="topcard" style="width:100%;">
|
||
<div class="layui-card-header layui-self-header" style="height:50px;">
|
||
<div style="float:left;">
|
||
<ul class="layui-tab-title">
|
||
<li onclick="window.location.href='CSelectionTag?machineid=@Html.Raw(ViewBag.machineid)&userid=@Html.Raw(ViewBag.userid)&corpid=@Html.Raw(ViewBag.corpid)'">标签筛选</li>
|
||
<li class="layui-this">添加时间筛选</li>
|
||
<li onclick="window.location.href='CSelectionQY?machineid=@Html.Raw(ViewBag.machineid)&userid=@Html.Raw(ViewBag.userid)&corpid=@Html.Raw(ViewBag.corpid)'">企业筛选</li>
|
||
</ul>
|
||
</div>
|
||
<div style="float:right;position:relative;">
|
||
<img src="@myinfo.thumb_avatar" width='50' height='50' style="vertical-align: middle;">
|
||
<ul class="MyUL2">
|
||
<li>企业号:@myinfo.corpname</li>
|
||
<li>昵称:@myinfo.name</li>
|
||
<li>
|
||
号码:@myinfo.mobile
|
||
<a href="Index?machineid=@ViewBag.machineid" class="qiehuan" title="切换其他企业微信" style="display:none">
|
||
<svg t="1649132381412" class="icon" viewBox="0 0 1029 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4302" width="18" height="18"><path d="M161.069235 551.794827c-25.510524-152.677406 62.122998-306.961398 218.610082-365.336357 115.970485-43.276427 241.009833-22.577709 329.549048 39.240078L633.885825 342.495192l337.867309-1.246695L850.994703 5.965049l-61.857553 95.864295C658.69148 20.981064 480.863441-5.461002 325.148831 52.641553 109.407938 133.129942-14.771449 341.290252 9.746889 551.796816h151.32334z m707.822602-83.572318c25.490641 152.677406-62.100132 306.981282-218.587216 365.336357-106.678928 39.79085-224.237111 24.794718-314.629468-28.849957 17.213142-26.73833 68.081087-105.579371 68.081088-105.579371L40.421157 678.727083 194.172272 1024l64.462291-99.898656c130.423798 80.84828 290.44219 101.397872 446.1568 43.29631 215.69715-80.51026 339.92028-288.648699 315.401942-499.13339H868.893825v-0.041755z" fill="#6E9FF4" p-id="4303"></path></svg>
|
||
切换
|
||
</a>
|
||
</li>
|
||
</ul>
|
||
</div>
|
||
<div style="float:right;position:relative;padding-right: 20px;">
|
||
@* <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-reset" data-method="delete" type="button" value="解绑" />*@
|
||
已选<span id="chooseCount">0</span>人
|
||
<a href="javascript:SubMit();" class="layui-btn layui-btn-sm layui-btn-primary layui-border-blue"><i class="layui-icon layui-icon-tabs"></i>提交数据</a>
|
||
<a href="javascript:ClearAll();" class="layui-btn layui-btn-sm layui-btn-primary layui-border-red"><i class="layui-icon layui-icon-delete"></i>清空已选择</a>
|
||
</div>
|
||
@*<div class="hrclass" style="position:relative;float: left;"></div>*@
|
||
</div>
|
||
<div class="layui-card-body " id="contentBody">
|
||
<div class="layui-row layui-col-space15">
|
||
<div class="layui-col-md6">
|
||
<div class="layui-panel">
|
||
<div style="padding: 5px;">
|
||
<form class="layui-form selftopwhere" id="myform">
|
||
<div class="layui-form-item">
|
||
名称:
|
||
<div class="layui-inline">
|
||
<input id="searchname1" type="text" style="width:130px;" name="name" required lay-verify="required" autocomplete="off" class="layui-input">
|
||
</div>
|
||
|
||
<div class="layui-inline" style="width:250px">
|
||
<input class="layui-btn layui-btn-sm layui-btn-ok" data-method="search1" type="button" value="查询" />
|
||
<input class="layui-btn layui-btn-sm layui-btn-primary layui-border-blue" data-method="searchAndCheck1" style="margin-left:0px;padding: 0 4px;" type="button" value="✔匹配勾选" />
|
||
<input class="layui-btn layui-btn-sm layui-btn-primary layui-border-blue" data-method="searchAndUnCheck1" style="margin-left:0px;padding: 0 4px;" type="button" value="✖匹配去除" />
|
||
@*<input data-method="clear" class="layui-btn layui-btn-sm layui-btn-reset" style="margin-left:0px;" type="reset" value="清空" />*@
|
||
</div>
|
||
</div>
|
||
|
||
@foreach (var item in diclist)
|
||
{
|
||
<div class="layui-form-item">
|
||
<div class="layui-inline mxxx" style="width:auto;">
|
||
@item.Key
|
||
@foreach (var month in item.Value)
|
||
{
|
||
<a ckallday="@month" class="layui-btn layui-btn-primary layui-btn-sm" ischeck="false" onclick="ChooseMonthMyAllA(this,'@Html.Raw(month)','#td_@month')" href="javascript:void(0);" nvalue="@month">@Html.Raw(Convert.ToDateTime((month+"-01")).Month)月</a>
|
||
}
|
||
</div>
|
||
</div>
|
||
}
|
||
</form>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="layui-col-md6">
|
||
<div class="layui-panel">
|
||
<div style="padding: 5px;overflow-y:auto; height:120px;">
|
||
<ul class="myChooseUL" id="chooseUL"></ul>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<table id="newTable" class="layui-table" lay-even lay-skin="row">
|
||
<thead>
|
||
<tr><th colspan="2">时间</th><th>客户</th></tr>
|
||
</thead>
|
||
<tbody>
|
||
@{
|
||
var all = datalist.Where(m => m.type == 1);
|
||
var daylist = all.GroupBy(m => m.cdate);
|
||
Dictionary<string, string> monthDic = new Dictionary<string, string>();
|
||
}
|
||
@foreach (var b in daylist)
|
||
{
|
||
string date = Convert.ToDateTime(b.Key).ToString("yyyy-MM");
|
||
<tr>
|
||
<td>
|
||
@if (!monthDic.ContainsKey(date))
|
||
{
|
||
monthDic.Add(date, date);
|
||
<a name="td_@Html.Raw(date)" class="PointClass"></a>
|
||
<input ckallday="@date" class="layui-btn layui-btn-primary layui-btn-sm" value="@Html.Raw(date)" type="button" ntype="nbp2" ischeck="false" onclick="ChooseMonthMyAll(this,'@Html.Raw(date)')" />
|
||
}
|
||
</td>
|
||
<td>
|
||
<input class="layui-btn layui-btn-primary layui-btn-sm" ckAllDay='@Html.Raw(date)' value="@Html.Raw(b.Key)" type="button" ntype="nbp" ischeck="false" onclick="ChooseMyAll(this,'@Html.Raw(b.Key)')" />
|
||
</td>
|
||
<td>
|
||
<ul class="myUL">
|
||
@{
|
||
int mycount = 0;
|
||
}
|
||
@foreach (var item in all.Where(m => m.cdate == b.Key).OrderBy(m => m.xuhao))
|
||
{
|
||
mycount++;
|
||
var mystyle = "";
|
||
|
||
if (mycount > 10)
|
||
{
|
||
mystyle = "hiddenLi";
|
||
}
|
||
string name = string.IsNullOrEmpty(item.remark) ? item.nickname : item.remark;
|
||
name = common.PhoneHelper.FormatPhoneUserName(name);
|
||
<li title="@Html.Raw(name)" class="@mystyle" mycount="@mystyle">
|
||
<input type='checkbox' ckmonth='@Html.Raw(date)' lay-ignore name='chooseck' id='ck_@Html.Raw(item.extuserid)' class='mycheckbox' onchange="ChooseOne(this,'@Html.Raw(item.extuserid)','@Html.Raw(item.thumb_avatar)','@Html.Raw(name)','@Html.Raw(item.description)',true)" cname='@Html.Raw(name)' thumb_avatar='@Html.Raw(item.thumb_avatar)' extuserid='@Html.Raw(item.extuserid)' description='@Html.Raw(item.description)' cktype='@Html.Raw(item.cdate)' value='@Html.Raw(item.extuserid)'>
|
||
@if (mycount > 10)
|
||
{
|
||
<img src="" nsrc="@Html.Raw(item.thumb_avatar)" width='28' height='28'>
|
||
}
|
||
else
|
||
{
|
||
<img src="@Html.Raw(item.thumb_avatar)" width='28' height='28'>
|
||
}
|
||
<span class="custonername">@Html.Raw(name)</span>
|
||
</li>
|
||
} @if (mycount > 10)
|
||
{
|
||
<li title="显示剩余客户" onclick="ShowHiddent(this)" ishidden="true">
|
||
<a href="javascript:void(0);">更多<i class="layui-icon layui-icon-down"></i> </a>
|
||
</li>
|
||
}
|
||
</ul>
|
||
</td>
|
||
</tr>
|
||
}
|
||
</tbody>
|
||
</table>
|
||
@*<table class="layui-hide" id="tab_kefuzhuangtaiyi1" lay-filter="wochao"></table>*@
|
||
<div style="height:200px;"> </div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<script>
|
||
function ShowHiddent(ck){
|
||
var hidden= $(ck).attr("ishidden");
|
||
if(hidden=="true"){
|
||
$(ck).parent().find("[mycount='hiddenLi']").removeClass("hiddenLi");
|
||
$(ck).attr("ishidden","false");
|
||
$(ck).html('<a href="javascript:void(0);">隐藏<i class="layui-icon layui-icon-up"></i> </a>');
|
||
$(ck).parent().find("[mycount='hiddenLi']").find("img").each(function(inx,bm){
|
||
if(!$(bm).attr("src")){
|
||
$(bm).attr("src",$(bm).attr("nsrc"));//无数据就显示图片
|
||
}
|
||
});
|
||
}else{
|
||
$(ck).parent().find("[mycount='hiddenLi']").addClass("hiddenLi");
|
||
$(ck).attr("ishidden","true");
|
||
$(ck).html('<a href="javascript:void(0);">更多<i class="layui-icon layui-icon-down"></i> </a>');
|
||
|
||
}
|
||
}
|
||
</script>
|
||
<script>
|
||
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");
|
||
// });
|
||
//});
|
||
var machineid='@ViewBag.Machineid';
|
||
var alldata=@Html.Raw(ViewBag.Data);
|
||
layui.use(['laypage', 'layer', 'table', 'laydate'], function () {
|
||
var laydate = layui.laydate;
|
||
layer = layui.layer;
|
||
table = layui.table;
|
||
var active = {
|
||
add: function () {
|
||
winindex = layer.open({
|
||
type: 2,
|
||
content: 'Bind?machineid=' + machineid,
|
||
title: '绑定企业微信',
|
||
area: ['500px', '400px']
|
||
});
|
||
}
|
||
, delete: function () {
|
||
if (selectRow.userid == "undefined" || selectRow.userid == null) {
|
||
layer.msg("请先选中一条记录!", { icon: 7 });
|
||
return;
|
||
}
|
||
layer.confirm('确定解绑吗?', {icon: 3, title:'提示'}, function(index){
|
||
var loading = layer.load(0, { shade: true});
|
||
$.ajax({
|
||
type: "POST",
|
||
url: "DisBind",
|
||
data:{machineid:machineid,userid:selectRow.userid,corpid:selectRow.corpid} ,
|
||
dataType: "json",
|
||
success: function (da) {
|
||
if (da.result == true) {
|
||
layer.msg('操作成功!', { icon: 1 });
|
||
TableReload();
|
||
} else {
|
||
layer.msg(da.retmsg, { icon: 2 });
|
||
}
|
||
},
|
||
error: function () {
|
||
layer.msg('操作失败!', { icon: 2 });
|
||
}
|
||
});
|
||
layer.close(loading);
|
||
});
|
||
}, search1: function () {
|
||
var name=$("#searchname1").val();
|
||
$("#searchname2").val(name);
|
||
ShearchPoint(name);
|
||
}, search2: function () {
|
||
var name=$("#searchname2").val();
|
||
$("#searchname1").val(name);
|
||
ShearchPoint(name);
|
||
},clear:function(){
|
||
ClearSearch();
|
||
},searchAndCheck1:function(){
|
||
var name=$("#searchname1").val();
|
||
$("#searchname2").val(name);
|
||
searchAndCheck();
|
||
},searchAndUnCheck1:function(){
|
||
var name=$("#searchname1").val();
|
||
$("#searchname2").val(name);
|
||
searchAndUnCheck();
|
||
},searchAndCheck2:function(){
|
||
var name=$("#searchname2").val();
|
||
$("#searchname1").val(name);
|
||
searchAndCheck();
|
||
},searchAndUnCheck2:function(){
|
||
var name=$("#searchname2").val();
|
||
$("#searchname1").val(name);
|
||
searchAndUnCheck();
|
||
}
|
||
};
|
||
$('.layui-btn').on('click', function () {
|
||
var othis = $(this), method = othis.data('method');
|
||
console.log(method);
|
||
active[method] ? active[method].call(this, othis) : '';
|
||
|
||
});
|
||
});
|
||
var preName="";
|
||
var searchIndex=0;
|
||
var maodian=[];
|
||
var maodianIndex=0;
|
||
function ShearchPoint(name){
|
||
if(name){
|
||
name=$.trim(name);
|
||
}
|
||
if(preName!=name){//名字不相等,进行锚点创建
|
||
preName=name;
|
||
$(".hgguanjianci").each(function(aa,bb){
|
||
$(this).after($(this).attr("title"));
|
||
$(this).remove();
|
||
});
|
||
$(".LiClas").removeClass("LiClas");
|
||
maodian=[];
|
||
maodianIndex=0;
|
||
var mi=0;
|
||
if(!name){
|
||
return;
|
||
}
|
||
$(".custonername").each(function(aa,bb){
|
||
var txt=$(this).html();
|
||
if(txt.indexOf(name)>-1){
|
||
searchIndex++;
|
||
txt=txt.replace(name,"<span class='hgguanjianci' title='"+name+"'><a name='search_"+searchIndex+"'></a>"+name+"</span>");
|
||
$(this).html(txt);
|
||
maodian[mi]="search_"+searchIndex;//添加到临时集合
|
||
mi++;
|
||
}
|
||
});
|
||
console.log(maodian);
|
||
if(maodian.length>0){
|
||
location.href="#"+maodian[maodianIndex];//锚点定位
|
||
$(".LiClas").removeClass("LiClas");
|
||
$("[name=\""+maodian[maodianIndex]+"\"]").parent().parent().addClass("LiClas");
|
||
}else{
|
||
layer.msg("未找查找到!", { icon: 7 });
|
||
}
|
||
}else{//名字相等,进行下一个锚点定位
|
||
maodianIndex++;
|
||
if(maodianIndex>=maodian.length){
|
||
layer.msg("没有更多!", { icon: 7 });
|
||
maodianIndex=-1;
|
||
return ;
|
||
}
|
||
else{
|
||
location.href="#"+maodian[maodianIndex];//锚点定位
|
||
$(".LiClas").removeClass("LiClas");
|
||
$("[name=\""+maodian[maodianIndex]+"\"]").parent().parent().addClass("LiClas");
|
||
}
|
||
}
|
||
preName=name;
|
||
}
|
||
function searchAndCheck(){
|
||
maodianIndex--;
|
||
//console.log($("#searchname1").val());
|
||
ShearchPoint($("#searchname1").val());
|
||
$(maodian).each(function(a,b){
|
||
var checkbox= $("[name=\""+b+"\"]").parent().parent().parent().find("[type=\"checkbox\"]");
|
||
$(checkbox).prop("checked",true);
|
||
ChooseOne( $(checkbox),$(checkbox).attr("extuserid"),$(checkbox).attr("thumb_avatar"),$(checkbox).attr("cname"),$(checkbox).attr("description"),false);
|
||
});
|
||
ShowCount();
|
||
}
|
||
function searchAndUnCheck(){
|
||
maodianIndex--;
|
||
ShearchPoint($("#searchname1").val());
|
||
$(maodian).each(function(a,b){
|
||
var checkbox= $("[name=\""+b+"\"]").parent().parent().parent().find("[type=\"checkbox\"]");
|
||
$(checkbox).prop("checked",false);
|
||
ChooseOne( $(checkbox),$(checkbox).attr("extuserid"),$(checkbox).attr("thumb_avatar"),$(checkbox).attr("cname"),$(checkbox).attr("description"),false);
|
||
});
|
||
ShowCount();
|
||
|
||
}
|
||
function ClearSearch(){
|
||
$("#searchname1").val("");
|
||
$("#searchname2").val("");
|
||
$(".hgguanjianci").each(function(aa,bb){
|
||
$(this).after($(this).attr("title"));
|
||
$(this).remove();
|
||
});
|
||
$(".LiClas").removeClass("LiClas");
|
||
maodian=[];
|
||
maodianIndex=0;
|
||
preName="";
|
||
}
|
||
//选择某天勾选
|
||
function ChooseMyAll(ck,cdate){
|
||
if($(ck).attr("ischeck")=="false"){
|
||
$("#newTable").find("[cktype='"+cdate+"']").prop("checked",true);
|
||
$(ck).attr("ischeck","true").addClass("layui-border-blue");
|
||
}else{
|
||
$("#newTable").find("[cktype='"+cdate+"']").prop("checked",false);
|
||
$(ck).attr("ischeck","false").removeClass("layui-border-blue");
|
||
}
|
||
$("#newTable").find("[cktype='"+cdate+"']").each(function(dd,i){
|
||
ChooseOne(this,$(this).attr("extuserid"),$(this).attr("thumb_avatar"),$(this).attr("cname"),$(this).attr("description"),false);
|
||
});
|
||
ShowCount();
|
||
}
|
||
function ChooseMonthMyAllA(ck,cdate,href){
|
||
ChooseMonthMyAll(ck,cdate);
|
||
window.location.href=href;
|
||
}
|
||
//月份勾选
|
||
function ChooseMonthMyAll(ck,cdate){
|
||
if($(ck).attr("ischeck")=="false"){
|
||
$("#newTable").find("[ckmonth='"+cdate+"']").prop("checked",true);
|
||
//$(ck).attr("ischeck","true").addClass("layui-border-blue");
|
||
$("[ckAllDay='"+cdate+"']").attr("ischeck","true").addClass("layui-border-blue");
|
||
|
||
}else{
|
||
$("#newTable").find("[ckmonth='"+cdate+"']").prop("checked",false);
|
||
//$(ck).attr("ischeck","false").removeClass("layui-border-blue");
|
||
$("[ckAllDay='"+cdate+"']").attr("ischeck","false").removeClass("layui-border-blue");
|
||
}
|
||
$("#newTable").find("[ckmonth='"+cdate+"']").each(function(dd,i){
|
||
ChooseOne(this,$(this).attr("extuserid"),$(this).attr("thumb_avatar"),$(this).attr("cname"),$(this).attr("description"),false);
|
||
});
|
||
ShowCount();
|
||
}
|
||
//单个勾选
|
||
function ChooseOne(ck,extuserid,thumb_avatar,title,description,isOne){
|
||
if(ck){
|
||
if($(ck).is(':checked')){
|
||
if($("#Chose_"+extuserid).length==0){
|
||
var html="<li title='"+title+"'description='"+description+"' id='Chose_"+extuserid+"' avatar='"+thumb_avatar+"' onclick='CanCleOne(this,\""+extuserid+"\")'><img src='"+thumb_avatar+"' width='30' height='30'></li>";
|
||
$("#chooseUL").append(html);
|
||
}
|
||
}else{
|
||
$("#Chose_"+extuserid).remove();
|
||
}
|
||
}
|
||
if(isOne){
|
||
ShowCount();
|
||
}
|
||
}
|
||
//已选客户头像点击,取消
|
||
function CanCleOne(cn,extuserid){
|
||
$(cn).remove();
|
||
$("#newTable").find("#ck_"+extuserid).prop("checked",false);
|
||
ShowCount();
|
||
}
|
||
//显示已选数量
|
||
function ShowCount(){
|
||
var chooseLenth=$("#chooseUL").children().length;
|
||
$("#chooseCount").html(chooseLenth);
|
||
$("#ChooseCountXF").html(chooseLenth);
|
||
|
||
}
|
||
function Closed() {
|
||
layer.close(winindex);
|
||
}
|
||
function TableReload() {
|
||
table.reload('listReload', {
|
||
|
||
});
|
||
}
|
||
|
||
|
||
|
||
//提交
|
||
function SubMit(){
|
||
var subdata=[];
|
||
var outuserids = [];
|
||
var userid = '@Html.Raw(ViewBag.userid)';
|
||
var corpid = '@Html.Raw(ViewBag.corpid)';
|
||
$("#chooseUL li").each(function(a,b){
|
||
subdata[a]={name:$(this).attr("title"),description:$(this).attr("description"),avatar:$(this).attr("avatar")};
|
||
outuserids[a] = {name:$(this).attr("title"),userid : $(this).attr("id").replace("Chose_","")};
|
||
});
|
||
var last=JSON.stringify(subdata);
|
||
console.log(last)
|
||
//alert(subdata);
|
||
setdata(last);
|
||
window.parent.postMessage({ type: "chooseMsgToolUser",pagetype:2, userid:userid,outuserList: outuserids,corpid:corpid}, "*");
|
||
}
|
||
//清空已选
|
||
function ClearAll(){
|
||
$("#chooseUL").html("");//清空
|
||
$("#newTable").find(":checked").prop("checked",false);
|
||
$("[ntype='nbp2']").attr("ischeck","false");
|
||
$("[ckAllDay]").attr("ischeck","false");
|
||
ShowCount();
|
||
}
|
||
window.addEventListener('message',function(e){
|
||
var value = e.data;
|
||
//返回方法向父页面发送数据
|
||
if (value != null && value.type == 'initData') {
|
||
if (value.userChose != "") {
|
||
var outuserList = value.userChose.outuserList;
|
||
for (var i = 0; i < outuserList.length; i++) {
|
||
checkbox = $("#newTable").find("#ck_"+outuserList[i].userid);
|
||
$(checkbox).prop("checked",true);
|
||
ChooseOne( $(checkbox),$(checkbox).attr("extuserid"),$(checkbox).attr("thumb_avatar"),$(checkbox).attr("cname"),$(checkbox).attr("description"),false);
|
||
}
|
||
ShowCount();
|
||
}
|
||
|
||
}
|
||
}, false);
|
||
document.onkeydown = function (e) {
|
||
//捕捉回车事件
|
||
var ev = (typeof event != 'undefined') ? window.event : e;
|
||
if (ev.keyCode == 13 || event.which == 13) {
|
||
ShearchPoint($("#searchname1").val());
|
||
return false;
|
||
}
|
||
}
|
||
</script>
|
||
<script type="text/javascript">
|
||
(async function(){
|
||
//await CefSharp.BindObjectAsync("cefsharpbrowser");
|
||
})();
|
||
|
||
function setdata(data) {
|
||
try{
|
||
cefsharpbrowser.setdata(data);
|
||
}
|
||
catch(e){
|
||
}
|
||
}
|
||
</script>
|
||
<ul id="ShowChoose" class="layui-fixbar" style="top:60px;display:none;">
|
||
<li class="layui-icon " lay-type="top" style="display: list-item;line-height: 23px;font-size: 16px;width: 60px;">已选<br /><span id="ChooseCountXF">0</span>人</li>
|
||
</ul>
|
||
<ul class="layui-fixbar">
|
||
<li class="layui-icon layui-fixbar-top" lay-type="top" style="display: list-item;"></li>
|
||
</ul>
|