6 changed files with 218 additions and 20 deletions
@ -0,0 +1,172 @@ |
|||||
|
@{ ViewData["Title"] = "QRS010A"; |
||||
|
Layout = "~/Views/Shared/_AMESLayout.cshtml"; } |
||||
|
|
||||
|
<script src="~/Highcharts-7.1.2/highcharts.js"></script> |
||||
|
<script src="~/Highcharts-7.1.2/modules/exporting.js"></script> |
||||
|
<script src="~/Highcharts-7.1.2/modules/export-data.js"></script> |
||||
|
|
||||
|
<style> |
||||
|
.control-label { |
||||
|
justify-content: flex-end !important; |
||||
|
} |
||||
|
|
||||
|
.text-error { |
||||
|
color: #dc3545 !important; |
||||
|
} |
||||
|
|
||||
|
.my-read-only-class { |
||||
|
cursor: not-allowed; |
||||
|
} |
||||
|
</style> |
||||
|
|
||||
|
<div class="layui-card"> |
||||
|
<div class="col-sm-12"> |
||||
|
<form enctype="multipart/form-data" class="layui-form" method="post"> |
||||
|
<div class="layui-form-item"> |
||||
|
<div class="layui-inline"> |
||||
|
<div id="divChart" style="width: 600px; height: 400px; margin: 0 auto"></div> |
||||
|
<input type="hidden" id="param_list" value="@ViewData["ParamList"]" /> |
||||
|
<table class="layui-hide" id="query" lay-filter="query"></table> |
||||
|
</div> |
||||
|
</div> |
||||
|
</form> |
||||
|
</div> |
||||
|
|
||||
|
</div> |
||||
|
|
||||
|
@section Scripts { |
||||
|
@{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); |
||||
|
await Html.RenderPartialAsync("_FileinputScriptsPartial"); } |
||||
|
|
||||
|
<script type="text/javascript"> |
||||
|
$(document).ready(function () { |
||||
|
|
||||
|
//alert(param_list.value); |
||||
|
|
||||
|
$.ajax({ |
||||
|
type: "Post", |
||||
|
url: '/QRS/GetYieldData4QRS010?id=' + param_list.value, |
||||
|
contentType: "application/json; charset=utf-8", |
||||
|
dataType: 'json', |
||||
|
success: function (response) { |
||||
|
var idx = 0; |
||||
|
var xAxisData = new Array(); |
||||
|
var yieldData = new Array(); |
||||
|
$.each(response, function (i, item) { |
||||
|
yieldData[idx] = item["yield"]; |
||||
|
xAxisData[idx] = item["wipNO"] + " - " + item["lineDesc"] + " - " + item["stationDesc"]; |
||||
|
idx = idx + 1; |
||||
|
}); |
||||
|
|
||||
|
Highcharts.chart('divChart', { |
||||
|
title: { |
||||
|
text: '良率圖表' |
||||
|
}, |
||||
|
subtitle: { |
||||
|
text: '' |
||||
|
}, |
||||
|
xAxis: { |
||||
|
categories: xAxisData |
||||
|
}, |
||||
|
yAxis: { |
||||
|
title: { |
||||
|
text: '良率' |
||||
|
} |
||||
|
}, |
||||
|
plotOptions: { |
||||
|
line: { |
||||
|
dataLabels: { |
||||
|
enabled: true |
||||
|
}, |
||||
|
enableMouseTracking: false |
||||
|
} |
||||
|
}, |
||||
|
series: [{ |
||||
|
type: 'column', |
||||
|
name: '工單-線別-站別', |
||||
|
data: yieldData |
||||
|
}, |
||||
|
{ |
||||
|
type: 'line', |
||||
|
name: '工單-線別-站別', |
||||
|
data: yieldData |
||||
|
}] |
||||
|
}); |
||||
|
}, |
||||
|
error: function () { |
||||
|
alert("查無良率資料!"); |
||||
|
$("#divChart").empty(); |
||||
|
} |
||||
|
}); |
||||
|
|
||||
|
var tableCols = [[ |
||||
|
{ |
||||
|
field: 'wipNO', |
||||
|
width: 160, |
||||
|
title: '工單號碼', |
||||
|
sort: true |
||||
|
}, |
||||
|
{ |
||||
|
field: 'itemNO', |
||||
|
title: '料號', |
||||
|
width: 200, |
||||
|
sort: true |
||||
|
}, |
||||
|
{ |
||||
|
field: 'planQTY', |
||||
|
width: 120, |
||||
|
title: '計畫數量', |
||||
|
sort: true |
||||
|
}, |
||||
|
{ |
||||
|
field: 'modelNO', |
||||
|
title: '機種', |
||||
|
sort: true |
||||
|
}, |
||||
|
{ |
||||
|
field: 'lineDesc', |
||||
|
width: 100, |
||||
|
title: '線別', |
||||
|
sort: true |
||||
|
}, |
||||
|
{ |
||||
|
field: 'stationDesc', |
||||
|
width: 120, |
||||
|
title: '站別', |
||||
|
sort: true |
||||
|
}, |
||||
|
{ |
||||
|
field: 'ruleStatus', |
||||
|
title: '過站狀態', |
||||
|
width: 100, |
||||
|
sort: true |
||||
|
}, |
||||
|
{ |
||||
|
field: 'firstCnt', |
||||
|
title: '首次過站數量', |
||||
|
width: 160, |
||||
|
sort: true |
||||
|
}, |
||||
|
{ |
||||
|
field: 'passCnt', |
||||
|
title: '總共過站數量', |
||||
|
width: 160, |
||||
|
sort: true |
||||
|
}, |
||||
|
{ |
||||
|
field: 'yield', |
||||
|
title: '良率', |
||||
|
width: 120, |
||||
|
sort: true |
||||
|
}] |
||||
|
]; |
||||
|
|
||||
|
//基本数据表格 |
||||
|
//var table = hg.table.datatable('query', '良率查詢', '/QRS/GetYieldData4QRS010List/' + param_list.value, {}, tableCols, toolbar, true, 'full-100', ['filter', 'print', 'exports']); |
||||
|
}); |
||||
|
|
||||
|
</script> |
||||
|
|
||||
|
|
||||
|
} |
||||
|
|
Loading…
Reference in new issue