TG.WXCRM.V4/WEB/Views/WeiXin/CommissionGroup/index.cshtml

244 lines
8.0 KiB
Plaintext

@using WX.CRM.WebHelper;
@{
ViewBag.Title = "";
Layout = "~/Views/Shared/_Index_Layout2.cshtml";
}
@*<script src="~/Scripts/op/tablegrid.sort.js"></script>*@
<div class="mvctool">
@Html.ToolButton("btnQuery", "icon-search", "查询", true)
@Html.ToolButton("btnExport", "icon-export", "导出", false)
</div>
<style>
.bodyDiv {
margin: 0 !important;
}
#tab {
white-space: nowrap;
width: 100%;
height: 745px;
}
#tab .grid_table {
overflow-x: auto;
height: 745px;
}
#tab table {
overflow-x: auto;
table-layout: fixed;
width: 100%;
border-collapse: separate;
border-spacing: 0;
border: 1px solid #DDDDDD;
}
/* 表格th/td样式 */
#tab td {
width: 150px;
box-sizing: border-box;
border-right: 1px solid #DDDDDD;
border-bottom: 1px solid #DDDDDD;
/*单元格 超出长度 显示...*/
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
height: 30px;
}
#tab thead tr th {
position: sticky;
z-index: 4;
top: 0;
left: 0;
background: #F4F4F5;
height: 30px;
width: 100px;
box-sizing: border-box;
border-right: 1px solid #DDDDDD;
border-bottom: 1px solid #DDDDDD;
/*单元格 超出长度 显示...*/
overflow: hidden;
white-space: pre-wrap;
word-wrap: break-word;
text-overflow: ellipsis;
height: 30px;
}
#tab th:first-child {
z-index: 999 !important;
}
#tab th:first-child,
#tab tr td:first-child {
width: 50px !important;
}
#tab th:first-child,
#tab tr td:first-child,
#tab .table_fixed {
z-index: 3;
position: sticky;
top: 0;
left: 0;
background: #F4F4F5;
text-align: center;
border-left: 1px solid #DDDDDD;
width: 150px;
}
#tab td:hover {
width: auto;
}
#tab .table_fixed:hover {
width: auto;
}
#tab .tr_onclick .table_fixed {
background-color: #FBEC88 !important;
}
</style>
<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 = ViewBag.saleDeptId, salegroupid = ViewBag.userGroupId, currentRight = WX.CRM.WebHelper.InitRights.CONST_销售组分成报表 })</li>*@
<li>@Html.Action("UserSSOComBox", "Control", new { currentRight = WX.CRM.WebHelper.InitRights.CONST_销售组分成报表 })</li>
@*<li>@Html.Action("UserComBox", "Control", new { type = "OnlyGroup" })</li>*@
<li>结算时间:<input type="text" id="txt_STime" name="txt_STime" value=@(new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1).ToString("yyyy-MM-dd")) onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd' })" style="width:100px;" />-@Html.WdatePickerText("txt_ETime", new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1).AddMonths(1).AddDays(-1).ToString("yyyy-MM-dd"))</li>
@*<li>开通时间:@Html.WdatePickerText("txt_KtBeginTime", string.Empty)-@Html.WdatePickerText("txt_KtEndTime", string.Empty)</li>*@
<li><input type="hidden" id="sort" name="txt_sort" /><input type="hidden" id="order" name="txt_order" /></li>
</ul>
</div>
<div id="tab"></div>
</div>
<script type="text/javascript">
$(function () {
$("#btnQuery").click(function () {
var sTime = $("#txt_STime").val();
var eTime = $("#txt_ETime").val();
if (sTime == "") {
alert("结算开始时间不能为空!");
return;
}
if (eTime == "") {
alert("结算结束时间不能为空!");
return;
}
var sYear = new Date(Date.parse(sTime)).getFullYear();
var eYear = new Date(Date.parse(eTime)).getFullYear();
if (sYear != eYear) {
alert("只能查询同一个年份的数据!");
return;
}
load();
});
$("#btnExport").click(function () {
var saleDeptId = $("#txt_deptId").val();
var groupId = $("#txt_groupIds").val();
var userId = $("#txt_userId").val();
var query = GetQueryStr();
if (query == "") {
query = "saleDeptId=" + saleDeptId + "&groupId=" + groupId + "&userId=" + userId;
}
else {
query = query + "&saleDeptId=" + saleDeptId + "&groupId=" + groupId + "&userId=" + userId;
}
window.open("/weiXin/CommissionGroup/Export?" + query);
});
});
function load() {
//debugger
var para = GetParams();
var saleDeptId = $("#txt_deptId").val();
var groupId = $("#txt_groupIds").val();
var userId = $("#txt_userId").val();
para["saleDeptId"] = saleDeptId;
para["groupId"] = groupId;
para["userId"] = userId;
$.r_post("/weiXin/CommissionGroup/SaleGroupReportHtml", para, function (res) {
$("#tab").empty();
$("#tab").html(res.rowsList);
$("#tablist tbody").append(res.foot);
$("#tablist tbody tr").on('click', function () {
$("#tablist tbody tr").removeClass("tr_onclick");
$(this).addClass("tr_onclick");
});
var sortV = $("#sort").val();
var orderV = $("#order").val();
$("#tablist .tablegrid_sort").each(function (x, y) {
//console.log(x);
//console.log(y);
if (sortV != "" && orderV != "") {
var defTH = $(y).attr("field");
if (defTH == sortV) {
if (orderV == "desc") {
$(y).addClass("tablegrid_sort_desc");
}
else {
$(y).addClass("tablegrid_sort_asc");
}
}
}
$(y).on("click", function () {
$("#tablist .tablegrid_sort").each(function (m, n) {
$(n).removeClass("tablegrid_sort_desc").removeClass("tablegrid_sort_asc");
});
var sort = $(y).attr("field");
//console.log(sort);
$("#sort").val(sort);
var order = "";
if (sortV != sort) {
order = "desc";
$(this).addClass("tablegrid_sort_desc");
}
else {
if (orderV == "desc") {
order = "asc";
$(this).addClass("tablegrid_sort_asc");
}
else {
order = "desc";
$(this).addClass("tablegrid_sort_desc");
}
}
$("#order").val(order);
load();
});
});
});
}
function onLoadSucced() {
load();
}
function frameReturnByClose() {
$("#modalwindow").window('close');
}
function frameReturnByReload(flag) {
load();
}
function frameReturnByMes(mes) {
$.messageBox5s('提示', mes);
}
function GetIframeHtml(src) {
return "<iframe width='100%' height='98%' scrolling='no' frameborder='0' src='" + src + "'></iframe>";
}
</script>