天津投入产出系统后端
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.
 
 
 
 
 
 

378 lines
14 KiB

<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/AppMaster.Master"
Inherits="System.Web.Mvc.ViewPage<QMAPP.FJC.Web.Models.StatisticalAnalysis.MendStatisticsModel>" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
Index
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<style type="text/css">
.tdset
{
border-top: 1px solid black;
border-left: 1px solid black;
width: 100px;
text-align: center;
}
.tdright
{
border-right: 1px solid black;
}
.tdbottom
{
border-bottom: 1px solid black;
}
</style>
<%=Html.QPSeach(105,true) %>
<table id="condiTable">
<tr>
<th align="right">
<%=Html.QV(p => p.MENDTYPE)%>
</th>
<td>
<%=Html.QC(p => p.MENDTYPE)%>
</td>
<th align="right">
<%=Html.QV(p => p.CREATEDATESTART)%>
</th>
<td>
<%=Html.QC(p => p.CREATEDATESTART)%>
</td>
<th align="right">
<%=Html.QV(p => p.CREATEDATEEND)%>
</th>
<td>
<%=Html.QC(p => p.CREATEDATEEND)%>
</td>
<th align="right">
<%=Html.QV(p => p.MENDREASON)%>
</th>
<td>
<%=Html.QC(p => p.MENDREASON)%>
</td>
</tr>
<tr>
<th align="right">
<%=Html.QV(p => p.VERTICAL)%>
</th>
<td>
<%=Html.QC(p => p.VERTICAL)%>
<%=Html.QC(p => p.HORIZONTAL)%>
</td>
<th align="right">
<%=Html.QV(p => p.PRODUCESHIFTTCODE)%>
</th>
<td>
<%=Html.QC(p => p.PRODUCESHIFTTCODE)%>
</td>
</tr>
</table>
<div style="left: 1px; position: relative;">
</div>
<%=Html.QPEnd()%>
<%=Html.QPList() %>
<table cellpadding="0" cellspacing="0" align="center" style="margin-left: 5px; margin-top: 5px;">
<tr style="height: 10px">
</tr>
<tr>
<td align="center">
<div id="chartdiv" style="width: 1000px; height: 400px;">
</div>
</td>
</tr>
</table>
<%=Html.QPEnd() %>
<%=Html.Hidden("Arr", Model.arr)%>
<%=Html.Hidden("Machine", Model.results)%>
<div id="addMatNoWindow" class="easyui-window" title="产品图片" iconcls="icon-save" closed="true"
style="width: 800px; height: 500px; padding: 5px;">
<div class="easyui-layout" fit="true">
<div region="center" border="false" style="padding: 0px; background: #fff; border: 1px solid #ccc;">
<table id="Table3">
<tr>
<td>
<img style="padding: 0px" src="../../Content/Img/pic.jpg" /></img>
</td>
</tr>
</table>
</div>
</div>
</div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ToolContent" runat="server">
<table id="EditTable" cellpadding="0" cellspacing="0">
<tr>
<td align="center">
<%=Html.QTButtonSearch("MendStatistics", "List", "Search()", (s, f) => { return true; })%>
<%=Html.QTButton("export", "ExportExcel", QMFrameWork.WebUI.IconCls.redo, "Export()", (s, f) => { return true; })%>
<%=Html.QTButton("ShowDetail", "ShowDetail", QMFrameWork.WebUI.IconCls.detail, "ShowPicture()", (s, f) => { return true; })%>
</td>
</tr>
</table>
<script type="text/javascript">
var chart;
$(function () {
$('#VERTICAL').combobox({
onSelect: function () {
var vertical = $('#VERTICAL').combobox('getValue');
if (vertical == "") {
$('#HORIZONTAL').combobox('setValue', '');
}
else {
var horizotal = $('#HORIZONTAL').combobox('getValue');
if (horizotal == "") {
$('#HORIZONTAL').combobox('setValue', 'A');
}
}
}
});
$('#HORIZONTAL').combobox({
onSelect: function () {
var horizotal = $('#HORIZONTAL').combobox('getValue');
if (horizotal == "") {
$('#VERTICAL').combobox('setValue', '');
}
else {
var vertical = $('#VERTICAL').combobox('getValue');
if (vertical == "") {
$('#VERTICAL').combobox('setValue', '1');
}
}
}
});
var chartData = eval($("#Arr").val());
if (chartData != undefined && chartData.length > 0) {
var typeValue = $('#MENDTYPE').combobox('getValue');
if (typeValue == 1 || typeValue == 2 || typeValue == 3 || typeValue == 4 || typeValue == 7) {
var categoryField = "";
var graphTitle = "";
if (typeValue == 1) {
categoryField = "DEFECTVALUE";
graphTitle = "缺陷类型";
}
else if (typeValue == 2) {
categoryField = "POSITION";
graphTitle = "缺陷位置";
}
else if (typeValue == 3) {
categoryField = "PRODUCESHIFTTCODE";
graphTitle = "班次";
}
else if (typeValue == 7) {
categoryField = "DEFECTVALUE";
graphTitle = "缺陷类型";
}
AmCharts.ready(function () {
// SERIAL CHART
chart = new AmCharts.AmSerialChart();
chart.dataProvider = chartData;
chart.categoryField = categoryField;
chart.plotAreaBorderAlpha = 0.2;
// AXES
// category
var categoryAxis = chart.categoryAxis;
categoryAxis.gridAlpha = 0.1;
categoryAxis.axisAlpha = 0;
categoryAxis.gridPosition = "start";
// value
var valueAxis = new AmCharts.ValueAxis();
valueAxis.stackType = "regular";
valueAxis.gridAlpha = 0.1;
valueAxis.axisAlpha = 0;
chart.addValueAxis(valueAxis);
// GRAPHS
// first graph
var graph = new AmCharts.AmGraph();
graph.title = graphTitle;
graph.labelText = "[[value]]";
graph.valueField = "QUATITY";
graph.type = "column";
graph.lineAlpha = 0;
graph.fillAlphas = 1;
graph.lineColor = "#C72C95";
graph.balloonText = "<span style='color:#555555;'>[[category]]</span><br><span style='font-size:14px'>[[title]]:<b>[[value]]</b></span>";
chart.addGraph(graph);
// LEGEND
var legend = new AmCharts.AmLegend();
legend.borderAlpha = 0.2;
legend.horizontalGap = 10;
chart.addLegend(legend);
// WRITE
chart.write("chartdiv");
});
} else {
var legend;
var categoryField = "";
var valueAxisTitle = "";
if (typeValue == 5) {
categoryField = "CODE";
valueAxisTitle = "返修率趋势图";
}
else if (typeValue == 6) {
categoryField = "CODE";
valueAxisTitle = "废品趋势图";
}
else if (typeValue == 8) {
categoryField = "CODE";
valueAxisTitle = "返修数量趋势图";
}
else if (typeValue == 9) {
categoryField = "CODE";
valueAxisTitle = "生产返修对比趋势图";
}
var MachineData = eval($("#Machine").val());
AmCharts.ready(function () {
chart = new AmCharts.AmSerialChart();
chart.dataProvider = chartData;
chart.categoryField = "NAME";
chart.startDuration = 0.5;
chart.balloon.color = "#000000";
// AXES
// category
var categoryAxis = chart.categoryAxis;
categoryAxis.fillAlpha = 1;
categoryAxis.fillColor = "#FAFAFA";
categoryAxis.gridAlpha = 0;
categoryAxis.axisAlpha = 0;
categoryAxis.gridPosition = "start";
// value
var valueAxis = new AmCharts.ValueAxis();
valueAxis.title = valueAxisTitle;
valueAxis.dashLength = 5;
valueAxis.axisAlpha = 0;
valueAxis.integersOnly = true;
valueAxis.gridCount = 10;
valueAxis.reversed = false; // this line makes the value axis reversed
chart.addValueAxis(valueAxis);
$(MachineData).each(function (i, obj) {
var graph = new AmCharts.AmGraph();
graph.title = obj.NAME;
graph.valueField = obj.CODE;
graph.balloonText = obj.NAME + "[[category]]: [[value]]";
graph.lineAlpha = 1;
graph.bullet = "round";
chart.addGraph(graph);
}); //
// CURSOR
var chartCursor = new AmCharts.ChartCursor();
chartCursor.cursorPosition = "mouse";
chartCursor.zoomable = false;
chartCursor.cursorAlpha = 0;
chart.addChartCursor(chartCursor);
// LEGEND
var legend = new AmCharts.AmLegend();
legend.useGraphSettings = true;
chart.addLegend(legend);
// WRITE
chart.write("chartdiv");
});
}
}
});
// this method sets chart 2D/3D
function setDepth() {
if (document.getElementById("rb1").checked) {
chart.depth3D = 0;
chart.angle = 0;
} else {
chart.depth3D = 25;
chart.angle = 30;
}
chart.validateNow();
}
//查询
function Search() {
var typeValue = $('#MENDTYPE').combobox('getValue');
if (typeValue == "") {
MSI("提示", "请选择统计类别!");
return;
}
var dateStart = $('#CREATEDATESTART').val();
if (dateStart == "") {
MSI("提示", "请选择开始日期!");
return;
}
var dateStart = $('#CREATEDATEEND').val();
if (dateStart == "") {
MSI("提示", "请选择结束日期!");
return;
}
submitByButton("List");
}
//导出
function Export() {
var typeValue = $('#MENDTYPE').combobox('getValue');
if (typeValue == "") {
MSI("提示", "请选择统计类别!");
return;
}
var dateStart = $('#CREATEDATESTART').val();
if (dateStart == "") {
MSI("提示", "请选择开始日期!");
return;
}
var dateStart = $('#CREATEDATEEND').val();
if (dateStart == "") {
MSI("提示", "请选择结束日期!");
return;
}
submitByButton("ExportExcel");
}
//显示图片信息
function ShowPicture() {
$('#addMatNoWindow').window({
title: '产品图片',
modal: true,
shadow: false,
closed: true,
left: 50,
top: 5,
closable: true,
minimizable: false,
maximizable: false,
width: 735,
height: 535,
collapsible: false
});
$('#addMatNoWindow').window('open');
}
</script>
</asp:Content>