| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055 |
- <!doctype html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
- <link rel="shortcut icon" href="/img/logo.png" />
- <link rel="bookmark" href="/img/logo.png" />
- <link rel="stylesheet" href="/plugins/bootstrap-4.3.1/css/bootstrap.min.css">
- <link rel="stylesheet" href="/plugins/font-awesome-4.7.0/css/font-awesome.min.css">
- <link href="/Plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet" />
- <link rel="stylesheet" href="DashBoard.css?v3" />
- <script src="/Plugins/jquery-3.4.1/jquery-3.4.1.min.js"></script>
- <script src="/Plugins/xrequest/xrequest.min.js"></script>
- <title>东科软件</title>
- </head>
- <body>
- <!--导航菜单-->
- <script src="/main/common/navbar.js"></script>
- <!--统计-->
- <div class="container-fluid">
- <!--页头-->
- <div class="row">
- <div class="col-4 d-inline-flex align-items-center justify-content-start">
- <img src="/Img/dongke_logo_white.png" style="height: 40px;" />
- <span class="pl-3" id="报表加载"></span>
- </div>
- <div class="col-4 d-inline-flex align-items-center justify-content-center">
- <h3 class="text-center"><span style="font-weight:600;font-size:36px;">二检(质量)</span></h3>
- </div>
- <div class="col-4 d-inline-flex align-items-center justify-content-end">
- <span id="当前时间"></span>
- <a class="pl-2" href="javascript:void(0)" onclick="fullScreen(); $('#navbar').toggle();">
- <img src="/Img/hegii_logo_white.png" style="height: 26px;" />
- </a>
- </div>
- </div>
- <!--行1-->
- <div class="row pt-0">
- <div class="col-12 pt-0">
- <div class="p-3 rounded border border-secondary d-flex flex-column" style="height:280px">
- <!--每小时合格率-->
- <div class="d-flex justify-content-center">
- <canvas id="canvasHour" style="-moz-user-select: none;-webkit-user-select: none;-ms-user-select: none; height:260px;width:100%"></canvas>
- </div>
- </div>
- </div>
- </div>
- <!--行2-->
- <div class="row pt-0">
- <div class="col-12 pt-0">
- <div class="p-3 rounded border border-secondary d-flex flex-column" style="height:280px">
- <!--每日合格率-->
- <div class="d-flex justify-content-center">
- <canvas id="canvasDay" style="-moz-user-select: none;-webkit-user-select: none;-ms-user-select: none; height:260px;width:100%"></canvas>
- </div>
- </div>
- </div>
- </div>
- <!--行3-->
- <div class="row pt-0">
- <div class="col-12 pt-0">
- <div class="p-3 rounded border border-secondary d-flex flex-row" style="height:280px">
- <div style="flex:1 1 auto;align-self:center;text-align:center;width:20%;height:100%; margin:1px;">
- <!--二检当天累计-->
- <div style="padding-top:5px;">二检当天累计</div>
- <canvas id="piecanvas1" style="-moz-user-select: none;-webkit-user-select: none;-ms-user-select: none; height:220px; width:100%; padding-bottom:5px;"></canvas>
- </div>
- <div style="flex:1 1 auto;align-self:center;text-align:center;width:20%;height:100%; margin:1px;">
- <canvas id="canvasCount1" style="-moz-user-select: none;-webkit-user-select: none;-ms-user-select: none; height:260px;width:100%"></canvas>
- </div>
- <div style="flex:1 1 auto;align-self:center;text-align:center;width:20%;height:100%;margin:1px;">
- <canvas id="canvasCount2" style="-moz-user-select: none;-webkit-user-select: none;-ms-user-select: none; height:260px;width:100%"></canvas>
- </div>
- <div style="flex:1 1 auto;align-self:center;text-align:center;width:20%;height:100%;margin:1px;">
- <canvas id="canvasCount3" style="-moz-user-select: none;-webkit-user-select: none;-ms-user-select: none; height:260px;width:100%"></canvas>
- </div>
- <div style="flex:1 1 auto;align-self:center;text-align:center;width:20%;height:100%;margin:1px;">
- <canvas id="canvasCount4" style="-moz-user-select: none;-webkit-user-select: none;-ms-user-select: none; height:260px;width:100%"></canvas>
- </div>
- </div>
- </div>
- </div>
- <div class="row pt-0">
- <div class="col-12 pt-0">
- <div class="p-3 rounded border border-secondary d-flex flex-row" style="height:280px">
- <div style="flex:1 1 auto;align-self:center;text-align:center;width:20%;height:100%; margin:1px;">
- <!--二检当月累计-->
- <div style="padding-top:5px;">二检当月累计</div>
- <canvas id="piecanvas2" style="-moz-user-select: none;-webkit-user-select: none;-ms-user-select: none; height:220px; width:100%; padding-bottom:5px;"></canvas>
- </div>
- <div style="flex:1 1 auto;align-self:center;text-align:center;width:20%;height:100%; margin:1px;">
- <canvas id="canvasCount11" style="-moz-user-select: none;-webkit-user-select: none;-ms-user-select: none; height:260px;width:100%"></canvas>
- </div>
- <div style="flex:1 1 auto;align-self:center;text-align:center;width:20%;height:100%;margin:1px;">
- <canvas id="canvasCount12" style="-moz-user-select: none;-webkit-user-select: none;-ms-user-select: none; height:260px;width:100%"></canvas>
- </div>
- <div style="flex:1 1 auto;align-self:center;text-align:center;width:20%;height:100%;margin:1px;">
- <canvas id="canvasCount13" style="-moz-user-select: none;-webkit-user-select: none;-ms-user-select: none; height:260px;width:100%"></canvas>
- </div>
- <div style="flex:1 1 auto;align-self:center;text-align:center;width:20%;height:100%;margin:1px;">
- <canvas id="canvasCount14" style="-moz-user-select: none;-webkit-user-select: none;-ms-user-select: none; height:260px;width:100%"></canvas>
- </div>
- </div>
- </div>
- <div style="height:300px;"></div>
- </div>
- <!--行4-->
- </div>
- <!--版权信息-->
- <!--<script src="../common/footer.js"></script>-->
- <script src="/Plugins/bootstrap-4.3.1/js/bootstrap.bundle.min.js"></script>
- <script src="/Plugins/bootstrap-table/bootstrap-table.min.js"></script>
- <script src="/Plugins/bootstrap-table/bootstrap-table-locale-all.min.js"></script>
- <script src="/Plugins/sweetalert/sweetalert.min.js"></script>
- <script src="/Plugins/chartjs-2.8.0/chart-2.8.min.js"></script>
- <script src="/Plugins/chartjs-2.8.0/chartjs-plugin-datalabels.js"></script>
- <script src="/Plugins/chartjs-2.8.0/utils.js"></script>
- <script src="/Plugins/circleChart/circleChart.min.js"></script>
- <script>
- //缺陷统计刷新时间
- var refreshTime1 = 60000;
- var currentTime1 = 0;
- var doGetData;
- var doGetTime;
- var frameHeight;
- var tableHeight;
- var offsetHeight = 20;
- $(document).ready(function () {
- //设置缩放
- //xuwell.setScale(1);
- //初始化
- init();
- //首次加载
- //loadData();
- //定时刷新数据
- doGetData = setInterval(function () { timeUpdate(); }, 1000);
- //刷新时间
- loadServerTime();
- doGetTime = setInterval(function () { loadServerTime(); }, 15000);
- });
- //取服务器时间
- function loadServerTime() {
- $.get('../api/GetDateTime.ashx', function (data) {
- var json = JSON.parse(data);
- if (json["success"] == true) {
- $('#当前时间').html(json["rows"]["时间"]);
- }
- });
- }
- function timeUpdate() {
- if (currentTime1 <= 0) {
- loadData(function () { currentTime1 = refreshTime1; });
- }
- else {
- if (currentTime1 > 0) {
- $('#报表加载').html('刷新:' + currentTime1 / 1000 + ' 秒');
- currentTime1 = currentTime1 - 1000;
- }
- }
- }
- function loadData(callback) {
- //正式数据===========================================================
- //加载每小时合格率
- $.get("hourCount.ashx", function (data) {
- var jsonHourCount = JSON.parse(data);
- if (jsonHourCount["success"] == true) {
- window.Hour.data.labels = [];
- window.Hour.data.datasets[0].data = [];
- window.Hour.data.datasets[1].data = [];
- window.Hour.data.labels = [];
- window.Hour.data.datasets[0].data = [];
- window.Hour.data.datasets[1].data = [];
- for (var i = 0; i < jsonHourCount["rows"].length; i++) {
- window.Hour.data.labels.push(jsonHourCount["rows"][i]["项目"]);
- window.Hour.data.datasets[0].data.push(jsonHourCount["rows"][i]["合格目标"]);
- window.Hour.data.datasets[1].data.push(jsonHourCount["rows"][i]["合格率"]);
- }
- window.Hour.update();
- }
- });
- //加载每日合格和报废
- $.get("dayCount.ashx", function (data) {
- var jsonDayCount = JSON.parse(data);
- if (jsonDayCount["success"] == true) {
- window.Day.data.labels = [];
- window.Day.data.datasets[0].data = [];
- window.Day.data.datasets[1].data = [];
- window.Day.data.labels = [];
- window.Day.data.datasets[0].data = [];
- window.Day.data.datasets[1].data = [];
- for (var i = 0; i < jsonDayCount["rows"].length; i++) {
- window.Day.data.labels.push(jsonDayCount["rows"][i]["项目"]);
- window.Day.data.datasets[0].data.push(jsonDayCount["rows"][i]["合格目标"]);
- window.Day.data.datasets[1].data.push(jsonDayCount["rows"][i]["合格率"]);
- }
- window.Day.update();
- }
- });
- //二检当天
- var semi2daytotal = $.ajax({ url: "semi2dayCount.ashx?m=total", dataType: "json", type: "get" });
- var semi2daydefectname = $.ajax({ url: "semi2dayCount.ashx?m=defectname", dataType: "json", type: "get" });
- var semi2daydefectposition = $.ajax({ url: "semi2dayCount.ashx?m=defectposition", dataType: "json", type: "get" });
- var semi2daygoodscode = $.ajax({ url: "semi2dayCount.ashx?m=goodscode", dataType: "json", type: "get" });
- var semi2daygroutingline = $.ajax({ url: "semi2dayCount.ashx?m=groutingline", dataType: "json", type: "get" });
- $.when(semi2daytotal, semi2daydefectname, semi2daydefectposition, semi2daygoodscode, semi2daygroutingline).then(
- function (result1,result2, result3, result4, result5) {
- //二检当天饼图
- var jsonData1 = result1[0];
- if (jsonData1["success"] == true) {
- var n1 = jsonData1["rows"][0]["NUM1"];
- var n2 = jsonData1["rows"][0]["NUM2"];
- var n3 = jsonData1["rows"][0]["NUM3"];
- var num1 = jsonData1["rows"][0]["QUALIFIED"];
- var num2 = jsonData1["rows"][0]["UNQUALIFIED"];
- var num3 = jsonData1["rows"][0]["SCRAP"];
- window.pieConfig1.data.labels = ["良品:" + n1, "不良:" + n2, "报废:" + n3];
- window.pieConfig1.data.datasets[0].data = [num1, num2, num3];
- window.pie1.update();
- }
- //加载二检当天缺陷统计数据
- var jsonData2 = result2[0];
- if (jsonData2["success"] == true) {
- var labelsArray = [];
- var datalabelsArray = [];
- for (var n = 0; n < jsonData2["rows"].length; n++) {
- labelsArray.push(jsonData2["rows"][n]["DEFECTNAME"]);
- datalabelsArray.push(jsonData2["rows"][n]["DTOTAL"]);
- }
- window.Count1.data.labels = labelsArray;
- window.Count1.data.datasets[0].data = datalabelsArray;
- //window.Count1.data.labels = [jsonData2["rows"][0]["DEFECTNAME"], jsonData2["rows"][1]["DEFECTNAME"], jsonData2["rows"][2]["DEFECTNAME"], jsonData2["rows"][3]["DEFECTNAME"], jsonData2["rows"][4]["DEFECTNAME"]];
- //window.Count1.data.datasets[0].data = [jsonData2["rows"][0]["DTOTAL"], jsonData2["rows"][1]["DTOTAL"], jsonData2["rows"][2]["DTOTAL"], jsonData2["rows"][3]["DTOTAL"], jsonData2["rows"][4]["DTOTAL"]];
- window.Count1.update();
- }
- //加载二检当天位置累计数据
- var jsonData3 = result3[0];
- if (jsonData3["success"] == true) {
- var labelsArray = [];
- var datalabelsArray = [];
- for (var n = 0; n < jsonData3["rows"].length; n++) {
- labelsArray.push(jsonData3["rows"][n]["DEFECTPOSITIONNAME"]);
- datalabelsArray.push(jsonData3["rows"][n]["PTOTAL"]);
- }
- window.Count2.data.labels = labelsArray;
- window.Count2.data.datasets[0].data = datalabelsArray;
- //window.Count2.data.labels = [jsonData3["rows"][0]["DEFECTPOSITIONNAME"], jsonData3["rows"][1]["DEFECTPOSITIONNAME"], jsonData3["rows"][2]["DEFECTPOSITIONNAME"], jsonData3["rows"][3]["DEFECTPOSITIONNAME"], jsonData3["rows"][4]["DEFECTPOSITIONNAME"]];
- //window.Count2.data.datasets[0].data = [jsonData3["rows"][0]["PTOTAL"], jsonData3["rows"][1]["PTOTAL"], jsonData3["rows"][2]["PTOTAL"], jsonData3["rows"][3]["PTOTAL"], jsonData3["rows"][4]["PTOTAL"]];
- window.Count2.update();
- }
- //加载二检当天产品累计数据
- var jsonData4 = result4[0];
- if (jsonData4["success"] == true) {
- var labelsArray = [];
- var datalabelsArray = [];
- for (var n = 0; n < jsonData4["rows"].length; n++) {
- labelsArray.push(jsonData4["rows"][n]["GOODSCODE"]);
- datalabelsArray.push(jsonData4["rows"][n]["GTOTAL"]);
- }
- window.Count3.data.labels = labelsArray;
- window.Count3.data.datasets[0].data = datalabelsArray;
- //window.Count3.data.labels = [jsonData4["rows"][0]["GOODSCODE"], jsonData4["rows"][1]["GOODSCODE"], jsonData4["rows"][2]["GOODSCODE"], jsonData4["rows"][3]["GOODSCODE"], jsonData4["rows"][4]["GOODSCODE"]];
- //window.Count3.data.datasets[0].data = [jsonData4["rows"][0]["GTOTAL"], jsonData4["rows"][1]["GTOTAL"], jsonData4["rows"][2]["GTOTAL"], jsonData4["rows"][3]["GTOTAL"], jsonData4["rows"][4]["GTOTAL"]];
- window.Count3.update();
- }
- //加载二检当天线号累计数据
- var jsonData5 = result5[0];
- if (jsonData5["success"] == true) {
- var labelsArray = [];
- var datalabelsArray = [];
- for (var n = 0; n < jsonData5["rows"].length; n++) {
- labelsArray.push(jsonData5["rows"][n]["GROUTINGLINENAME"]);
- datalabelsArray.push(jsonData5["rows"][n]["LTOTAL"]);
- }
- window.Count4.data.labels = labelsArray;
- window.Count4.data.datasets[0].data = datalabelsArray;
- //window.Count4.data.labels = [jsonData5["rows"][0]["GROUTINGLINENAME"], jsonData5["rows"][1]["GROUTINGLINENAME"], jsonData5["rows"][2]["GROUTINGLINENAME"], jsonData5["rows"][3]["GROUTINGLINENAME"]];
- //window.Count4.data.datasets[0].data = [jsonData5["rows"][0]["LTOTAL"], jsonData5["rows"][1]["LTOTAL"], jsonData5["rows"][2]["LTOTAL"], jsonData5["rows"][3]["LTOTAL"]];
- window.Count4.update();
- }
- });
- //二检当月
- var semi2monthtotal = $.ajax({ url: "semi2monthCount.ashx?m=total", dataType: "json", type: "get" });
- var semi2monthdefectname = $.ajax({ url: "semi2monthCount.ashx?m=defectname", dataType: "json", type: "get" });
- var semi2monthdefectposition = $.ajax({ url: "semi2monthCount.ashx?m=defectposition", dataType: "json", type: "get" });
- var semi2monthgoodscode = $.ajax({ url: "semi2monthCount.ashx?m=goodscode", dataType: "json", type: "get" });
- var semi2monthgroutingline = $.ajax({ url: "semi2monthCount.ashx?m=groutingline", dataType: "json", type: "get" });
- $.when(semi2monthtotal, semi2monthdefectname, semi2monthdefectposition, semi2monthgoodscode, semi2monthgroutingline).then(
- function (result1,result2, result3, result4, result5) {
- //二检当月饼图
- var jsonData1 = result1[0];
- if (jsonData1["success"] == true) {
- var n1 = jsonData1["rows"][0]["NUM1"];
- var n2 = jsonData1["rows"][0]["NUM2"];
- var n3 = jsonData1["rows"][0]["NUM3"];
- var num1 = jsonData1["rows"][0]["QUALIFIED"];
- var num2 = jsonData1["rows"][0]["UNQUALIFIED"];
- var num3 = jsonData1["rows"][0]["SCRAP"];
- window.pieConfig2.data.labels = ["良品:" + n1, "不良:" + n2, "报废:" + n3];
- window.pieConfig2.data.datasets[0].data = [num1, num2, num3];
- window.pie2.update();
- }
- //加载二检当月缺陷统计数据
- var jsonData2 = result2[0];
- if (jsonData2["success"] == true) {
- var labelsArray = [];
- var datalabelsArray = [];
- for (var n = 0; n < jsonData2["rows"].length; n++) {
- labelsArray.push(jsonData2["rows"][n]["DEFECTNAME"]);
- datalabelsArray.push(jsonData2["rows"][n]["DTOTAL"]);
- }
- window.Count11.data.labels = labelsArray;
- window.Count11.data.datasets[0].data = datalabelsArray;
- //window.Count11.data.labels = [jsonData2["rows"][0]["DEFECTNAME"], jsonData2["rows"][1]["DEFECTNAME"], jsonData2["rows"][2]["DEFECTNAME"], jsonData2["rows"][3]["DEFECTNAME"], jsonData2["rows"][4]["DEFECTNAME"]];
- //window.Count11.data.datasets[0].data = [jsonData2["rows"][0]["DTOTAL"], jsonData2["rows"][1]["DTOTAL"], jsonData2["rows"][2]["DTOTAL"], jsonData2["rows"][3]["DTOTAL"], jsonData2["rows"][4]["DTOTAL"]];
- window.Count11.update();
- }
- //加载二检当月位置累计数据
- var jsonData3 = result3[0];
- if (jsonData3["success"] == true) {
- var labelsArray = [];
- var datalabelsArray = [];
- for (var n = 0; n < jsonData3["rows"].length; n++) {
- labelsArray.push(jsonData3["rows"][n]["DEFECTPOSITIONNAME"]);
- datalabelsArray.push(jsonData3["rows"][n]["PTOTAL"]);
- }
- window.Count12.data.labels = labelsArray;
- window.Count12.data.datasets[0].data = datalabelsArray;
- //window.Count12.data.labels = [jsonData3["rows"][0]["DEFECTPOSITIONNAME"], jsonData3["rows"][1]["DEFECTPOSITIONNAME"], jsonData3["rows"][2]["DEFECTPOSITIONNAME"], jsonData3["rows"][3]["DEFECTPOSITIONNAME"], jsonData3["rows"][4]["DEFECTPOSITIONNAME"]];
- //window.Count12.data.datasets[0].data = [jsonData3["rows"][0]["PTOTAL"], jsonData3["rows"][1]["PTOTAL"], jsonData3["rows"][2]["PTOTAL"], jsonData3["rows"][3]["PTOTAL"], jsonData3["rows"][4]["PTOTAL"]];
- window.Count12.update();
- }
- //加载二检当月产品累计数据
- var jsonData4 = result4[0];
- if (jsonData4["success"] == true) {
- var labelsArray = [];
- var datalabelsArray = [];
- for (var n = 0; n < jsonData4["rows"].length; n++) {
- labelsArray.push(jsonData4["rows"][n]["GOODSCODE"]);
- datalabelsArray.push(jsonData4["rows"][n]["GTOTAL"]);
- }
- window.Count13.data.labels = labelsArray;
- window.Count13.data.datasets[0].data = datalabelsArray;
- //window.Count13.data.labels = [jsonData4["rows"][0]["GOODSCODE"], jsonData4["rows"][1]["GOODSCODE"], jsonData4["rows"][2]["GOODSCODE"], jsonData4["rows"][3]["GOODSCODE"], jsonData4["rows"][4]["GOODSCODE"]];
- //window.Count13.data.datasets[0].data = [jsonData4["rows"][0]["GTOTAL"], jsonData4["rows"][1]["GTOTAL"], jsonData4["rows"][2]["GTOTAL"], jsonData4["rows"][3]["GTOTAL"], jsonData4["rows"][4]["GTOTAL"]];
- window.Count13.update();
- }
- //加载二检当月线号累计数据
- var jsonData5 = result5[0];
- if (jsonData5["success"] == true) {
- var labelsArray = [];
- var datalabelsArray = [];
- for (var n = 0; n < jsonData5["rows"].length; n++) {
- labelsArray.push(jsonData5["rows"][n]["GROUTINGLINENAME"]);
- datalabelsArray.push(jsonData5["rows"][n]["LTOTAL"]);
- }
- window.Count14.data.labels = labelsArray;
- window.Count14.data.datasets[0].data = datalabelsArray;
- //window.Count14.data.labels = [jsonData5["rows"][0]["GROUTINGLINENAME"], jsonData5["rows"][1]["GROUTINGLINENAME"], jsonData5["rows"][2]["GROUTINGLINENAME"], jsonData5["rows"][3]["GROUTINGLINENAME"]];
- //window.Count14.data.datasets[0].data = [jsonData5["rows"][0]["LTOTAL"], jsonData5["rows"][1]["LTOTAL"], jsonData5["rows"][2]["LTOTAL"], jsonData5["rows"][3]["LTOTAL"]];
- window.Count14.update();
- }
- });
- //===================================================================
- if (typeof callback != 'undefined') callback();
- }
- function loadTable(id, url, callback) {
- }
- //日期格式化
- function groutingDate(value, row, index) {
- var d = new Date(value);
- return d.getFullYear() + '-' + d.getMonth() + '-' + d.getDay();
- }
- function dateFormat(fmt, date) {
- let ret;
- const opt = {
- "Y+": date.getFullYear().toString(), // 年
- "m+": (date.getMonth() + 1).toString(), // 月
- "d+": date.getDate().toString(), // 日
- "H+": date.getHours().toString(), // 时
- "M+": date.getMinutes().toString(), // 分
- "S+": date.getSeconds().toString() // 秒
- // 有其他格式化字符需求可以继续添加,必须转化成字符串
- };
- for (let k in opt) {
- ret = new RegExp("(" + k + ")").exec(fmt);
- if (ret) {
- fmt = fmt.replace(ret[1], (ret[1].length == 1) ? (opt[k]) : (opt[k].padStart(ret[1].length, "0")))
- };
- };
- return fmt;
- }
- </script>
- <script>
- window.chartColors = {
- red: 'rgb(255, 99, 132)',
- orange: 'rgb(255, 159, 64)',
- yellow: 'rgb(255, 250, 86)',
- green: 'rgb(75, 192, 192)',
- blue: 'rgb(54, 162, 250)',
- purple: 'rgb(153, 102, 255)',
- grey: 'rgb(231,233,237)'
- };
- var color = Chart.helpers.color;
- window.randomScalingFactor = function (num) {
- return Math.round(Math.random() * num);
- }
- function init() {
- Chart.defaults.global.defaultFontColor = 'white';
- Chart.defaults.global.defaultFontSize = 12;
- //每小时合格率=========================================
- window.configHour = {
- data: {
- labels: [],
- datasets: [{
- label: "合格目标",
- backgroundColor: color(window.chartColors.red).alpha(0.6).rgbString(),
- borderColor: window.chartColors.red,
- borderWidth: 2,
- pointRadius: 12,
- data: [],
- fill: false,
- }, {
- label: "合格率",
- fill: false,
- backgroundColor: color(window.chartColors.blue).alpha(0.6).rgbString(),
- borderColor: window.chartColors.blue,
- borderWidth: 2,
- pointRadius: 12,
- data: []
- }]
- },
- type: 'line',
- options: {
- responsive: true,
- title: {
- display: true,
- text: '每小时合格率'
- },
- tooltips: {
- mode: 'index',
- intersect: false,
- },
- hover: {
- mode: 'nearest',
- intersect: true
- },
- scales: {
- xAxes: [{
- display: true,
- scaleLabel: {
- display: false,
- labelString: ''
- }
- }],
- yAxes: [{
- display: true,
- scaleLabel: {
- display: false,
- labelString: 'Value'
- }
- }]
- }
- }
- };
- var ctxHour = document.getElementById("canvasHour").getContext("2d");
- window.Hour = new Chart(ctxHour, configHour);
- //====================================================
- //每日计合格率=======================================
- window.configDay = {
- data: {
- labels: [],
- datasets: [{
- label: "合格目标",
- backgroundColor: color(window.chartColors.red).alpha(0.6).rgbString(),
- borderColor: window.chartColors.red,
- borderWidth: 2,
- pointRadius: 12,
- data: [],
- fill: false,
- }, {
- label: "合格率",
- fill: false,
- backgroundColor: color(window.chartColors.blue).alpha(0.6).rgbString(),
- borderColor: window.chartColors.blue,
- borderWidth: 2,
- pointRadius: 12,
- data: []
- }]
- },
- type: 'line',
- options: {
- responsive: true,
- title: {
- display: true,
- text: '每日合格率'
- },
- tooltips: {
- mode: 'index',
- intersect: false,
- },
- hover: {
- mode: 'nearest',
- intersect: true
- },
- scales: {
- xAxes: [{
- display: true,
- scaleLabel: {
- display: false,
- labelString: ''
- }
- }],
- yAxes: [{
- display: true,
- scaleLabel: {
- display: false,
- labelString: 'Value'
- }
- }]
- }
- }
- };
- var ctxDay = document.getElementById("canvasDay").getContext("2d");
- window.Day = new Chart(ctxDay, configDay);
- //===================================================
- //饼图
- window.pieConfig1 = {
- data: {
- datasets: [{
- data: [
- 0,
- 0,
- 0
- ],
- backgroundColor: [
- color(window.chartColors.blue).alpha(0.6).rgbString(),
- color(window.chartColors.yellow).alpha(0.6).rgbString(),
- color(window.chartColors.red).alpha(0.6).rgbString()
- ],
- borderColor: [
- window.chartColors.blue,
- window.chartColors.yellow,
- window.chartColors.red
- ],
- borderWidth: 1,
- label: '数据1'
- }],
- labels: [
- "良品",
- "不良",
- "报废"
- ]
- },
- type: 'pie',
- options: {
- responsive: true,
- legend: {
- position: 'top'
- }
- }
- };
- var ctxPie1 = document.getElementById("piecanvas1").getContext("2d");
- window.pie1 = new Chart(ctxPie1, pieConfig1);
- window.pieConfig2 = {
- data: {
- datasets: [{
- data: [
- 0,
- 0,
- 0
- ],
- backgroundColor: [
- color(window.chartColors.blue).alpha(0.6).rgbString(),
- color(window.chartColors.yellow).alpha(0.6).rgbString(),
- color(window.chartColors.red).alpha(0.6).rgbString()
- ],
- borderColor: [
- window.chartColors.blue,
- window.chartColors.yellow,
- window.chartColors.red
- ],
- borderWidth: 1,
- label: '数据1'
- }],
- labels: [
- "良品",
- "不良",
- "报废"
- ]
- },
- type: 'pie',
- options: {
- responsive: true,
- legend: {
- position: 'top'
- }
- }
- };
- var ctxPie2 = document.getElementById("piecanvas2").getContext("2d");
- window.pie2 = new Chart(ctxPie2, pieConfig2);
- window.configCount1 = {
- data: {
- labels: [],
- datasets: [{
- label: '',
- backgroundColor: color(window.chartColors.blue).alpha(0.5).rgbString(),
- fill: false,
- borderColor: window.chartColors.blue,
- borderWidth: 2,
- pointRadius: 12,
- data: []
- }]
- },
- type: 'horizontalBar',
- options: {
- legend: {
- display: false
- },
- title: {
- display: true,
- text: "二检当天缺陷累计"
- },
- tooltips: {
- mode: 'point',
- intersect: false
- },
- responsive: true,
- scales: {
- xAxes: [{
- stacked: false
- }],
- yAxes: [{
- display: true,
- stacked: false,
- ticks: {
- min: 0,
- //stepSize: 20,
- //max: 20
- }
- }]
- }
- }
- };
- var ctxCount1 = document.getElementById("canvasCount1").getContext("2d");
- window.Count1 = new Chart(ctxCount1, configCount1);
- window.configCount2 = {
- data: {
- labels: [],
- datasets: [{
- label: '',
- backgroundColor: color(window.chartColors.blue).alpha(0.5).rgbString(),
- fill: false,
- borderColor: window.chartColors.blue,
- borderWidth: 2,
- pointRadius: 12,
- data: []
- }]
- },
- type: 'horizontalBar',
- options: {
- legend: {
- display: false
- },
- title: {
- display: true,
- text: "二检当天位置累计"
- },
- tooltips: {
- mode: 'point',
- intersect: false
- },
- responsive: true,
- scales: {
- xAxes: [{
- stacked: false
- }],
- yAxes: [{
- display: true,
- stacked: false,
- ticks: {
- min: 0,
- //stepSize: 20,
- //max: 20
- }
- }]
- }
- }
- };
- var ctxCount2 = document.getElementById("canvasCount2").getContext("2d");
- window.Count2 = new Chart(ctxCount2, configCount2);
- window.configCount3 = {
- data: {
- labels: [],
- datasets: [{
- label: '',
- backgroundColor: color(window.chartColors.blue).alpha(0.5).rgbString(),
- fill: false,
- borderColor: window.chartColors.blue,
- borderWidth: 2,
- pointRadius: 12,
- data: []
- }]
- },
- type: 'horizontalBar',
- options: {
- legend: {
- display: false
- },
- title: {
- display: true,
- text: "二检当天产品累计"
- },
- tooltips: {
- mode: 'point',
- intersect: false
- },
- responsive: true,
- scales: {
- xAxes: [{
- stacked: false
- }],
- yAxes: [{
- display: true,
- stacked: false,
- ticks: {
- min: 0,
- //stepSize: 20,
- //max: 20
- }
- }]
- }
- }
- };
- var ctxCount3 = document.getElementById("canvasCount3").getContext("2d");
- window.Count3 = new Chart(ctxCount3, configCount3);
- window.configCount4 = {
- data: {
- labels: [],
- datasets: [{
- label: '',
- backgroundColor: color(window.chartColors.blue).alpha(0.5).rgbString(),
- fill: false,
- borderColor: window.chartColors.blue,
- borderWidth: 2,
- pointRadius: 12,
- data: []
- }]
- },
- type: 'horizontalBar',
- options: {
- legend: {
- display: false
- },
- title: {
- display: true,
- text: "当天成型线号累计"
- },
- tooltips: {
- mode: 'point',
- intersect: false
- },
- responsive: true,
- scales: {
- xAxes: [{
- stacked: false
- }],
- yAxes: [{
- display: true,
- stacked: false,
- ticks: {
- min: 0,
- //stepSize: 20,
- //max: 20
- }
- }]
- }
- }
- };
- var ctxCount4 = document.getElementById("canvasCount4").getContext("2d");
- window.Count4 = new Chart(ctxCount4, configCount4);
- window.configCount11 = {
- data: {
- labels: [],
- datasets: [{
- label: '',
- backgroundColor: color(window.chartColors.blue).alpha(0.5).rgbString(),
- fill: false,
- borderColor: window.chartColors.blue,
- borderWidth: 2,
- pointRadius: 12,
- data: []
- }]
- },
- type: 'horizontalBar',
- options: {
- legend: {
- display: false
- },
- title: {
- display: true,
- text: "二检当月缺陷累计"
- },
- tooltips: {
- mode: 'point',
- intersect: false
- },
- responsive: true,
- scales: {
- xAxes: [{
- stacked: false
- }],
- yAxes: [{
- display: true,
- stacked: false,
- ticks: {
- min: 0,
- //stepSize: 20,
- //max: 20
- }
- }]
- }
- }
- };
- var ctxCount11 = document.getElementById("canvasCount11").getContext("2d");
- window.Count11 = new Chart(ctxCount11, configCount11);
- window.configCount12 = {
- data: {
- labels: [],
- datasets: [{
- label: '',
- backgroundColor: color(window.chartColors.blue).alpha(0.5).rgbString(),
- fill: false,
- borderColor: window.chartColors.blue,
- borderWidth: 2,
- pointRadius: 12,
- data: []
- }]
- },
- type: 'horizontalBar',
- options: {
- legend: {
- display: false
- },
- title: {
- display: true,
- text: "二检当月位置累计"
- },
- tooltips: {
- mode: 'point',
- intersect: false
- },
- responsive: true,
- scales: {
- xAxes: [{
- stacked: false
- }],
- yAxes: [{
- display: true,
- stacked: false,
- ticks: {
- min: 0,
- //stepSize: 20,
- //max: 20
- }
- }]
- }
- }
- };
- var ctxCount12 = document.getElementById("canvasCount12").getContext("2d");
- window.Count12 = new Chart(ctxCount12, configCount12);
- window.configCount13 = {
- data: {
- labels: [],
- datasets: [{
- label: '',
- backgroundColor: color(window.chartColors.blue).alpha(0.5).rgbString(),
- fill: false,
- borderColor: window.chartColors.blue,
- borderWidth: 2,
- pointRadius: 12,
- data: []
- }]
- },
- type: 'horizontalBar',
- options: {
- legend: {
- display: false
- },
- title: {
- display: true,
- text: "二检当月产品累计"
- },
- tooltips: {
- mode: 'point',
- intersect: false
- },
- responsive: true,
- scales: {
- xAxes: [{
- stacked: false
- }],
- yAxes: [{
- display: true,
- stacked: false,
- ticks: {
- min: 0,
- //stepSize: 20,
- //max: 20
- }
- }]
- }
- }
- };
- var ctxCount13 = document.getElementById("canvasCount13").getContext("2d");
- window.Count13 = new Chart(ctxCount13, configCount13);
- window.configCount14 = {
- data: {
- labels: [],
- datasets: [{
- label: '',
- backgroundColor: color(window.chartColors.blue).alpha(0.5).rgbString(),
- fill: false,
- borderColor: window.chartColors.blue,
- borderWidth: 2,
- pointRadius: 12,
- data: []
- }]
- },
- type: 'horizontalBar',
- options: {
- legend: {
- display: false
- },
- title: {
- display: true,
- text: "当月成型线号累计"
- },
- tooltips: {
- mode: 'point',
- intersect: false
- },
- responsive: true,
- scales: {
- xAxes: [{
- stacked: false
- }],
- yAxes: [{
- display: true,
- stacked: false,
- ticks: {
- min: 0,
- //stepSize: 20,
- //max: 20
- }
- }]
- }
- }
- };
- var ctxCount14 = document.getElementById("canvasCount14").getContext("2d");
- window.Count14 = new Chart(ctxCount14, configCount14);
- }
- </script>
- </body>
- </html>
|