155 lines
5.5 KiB
Plaintext
155 lines
5.5 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
|
|
}
|
|
</style>
|
|
|
|
<div class="bas_datagrid">
|
|
<div id="tb" style="padding:5px;height:auto" class="grid_toolbar">
|
|
<ul class="toolBar_ul">
|
|
<li>@Html.Action("UserComBox", "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>
|
|
</ul>
|
|
</div>
|
|
@Html.Raw(ViewBag.gridTable)
|
|
</div>
|
|
|
|
<script type="text/javascript">
|
|
|
|
$(function () {
|
|
$(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*31)) {
|
|
alert("时间范围不超过31天");
|
|
$("#stime").val(o_s);
|
|
$("#etime").val(o_e);
|
|
}
|
|
}
|
|
function stimePicked() {
|
|
|
|
}
|
|
//结果前
|
|
function PickeingFunc() {
|
|
o_e = $("#etime").val();
|
|
o_s = $("#stime").val();
|
|
}
|
|
</script> |