TG.WXCRM.V4/WEB/Views/Home/WelCome.cshtml

474 lines
19 KiB
Plaintext

@using WX.CRM.WebHelper;
@using WX.CRM.Model.Entity;
@using WX.CRM.Model.MAP;
@using WX.CRM.Common;
@using WX.CRM.Model.QueryMap
@{
ViewBag.Title = "我的桌面";
Layout = "~/Views/Shared/_Index_Layout2.cshtml";
}
<style>
.kjMenu {
list-style: outside none circle;
position: relative;
}
.kjMenu li {
width: 150px;
float: left;
margin-bottom: 5px;
margin-right: 5px;
margin-top: 5px;
vertical-align: middle;
}
.kjMenu li:hover a {
border-bottom: 2px solid red;
}
.kjMenu li a {
height: 30px;
width: 80%;
color: black;
font-size: 14px;
font-weight: bold;
display: inline-block;
}
.kjMenu li a:focus {
color: red;
font-weight: bold;
}
.kjMenu li img {
vertical-align: middle;
padding-right: 10px;
}
.ulColor a {
color: red;
font-weight: bold;
}
.nmalegeb .panel-title {
padding-left: 35px;
}
.nmalegeb .panel-icon {
left: 10px;
}
.WelComeIcon {
display: inline-block;
position: relative;
width: 25px;
height: 25px;
background: url(/Content/Images/icon/windows.png) no-repeat center;
vertical-align: middle;
/*cursor: pointer;*/
padding-left: 20px;
}
#u1 {
border-width: 0px;
position: absolute;
width: 184px;
height: 65px;
display: flex;
}
#u1_img {
border-width: 0px;
position: absolute;
left: 0px;
top: 0px;
width: 113px;
height: 30px;
}
#u1_text {
position: absolute;
align-self: center;
padding: 2px 2px 2px 2px;
box-sizing: border-box;
width: 100%;
}
</style>
<script src="~/layui-v2.5.4/layui.js"></script>
<div class="mvctool" @*style="border-bottom: 1px solid #6ca5d1; "*@>
<div class="mvctool_mytitle">
<span id="showOrHidSearch" class="WelComeIcon" ishiiden="false"></span>
我的桌面
</div>
@if (string.IsNullOrEmpty(ViewBag.HideCommonPayInfo))
{
<input class="layui-btn layui-btn-sm layui-btn-ok" data-method="btnPay" onclick="undefined" id="btnPay" type="button" value="通用支付二维码">
}
@if (string.IsNullOrEmpty(ViewBag.HideCommonPayInfo2))
{
<input class="layui-btn layui-btn-sm layui-btn-ok" data-method="btnPay2" onclick="undefined" id="btnPay2" type="button" value="通用支付二维码(新)">
}
@if (string.IsNullOrEmpty(ViewBag.HideCommonPayInfo3))
{
<input class="layui-btn layui-btn-sm layui-btn-ok" data-method="btnPay3" onclick="undefined" id="btnPay3" type="button" value="通用支付二维码(新)">
}
<input class="layui-btn layui-btn-sm layui-btn-ok" data-method="btnUpdatePwd" onclick="undefined" id="btnUpdatePwd" type="button" value="修改密码">
<input class="layui-btn layui-btn-sm layui-btn-normal" data-method="btnDialyMemu" onclick="undefined" id="btnDialyMemu" type="button" value="常用菜单管理">
<input class="layui-btn layui-btn-sm layui-btn-primary" data-method="btnFeedback" onclick="undefined" id="btnFeedback" type="button" value="意见反馈">
<input class="layui-btn layui-btn-sm layui-btn-ok" data-method="btnC2021" onclick="undefined" id="btnC2021" type="button" value="证券从业资格视频2021">
<input class="layui-btn layui-btn-sm layui-btn-primary" data-method="btnMp4_2" onclick="undefined" id="btnMp4_2" type="button" value="证券从业资格视频2020">
<input class="layui-btn layui-btn-sm layui-btn-primary" data-method="btnStudy" onclick="undefined" id="btnStudy" type="button" value="考试资源">
<input class="layui-btn layui-btn-sm layui-btn-normal" data-method="btnExam" onclick="undefined" id="btnExam" type="button" value="考试">
</div>
<div style="width:100%;" id="manDiv">
<table id="manTable" style="width:50%; background-color:#eff0f4;float:left;" class="nmalegeb">
<tr>
<td width="50%" style=" padding:5px;">
<div id="panel1" data-options="iconCls:'icon-kuaijie',width:'auto'" class="easyui-panel" title="快捷菜单" style="padding:10px;">
<ul class="kjMenu">
<li style="width:200px" onclick="openurl(this,'个人企微绑定','Ww/MyWork/SelfIndex')">
<!--<div id="u1" class="ax_default placeholder">
<img id="u1_img" class="img " data-src="/Content/Images/qiwei.png" src="/Content/Images/qiwei.png">-->
@*<div id="u1_text" class="text ">
<p style="text-align:center"><span>个人企微账号绑定</span></p>
</div>*@
<!--</div>-->
</li>
@{
List<BAS_LEFTMEMU> cacheMenuList = DataCacheHelper.GetCache().GetList_LeftMemu();
BAS_LEFTMEMU cacheMeu = null;
}
@foreach (var menu in (ViewBag.memuList as List<BAS_DAILYMEMU>))
{
cacheMeu = cacheMenuList.FirstOrDefault(m => m.MENUID == menu.MENUID);
if (cacheMeu != null)
{
<li onclick="openurl(this,'@cacheMeu.MNAME','@cacheMeu.URL')"><a href="#"><img src="/Content/Images/surperlink.png" />@cacheMeu.MNAME</a></li>
}
}
</ul>
</div>
</td>
@*<td width="50%" style=" padding:5px;">
<div id="panel2" data-options="iconCls:'icon-weixin',width:'auto',tools:[ { iconCls:'icon-reload', handler:function(){ loadWorckAccount();} }]" class="easyui-panel" title="我的工作微信">
<table id="tablist" width="100%" class="layui-table">
<thead>
<tr class="grid_table_head">
<th style="width:25px;">&nbsp;</th>
<th width="23%" style="text-align:center;">微信用户名</th>
<th width="23%" style="text-align:center;">微信号</th>
<th width="15%" style="text-align:center;">昵称</th>
<th width="12%" style="text-align:center;">状态</th>
<th width="23%" style="text-align:center;">最后刷新时间</th>
</tr>
</thead>
<tbody>
@{int i = 0;}
@foreach (var msg in (ViewBag.wxWorkAccount as List<WX_WORKACCOUNT_ALIVE>))
{
i++;
<tr>
<td><span>@i</span></td>
<td>@msg.UserName</td>
<td>@msg.Alias</td>
<td>@msg.NickName</td>
<td><span style="color:@(msg.OnLine == 1 ? "red":"#AAAAAA")">@(msg.OnLine == 1 ? "在线" : "离线")</span></td>
<td>@msg.LastTime</td>
</tr>
}
</tbody>
</table>
</div>
</td>*@
</tr>
<tr>
<td width="50%" style=" padding:5px;">
<div id="panel3" data-options="iconCls:'icon-gonggao'" class="easyui-panel" title="公司公告">
<table id="tablist4" width="100%" class="layui-table">
<thead>
<tr class="grid_table_head">
<th style="width:25px;">&nbsp;</th>
<th width="50%" style="text-align:center;">标题</th>
<th width="30%" style="text-align:center;">时间</th>
<th style="text-align:center;width:30px;">操作</th>
</tr>
</thead>
<tbody>
@{int n = 0;}
@foreach (var msg in (ViewBag.noticeList as List<BAS_NOTICE>))
{
n++;
<tr>
<td><span>@n</span></td>
<td>@msg.TITLE</td>
<td>@msg.CTIME</td>
<td><a href="javascript:window.parent.ChildAddTab('公告详情', '/Content/NoticeDetail.html?id=@msg.PKID');">查看</a></td>
</tr>
}
</tbody>
</table>
</div>
</td>
</tr>
</table>
<table id="manTable1" style="width:50%; background-color:#eff0f4;float:right;" class="nmalegeb1">
<tr>
<td style=" padding:5px">
<div id="panel4" data-options="iconCls:'icon-compute'" class="easyui-panel" title="产品展示">
<table id="tablistProduct" width="100%" class="layui-table">
@*<thead>
<tr class="grid_table_head">
<th style="width:25px;">&nbsp;</th>
<th style="text-align:center;">产品名称</th>
<th style="text-align:center;">价格</th>
<th style="text-align:left;">时长</th>
<th width="50%" style="text-align:left;">说明</th>
</tr>
</thead>
<tbody id="productPannel">
</tbody>*@
</table>
</div>
</td>
</tr>
</table>
</div>
<script type="text/javascript">
$(function () {
/*$('#tablist').tablegrid({
url: '/Home/GetNewAccountList',
loadNow: false,
height: 180,
onLoadSuccess: function (data) {
//成功
}, onLoadError: function (ex) {
//失败
}
});*/
loadWorckAccount();
//loadProduct();
//$('#tablist3').tablegrid({
// url: '/Home/GetRecourceCheck',
// loadNow: true,
// height: 180
//});
LoadNotice();
///三分钟刷新一次
/*var timename = setInterval(function () {
alert(Date.parse(new Date()));
$('#tablist').tablegrid('Load');
clearInterval(timename);
}, 1000*60);*/
function refreshWorkAccount() {
$('#tablist')
.tablegrid({
url: '/Home/GetWorkAccountList?type=cache',
loadNow: true,
height: 120,
onLoadSuccess: function (data) {
//成功
},
onLoadError: function (ex) {
//失败
}
});
}
//setInterval(refreshWorkAccount, 1000 * 60);
$("#btnUpdatePwd")
.click(function () {
$("#modalwindow").html(GetIframeHtml("/Base/InnerUser/ChangeUserIfo"));
$("#modalwindow")
.window({
title: '修改密码',
width: 700,
height: 400,
iconCls: 'icon-edit'
})
.window('open');
});
$("#btnDialyMemu")
.click(function () {
$("#modalwindow").html(GetIframeHtml("/Base/DailyMemu/Index"));
$("#modalwindow").window({ title: '常用菜单管理', width: 750, height: 500 }).window('open');
});
$("#btnPay")
.click(function () {
$("#modalwindow").html(GetIframeHtml("/WeiXin/JZOrder/CommonPayInfo"));
$("#modalwindow").window({ title: '常用二维码', width: 750, height: 700 }).window('open');
});
$("#btnPay2")
.click(function () {
$("#modalwindow").html(GetIframeHtml("/WeiXin/JZOrder/CommonPayInfo2"));
$("#modalwindow").window({ title: '常用二维码', width: 750, height: 700 }).window('open');
});
$("#btnPay3")
.click(function () {
$("#modalwindow").html(GetIframeHtml("/WeiXin/JZOrder/CommonPayInfo3"));
$("#modalwindow").window({ title: '常用二维码', width: 750, height: 700 }).window('open');
});
$("#btnFeedback")
.click(function () {
$("#modalwindow").html(GetIframeHtml("/Base/Feedback/Add"));
$("#modalwindow").window({ title: '意见反馈', width: 750, height: 500 }).window('open');
});
$("#btnMp4").click(function () {
parent.ChildAddTab('证券从业资格视频2018', '/MP4/Mp4.html', 'icon-world_link');
});
$("#btnMp4_2").click(function () {
parent.ChildAddTab('证券从业资格视频2020', '/MP4/Mp4_2.html', 'icon-world_link');
});
$("#btnC2021").click(function () {
window.open("https://www.aliyundrive.com/s/3LJw69VCvpB");
});
$("#btnStudy").click(function () {
parent.ChildAddTab('考试资源', '/MP4/study.html', 'icon-world_link');
});
$("#btnExam").click(function () {
parent.ChildAddTab('考试', '/exam/exam/index', 'icon-world_link');
});
var resizefunction = function () { //自动适应大小
var windowwidth = $(window).width();
//$('#manDiv').width(windowwidth);
//$('#manTable').width(windowwidth);
$('#panel2').panel('resize',
{
width: parseInt((windowwidth - 55) / 2),
height: 280
});
$('#panel1').panel('resize',
{
width: parseInt((windowwidth - 55) / 2),
height: 280
});
$('#panel3').panel('resize',
{
width: parseInt((windowwidth - 55) / 2),
height: 280
});
$('#panel4').panel('resize',
{
width: parseInt((windowwidth - 55) / 2),
height: 570
});
};
resizefunction();
$(window).resize(resizefunction);
});
function SaveRecourceCheck() {
var row = $("#tablist3").tablegrid("getSelected");
if (row != null) {
//console.dir(row);
if (confirm("确定已经在客服微信中删除该客户了吗?")) {
if (row.eid === "" || row.eid === undefined) {
alert('参数错误,请刷新重试!');
return;
}
var eid = row.eid.split('-')[0];
$.r_post("/Home/SaveRecourceCheck?eid=" + eid + "&username=" + row.username + "&jobusername=" + row.jobusername, function (data) {
if (data.msg === "ok") {
$("#tablist3").tablegrid("Load");
$.messageBox5s('提示', "操作成功!");
} else {
$.messageBox5s('提示', "操作失败,请稍后重试!");
}
}, "json");
}
} else { $.messageBox5s('提示', "选中要确认的数据!"); }
}
function ShowResDetial(url) {
window.parent.ChildAddTab("客户详细", url, "");
}
function GetIframeHtml(src) {
return "<iframe width='100%' height='98%' scrolling='no' frameborder='0'' src='" + src + "'></iframe>";
}
function openurl(li, name, url) {
$(li).addClass("ulColor");
window.parent.ChildAddTab(name, url, "");
}
function loadWorckAccount() {
$('#tablist').tablegrid({
url: '/Home/GetWorkAccountList?type=nocache',
loadNow: true,
height: 120,
onLoadSuccess: function (data) {
//成功
}, onLoadError: function (ex) {
//失败
}
});
}
//function loadProduct() {
// $.r_post("/WeiXin/SubProduct/GetWelComeJsonList", function (data) {
// $("#productPannel").html("");
// $(data).each(function (a, da) {
// $("#productPannel").append("<tr><td>" + (a + 1) + "</td><td>" + da.SUBPRODUCTNAME + "</td><td>" + da.PRICE + "</td><td>" + da.RIGHTPERIOD + "</td><td>" + (da.REMARK??"")+"</td><tr>");
// });
// }, "json");
//}
function LoadNotice() {
$('#tablist4').tablegrid({
url: '/Home/GetNoticeList',
loadNow: false,
height: 180,
onLoadSuccess: function (data) {
//成功
},
onLoadError: function (ex) {
//失败
}
});
}
function getDataGridHeader() {
var columns = $('#tablist3').tablegrid("getHead");
return columns;
}
function Export_Click() {
$("#modalwindow").html(GetIframeHtml("/Control/ExcelExport?Query=" + encodeURIComponent("/Home/Export?" + GetQueryStr())));
$("#modalwindow").window({ title: '导出', width: 480, height: 300, iconCls: 'icon-export' }).window('open');
}
layui.use(['laypage', 'layer', 'table'], function () {
var table = layui.table;
table.render({
id: 'testReload'//列表别名ID
, elem: '#tablistProduct'
, url: '/WeiXin/SubProduct/GetWelComeJsonList'
, method: 'POST'
//, limit: 30
, height: "470"
, cols: [[
{ field: 'numbers', type: 'numbers' }
, { field: 'SUBPRODUCTNAME', width: 140, title: '产品名称' }
, { field: 'PRICE', width: 80, title: '价格' }
, { field: 'RIGHTPERIOD', width: 80, title: '时长' }
, { field: 'MODULES', width: 140, title: '权限' }
, { field: 'REMARK', title: '说明' }
]]
});
});
</script>