255 lines
10 KiB
Plaintext
255 lines
10 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>
|
||
.layui-table-cell {
|
||
height: auto;
|
||
}
|
||
.layui-table-body{
|
||
height:600px !important;
|
||
}
|
||
</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[] { }
|
||
|
||
})
|
||
</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>
|
||
客户ID:
|
||
<div class="layui-inline">
|
||
<input type="text" name="resid" placeholder="客户ID" autocomplete="off" class="layui-input">
|
||
</div>
|
||
昵称:
|
||
<div class="layui-inline">
|
||
<input type="text" name="name" placeholder="客户ID" autocomplete="off" class="layui-input">
|
||
</div>
|
||
来源:
|
||
<div class="layui-inline">
|
||
<select id="addway" name="addway" style="width:150px;" lay-filter="changeMidSource">
|
||
<option value="">--全部--</option>
|
||
@foreach (var item in ViewBag.SceneType as List<SelectListItem>)
|
||
{
|
||
<option value="@item.Value">@item.Text</option>
|
||
}
|
||
</select>
|
||
</div>
|
||
活动名称:
|
||
<div class="layui-inline">
|
||
<select id="activeId" name="activeName">
|
||
</select>
|
||
</div>
|
||
时间:
|
||
<div class="layui-inline">
|
||
<input class="layui-input" placeholder="开始日" name="xstime" id="xstart" style="width:120px;">
|
||
</div>
|
||
<div class="layui-inline">
|
||
<input class="layui-input" placeholder="截止日" name="xetime" id="xend" style="width:120px;">
|
||
</div>
|
||
<div class="layui-inline" style="width:460px;">
|
||
@Html.Action("UserSSOComBox", "Control", new { currentRight = WX.CRM.WebHelper.InitRights.CONST_我的企微客户 })
|
||
|
||
</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);
|
||
}
|
||
});
|
||
</script>
|
||
<script>
|
||
layui.use('laydate', function () {
|
||
var laydate = layui.laydate;
|
||
var nowDate = new Date(); //当前日期;
|
||
laydate.render({ elem: '#xstart', value: nowDate });
|
||
laydate.render({ elem: '#xend', value: nowDate });
|
||
});
|
||
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: 'GetMyWeWorktHtmlList'
|
||
, method: 'POST'
|
||
, cellMinWidth: 80 //全局定义常规单元格的最小宽度,layui 2.2.1 新增
|
||
, page: true
|
||
, limit: 30
|
||
, height: "full-160"
|
||
//, size:"sm"
|
||
, cols: [[
|
||
{ field: 'numbers', type: 'numbers' }
|
||
, { field: 'unionid', title: '企微', templet: '#qwNameTpl',width: 200 }
|
||
, { field: 'resId', title: '客户id', width: 300, templet: '#resTpl'}
|
||
, { field: 'avatar', title: '头像', templet: '#imgTpl' }
|
||
, { field: 'name', title: '昵称' }
|
||
, { field: 'addway', title: '来源' }
|
||
, { field: 'activeName', title: '活动名称' }
|
||
, { field: 'deptName', title: '部门', width: 200 }
|
||
, { field: 'userName', title: '员工' }
|
||
, { field: 'createTime', title: '创建时间', width: 180 }
|
||
]], 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 = {
|
||
search: function () {
|
||
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) : '';
|
||
|
||
});
|
||
form.on('select(changeMidSource)', function (data) {
|
||
debugger
|
||
changeMidSource(data.value);
|
||
// form.render('select')//当对dom元素进行操作之后,需要把这一行代码解除注释
|
||
});
|
||
});
|
||
function Closed() {
|
||
layer.close(winindex);
|
||
}
|
||
function TableReload() {
|
||
table.reload('listReload', {
|
||
|
||
});
|
||
}
|
||
function changeMidSource(scene) {
|
||
$.r_post("/MyWork/GetSubSceneList?scene=" + scene, function (data) {
|
||
debugger
|
||
$("#activeId").html("<option value=''>--全部--</option>");
|
||
$("#activeId").next().find('dl').html("<dd lay-value='' class='layui-select-tips'>--全部--</dd>")
|
||
$(data).each(function (n, m) {
|
||
$("#activeId").append("<option value='" + m.Value + "'>" + m.Text + "</option>");
|
||
$("#activeId").next().find('dl').append("<dd lay-value='" + m.Value + "'>" + m.Text + "</dd>");
|
||
});
|
||
layui.form.render('select');
|
||
}, "json");
|
||
}
|
||
|
||
|
||
</script>
|
||
<script type="text/html" id="imgTpl">
|
||
<img src="{{ d.avatar}}" />
|
||
</script>
|
||
<script type="text/html" id="qwNameTpl">
|
||
<div>
|
||
<div style="text-align:center">{{d.company }}</div>
|
||
<div style="text-align:center">({{d.unionid }})</div>
|
||
</div>
|
||
</script>
|
||
<script type="text/html" id="resTpl">
|
||
<a href="javascript:parent.ChildAddTab('客户详细', '/Csvr/CustomerInfo/CustomerDetail?resid={{d.resId }}', '')">
|
||
{{d.resId }}
|
||
</a>
|
||
</script>
|
||
|
||
|
||
|