TG.WXCRM.V4/WEB/Views/Res/Activity/ActivityStOrEx.cshtml

461 lines
16 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 WX.CRM.WebHelper;
@{
ViewBag.Title = "ActivityStOrEx";
Layout = "~/Views/Shared/_Index_Layout2.cshtml";
}
<link href="/layui-v2.5.4/css/layui.css" rel="stylesheet" />
<link href="/layui-v2.5.4/css/workbench.css" rel="stylesheet" />
<link href="/layui-v2.5.4/css/common.css" rel="stylesheet" />
<script src="/layui-v2.5.4/layui.js"></script>
<style>
.txt-expand {
width: 16px;
height: 16px;
display: inline-block;
cursor: pointer;
}
.expand-activity {
background: url("/Content/Images/tools.png") no-repeat scroll 0 0;
}
.close-activity {
background: url("/Content/Images/icon/edit_remove.png") no-repeat;
}
</style>
<div class="mvctool">
@Html.ToolButton("btnQuery", "icon-search", "查询", true)
@Html.Action("ToolBar", "Control", ViewBag.ToolBar as ToolBar)
</div>
<div class="bas_datagrid">
<div id="tb" style="padding:5px;height:auto" class="grid_toolbar">
<ul class="toolBar_ul">
<li>
开始时间:@*@Html.WdatePickerText("txt_stime", DateTime.Now.AddMonths(-1).ToString("yyy-MM-dd"))*@
<input id='txt_stime' name='txt_stime' class='Wdate' type='text' value='@DateTime.Now.ToString("yyy-MM-dd")' onchange="timechange()" onclick='javascript: WdatePicker(); ;' />
&nbsp;
</li>
@*<li>开始时间:@Html.WdatePickerText("txt_stime", "2015-03-01")&nbsp;</li>*@
<li>
结束时间:@*@Html.WdatePickerText("txt_etime", DateTime.Now.ToString("yyy-MM-dd"))*@
<input id='txt_etime' name='txt_etime' class='Wdate' type='text' value='@DateTime.Now.ToString("yyy-MM-dd")' onchange="timechange()" onclick=' javascript: WdatePicker(); ' />
&nbsp;
</li>
<li>
@*@Html.ToolButtonPlain("btnQuery" , "icon-search", "查询", false, "")*@
</li>
</ul>
</div>
<div id="tt" class="easyui-tabs" data-options="{title:'New Tab',tabHeight:'42'}">
<div title="诊股推广资源统计" style="">
@Html.Raw(ViewBag.gridTable)
</div>
<div title="PC端推广报名资源统计" data-options="" style="">
@Html.Raw(ViewBag.gridTable2)
</div>
<div title="策划资源统计" data-options="" style="">
@Html.Raw(ViewBag.gridTable1)
</div>
<div title="APP手机号注册资源统计" data-options="" style="">
@Html.Raw(ViewBag.gridTable3)
</div>
<div title="PC手机号注册资源统计" data-options="" style="">
@Html.Raw(ViewBag.gridTable5)
</div>
<div title="其他资源统计" data-options="" style="">
@Html.Raw(ViewBag.gridTable4)
</div>
</div>
</div>
<script type="text/javascript">
//0为策划统计1为移动端推广统计2为PC端推广统计3为app手机号注册4为其他,5为pc手机号注册资
var istg = 1;
var isload0 = 0;
var isload1 = 0;
var isload2 = 0;
var isload3 = 0;
var isload4 = 0;
var isload5 = 0;
var sdate = '@Request["sdate"]';
if (sdate != undefined && sdate != '') {
$('#txt_stime').val(sdate);
}
$(function () {
//移动端推广报名资源统计
$('#tablist').tablegrid({
url: '/Res/Activity/GetStaHtmlList3g',
height: $(window).height() - 110,
loadNow: true,
});
//策划资源统计
$('#tablist1').tablegrid({
url: '/Res/Activity/GetStaHtmlListch',
height: $(window).height() - 110,
loadNow: false,
});
//PC端推广报名资源统计
$('#tablist2').tablegrid({
url: '/Res/Activity/GetStaHtmlListpc',
height: $(window).height() - 110,
loadNow: false,
});
//APP手机号注册资源统计
$('#tablist3').tablegrid({
url: '/Res/Activity/GetStaHtmlListappzc',
height: $(window).height() - 110,
loadNow: false,
});
//PC手机号注册资源统计
$('#tablist5').tablegrid({
url: '/Res/Activity/GetStaHtmlListpczc',
height: $(window).height() - 110,
loadNow: false,
});
//其他
$('#tablist4').tablegrid({
url: '/Res/Activity/GetStaHtmlListqt',
height: $(window).height() - 110,
loadNow: false,
});
$('#tt').tabs({
border: false,
onSelect: function (title) {
//alert(isload2);
if (title == '诊股推广资源统计') {
istg = 1;
if (isload1 == 0) {
isload1 = 1;
$('#tablist').tablegrid("Search");
}
}
if (title == 'PC端推广报名资源统计') {
istg = 2;
if (isload2 == 0) {
isload2 = 1;
$('#tablist2').tablegrid("Search");
}
}
if (title == '策划资源统计') {
istg = 0;
if (isload0 == 0) {
isload0 = 1;
$('#tablist1').tablegrid("Search");
}
}
if (title == 'APP手机号注册资源统计') {
istg = 3;
if (isload3 == 0) {
isload3 = 1;
$('#tablist3').tablegrid("Search");
}
}
if (title == 'PC手机号注册资源统计') {
istg = 5;
if (isload5 == 0) {
isload5 = 1;
$('#tablist5').tablegrid("Search");
}
}
if (title == '其他资源统计') {
istg = 4;
if (isload4 == 0) {
isload4 = 1;
$('#tablist4').tablegrid("Search");
}
}
}
});
$("#btnQuery").click(function () {//搜索按钮点击事件
//0为策划统计1为移动端推广统计2为PC端推广统计3为app手机号注册4为其他,5为pc手机号注册资
if (istg == 0) {
$('#tablist1').tablegrid("Search");
isload0 = 0;
}
if (istg == 1) {
$('#tablist').tablegrid("Search");
isload1 = 1;
}
if (istg == 2) {
$('#tablist2').tablegrid("Search");
isload2 = 1;
}
if (istg == 3) {
$('#tablist3').tablegrid("Search");
isload3 = 1;
}
if (istg == 5) {
$('#tablist5').tablegrid("Search");
isload5 = 1;
}
if (istg == 4) {
$('#tablist4').tablegrid("Search");
isload4 = 1;
}
});
$(".txt-expand").live("click", function () {
if ($(this).hasClass("expand-activity")) {
$(this).removeClass("expand-activity").addClass("close-activity");
$("[typeName='" + $(this).attr("title") + "']").css("display", "");
}
else {
$(this).removeClass("close-activity").addClass("expand-activity");
$("[typeName='" + $(this).attr("title") + "']").css("display", "none");
}
});
$(window).resize(function () {//自动适应大小
$('#tablist').tablegrid('resize', {
height: $(window).height() - 110
});
$('#tablist1').tablegrid('resize', {
height: $(window).height() - 110
});
$('#tablist2').tablegrid('resize', {
height: $(window).height() - 110
});
$('#tablist3').tablegrid('resize', {
height: $(window).height() - 110
});
$('#tablist4').tablegrid('resize', {
height: $(window).height() - 110
});
$('#tablist5').tablegrid('resize', {
height: $(window).height() - 110
});
});
});
//当时间改变时 设置所有可加载
function timechange() {
isload1 = 0;
isload2 = 0;
isload3 = 0;
isload4 = 0;
isload0 = 0;
isload5 = 0;
}
function frameReturnByClose() {
$("#modalwindow").window('close');
}
function frameReturnByReload(flag) {
$("#tablist").tablegrid("Load");
$("#tablist1").tablegrid("Load");
$("#tablist2").tablegrid("Load");
$("#tablist3").tablegrid("Load");
$("#tablist4").tablegrid("Load");
$("#tablist5").tablegrid("Load");
}
function frameReturnByMes(mes) {
$.messageBox5s('提示', mes);
}
@*ToolBar事件处理*@
function GetIframeHtml(src) {
return "<iframe width='100%' height='98%' scrolling='no' frameborder='0' src='" + src + "'></iframe>";
}
function Export_Res_Click() {
var row;
if (istg == 0) {
row = $('#tablist1').tablegrid('getSelected');
}
if (istg == 1) {
row = $('#tablist').tablegrid('getSelected');
}
if (istg == 2) {
row = $('#tablist2').tablegrid('getSelected');
}
if (istg == 3) {
row = $('#tablist3').tablegrid('getSelected');
}
if (istg == 4) {
row = $('#tablist4').tablegrid('getSelected');
}
if (istg == 5) {
row = $('#tablist5').tablegrid('getSelected');
}
if (row != null) {
var url = "/Res/Activity/ResourceExport?ResTypeId=" + row.ResTypeId + "&ActivityId=" + row.ActivityId+ "&" + GetQueryStr();
window.open(url);//弹出下载
} else { $.messageBox5s('提示', '@Suggestion.PlaseChooseToOperatingRecords'); }
}
function Continued_Click() {
var row;
if (istg == 0) {
row = $('#tablist1').tablegrid('getSelected');
}
if (istg == 1) {
row = $('#tablist').tablegrid('getSelected');
}
if (istg == 2) {
row = $('#tablist2').tablegrid('getSelected');
}
if (istg == 3) {
row = $('#tablist3').tablegrid('getSelected');
}
if (istg == 4) {
row = $('#tablist4').tablegrid('getSelected');
}
if (istg == 5) {
row = $('#tablist5').tablegrid('getSelected');
}
if (row != null) {
var url = "/Res/Activity/ContinuedExport?ResTypeId=" + row.ResTypeId + "&ActivityId=" + row.ActivityId;
$("#modalwindow").html(GetIframeHtml(url));
$("#modalwindow").window({ title: '续导出', width: 500, height: 300, iconCls: 'icon-export' }).window('open');
} else { $.messageBox5s('提示', '@Suggestion.PlaseChooseToOperatingRecords'); }
}
function Advanced_Search_Click() {
var row;
if (istg == 1) {
row = $('#tablist').tablegrid('getSelected');
}
if (istg == 0) {
row = $('#tablist1').tablegrid('getSelected');
}
if (istg == 2) {
row = $('#tablist2').tablegrid('getSelected');
}
if (istg == 3) {
row = $('#tablist3').tablegrid('getSelected');
}
if (istg == 4) {
row = $('#tablist4').tablegrid('getSelected');
}
if (istg == 5) {
row = $('#tablist5').tablegrid('getSelected');
}
if (row != null) {
/* var url = "/Res/Activity/AdvancedExport?ResTypeId=" + row.ResTypeId + "&ActivityId=" + row.ActivityId + "&Attribute=" + istg + "&" + GetQueryStr();
$("#modalwindow").html(GetIframeHtml(url));
$("#modalwindow").window({ title: '高级查询导出', width: 750, height: 500, iconCls: 'icon-export' }).window('open');*/
var url = "/Res/Activity/Strategy?ResTypeId=" + row.ResTypeId + "&ActivityId=" + row.ActivityId + "&type=1&" + GetQueryStr(); //+ "&ActivityId=" + row.ActivityId + "&total=" + row.RESTOTAL + "&" +
$("#modalwindow").html(GetIframeHtml(url));
$("#modalwindow").window({ title: '筛选策略', width: 600, height: 300, iconCls: 'icon-edit' }).window('open');
} else { $.messageBox5s('提示', '@Suggestion.PlaseChooseToOperatingRecords'); }
}
function ResourceCountExport_Click() {
var url = "/Res/Activity/ResourceCountExport?stime=" + $('#txt_stime').val() + "&etime=" + $('#txt_etime').val() + "&attribute=" + istg;
$("#modalwindow").html(GetIframeHtml(url));
}
function Distbute_Click() {
var row;
if (istg == 1) {
row = $('#tablist').tablegrid('getSelected');
}
if (istg == 0) {
row = $('#tablist1').tablegrid('getSelected');
}
if (istg == 2) {
row = $('#tablist2').tablegrid('getSelected');
}
if (istg == 3) {
row = $('#tablist3').tablegrid('getSelected');
}
if (istg == 4) {
row = $('#tablist4').tablegrid('getSelected');
}
if (istg == 5) {
row = $('#tablist5').tablegrid('getSelected');
}
if (row != null) {
//var selects = $('#tablist').tablegrid('getSelections');
//var pkids = "";
//$(selects).each(function (i, n) {
// if(i!=0)
// pkids += "" + n.ResTypeId + ",";
//});
//if (pkids.length > 0)
// pkids = pkids.substr(0, pkids.length - 1);
var url = "/Res/Activity/Strategy?ResTypeId=" + row.ResTypeId + "&ActivityId=" + row.ActivityId + "&" + GetQueryStr(); //+ "&ActivityId=" + row.ActivityId + "&total=" + row.RESTOTAL + "&" +
$("#modalwindow").html(GetIframeHtml(url));
$("#modalwindow").window({ title: '筛选策略', width: 600, height: 300, iconCls: 'icon-edit' }).window('open');
} else { $.messageBox5s('提示', '@Suggestion.PlaseChooseToOperatingRecords'); }
}
function List_Click() {
}
function CloseDistbuteWin() {
$("#modalwindow").window("close", true);
}
function OpenDistbuteWin(url) {
//var url = "/Res/Activity/Distbute?ResTypeId=" + row.ResTypeId + "&ActivityId=" + row.ActivityId + "&total=" + row.RESTOTAL + "&" + GetQueryStr();
$("#modalwindow").html(GetIframeHtml(url));
$("#modalwindow").window({ title: '资源分配', width: 800, height: 500, iconCls: 'icon-details' }).window('open');
}
</script>
<script>
$(function () {
$(".mvctool .mvctool_mytitle").after($("#Other4"));
});
layui.use(['layer'], function () {
var layer = layui.layer;
$("#Other6").click(function () {
var row;
if (istg == 1) {
row = $('#tablist').tablegrid('getSelected');
}
if (istg == 0) {
row = $('#tablist1').tablegrid('getSelected');
}
if (istg == 2) {
row = $('#tablist2').tablegrid('getSelected');
}
if (istg == 3) {
row = $('#tablist3').tablegrid('getSelected');
}
if (istg == 4) {
row = $('#tablist4').tablegrid('getSelected');
}
if (istg == 5) {
row = $('#tablist5').tablegrid('getSelected');
}
if (row != null) {
var sTime = $("#txt_stime").val();
var eTime = $("#txt_etime").val();
if (sTime == '' || eTime == '') {
layer.msg('时间不能为空!');
return;
}
layer.msg(sTime);
var url = "/Res/Activity/List?resTypeId=" + row.ResTypeId + "&activityId=" + row.ActivityId + "&sTime=" + sTime + "&etime=" + eTime;
layer.open({
title: '明细列表',
type: 2,
content: url,
area: ['80%', '80%']
});
}
});
});
</script>