141 lines
5.5 KiB
Plaintext
141 lines
5.5 KiB
Plaintext
@using WX.CRM.WebHelper
|
|
|
|
@{
|
|
ViewBag.Title = "组别业绩汇总查询(实时)";
|
|
Layout = "~/Views/Shared/_Index_Layout2.cshtml";
|
|
DateTime maxMonthlyDate = DateTime.ParseExact(ViewBag.maxMonthlyDate + "01", "yyyyMMdd", System.Globalization.CultureInfo.CurrentCulture, System.Globalization.DateTimeStyles.None);
|
|
if (DateTime.Now.Day > 10)
|
|
{
|
|
maxMonthlyDate = maxMonthlyDate.AddMonths(1);
|
|
}
|
|
}
|
|
<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.Action("UserComBoxByRole", "Control", new { type = "2", onLoadSucced = "onLoadSucced()", controlName = "nb1", roleCodes = ViewBag.roleCodes, saledeptid = "", salegroupid = ViewBag.userGroupId })</li>
|
|
@*<li>
|
|
月份:@Html.DropDownList("txt_SltYearMonth", new WX.CRM.WEB.Handler.ControlResource().GetMonthByUserPerformanct())
|
|
</li>
|
|
<li>*@
|
|
<input id="btnPre" type="button" name="btnPre" value="前一日" />
|
|
</li>
|
|
<li>
|
|
最后计算时间:@Html.Label("lbInitDatetime", new { id = "lbInitDatetime" })
|
|
<span id="advandli" style="display:none;">
|
|
开始时间:
|
|
<input type="text" id="txt_STime" name="txt_STime" onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd', minDate: '@maxMonthlyDate' })" style="width:100px;" />
|
|
~<input type="text" id="txt_ETime" name="txt_ETime" onclick="WdatePicker({dateFmt:'yyyy-MM-dd'})" style="width:100px;" />
|
|
</span>
|
|
</li>
|
|
@*<li>
|
|
<input id="txt_SearchType" name="txt_SearchType" type="hidden" value="0" />
|
|
</li>*@
|
|
</ul>
|
|
</div>
|
|
@Html.Raw(ViewBag.GroupList)
|
|
</div>
|
|
|
|
<script type="text/javascript">
|
|
$(function () {
|
|
getDate();
|
|
function getDate() {
|
|
var _date, $stime, $etime;
|
|
_date = CRM_Comon().GetDate();
|
|
$stime = $("#txt_STime");
|
|
$etime = $("#txt_ETime");
|
|
if ($stime.val() == "") {
|
|
$stime.val(_date.getFistDate({ MinDate: false }));
|
|
} if ($etime.val() == "") {
|
|
$etime.val(_date.getLastDate({ MaxDate: false }));
|
|
}
|
|
}
|
|
$('#tablist').tablegrid({
|
|
url: '/QH/GroupPerformanceQuery/GetHtmlList',
|
|
height: $(window).height() - 130,
|
|
loadNow: false,
|
|
isPage: true,
|
|
data: GetControlValue,
|
|
onLoadSuccess: function (data) {
|
|
$("#lbInitDatetime").text(data.initTime);
|
|
}
|
|
});
|
|
function GetControlValue() {
|
|
return { groupId: $("#nb1_uc_org_groups").val()};
|
|
}
|
|
$("#btnQuery").click(function () {
|
|
if ($("#txt_SltYearMonth").attr("disabled") != "disabled")
|
|
$("#txt_SearchType").val(0);
|
|
$('#tablist').tablegrid("Search");
|
|
});
|
|
$("#btnPre").click(function () {
|
|
var $stime = $("#txt_STime");
|
|
$stime.val('@DateTime.Now.AddDays(-1).ToShortDateString()');
|
|
$("#txt_SearchType").val(2);
|
|
$('#tablist').tablegrid("Search");
|
|
});
|
|
});
|
|
function onLoadSucced() {
|
|
$('#tablist').tablegrid("Search");
|
|
}
|
|
function frameReturnByClose() {
|
|
$("#modalwindow").window('close');
|
|
}
|
|
|
|
function frameReturnByReload(flag) {
|
|
$("#tablist").tablegrid("Load");
|
|
}
|
|
|
|
function frameReturnByMes(mes) {
|
|
$.messageBox5s('提示', mes);
|
|
}
|
|
function GetIframeHtml(src) {
|
|
return "<iframe width='100%' height='98%' scrolling='no' frameborder='0' src='" + src + "'></iframe>";
|
|
}
|
|
//获取datagrid头部及字段
|
|
function getDataGridHeader() {
|
|
var columns = $('#tablist').tablegrid("getHead");
|
|
return columns;
|
|
}
|
|
function ExportAllPage_Click1() {
|
|
$("#modalwindow").html(GetIframeHtml("/Control/ExcelExport?Query=" + encodeURIComponent("/QH/GroupPerformanceQuery/Export?" + GetQueryStr() + "&groupId=" + $("#nb1_uc_org_groups").val())));
|
|
$("#modalwindow").window({ title: '导出', width: 480, height: 300, iconCls: 'icon-export' }).window('open');
|
|
}
|
|
function initRpt() {
|
|
$.r_ajax({
|
|
url: "/QH/GroupPerformanceQuery/InitRpt",
|
|
type: "Post",
|
|
data: { SltYearMonth: $("#txt_SltYearMonth").val() },
|
|
dataType: "json",
|
|
loading: true,
|
|
success: function (data) {
|
|
if (data.result == 1) {
|
|
$('#tablist').tablegrid("Search");
|
|
$.messageBox5s('提示', data.msg);
|
|
}
|
|
else {
|
|
$.messageBox5s('初始化失败:', data.msg);
|
|
}
|
|
}
|
|
});
|
|
}
|
|
function AdvanceSearch() {
|
|
var o = $("#txt_SearchType").val();
|
|
if (o == "0") {
|
|
$("#txt_SearchType").val(1);
|
|
$("#advandli").attr("style", "");
|
|
$("#txt_SltYearMonth").attr("disabled", "disabled");
|
|
$("#btnPre").attr("disabled", "disabled");
|
|
} else {
|
|
$("#txt_SearchType").val(0);
|
|
$("#advandli").attr("style", "display:none;");
|
|
$("#txt_SltYearMonth").removeAttr("disabled");
|
|
$("#btnPre").removeAttr("disabled");
|
|
}
|
|
}
|
|
</script>
|