TG.WXCRM.V4/WEB/Views/Live/LiveUserSummay.cshtml

861 lines
35 KiB
Plaintext
Raw 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
@using WX.CRM.Model.DTO;
@{
/**/
/**/
ViewBag.Title = "bas_salesDepartment";
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>
.total {
color: #01AAED;
font-weight: bolder;
margin-right: 10px;
}
.layui-table-cell {
height: 40px !important;
line-height: 40px !important;
}
.layui-form-checkbox {
margin: 0 !important;
}
.hidden {
display: none;
}
</style>
<div class="mvctool">
@*@Html.ToolButton("btnExport", "icon-export", "导出", true)*@
@Html.Action("ToolBar", "Control", ViewBag.ToolBar as ToolBar)
</div>
<div class="layui-card" id="topcard" style="width:100%;">
<div class="layui-card-body " id="contentBody">
<form class="layui-form" id="myform">
<div class="layui-form-item">
@Html.Action("UserGroupSSOComBox", "Control", new { currentRight = WX.CRM.WebHelper.InitRights.CONST_直播客户列表 })
@*销售组:
<div class="layui-inline" style="width:300px">
<select id="groupid" name="groupid" lay-filter="groupid">
<option value="">请选择</option>
</select>
</div>
员工:
<div class="layui-inline" style="width:180px">
<select id="user" name="user">
<option value="">请选择</option>
</select>
</div>*@
员工姓名:
<div class="layui-inline">
<input type="text" id="employeeName" name="employeeName" style="width:120px" />
</div>
工号:
<div class="layui-inline">
<input type="text" name="eid" style="width:120px" />
</div>
@*企业号:
<div class="layui-inline">
<input type="text" name="appname" style="width:120px" />
</div>
企微客服ID
<div class="layui-inline">
<input type="text" name="customerid" style="width:120px" />
</div>*@
客户ID
<div class="layui-inline">
<input type="text" name="umid" style="width:120px" />
</div>
客户昵称:
<div class="layui-inline">
<input type="text" name="nickname" style="width:120px" />
</div>
直播日期:
<div class="layui-inline">
<input class="layui-input" placeholder="开始日" name="livingDateFrom" id="livingDateFrom" style="width:120px;">
</div>
<div class="layui-inline">
<input class="layui-input" placeholder="结束日" name="livingDateTo" id="livingDateTo" style="width:120px;">
</div>
进线时间:
<div class="layui-inline">
<input class="layui-input" placeholder="开始时间" name="createTimeFrom" id="createTimeFrom" style="width:120px;">
</div>
<div class="layui-inline">
<input class="layui-input" placeholder="结束时间" name="createTimeTo" id="createTimeTo" style="width:120px;">
</div>
直播课:
<div class="layui-inline" style="width: 900px ">
<div id="scheduleids" name="scheduleids" class="xm-select-size" style="width: 900px; display: flex; "></div>
@*<select id="scheduleid" name="scheduleid" lay-filter="scheduleid">
<option value="">请选择</option>
</select>*@
</div>
客户是否为员工账号:
<div class="layui-inline">
<select name="userType" style="height:35px;">
<option value="">全部</option>
<option value="0">是</option>
<option value="1">否</option>
</select>
</div>
听课天数:
<div class="layui-inline">
<input type="text" name="watchDays" style="width:120px" />
</div>
客户数据:
<div class="layui-inline">
<select name="whole" style="height:35px;">
<option value="0">去重</option>
<option value="1" selected>不去重</option>
</select>
</div>
听课时长:
<div class="layui-inline">
<input type="text" name="watchTimeFrom" style="width:120px" />
</div>
-
<div class="layui-inline">
<input type="text" name="watchTimeTo" style="width:120px" />
</div>
分钟
<div class="layui-inline">
<input style="margin:0;" type="checkbox" value="1" name="employeeStatusCheck" lay-skin="primary" title="不显示离职员工" lay-filter="employeeStatusCheck">
</div>
课程邀请:
<div class="layui-inline">
<select name="onlyinvite" style="height:35px;">
<option value="">全部</option>
<option value="1">有</option>
<option value="0">无</option>
</select>
</div>
好友关系:
<div class="layui-inline">
<select name="isWework" style="height:35px;">
<option value="">全部</option>
<option value="1">有</option>
<option value="0">无</option>
</select>
</div>
归属关系:
<div class="layui-inline">
<select name="IsBelong" style="height:35px;">
<option value="">全部</option>
<option value="1">有</option>
<option value="0">无</option>
</select>
</div>
互动行为:
<div class="layui-inline">
<select name="interaction" style="height:35px;">
<option value="">全部</option>
<option value="1">有</option>
<option value="0">无</option>
</select>
</div>
<div class="layui-inline" style="display:flex;">
<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" id="reset" type="button" value="清空" />
<input class="layui-btn layui-btn-sm layui-btn-reset" style="display:none" id="onreset" type="reset" value="" />
</div>
<input type="hidden" value="1" lay-filter="onlyDept" name="onlyDept" />
<input type="hidden" value="" lay-filter="excludeDeptid" name="excludeDeptid" />
</div>
</form>
<div>
数据汇总: 听课员工数:<span class="total" id="StaffNum"></span>
全部听课客户数:<span class="total" id="TotalNum"></span>
本事业部听课客户数:<span class="total" id="UserNum"></span>
在线客户峰值:<span class="total" id="MaxViewerNum"></span>
互动客户数:<span class="total" id="InteractNum"></span>
听课20分钟以上的客户数<span class="total" id="WatchNum20"></span>
客户平均听课时长:<span class="total" id="AvgWatchTimeStr"></span>
</div>
<div id="normal">
<table class="layui-hide" id="summaylist" lay-filter="summaylist"></table>
</div>
<div id="tag" class="hidden">
<div class="layui-tab" lay-filter="tab">
<ul class="layui-tab-title">
<li class="layui-this" lay-id="1">本事业部</li>
<li lay-id="2">其他事业部</li>
</ul>
<div class="layui-tab-content">
<div class="layui-tab-item layui-show">
<table class="layui-hide" id="taglist" lay-filter="taglist"></table>
</div>
<div class="layui-tab-item">
<table class="layui-hide" id="taglistNotDept" lay-filter="taglistNotDept"></table>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="~/Scripts/layui_ext/xm-select/xm-select.js"></script>
<script>
var selectRow = {};
var winindex;
var layer;
var rowid;
var form;
var element;
var employeeStatus = null;
var courses;
var fristInitTag = true;
var summaylistTotal = 0;
var taglistTotal = 0;
var taglistNotDeptTotal = 0;
var tab = '1';
var schedules;
var scheduleDeptid;
//注意:选项卡 依赖 element 模块,否则无法进行功能性操作
layui.use(['laypage', 'layer', 'table', 'laydate', 'form', 'element'], function () {
var laydate = layui.laydate;
form = layui.form;
layer = layui.layer;
table = layui.table;
element = layui.element;
//执行一个laydate实例
laydate.render({
elem: '#livingDateFrom', //指定元素
value: getDate()
});
//执行一个laydate实例
laydate.render({
elem: '#livingDateTo' //指定元素
});
//执行一个laydate实例
laydate.render({
elem: '#statustime' //指定元素
});
//执行一个laydate实例
laydate.render({
elem: '#statusEndtime' //指定元素
});
laydate.render({
elem: '#createTimeFrom' //指定元素
});
//执行一个laydate实例
laydate.render({
elem: '#createTimeTo' //指定元素
});
var where = $("#myform").serializeFormJSON();
where.livingDateFrom = getDate();
where.employeeStatus = employeeStatus;
TotalReload(where);
InitSchedule();
InitGroup();
initTable('summaylist', where);
//监听行单击事件
table.on('row(tabl1)', function (obj) {
var data = obj.data;
//标注选中样式
obj.tr.addClass('self-table-click').siblings().removeClass('self-table-click');
selectRow = data;
});
// 选择事业部事件
form.on('select(groupid)', function (data) {
var val = data.value;
InitInnerusers(val);
});
element.on('tab(tab)', function () {
tab = this.getAttribute('lay-id');
});
var active = {
search: function (sortBy) {
console.log(sortBy);
var where = $("#myform").serializeFormJSON();
if (sortBy) {
where.sortBy = sortBy;
}
where.employeeStatus = employeeStatus;
var deptid = $("#deptId").val();
if (deptid === "0") {
return;
}
if (!where.livingDateFrom) {
layer.msg('请选择直播日期开始日期!', { icon: 2 });
return;
} else if (where.livingDateTo) {
var day = diffDay(where.livingDateTo, where.livingDateFrom);
if (day < 0 || day > 31) {
layer.msg('直播日期选择不能超过一个月,请重新选择!', { icon: 2 });
return;
}
} else {
var day = diffDay(getDate(), where.livingDateFrom);
if (day < 0 || day > 31) {
layer.msg('直播日期选择不能超过一个月,请重新选择!', { icon: 2 });
return;
}
}
TotalReload(where);
if (!where.txt_deptId && !where.txt_groupIds && where.scheduleids && scheduleDeptid) {
document.getElementById("normal").setAttribute('class', 'hidden');
document.getElementById("tag").setAttribute('class', '');
if (fristInitTag) {
initTable('taglist', where);
var where2 = JSON.parse(JSON.stringify(where));
where2.onlyDept = 0;
where2.excludeDeptid = scheduleDeptid;
initTable('taglistNotDept', where2);
fristInitTag = false;
} else {
table.reload('taglist', {
where: where,
page: {
curr: 1
}
});
var where2 = JSON.parse(JSON.stringify(where));
where2.onlyDept = 0;
where2.excludeDeptid = scheduleDeptid;
table.reload('taglistNotDept', {
where: where2,
page: {
curr: 1
}
});
}
} else {
document.getElementById("normal").setAttribute('class', '');
document.getElementById("tag").setAttribute('class', 'hidden');
table.reload('summaylist', {
where: where,
page: {
curr: 1
}
});
}
}
};
// 触发排序事件
table.on('sort()', function (obj) {
console.log(obj.field); // 当前排序的字段名
let dict = new Map([
['avgWatchTime', 'avg_watch_time'],
['totalWatchTimeStr', 'total_watch_time']
]);
var field = dict.get(obj.field) ? dict.get(obj.field) : obj.field;
console.log(obj.type); // 当前排序类型desc降序、asc升序、null空对象默认排序
active['search'](field + (obj.type == "desc" ? " desc" : ""));
});
//查询
$('.layui-btn-ok').on('click', function () {
var othis = $(this), method = othis.data('method');
active[method] ? active[method]() : '';
});
//清空
$('#reset').on('click', function () {
document.getElementById("onreset").click();
employeeStatus = null;
InitSchedule();
clear();
});
//导出
//window.parent.$("#btnExport4").on("click", function () {
// Export();
//});
form.on('checkbox(employeeStatusCheck)', function (data) {
if (data.elem.checked) {
employeeStatus = 1;
} else {
employeeStatus = null;
}
})
//form.on('select(scheduleid)', function (data) {
// var deptid = courses.filter(item => item.id == data.value)[0].departmentId;
// treeData = treeData.filter(item => item.deptids == deptid);
// ComBoxLoad();
// if ($("#deptId").val() == deptid) return;
//})
function initTable(name, where) {
table.render({
id: name //列表别名ID
, elem: '#' + name
, url: '@Html.Raw(ViewBag.webapi + "/api/Live/Summay")'
//, url: '@Html.Raw("https://localhost:44377/api/Live/Summay")'
//, url: 'http://api.crm.tcfortune.com:8282/api/Live/Summay'
, method: 'get'
, dataType: 'json'
, headers: { appid: '@ViewBag.appid', eid: '@ViewBag.eid' }
, autoSort: false
, request: {
pageName: 'currentPage' //页码的参数名称默认page
, limitName: 'pageSize' //每页数据量的参数名默认limit
}
, response: {
statusName: 'code' //规定数据状态的字段名称默认code
, statusCode: 0 //规定成功的状态码默认0
, msgName: 'message' //规定状态信息的字段名称默认msg
},
parseData: function (res) { //res 即为原始返回的数据
if (res.code !== 0) {
layer.msg(res.message, { icon: 2 });
return {
"code": res.code, //解析接口状态
"msg": res.message, //解析提示文本
"count": 0, //解析数据长度
"data": [] //解析数据列表
}
}
if (name == 'summaylist') {
summaylistTotal = res.data.total;
} else if (name == 'taglist') {
taglistTotal = res.data.total
} else {
taglistNotDeptTotal = res.data.total;
}
return {
"code": res.code, //解析接口状态
"msg": res.message, //解析提示文本
"count": res.data.total, //解析数据长度
"data": res.data.tableData //解析数据列表
};
}
, cellMinWidth: 80 //全局定义常规单元格的最小宽度layui 2.2.1 新增
, page: true
, limit: 10
, size: "sm"
, cols: [[
{ type: 'checkbox', hide: true }
, { field: 'id', title: '序号', type: 'numbers' }
, { field: 'dept_name', title: '事业部', width: 130 }
, { field: 'group_name', title: '组别', width: 100 }
//, { field: 'app_name', title: '企业号', width: 120 }
//, { field: 'userid', title: '企微客服ID', width: 120 }
, { field: 'eid', title: '工号' }
, { field: 'employee_name', title: '客服' }
, {
field: 'is_wework', title: '好友关系', templet: function (b) {
if (b.is_wework === null || b.is_wework === '') return '';
return b.is_wework == 1 ? '有' : '无';
}
}
, {
field: 'is_belong', title: '归属关系', templet: function (b) {
if (b.is_belong === null || b.is_belong === '') return '';
return b.is_belong == 1 ? '有' : '无';
}
}
, { field: 'inviter_eid', title: '课程邀请', templet: '#inviterEidTpl' }
, { field: 'title', title: '直播课', width: 120 }
, {
field: 'umid', title: '客户ID', width: 150, templet: function (d) {
if (!d.umid) {
return "";
}
return "<div><a href=\"javascript:AddTab('" + d.username + "', '/Csvr/CustomerInfo/CustomerDetail?resid=" + d.umid + "', ' ')\" class=\"layui-table-link\">" + d.umid + "</a></div>"
}
}
, { field: 'username', title: '真实姓名', width: 120 }
, {
field: 'interaction', title: '互动行为', templet: function (b) {
if (b.interaction === null || b.interaction === '') return '';
return b.interaction == 1 ? '有' : '无';
}
}
, { field: 'user_type', title: '客户是否为员工账号', templet: '#userTypeTpl', width: 70 }
, { field: 'headimgurl', title: '线索', templet: '#residTpl' }
, { field: 'headimgurl', title: '头像', templet: "#headimgurlTpl" }
, { field: 'nickname', title: '昵称' }
//, { field: 'REMARK', title: '评论数' }
, { field: 'avgWatchTime', title: '平均听课时长', width: 150, sort: true }
, { field: 'watch_days', title: '听课天数', width: 100, sort: true }
, { field: 'totalWatchTimeStr', title: '听课总时长', width: 150, sort: true }
, { field: 'start_time', title: '开始听课时间', width: 150, sort: true }
, { field: 'end_time', title: '最后听课时间', width: 150, sort: true }
, { field: 'create_time', title: '进线时间', width: 150, sort: true }
]], where: where
});
}
});
function AddTab(name, url) {
window.parent.postMessage({ name: name, url: url }, '*');
}
function Closed() {
layer.close(winindex);
}
function TableReload() {
table.reload('listReload', {});
}
function ComBoxOnSelect() {
InitCourses();
}
function InitCourses() {
var deptid = $("#deptId").val();
if (deptid === "0") {
return;
}
$("#scheduleid").text("");
$("#scheduleid").append(new Option('请选择', ''));
$.ajax({
type: "GET",
url: '@Html.Raw(ViewBag.webapi + "/api/Live/Courses?deptid=")' + deptid,
headers: { appid: '@ViewBag.appid', eid: '@ViewBag.eid' },
dataType: "json",
contentType: "application/json",
success: function (da) {
courses = da.data;
$(da.data).each(function (n, m) {
$("#scheduleid").append(new Option(m.title, m.id));
});
form.render('select');
},
error: function () {
layer.close(loadingindex);
layer.msg('统计数据加载失败!', { icon: 2 });
}
});
}
function InitGroup() {
$.ajax({
type: "GET",
url: '@Html.Raw(ViewBag.webapi + "/api/Live/DeptMent")',
headers: { appid: '@ViewBag.appid', eid: '@ViewBag.eid' },
dataType: "json",
contentType: "application/json",
success: function (da) {
$(da.data).each(function (n, m) {
$("#groupid").append(new Option(m.title, m.id));
});
form.render('select');
},
error: function () {
layer.close(loadingindex);
layer.msg('统计数据加载失败!', { icon: 2 });
}
});
}
function TotalReload(data) {
var deptid = $("#deptId").val();
if (deptid === "0") {
return;
}
console.log(data);
$.ajax({
type: "GET",
url: '@Html.Raw(ViewBag.webapi + "/api/Live/UserStat")',
//url: '@Html.Raw("https://localhost:44377/api/Live/UserStat")',
data: data,
headers: { appid: '@ViewBag.appid', eid: '@ViewBag.eid' },
dataType: "json",
contentType: "application/json",
success: function (da) {
$('#UserNum').html(da.data.user_num);
$('#TotalNum').html(da.data.total_num);
$('#StaffNum').html(da.data.staff_num);
$('#InteractNum').html(da.data.interact_num);
$('#WatchNum20').html(da.data.watch_num_20);
$('#WatchNum30').html(da.data.watch_num_30);
$('#AvgWatchTimeStr').html(da.data.avgWatchTimeStr);
if (data.scheduleids && data.scheduleids.split(',').length == 1) {
@* if (da.data.user_num > 0) {
InitCourseSummary(data);
} else {
$('#MaxViewerNum').html('0');
}*@
InitCourseSummary(data);
} else {
$('#MaxViewerNum').html('');
}
},
error: function () {
layer.close(loadingindex);
layer.msg('统计数据加载失败!', { icon: 2 });
}
});
}
function InitInnerusers(groupid) {
$.ajax({
type: "GET",
url: '@Html.Raw(ViewBag.webapi + "/api/Live/Innerusers?groupid=")' + groupid,
headers: { appid: '@ViewBag.appid', eid: '@ViewBag.eid' },
dataType: "json",
contentType: "application/json",
success: function (da) {
$("#user").html("");
$("#user").append(new Option('请选择', ''));
$(da.data).each(function (n, m) {
$("#user").append(new Option(m.title, m.id));
});
form.render('select');
},
error: function () {
layer.close(loadingindex);
layer.msg('统计数据加载失败!', { icon: 2 });
}
});
}
function InitCourseSummary(data) {
var deptid = $("#deptId").val();
if (deptid === "0") {
return;
}
var where = JSON.parse(JSON.stringify(data));
where.scheduleid = where.scheduleids;
$.ajax({
type: "GET",
url: '@Html.Raw(ViewBag.webapi + "/api/Live/CourseSummary")',
headers: { appid: '@ViewBag.appid', eid: '@ViewBag.eid' },
data: where,
dataType: "json",
contentType: "application/json",
success: function (da) {
if (da.data.length > 0) {
$('#MaxViewerNum').html(da.data[0].max_viewer_num);
} else {
$('#MaxViewerNum').html("0");
}
},
error: function () {
layer.close(loadingindex);
layer.msg('统计数据加载失败!', { icon: 2 });
}
});
}
function OpenSalesLead(id, appuserid,app_id) {
layer.open({
type: 2,
content: '/Live/SalesLeads?resid=' + id + '&appuserid=' + appuserid + '&app_id=' + app_id,
title: "销售线索",
area: [ '1000px', '600px']
});
}
/* 个数字变两位数 */
function toDou(n) {
return n < 10 ? '0' + n : '' + n;
}
function getDate() {
var date = new Date();
date = date.setDate(date.getDate());
date = new Date(date);
var month = date.getMonth() + 1; //月份从0开始所以需要+1
var day = date.getDate();
if (month < 10) {
month = '0' + month;
}
return date.getFullYear() + '-' + month + '-' + day;
}
function Export() {
var where = $("#myform").serializeFormJSON();
schedules.forEach(function (item, index) {
item.children.forEach(function (item2, index2) {
if (where.scheduleids.split(',').indexOf(item2.value) > -1) {
deptname = item.title;
children.push(item2);
}
});
});
if (employeeStatus != null) {
where.employeeStatus = employeeStatus;
} else {
where.employeeStatus = "";
}
var date = where.livingDateFrom;
if (where.livingDateFrom != getDate()) {
date = `${where.livingDateFrom}-${where.livingDateTo}`;
}
if (!where.txt_deptId && !where.txt_groupIds && where.scheduleids) {
var children = [];
var deptname = '';
var deptid;
schedules.forEach(function (item, index) {
item.children.forEach(function (item2, index2) {
if (where.scheduleids.split(',').indexOf(`${item2.value}`) > -1) {
deptname = item.name;
deptid = item.value;
children.push(item2);
}
});
});
var fliename = '';
children.forEach(function (item, index) {
fliename += `-${item.name.split('(')[0]}-${item.value}`;
});
if (tab == '1') {
where.filename = `直播课汇总表-本事业部-${deptname}${fliename} (${date})`;
ExprotByParam('taglist', where);
} else if (tab == '2') {
var where2 = JSON.parse(JSON.stringify(where));
where2.filename = `直播课汇总表-其他事业部-${deptname}${fliename} (${date})`;
where2.onlyDept = 0;
where2.excludeDeptid = deptid;
ExprotByParam('taglistNotDept', where2);
}
} else {
where.filename = `直播课汇总表 (${ date })`;
ExprotByParam('summaylist', where);
}
}
function ExprotByParam(name, param) {
if (name == 'summaylist') {
param.pageSize = summaylistTotal;
} else if (name == 'taglist') {
param.pageSize = taglistTotal;
} else {
param.pageSize = taglistNotDeptTotal;
}
param.currentPage = 1;
var queryString = "";
for (var key in param) {
if (queryString != "") queryString += "&";
queryString += key + "=" + encodeURIComponent(param[key]);
}
window.open("/Live/LiveUserSummayExport?" + queryString);
}
function InitSchedule() {
var deptid = $("#deptId").val();
if (deptid === "0") {
return;
}
scheduleDeptid = null;
$.ajax({
type: "GET",
url: '@Html.Raw(ViewBag.webapi + "/api/Live/ScheduleTree?deptid=")' + deptid,
headers: { appid: '@ViewBag.appid', eid: '@ViewBag.eid' },
dataType: "json",
contentType: "application/json",
success: function (da) {
schedules = da.data;
renderSelectSchedule(da.data);
},
error: function () {
layer.close(loadingindex);
layer.msg('统计数据加载失败!', { icon: 2 });
}
});
}
function renderSelectSchedule(scheduleTree, check) {
var optionsSchedule = {
el: '#scheduleids',
name: 'scheduleids',//表单的name属性
//clickClose: true, //单选完关闭下拉框
filterable: true, //搜索
size: 'mini',
direction: 'down',
// 展开方向 下
//radio: false, //单选
height: '400px',
tree: {
show: true,
showFolderIcon: true,
showLine: true,
expandedKeys: true
},
//toolbar: {//工具条,全选,清空,反选,自定义
// show: true,
// list: [
// 'CLEAR'
// ]
//},
on: function ({ arr, change }) {
try {
if (arr.length == 0) {
//schedules.forEach(x => {
// x.disabled = false
// x.children.forEach(y => y.disabled = false)
//});
scheduleDeptid = null;
} else {
scheduleDeptid = change[0].deptid;
//schedules.forEach(x => {
// if (x.deptid == change[0].deptid) {
// x.disabled = false
// x.children.forEach(y => y.disabled = false)
// } else {
// x.disabled = true
// x.children.forEach(y => y.disabled = true)
// }
//});
}
selectSchedule.update(schedules);
} catch (e) {
console.log(e);
}
},
data: scheduleTree,
initValue: check
};
var selectSchedule = xmSelect.render(optionsSchedule);
return selectSchedule;
}
//导出监听
window.addEventListener("message", receiveMessage, false);
function receiveMessage(event) {
Export();
}
function diffDay(lastDate, earlyDate) {
return (Date.parse(lastDate) - Date.parse(earlyDate)) / 1000 / 60 / 60 / 24;
}
</script>
<script type="text/html" id="userTypeTpl">
{{# if(d.user_type == 1){ }}
{{# } else if(d.user_type == 0) { }}
{{# } }}
</script>
<script type="text/html" id="inviterEidTpl">
{{# if(d.inviter_eid == d.eid){ }}
{{# } else { }}
{{# } }}
</script>
<script type="text/html" id="headimgurlTpl">
{{# if(d.headimgurl != "" && d.headimgurl != null){ }}
<img src="{{d.headimgurl}}" width="50" height="50" />
{{# } }}
</script>
<script type="text/html" id="statusTpl">
{{# if(d.STATUS == 1){ }}
<span>通过</span>
@*<img src="/Content/Images/checked.png" style="height:20px;width:20px;" />*@
@*<i class="layui-icon layui-icon-ok layui-bg-green"></i>*@
{{# } else if(d.STATUS == -1) { }}
<span>未通过</span>
@*<i class="layui-icon layui-icon-close layui-bg-red"></i>*@
@*<img src="/Content/Images/unchecked.png" style="height:18px;width:18px;" />*@
{{# } else { }}
<span>未审核</span>
@*<i class="layui-icon layui-icon-more layui-bg-blue"></i>*@
@*<img src="/Content/Images/checking.png" style="height:16px;width:16px;" />*@
{{# } }}
</script>
<script type="text/html" id="residTpl">
@*{{# if(d.resid != null && d.resid != ""){ }}*@
@*<a href="javascript:console.log('{{d.appuserid}}');console.log('{{d.app_id}}')">chakan</a>>*@
<a href="javascript:OpenSalesLead('{{d.resid}}','{{d.resid?d.appuserid:d.c_appuserid}}','{{d.resid?d.app_id:d.c_appid}}')" class="layui-table-link">查看</a>
@*{{# } }}*@
</script>