一厂MES,含注塑,喷涂,冲孔
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

230 lines
8.3 KiB

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="InjectionDownMonth.aspx.cs" Inherits="MESWebSite.Manage.InjectionDownMonth" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="/CSS/Basics.css" rel="stylesheet" />
<link href="/Scripts/jquery-easyui-1.4.3/themes/metro/easyui.css" rel="stylesheet" type="text/css" />
<link href="/Scripts/jquery-easyui-1.4.3/themes/icon.css" rel="stylesheet" type="text/css" />
<link href="/Scripts/jquery-easyui-1.4.3/themes/color.css" rel="stylesheet" type="text/css" />
<script src="/Scripts/jquery-easyui-1.4.3/jquery.min.js" type="text/javascript"></script>
<script src="/Scripts/jquery-easyui-1.4.3/jquery.easyui.min.js" type="text/javascript"></script>
<script src="/Scripts/jquery-easyui-1.4.3/locale/easyui-lang-zh_CN.js" type="text/javascript"></script>
<script src="/Scripts/MyJs.js" type="text/javascript"></script>
<link href="../Show/bootstrap/css/bootstrap.css" rel="stylesheet" />
<script src="../Show/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<script src="../Show/echar/echarts.min.js" type="text/javascript"></script>
<style>
#w td {
padding: 5px 5px;
text-align: left;
vertical-align: middle;
}
#w .title {
vertical-align: middle;
text-align: right;
width: 80px;
height: 40px;
padding: 0px;
}
p {
padding: 0px 5px;
font-size: small;
font-family: 微软雅黑;
margin: 0px;
}
.tree-folder-open, .tree-folder, .tree-file {
display: none;
}
.datagrid {
text-align: center;
}
.ttb {
width: 180px;
display: block;
}
#ReportTable_div {
margin: 0 auto;
margin-top: 20px;
}
#ReportTable_div table {
border: 1px solid #000000;
border-collapse: collapse;
margin: 0 auto;
width: 80%;
}
#bar {
float: left;
margin-left: 0px;
margin-top: 20px;
width: 100%;
height: 500px;
}
</style>
<title>每月平均换膜统计</title>
<script>
</script>
</head>
<body>
<form id="form1" runat="server">
<div class="top">
<table cellpadding="0" cellspacing="0" style="width: 100%">
<thead>
<tr>
<td><span class="title">每月平均换膜统计</span></td>
</tr>
</thead>
<tbody>
<tr>
<td style="width: 415px;">
<input id="start_time" editable="false" class="easyui-datebox" name="name" data-options="label:'月份:'" />
&nbsp;&nbsp;
<a class="topsearchBtn">查询</a>
&nbsp;&nbsp;
<a class="topexcelBtn" id="exportbtn">导出</a>
</td>
<td style="width: 75px;"></td>
<td style="width: 75px;"></td>
</tr>
</tbody>
</table>
</div>
<div id="ReportTable_div">
</div>
<script>
$(function () {
$('#start_time').datebox({
//显示日趋选择对象后再触发弹出月份层的事件,初始化时没有生成月份层
onShowPanel: function () {
//触发click事件弹出月份层
span.trigger('click');
if (!tds)
//延时触发获取月份对象,因为上面的事件触发和对象生成有时间间隔
setTimeout(function () {
tds = p.find('div.calendar-menu-month-inner td');
tds.click(function (e) {
//禁止冒泡执行easyui给月份绑定的事件
e.stopPropagation();
//得到年份
var year = /\d{4}/.exec(span.html())[0],
//月份
//之前是这样的month = parseInt($(this).attr('abbr'), 10) + 1;
month = parseInt($(this).attr('abbr'), 10);
//隐藏日期对象
$('#start_time').datebox('hidePanel')
//设置日期的值
.datebox('setValue', year + '-' + month);
});
}, 0);
},
//配置parser,返回选择的日期
parser: function (s) {
if (!s) return new Date();
var arr = s.split('-');
return new Date(parseInt(arr[0], 10), parseInt(arr[1], 10) - 1, 1);
},
//配置formatter,只返回年月 之前是这样的d.getFullYear() + '-' +(d.getMonth());
formatter: function (d) {
var currentMonth = (d.getMonth() + 1);
var currentMonthStr = currentMonth < 10 ? ('0' + currentMonth) : (currentMonth + '');
return d.getFullYear() + '-' + currentMonthStr;
}
});
//日期选择对象
var p = $('#start_time').datebox('panel'),
//日期选择对象中月份
tds = false,
//显示月份层的触发控件
span = p.find('span.calendar-text');
var curr_time = new Date();
//设置默认值为当前月
//$("#start_time").datebox("setValue", formatter(curr_time));
//搜索按钮
$('.topsearchBtn').first().click(function () {
SearchInfo();
});
$.ajaxSetup({
cache: false //关闭AJAX缓存
});
$("#exportbtn").bind('click', function () {
var StartTime = $('#start_time').datetimebox('getValue');
var queryParams = {
StartTime: StartTime
};
post('<%=ResolveUrl("~/HttpHandlers/InjectionDownMonthHandler.ashx?method=QueryExcel") %>', queryParams);
});
});
function SearchInfo() {
var StartTime = $('#start_time').datetimebox('getValue');
$.ajax({
url: "InjectionDownMonth.aspx/GetDate",
datatype: 'json',
type: "Post",
data: "{'StartTime':'" + StartTime + "'}",
contentType: "application/json; charset=utf-8",
success: function (data) {
if (data != null && data.d != "") {
$('#ReportTable_div').html(data.d);
}
else {
$('#ReportTable_div').html('');
}
}
});
}
function post(url, PARAMS) {
var temp_form = document.createElement("form");
temp_form.action = url;
temp_form.target = "_blank";
temp_form.method = "post";
temp_form.style.display = "none"; for (var x in PARAMS) {
var opt = document.createElement("textarea");
opt.name = x;
opt.value = PARAMS[x];
temp_form.appendChild(opt);
}
document.body.appendChild(temp_form);
temp_form.submit();
}
</script>
</form>
</body>
</html>