TG.WXCRM.V4/WEB/Views/WeiXin/WxResourceReport/UserWorkReport3.cshtml

169 lines
6.2 KiB
Plaintext

@using WX.CRM.WebHelper
@{
ViewBag.Title = "新媒体资源工作报表";
Layout = "~/Views/Shared/_Index_Layout2.cshtml";
}
<div class="mvctool">
@Html.ToolButton("btnQuery", "icon-search", "查询", true)
@Html.ToolButton("btnExport", "icon-export", "导出", true)
@Html.Action("ToolBar", "Control", ViewBag.ToolBar as ToolBar)
</div>
<style>
body {
overflow: hidden
}
.tip-icon {
padding: 0px 4px;
border-radius: 2px;
background-color: #ff6a00;
color: aliceblue;
}
</style>
<div class="bas_datagrid">
<div id="tb" style="padding:5px;height:auto" class="grid_toolbar">
<ul class="toolBar_ul">
<li>@Html.Action("UserSSOComBox", "Control", new { currentRight = WX.CRM.WebHelper.InitRights.CONST_员工日常工作报表 })</li>
<li>
<span>员工名称:</span>
<input type="text" id="txt_UName" name="txt_UName" style="width:130px">
</li>
<li>
<span>工号:</span>
<input type="text" id="txt_Eid" name="txt_Eid" style="width:130px">
</li>
<li>
<span>分配时间:</span>
<input type="text" id="stime" name="stime" value=@(DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd")) style="width: 100px;" onfocus="stimeFocus(this)" />-
<input type="text" id="etime" name="etime" value=@(DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd")) onclick="" style="width: 100px;" onfocus="etimeFocus(this)" />
</li>
<li>
<input type="checkbox" name="hideQuit" id="hideQuit" value="1">
不显示离职员工
</li>
</ul>
</div>
@Html.Raw(ViewBag.gridTable)
</div>
<script type="text/javascript">
$(function () {
$("th[field='wx_total_re_eid']").attr('title', "是指对员工名下所有企微账号重复添加的客户微信进行去重").append("<span class='tip-icon'>?</span>");
$("th[field='wx_total_re_dep']").attr('title', "是指对本事业部员工重复添加的客户微信进行去重,即剔除本事业部内非首次添加的加微数").append("<span class='tip-icon'>?</span>");
$(window).resize(function () {
$('#tablist').tablegrid('resize', {
height: $(window).height() - 110
});
});
$("#btnQuery").click(function () {
LoadData();
});
$("#btnExport").click(function () {
BtnExportAll_Click();
});
var CurTimeAmount = $(".grid_table_head th[field='CurTimeAmount']");
//console.dir(CurTimeAmount);
$(CurTimeAmount).css("color", "red");
});
function onLoadSucced() {
LoadData();
}
function getPageOptions(gridID) {
var option = $("#tablist").tablepage('getPagination');
var str = "rows=" + option.rows + "&page=" + option.page + "&order=" + option.order + "&sort=" + option.sort;
return str;
}
function LoadData() {
$("#tablist").tablegrid({
url: '/weixin/WxResourceReport/UserWorkReport3',
height: $(window).height() - 110,
loadNow: true,
isPage: true,
data: GetControlValue(),
onLoadSuccess: function (data) {
$(".layui-table-page").hide();
}
});
}
function GetControlValue() {
return {
companyId: $("#txt_companyId").val(),
deptId: $("#txt_deptId").val(),
groupId: $("#txt_groupIds").val(),
userid: $('#txt_userId').val(),
uname: $('#txt_UName').val(),
eid: $('#txt_Eid').val(),
stime: $('#stime').val(),
etime: $('#etime').val(),
hideQuit: $('#hideQuit').prop("checked")
};
}
function frameReturnByClose() {
$("#modalwindow").window('close');
}
function frameReturnByReload(flag) {
$("#tablist").tablegrid("Load");
}
//获取datagrid头部及字段
function getDataGridHeader() {
var columns = $('#tablist').tablegrid("getHead");
return columns;
}
function GetIframeHtml(src) {
return "<iframe width='100%' height='98%' scrolling='no' frameborder='0' src='" + src + "'></iframe>";
}
function BtnExportAll_Click() {
var param = "&gid=" + $(".combo-value").val()
+ "&pkid=" + $('#nb1_combox_user').val()
+ "&uname=" + $('#txt_UName').val()
+ "&eid=" + $('#txt_Eid').val()
+ "&stime=" + $('#stime').val()
+ "&etime=" + $('#etime').val()
+ "&hideQuit=" + $('#hideQuit').prop("checked");
var option = $("#tablist").tablepage('getPagination');
//全部导出
param += "&rows=" + option.totalRows + "&page=1&order=" + option.order + "&sort=" + option.sort;
$("#modalwindow").html(GetIframeHtml("/Control/ExcelExport?Query=" + encodeURIComponent("/weixin/WxResourceReport/UserWorkReport3Export?" + GetQueryStr() + param)));
$("#modalwindow").window({ title: '导出', width: 480, height: 300, iconCls: 'icon-export' }).window('open');
}
//时间
function stimeFocus(ele) {
WdatePicker({
el: ele, dateFmt: 'yyyy-MM-dd', maxDate: '#F{$dp.$D(\'etime\')}',
onpicked: function (p) { PickedFunc() },
onpicking: function (p) { PickeingFunc() }
})
}
function etimeFocus(ele) {
WdatePicker({
el: ele, dateFmt: 'yyyy-MM-dd', minDate: '#F{$dp.$D(\'stime\')}',
onpicked: function (p) { PickedFunc() },
onpicking: function (p) { PickeingFunc() }
})
}
//结果
var o_s, o_e;
function PickedFunc() {
var s = new Date($("#stime").val());
var e = new Date($("#etime").val());
if (Math.abs(s - e) > (1000*60*60*24*62)) {
alert("时间范围不超过62天");
$("#stime").val(o_s);
$("#etime").val(o_e);
}
}
function stimePicked() {
}
//结果前
function PickeingFunc() {
o_e = $("#etime").val();
o_s = $("#stime").val();
}
</script>