demo.html 45 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553
  1. <!doctype html>
  2. <html lang="en" data-bs-theme="auto">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width">
  6. <link rel="icon" href="/app/images/dongke-logo.png">
  7. <link href="/plugins/bootstrap/bootstrap.min.css" rel="stylesheet">
  8. <title>东科软件</title>
  9. <style>
  10. body {
  11. background-color: black;
  12. }
  13. .col {
  14. width: 1280px;
  15. height: 660px;
  16. }
  17. .bigtitle {
  18. height: 137px;
  19. background-repeat: no-repeat;
  20. background-position: center;
  21. background-image: url(/Img/title9in1.png);
  22. }
  23. .boardone {
  24. background-repeat: no-repeat;
  25. background-position: center;
  26. background-image: url(/Img/bg9in1.png);
  27. }
  28. .boardone .title {
  29. padding-top: 50px;
  30. color: white;
  31. font-size: 40px;
  32. font-weight: 600;
  33. }
  34. .boardone .chart {
  35. margin-left: 150px;
  36. margin-top: 10px;
  37. width: 980px;
  38. height: 450px;
  39. font-size: 6px;
  40. outline-width: 10px;
  41. }
  42. .doughnut {
  43. width: 600px !important;
  44. height: 800px !important;
  45. }
  46. table, tr, td {
  47. border: 1px solid #84C1FF;
  48. font-size: 30px;
  49. color: #D0D0D0;
  50. white-space: nowrap;
  51. /*line-height: 200%;*/
  52. }
  53. .tableheader {
  54. font-weight: 800;
  55. background-color: #0f58a2;
  56. }
  57. .pinguan {
  58. margin-left: 10px;
  59. margin-top: 10px;
  60. width: 1230px;
  61. height: 450px;
  62. font-size: 5px;
  63. }
  64. </style>
  65. </head>
  66. <body class="m-0 p-0 border-0">
  67. <div class="m-1">
  68. <div class="row pb-4" style="width:100%;">
  69. <div class="col bigtitle"></div>
  70. </div>
  71. <div class="row row-cols-3 text-center g-2">
  72. <div class="col mx-1 boardone">
  73. <div class="title">
  74. 新品入仓
  75. </div>
  76. <div class="chart">
  77. <canvas id="canvas04" height="145"></canvas>
  78. </div>
  79. </div>
  80. <div class="col mx-1 boardone">
  81. <div class="title">
  82. 每周产品半检检验报废率TOP5
  83. </div>
  84. <div class="chart">
  85. <canvas id="canvas10" height="135"></canvas>
  86. </div>
  87. </div>
  88. <div class="col mx-1 boardone">
  89. <div class="title pb-2">
  90. 每周产品成检检验报废率TOP5
  91. </div>
  92. <div class="chart">
  93. <canvas id="canvas06" height="145"></canvas>
  94. </div>
  95. </div>
  96. <div class="col mx-1 boardone">
  97. <div class="title">
  98. 每周各车间半检TOP3
  99. </div>
  100. <div class="doughnut">
  101. <canvas id="canvas031" style="margin-left:-50px; margin-top:120px;"></canvas>
  102. <label style="font-size: 30px; color: white; margin-left: 100px; width:1070px">
  103. 一车间
  104. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  105. 二车间
  106. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  107. 三车间
  108. </label>
  109. <canvas id="canvas032" style="margin-left:340px; margin-top:-450px"></canvas>
  110. <canvas id="canvas033" style="margin-left:720px; margin-top:-200px"></canvas>
  111. </div>
  112. </div>
  113. <div class="col mx-1 boardone">
  114. <div class="title">
  115. 每周各车间产质量
  116. </div>
  117. <div class="chart">
  118. <canvas id="canvas01" height="145"></canvas>
  119. </div>
  120. </div>
  121. <div class="col mx-1 boardone">
  122. <div class="title">
  123. 每周各车间成检TOP3
  124. </div>
  125. <div class="doughnut">
  126. <canvas id="canvas021" style="margin-left:-60px; margin-top:150px;"></canvas>
  127. <label style="font-size: 30px; color: white; margin-left: 80px; width:1070px">
  128. 一车间
  129. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  130. <span style="font-size: 30px; color: white; margin-top: -950px"> 二车间 </span>
  131. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  132. 三车间
  133. </label>
  134. <canvas id="canvas022" style="margin-left:340px; margin-top:-500px"></canvas>
  135. <canvas id="canvas023" style="margin-left: 700px; margin-top: -140px "></canvas>
  136. </div>
  137. </div>
  138. <div class="col mx-1 boardone">
  139. <div class="title">
  140. 品管抽检缺陷率
  141. </div>
  142. <div class="pinguan" height="100" style="width: 92%; margin-left: 40px ;margin-top:-15px">
  143. <canvas id="canvas11" height="130"></canvas>
  144. </div>
  145. </div>
  146. <div class="col mx-1 boardone">
  147. <div class="title">
  148. 品管抽检数据展示
  149. </div>
  150. <div class="pinguan" height="100" style="width: 92%; margin-left: 40px ;margin-top:-15px">
  151. <canvas id="canvas09" height="130"></canvas>
  152. </div>
  153. </div>
  154. <div class="col mx-1 boardone">
  155. <div class="title pb-2">
  156. 各车间缺陷周环比
  157. </div>
  158. <div class="chart" style=" margin-left:60px">
  159. <table width="118%" class="table-striped">
  160. <tr class="各车间缺陷周环比">
  161. <td style="width:160px;">产品类别</td>
  162. <td style="width:160px;">缺陷名称</td>
  163. <td style="width:160px;">缺陷数</td>
  164. <td style="width:180px;">缺陷占比 </td>
  165. <td style="width:180px;">上周比</td>
  166. <td>对比趋势</td>
  167. </tr>
  168. </table>
  169. <div>
  170. <div>
  171. <table id="dayTable_template" style="display:none;">
  172. <tr>
  173. <td style="width:160px;">{产品类别}</td>
  174. <td style="width:160px;">{缺陷名称}</td>
  175. <td style="width:160px;">{缺陷数}</td>
  176. <td style="width:180px;">{缺陷占比}</td>
  177. <td style="width:180px;">{上周比}</td>
  178. <td>{对比趋势}</td>
  179. </tr>
  180. </table>
  181. </div>
  182. <table id="tableheader" class="tablefix" style="width: 118%;">
  183. </table>
  184. </div>
  185. </div>
  186. </div>
  187. </div>
  188. </div>
  189. <script src="/plugins/bootstrap/bootstrap.bundle.min.js"></script>
  190. <script src="/plugins/jquery-3.4.1/jquery-3.4.1.min.js"></script>
  191. <script src="/Plugins/chartjs-2.8.0/chart-2.8.min.js"></script>
  192. <script src="/Plugins/chartjs-2.8.0/chartjs-plugin-datalabels.js"></script>
  193. <script src="/Plugins/chartjs-2.8.0/utils.js"></script>
  194. <script src="/main/Common/xuwell.js"></script>
  195. <script>
  196. //定义color
  197. var color = Chart.helpers.color;
  198. //每周各车间产质量
  199. var refreshTime01 = 30;
  200. var currentTime01 = 10;
  201. //半检大小件TOP3缺陷占比
  202. var refreshTime02 = 60;
  203. var currentTime02 = 10;
  204. //成检大小件TOP3缺陷占比
  205. var refreshTime03 = 120;
  206. var currentTime03 = 10;
  207. //每周各车间成型产量湿收率
  208. var refreshTime04 = 180;
  209. var currentTime04 = 10;
  210. //各车间缺陷周环比
  211. var refreshTime05 = 240;
  212. var currentTime05 = 10;
  213. //每周干补率及冷补率
  214. var refreshTime06 = 300;
  215. var currentTime06 = 10;
  216. //每周大小件大工序产量
  217. var refreshTime07 = 360;
  218. var currentTime07 = 10;
  219. //模具库存周转率,产品SKU周转率
  220. var refreshTime08 = 420;
  221. var currentTime08 = 10;
  222. //品管抽检数据展示
  223. var refreshTime09 = 480;
  224. var currentTime09 = 10;
  225. var mainInterval;
  226. var mainRowCount = 0;
  227. //刷新时间
  228. function doTimer() {
  229. if (currentTime01 == 0) load01();
  230. if (currentTime01 >= 0) $("#currentTime01").text(currentTime01);
  231. currentTime01--;
  232. if (currentTime02 == 0) load02();
  233. if (currentTime02 >= 0) $("#currentTime02").text(currentTime02);
  234. currentTime02--;
  235. if (currentTime03 == 0) load03();
  236. if (currentTime03 >= 0) $("#currentTime03").text(currentTime03);
  237. currentTime03--;
  238. if (currentTime04 == 0) load04();
  239. if (currentTime04 >= 0) $("#currentTime04").text(currentTime04);
  240. currentTime04--;
  241. if (currentTime05 == 0) load05();
  242. if (currentTime05 >= 0) $("#currentTime05").text(currentTime05);
  243. currentTime05--;
  244. if (currentTime06 == 0) load06();
  245. if (currentTime06 >= 0) $("#currentTime06").text(currentTime06);
  246. currentTime06--;
  247. if (currentTime07 == 0) load07();
  248. if (currentTime07 >= 0) $("#currentTime07").text(currentTime07);
  249. currentTime07--;
  250. if (currentTime08 == 0) load08();
  251. if (currentTime08 >= 0) $("#currentTime08").text(currentTime08);
  252. currentTime08--;
  253. if (currentTime09 == 0) load09();
  254. if (currentTime09 >= 0) $("#currentTime09").text(currentTime09);
  255. currentTime09--;
  256. }
  257. //页面初期
  258. $(document).ready(function () {
  259. initAll();
  260. //设置缩放
  261. xuwell.setScale(0.391);
  262. loadAll();
  263. });
  264. function mainScroll() {
  265. var scrollHeight = $("#tableheader").find("tr").outerHeight();
  266. $("#tableheader").animate({ marginTop: -scrollHeight, }, 500,
  267. function () {
  268. $(this).css({ marginTop: "0px", }).find("tr:first").appendTo(this);
  269. if (--mainRowCount == -1) load05();
  270. }
  271. );
  272. }
  273. //初期加载画面样式
  274. function initAll() {
  275. window.chartColors = {
  276. red: 'rgb(255, 99, 132)',
  277. orange: 'rgb(255, 159, 64)',
  278. yellow: 'rgb(255, 250, 86)',
  279. green: 'rgb(75, 192, 192)',
  280. blue: 'rgb(54, 162, 250)',
  281. purple: 'rgb(153, 102, 255)',
  282. grey: 'rgb(231,233,237)',
  283. MediumVioletRed: 'rgb(199,21,133)',
  284. DarkViolet: 'rgb(148,0,211)',
  285. Magenta1: 'rgb(255,0,255)'
  286. };
  287. window.randomScalingFactor = function (num) {
  288. return Math.round(Math.random() * num);
  289. }
  290. Chart.defaults.global.defaultFontColor = 'white';
  291. Chart.defaults.global.defaultFontSize = 30;
  292. //调用数据加载
  293. init01(); init021(); init022(); init023(); init031(); init032(); init033(); init04(); init05(); init06(); init08(); init09(); init11();
  294. }
  295. //每周各车间产质量
  296. function init01() {
  297. window.config01 = {
  298. data: {
  299. labels: ["一车间", "二车间", "三车间"],
  300. barWidth: 10,
  301. datasets: [{
  302. type: 'line',
  303. label: "综合质量",
  304. yAxesGroup: 'A',
  305. yAxisID: 'A',
  306. backgroundColor: color(window.chartColors.orange).alpha(0.5).rgbString(),
  307. borderColor: window.chartColors.orange,
  308. borderWidth: 2,
  309. pointRadius: 10,
  310. fill: false
  311. }, {
  312. type: 'line',
  313. label: "本烧质量",
  314. yAxesGroup: 'A',
  315. yAxisID: 'A',
  316. backgroundColor: color(window.chartColors.green).alpha(0.5).rgbString(),
  317. borderColor: window.chartColors.green,
  318. borderWidth: 2,
  319. pointRadius: 10,
  320. fill: false
  321. }, {
  322. label: '本烧产量',
  323. yAxesGroup: 'B',
  324. yAxisID: 'B',
  325. backgroundColor: color(window.chartColors.blue).alpha(0.7).rgbString(),
  326. borderColor: window.chartColors.blue,
  327. barWidth: 1,
  328. fill: true
  329. }]
  330. },
  331. type: 'bar',
  332. barWidth: 10,
  333. options: {
  334. legend: {
  335. display: true
  336. },
  337. title: {
  338. display: false,
  339. text: '每周各车间产质量'
  340. },
  341. tooltips: {
  342. mode: 'index',
  343. intersect: false,
  344. },
  345. hover: {
  346. mode: 'nearest',
  347. intersect: true
  348. },
  349. responsive: true,
  350. scales: {
  351. xAxes: [{
  352. scaleLabel: {
  353. stacked: false,
  354. },
  355. barThickness: 90
  356. }],
  357. yAxes: [{
  358. display: true,
  359. id: 'B',
  360. name: 'B',
  361. barWidth: 10,
  362. barThickness: 10,
  363. position: 'left',
  364. scaleLabel: {
  365. display: false,
  366. labelString: 'Value'
  367. },
  368. ticks: {
  369. min: 0,
  370. stepSize: 10000,
  371. max: 40000
  372. }
  373. }
  374. , {
  375. display: true,
  376. id: 'A',
  377. name: 'A',
  378. scalePositionLeft: false,
  379. position: 'right',
  380. scaleLabel: {
  381. display: false,
  382. labelString: 'Value2',
  383. barWidth: 5,
  384. },
  385. ticks: {
  386. min: 80,
  387. stepSize: 5,
  388. max: 100
  389. }
  390. }]
  391. }
  392. }
  393. };
  394. var ctx01 = document.getElementById("canvas01").getContext("2d");
  395. window.chart01 = new Chart(ctx01, config01);
  396. }
  397. //成检一车间TOP3缺陷占比
  398. function init021() {
  399. window.config021 = {
  400. data: {
  401. labels: [],
  402. datasets: [{
  403. label: '缺陷',
  404. backgroundColor: [
  405. Chart.helpers.color(window.chartColors.red).rgbString(),
  406. Chart.helpers.color(window.chartColors.orange).rgbString(),
  407. Chart.helpers.color(window.chartColors.yellow).rgbString()
  408. ],
  409. fill: false,
  410. borderColor: [
  411. window.chartColors.red,
  412. window.chartColors.orange,
  413. window.chartColors.yellow
  414. ],
  415. borderWidth: 4,
  416. pointRadius: 30,
  417. data: []
  418. }]
  419. },
  420. type: 'doughnut',
  421. options: {
  422. legend: {
  423. display: true
  424. },
  425. textstyle: {
  426. fontsize: 2
  427. },
  428. title: {
  429. display: false,
  430. text: "缺陷",
  431. },
  432. tooltips: {
  433. mode: 'point',
  434. intersect: false
  435. },
  436. responsive: true
  437. }
  438. };
  439. var ctx021 = document.getElementById("canvas021").getContext("2d");
  440. window.chart021 = new Chart(ctx021, config021);
  441. }
  442. //成检二车间TOP3缺陷占比
  443. function init022() {
  444. window.config022 = {
  445. data: {
  446. labels: [],
  447. datasets: [{
  448. label: '缺陷',
  449. backgroundColor: [
  450. Chart.helpers.color(window.chartColors.green).rgbString(),
  451. Chart.helpers.color(window.chartColors.blue).rgbString(),
  452. Chart.helpers.color(window.chartColors.purple).rgbString()
  453. ],
  454. fill: false,
  455. borderColor: [
  456. window.chartColors.green,
  457. window.chartColors.blue,
  458. window.chartColors.purple
  459. ],
  460. borderWidth: 4,
  461. pointRadius: 30,
  462. data: []
  463. }]
  464. },
  465. type: 'doughnut',
  466. options: {
  467. legend: {
  468. display: true
  469. },
  470. title: {
  471. display: false,
  472. text: "缺陷"
  473. },
  474. tooltips: {
  475. mode: 'point',
  476. intersect: false
  477. },
  478. responsive: true
  479. }
  480. };
  481. var ctx022 = document.getElementById("canvas022").getContext("2d");
  482. window.chart022 = new Chart(ctx022, config022);
  483. }
  484. //成检三车间TOP3缺陷占比
  485. function init023() {
  486. window.config023 = {
  487. data: {
  488. labels: [],
  489. datasets: [{
  490. label: '缺陷',
  491. backgroundColor: [
  492. Chart.helpers.color(window.chartColors.Magenta1).rgbString(),
  493. Chart.helpers.color(window.chartColors.MediumVioletRed).rgbString(),
  494. Chart.helpers.color(window.chartColors.DarkViolet).rgbString()
  495. ],
  496. fill: false,
  497. borderColor: [
  498. window.chartColors.Magenta1,
  499. window.chartColors.MediumVioletRed,
  500. window.chartColors.DarkViolet
  501. ],
  502. borderWidth: 4,
  503. pointRadius: 30,
  504. data: []
  505. }]
  506. },
  507. type: 'doughnut',
  508. options: {
  509. legend: {
  510. display: true
  511. },
  512. title: {
  513. display: false,
  514. text: "缺陷"
  515. },
  516. tooltips: {
  517. mode: 'point',
  518. intersect: false
  519. },
  520. responsive: true
  521. }
  522. };
  523. var ctx023 = document.getElementById("canvas023").getContext("2d");
  524. window.chart023 = new Chart(ctx023, config023);
  525. }
  526. //半检一车间TOP3缺陷占比
  527. function init031() {
  528. window.config031 = {
  529. data: {
  530. labels: [],
  531. datasets: [{
  532. label: '缺陷',
  533. backgroundColor: [
  534. Chart.helpers.color(window.chartColors.red).rgbString(),
  535. Chart.helpers.color(window.chartColors.orange).rgbString(),
  536. Chart.helpers.color(window.chartColors.yellow).rgbString()
  537. ],
  538. fill: false,
  539. borderColor: [
  540. window.chartColors.red,
  541. window.chartColors.orange,
  542. window.chartColors.yellow
  543. ],
  544. borderWidth: 4,
  545. pointRadius: 30,
  546. data: []
  547. }]
  548. },
  549. type: 'doughnut',
  550. options: {
  551. legend: {
  552. display: true
  553. },
  554. textstyle: {
  555. fontsize: 2
  556. },
  557. title: {
  558. display: false,
  559. text: "缺陷",
  560. },
  561. tooltips: {
  562. mode: 'point',
  563. intersect: false
  564. },
  565. responsive: true
  566. }
  567. };
  568. var ctx031 = document.getElementById("canvas031").getContext("2d");
  569. window.chart031 = new Chart(ctx031, config031);
  570. }
  571. //半检二车间TOP3缺陷占比
  572. function init032() {
  573. window.config032 = {
  574. data: {
  575. labels: [],
  576. datasets: [{
  577. label: '缺陷',
  578. backgroundColor: [
  579. Chart.helpers.color(window.chartColors.green).rgbString(),
  580. Chart.helpers.color(window.chartColors.purple).rgbString(),
  581. Chart.helpers.color(window.chartColors.blue).rgbString()
  582. ],
  583. fill: false,
  584. borderColor: [
  585. window.chartColors.green,
  586. window.chartColors.purple,
  587. window.chartColors.blue
  588. ],
  589. borderWidth: 4,
  590. pointRadius: 30,
  591. data: []
  592. }]
  593. },
  594. type: 'doughnut',
  595. options: {
  596. legend: {
  597. display: true
  598. },
  599. title: {
  600. display: false,
  601. text: "缺陷"
  602. },
  603. tooltips: {
  604. mode: 'point',
  605. intersect: false
  606. },
  607. responsive: true
  608. }
  609. };
  610. var ctx032 = document.getElementById("canvas032").getContext("2d");
  611. window.chart032 = new Chart(ctx032, config032);
  612. }
  613. //半检三车间TOP3缺陷占比
  614. function init033() {
  615. window.config033 = {
  616. data: {
  617. labels: [],
  618. datasets: [{
  619. label: '缺陷',
  620. backgroundColor: [
  621. Chart.helpers.color(window.chartColors.MediumVioletRed).rgbString(),
  622. Chart.helpers.color(window.chartColors.DarkViolet).rgbString(),
  623. Chart.helpers.color(window.chartColors.Magenta1).rgbString()
  624. ],
  625. fill: false,
  626. borderColor: [
  627. window.chartColors.MediumVioletRed,
  628. window.chartColors.DarkViolet,
  629. window.chartColors.Magenta1
  630. ],
  631. borderWidth: 4,
  632. pointRadius: 30,
  633. data: []
  634. }]
  635. },
  636. type: 'doughnut',
  637. options: {
  638. legend: {
  639. display: true
  640. },
  641. title: {
  642. display: false,
  643. text: "缺陷"
  644. },
  645. tooltips: {
  646. mode: 'point',
  647. intersect: false
  648. },
  649. responsive: true
  650. }
  651. };
  652. var ctx033 = document.getElementById("canvas033").getContext("2d");
  653. window.chart033 = new Chart(ctx033, config033);
  654. }
  655. //新品入仓
  656. function init04() {
  657. window.config04 = {
  658. data: {
  659. labels: [],
  660. datasets: [{
  661. label: '新品入库',
  662. backgroundColor: Chart.helpers.color(window.chartColors.orange).alpha(0.6).rgbString(),
  663. fill: false,
  664. borderColor: window.chartColors.orange,
  665. borderWidth: 4,
  666. pointRadius: 30,
  667. data: []
  668. },]
  669. },
  670. type: 'bar',
  671. options: {
  672. legend: {
  673. display: true
  674. },
  675. title: {
  676. display: false,
  677. text: "产量"
  678. },
  679. tooltips: {
  680. mode: 'point',
  681. intersect: false
  682. },
  683. axisLabel: {
  684. textStyle: {
  685. fontSize: 5,
  686. },
  687. },
  688. responsive: true,
  689. scales: {
  690. xAxes: [{
  691. display: true,
  692. scaleLabel: {
  693. display: false,
  694. labelString: '',
  695. fontsize: 10
  696. },
  697. barThickness: 60,
  698. },
  699. ],
  700. yAxes: [{
  701. display: true,
  702. id: 'A',
  703. name: 'A',
  704. scalePositionLeft: true,
  705. position: 'left',
  706. scaleLabel: {
  707. display: false,
  708. labelString: 'Value'
  709. },
  710. ticks: {
  711. min: 0,
  712. stepSize: 500
  713. }
  714. }]
  715. }
  716. }
  717. };
  718. var ctx04 = document.getElementById("canvas04").getContext("2d");
  719. ctx04.fontsize = 10;
  720. window.chart04 = new Chart(ctx04, config04);
  721. }
  722. //各车间缺陷周环比
  723. function init05() {
  724. }
  725. //每周干补率及冷补率
  726. function init06() {
  727. window.config06 = {
  728. data: {
  729. labels: [],
  730. datasets: [
  731. {
  732. type: 'line',
  733. label: "成检废品率",
  734. yAxesGroup: 'A',
  735. yAxisID: 'A',
  736. backgroundColor: color(window.chartColors.orange).alpha(0.5).rgbString(),
  737. borderColor: window.chartColors.MediumVioletRed,
  738. borderWidth: 4,
  739. pointRadius: 20,
  740. fill: false
  741. }, {
  742. label: '成检检验数',
  743. yAxesGroup: 'B',
  744. yAxisID: 'B',
  745. backgroundColor: color(window.chartColors.blue).alpha(0.7).rgbString(),
  746. borderColor: window.chartColors.blue,
  747. barWidth: 1,
  748. fill: true
  749. }]
  750. },
  751. type: 'bar',
  752. barWidth: 10,
  753. options: {
  754. legend: {
  755. display: true,
  756. labels: {
  757. // 这个更具体的字体属性覆盖全局属性
  758. fontColor: 'white'
  759. }
  760. },
  761. title: {
  762. display: false,
  763. text: '每周产品检验报废率'
  764. },
  765. tooltips: {
  766. mode: 'index',
  767. intersect: false,
  768. },
  769. hover: {
  770. mode: 'nearest',
  771. intersect: true
  772. },
  773. responsive: true,
  774. scales: {
  775. xAxes: [{
  776. scaleLabel: {
  777. stacked: false,
  778. },
  779. barThickness: 90,
  780. ticks: {
  781. fontSize: 20 // 设置X轴标签的字体大小
  782. }
  783. }],
  784. yAxes: [{
  785. display: true,
  786. id: 'B',
  787. name: 'B',
  788. barWidth: 10,
  789. barThickness: 10,
  790. position: 'left',
  791. scaleLabel: {
  792. display: false,
  793. labelString: 'Value'
  794. },
  795. ticks: {
  796. min: 0,
  797. stepSize: 500
  798. }
  799. }
  800. , {
  801. display: true,
  802. id: 'A',
  803. name: 'A',
  804. scalePositionLeft: false,
  805. position: 'right',
  806. scaleLabel: {
  807. display: false,
  808. labelString: 'Value2',
  809. barWidth: 5,
  810. },
  811. ticks: {
  812. min: 0,
  813. stepSize: 10
  814. }
  815. }]
  816. }
  817. }
  818. };
  819. var ctx06 = document.getElementById("canvas06").getContext("2d");
  820. window.chart06 = new Chart(ctx06, config06);
  821. }
  822. //每周大小件大工序产量
  823. //function init07() {
  824. // window.config07 = {
  825. // data: {
  826. // labels: ["成型", "半检", "施釉", "烧成", "成检", "包装"],
  827. // datasets: [{
  828. // label: '大件产量',
  829. // backgroundColor: Chart.helpers.color(window.chartColors.orange).alpha(0.6).rgbString(),
  830. // fill: false,
  831. // borderColor: window.chartColors.orange,
  832. // borderWidth: 4,
  833. // pointRadius: 30,
  834. // data: []
  835. // },
  836. // {
  837. // label: '小件产量',
  838. // backgroundColor: Chart.helpers.color(window.chartColors.blue).alpha(0.6).rgbString(),
  839. // fill: false,
  840. // borderColor: window.chartColors.blue,
  841. // borderWidth: 4,
  842. // pointRadius: 30,
  843. // data: []
  844. // },]
  845. // },
  846. // type: 'bar',
  847. // options: {
  848. // legend: {
  849. // display: true
  850. // },
  851. // title: {
  852. // display: false,
  853. // text: "品管抽检数据展示"
  854. // },
  855. // tooltips: {
  856. // mode: 'point',
  857. // intersect: false
  858. // },
  859. // responsive: true,
  860. // scales: {
  861. // xAxes: [{
  862. // display: true,
  863. // scaleLabel: {
  864. // display: false,
  865. // labelString: ''
  866. // }
  867. // }],
  868. // yAxes: [{
  869. // display: true,
  870. // id: 'A',
  871. // name: 'A',
  872. // scalePositionLeft: true,
  873. // position: 'left',
  874. // scaleLabel: {
  875. // display: false,
  876. // labelString: 'Value'
  877. // },
  878. // ticks: {
  879. // min: 0,
  880. // stepSize: 10000,
  881. // max:40000
  882. // }
  883. // }]
  884. // }
  885. // }
  886. // };
  887. // var ctx07 = document.getElementById("canvas07").getContext("2d");
  888. // window.chart07 = new Chart(ctx07, config07);
  889. //}
  890. //每周产品半检验报废率
  891. function init08() {
  892. window.config10 = {
  893. data: {
  894. labels: [],
  895. datasets: [{
  896. type: 'line',
  897. label: "半检废品率",
  898. yAxesGroup: 'A',
  899. yAxisID: 'A',
  900. backgroundColor: color(window.chartColors.red).alpha(0.5).rgbString(),
  901. borderColor: window.chartColors.MediumVioletRed,
  902. borderWidth: 4,
  903. pointRadius: 20,
  904. fill: false,
  905. }, {
  906. label: '半检检验数',
  907. yAxesGroup: 'B',
  908. yAxisID: 'B',
  909. backgroundColor: color(window.chartColors.green).alpha(0.7).rgbString(),
  910. borderColor: window.chartColors.green,
  911. barWidth: 1,
  912. fill: true,
  913. },
  914. ]
  915. },
  916. type: 'bar',
  917. barWidth: 10,
  918. options: {
  919. legend: {
  920. display: true,
  921. labels: {
  922. // 这个更具体的字体属性覆盖全局属性
  923. fontColor: 'white'
  924. }
  925. },
  926. title: {
  927. display: false,
  928. text: '每周产品检验报废率'
  929. },
  930. tooltips: {
  931. mode: 'index',
  932. intersect: false,
  933. },
  934. hover: {
  935. mode: 'nearest',
  936. intersect: true
  937. },
  938. responsive: true,
  939. scales: {
  940. xAxes: [{
  941. scaleLabel: {
  942. stacked: false,
  943. },
  944. barThickness: 90,
  945. ticks: {
  946. fontSize:20 // 设置X轴标签的字体大小
  947. }
  948. }],
  949. yAxes: [{
  950. display: true,
  951. id: 'B',
  952. name: 'B',
  953. barWidth: 10,
  954. barThickness: 10,
  955. position: 'left',
  956. scaleLabel: {
  957. display: false,
  958. labelString: 'Value'
  959. },
  960. ticks: {
  961. min: 0,
  962. stepSize: 500
  963. }
  964. }
  965. , {
  966. display: true,
  967. id: 'A',
  968. name: 'A',
  969. scalePositionLeft: false,
  970. position: 'right',
  971. scaleLabel: {
  972. display: false,
  973. labelString: 'Value2',
  974. barWidth: 5,
  975. },
  976. ticks: {
  977. min: 0,
  978. stepSize: 3
  979. }
  980. }]
  981. }
  982. }
  983. };
  984. var ctx10 = document.getElementById("canvas10").getContext("2d");
  985. window.chart10 = new Chart(ctx10, config10);
  986. }
  987. //品管抽检数据展示
  988. function init09() {
  989. window.config09 = {
  990. data: {
  991. labels: [],
  992. datasets: [{
  993. label: '完成率',
  994. type: 'line',
  995. yAxesGroup: 'A',
  996. yAxisID: 'A',
  997. backgroundColor: Chart.helpers.color(window.chartColors.orange).alpha(0.6).rgbString(),
  998. fill: false,
  999. borderColor: window.chartColors.orange,
  1000. borderWidth: 2,
  1001. pointRadius: 15,
  1002. data: []
  1003. },
  1004. {
  1005. label: '合格率',
  1006. type: 'line',
  1007. yAxesGroup: 'A',
  1008. yAxisID: 'A',
  1009. backgroundColor: Chart.helpers.color(window.chartColors.blue).alpha(0.6).rgbString(),
  1010. fill: false,
  1011. borderColor: window.chartColors.blue,
  1012. borderWidth: 2,
  1013. pointRadius: 15,
  1014. data: []
  1015. },
  1016. {
  1017. label: '抽检数',
  1018. yAxesGroup: 'B',
  1019. yAxisID: 'B',
  1020. backgroundColor: color(window.chartColors.blue).alpha(0.7).rgbString(),
  1021. borderColor: window.chartColors.blue,
  1022. barWidth: 1,
  1023. fill: true
  1024. }
  1025. ]
  1026. },
  1027. type: 'bar',
  1028. options: {
  1029. legend: {
  1030. display: true
  1031. },
  1032. title: {
  1033. display: false,
  1034. text: "品管抽检数据展示"
  1035. },
  1036. tooltips: {
  1037. mode: 'point',
  1038. intersect: false
  1039. },
  1040. responsive: true,
  1041. scales: {
  1042. xAxes: [{
  1043. scaleLabel: {
  1044. stacked: false,
  1045. },
  1046. barThickness: 80
  1047. }],
  1048. yAxes: [{
  1049. display: true,
  1050. id: 'B',
  1051. name: 'B',
  1052. barWidth: 10,
  1053. barThickness: 10,
  1054. position: 'left',
  1055. scaleLabel: {
  1056. display: false,
  1057. labelString: 'Value'
  1058. },
  1059. ticks: {
  1060. min: 200,
  1061. stepSize: 1000
  1062. }
  1063. }
  1064. , {
  1065. display: true,
  1066. id: 'A',
  1067. name: 'A',
  1068. scalePositionLeft: false,
  1069. position: 'right',
  1070. scaleLabel: {
  1071. display: false,
  1072. labelString: 'Value2',
  1073. barWidth: 5,
  1074. },
  1075. ticks: {
  1076. min: 10,
  1077. stepSize: 20
  1078. }
  1079. }]
  1080. }
  1081. }
  1082. };
  1083. var ctx09 = document.getElementById("canvas09").getContext("2d");
  1084. window.chart09 = new Chart(ctx09, config09);
  1085. }
  1086. function init11() {
  1087. window.config11 = {
  1088. data: {
  1089. labels: [],
  1090. datasets: [{
  1091. type: 'line',
  1092. label: "缺陷率",
  1093. yAxesGroup: 'A',
  1094. yAxisID: 'A',
  1095. backgroundColor: color(window.chartColors.red).alpha(0.5).rgbString(),
  1096. borderColor: window.chartColors.MediumVioletRed,
  1097. borderWidth: 4,
  1098. pointRadius: 20,
  1099. fill: false,
  1100. }, {
  1101. label: '缺陷数',
  1102. yAxesGroup: 'B',
  1103. yAxisID: 'B',
  1104. backgroundColor: color(window.chartColors.green).alpha(0.7).rgbString(),
  1105. borderColor: window.chartColors.green,
  1106. barWidth: 1,
  1107. fill: true,
  1108. },
  1109. ]
  1110. },
  1111. type: 'bar',
  1112. barWidth: 10,
  1113. options: {
  1114. legend: {
  1115. display: true,
  1116. labels: {
  1117. // 这个更具体的字体属性覆盖全局属性
  1118. fontColor: 'white'
  1119. }
  1120. },
  1121. title: {
  1122. display: false,
  1123. text: '品管抽检缺陷率'
  1124. },
  1125. tooltips: {
  1126. mode: 'index',
  1127. intersect: false,
  1128. },
  1129. hover: {
  1130. mode: 'nearest',
  1131. intersect: true
  1132. },
  1133. responsive: true,
  1134. scales: {
  1135. xAxes: [{
  1136. scaleLabel: {
  1137. stacked: false,
  1138. },
  1139. barThickness: 90,
  1140. ticks: {
  1141. fontSize: 20 // 设置X轴标签的字体大小
  1142. }
  1143. }],
  1144. yAxes: [{
  1145. display: true,
  1146. id: 'B',
  1147. name: 'B',
  1148. barWidth: 10,
  1149. barThickness: 10,
  1150. position: 'left',
  1151. scaleLabel: {
  1152. display: false,
  1153. labelString: 'Value'
  1154. },
  1155. ticks: {
  1156. min: 0,
  1157. stepSize: 500
  1158. }
  1159. }
  1160. , {
  1161. display: true,
  1162. id: 'A',
  1163. name: 'A',
  1164. scalePositionLeft: false,
  1165. position: 'right',
  1166. scaleLabel: {
  1167. display: false,
  1168. labelString: 'Value2',
  1169. barWidth: 5,
  1170. },
  1171. ticks: {
  1172. min: 0,
  1173. stepSize: 3,
  1174. }
  1175. }]
  1176. }
  1177. }
  1178. };
  1179. var ctx11 = document.getElementById("canvas11").getContext("2d");
  1180. window.chart11 = new Chart(ctx11, config11);
  1181. }
  1182. //初期加载画面数据
  1183. function loadAll() {
  1184. load01(); load02(); load03(); load04(); load05(); load06(); load08(); load09(); load11();
  1185. }
  1186. //每周各车间产质量
  1187. function load01() {
  1188. //加载数据
  1189. $.get("rpt.ashx?m=Load01", function (data) {
  1190. //更新图表数据
  1191. var json = JSON.parse(data);
  1192. if (json["success"] == true) {
  1193. let onedate1 = [];
  1194. let onedate2 = [];
  1195. let onedate3 = [];
  1196. onedate1.push((json["rows"][0]["一车间"]));
  1197. onedate1.push((json["rows"][0]["二车间"]));
  1198. onedate1.push((json["rows"][0]["三车间"]));
  1199. onedate2.push((json["rows"][1]["一车间"]));
  1200. onedate2.push((json["rows"][1]["二车间"]));
  1201. onedate2.push((json["rows"][1]["三车间"]));
  1202. onedate3.push((json["rows"][2]["一车间"]));
  1203. onedate3.push((json["rows"][2]["二车间"]));
  1204. onedate3.push((json["rows"][2]["三车间"]));
  1205. window.chart01.data.datasets[0].data = onedate3;
  1206. window.chart01.data.datasets[1].data = onedate2;
  1207. window.chart01.data.datasets[2].data = onedate1;
  1208. window.chart01.update();
  1209. }
  1210. //加载完成,重置刷新时间。
  1211. currentTime01 = refreshTime01;
  1212. });
  1213. }
  1214. //半检大小件TOP3缺陷占比
  1215. function load02() {
  1216. //加载数据
  1217. $.get("rpt.ashx?m=Load02", function (data) {
  1218. //更新图表数据
  1219. var json = JSON.parse(data);
  1220. if (json["success"] == true) {
  1221. let onedate = []; let onelabel = [];
  1222. let twodate = []; let twolabel = [];
  1223. let threedate = []; let threelabel = [];
  1224. //var num = (json["rows"][0]["ROWNUM"]);
  1225. var num = (json["rows"].length);
  1226. for (var i = 0; i < num; i++) {
  1227. if (i <= 2) { //一车间
  1228. onedate.push((json["rows"][i]["缺陷占比"]));
  1229. onelabel.push(json["rows"][i]["缺陷名称"]);
  1230. }
  1231. if (i > 2 && i < 6) { //二车间
  1232. twodate.push((json["rows"][i]["缺陷占比"]));
  1233. twolabel.push(json["rows"][i]["缺陷名称"]);
  1234. }
  1235. if (i >= 6) {//三车间
  1236. threedate.push((json["rows"][i]["缺陷占比"]));
  1237. threelabel.push(json["rows"][i]["缺陷名称"]);
  1238. }
  1239. window.chart031.data.datasets[0].data = onedate;
  1240. window.chart031.data.labels = onelabel;
  1241. window.chart032.data.datasets[0].data = twodate;
  1242. window.chart032.data.labels = twolabel;
  1243. window.chart033.data.datasets[0].data = threedate;
  1244. window.chart033.data.labels = threelabel;
  1245. window.chart031.update();
  1246. window.chart032.update();
  1247. window.chart033.update();
  1248. }
  1249. //加载完成,重置刷新时间。
  1250. currentTime01 = refreshTime01;
  1251. }
  1252. });
  1253. }
  1254. //成检大小件TOP3缺陷占比
  1255. function load03() {
  1256. //加载数据
  1257. $.get("rpt.ashx?m=Load03", function (data) {
  1258. //更新图表数据
  1259. var json = JSON.parse(data);
  1260. if (json["success"] == true) {
  1261. let onedate = []; let onelabel = [];
  1262. let twodate = []; let twolabel = [];
  1263. let threedate = []; let threelabel = [];
  1264. if (json["success"] == true) {
  1265. //var num = (json["rows"][0]["ROWNUM"]);
  1266. var num = (json["rows"].length);
  1267. for (var i = 0; i < num; i++) {
  1268. if (i <= 2) { //一车间
  1269. onedate.push((json["rows"][i]["缺陷占比"]));
  1270. onelabel.push(json["rows"][i]["缺陷名称"]);
  1271. }
  1272. if (i > 2 && i < 6) { //二车间
  1273. twodate.push((json["rows"][i]["缺陷占比"]));
  1274. twolabel.push(json["rows"][i]["缺陷名称"]);
  1275. }
  1276. if (i >= 6) {//三车间
  1277. threedate.push((json["rows"][i]["缺陷占比"]));
  1278. threelabel.push(json["rows"][i]["缺陷名称"]);
  1279. }
  1280. window.chart021.data.datasets[0].data = onedate;
  1281. window.chart021.data.labels = onelabel;
  1282. window.chart022.data.datasets[0].data = twodate;
  1283. window.chart022.data.labels = twolabel;
  1284. window.chart023.data.datasets[0].data = threedate;
  1285. window.chart023.data.labels = threelabel;
  1286. window.chart021.update();
  1287. window.chart022.update();
  1288. window.chart023.update();
  1289. }
  1290. }
  1291. //加载完成,重置刷新时间。
  1292. currentTime01 = refreshTime01;
  1293. }
  1294. });
  1295. }
  1296. //新品入仓
  1297. function load04() {
  1298. //加载数据
  1299. $.get("rpt.ashx?m=Load04", function (data) {
  1300. //更新图表数据
  1301. var json = JSON.parse(data);
  1302. if (json["success"] == true) {
  1303. let onedate = []; let onelabel = [];
  1304. var num = (json["rows"].length);
  1305. for (var i = 0; i < num; i++) {
  1306. onedate.push((json["rows"][i]["COUNTS"]));
  1307. onelabel.push(json["rows"][i]["GOODCODE"]);
  1308. window.chart04.data.labels = onelabel;
  1309. window.chart04.data.datasets[0].data = onedate;
  1310. window.chart04.update();
  1311. }
  1312. }
  1313. //加载完成,重置刷新时间。
  1314. currentTime01 = refreshTime01;
  1315. });
  1316. }
  1317. //各车间缺陷周环比
  1318. function load05() {
  1319. if (mainInterval) {
  1320. clearInterval(mainInterval);
  1321. console.log("Interval Stop!");
  1322. }
  1323. //加载数据
  1324. $.get("rpt.ashx?m=Load05", function (data) {
  1325. //更新图表数据
  1326. var json = JSON.parse(data);
  1327. if (json["success"] == true) {
  1328. $("#tableheader").html("");
  1329. for (var i = 0; i < json["rows"].length; i++) {
  1330. var temp = $("#dayTable_template").html();
  1331. temp = temp.replace("<tbody>", "").replace("</tbody>", "");
  1332. temp = temp.replace('{产品类别}', json["rows"][i]['产品类别']);
  1333. temp = temp.replace('{缺陷名称}', json["rows"][i]['缺陷名称']);
  1334. temp = temp.replace('{缺陷数}', json["rows"][i]['缺陷数']);
  1335. temp = temp.replace('{缺陷占比}', json["rows"][i]['缺陷占比']);
  1336. temp = temp.replace('{上周比}', json["rows"][i]['上周比']);
  1337. temp = temp.replace('{对比趋势}', json["rows"][i]['对比趋势']);
  1338. $("#tableheader").append(temp);
  1339. }
  1340. var num = (json["rows"].length);
  1341. for (var i = 0; i < num; i++) {
  1342. var a = document.getElementById("tableheader").rows[i].cells[5].innerHTML;
  1343. if (a == '下降↓') {
  1344. document.getElementById("tableheader").rows[i].cells[5].style.color = '#3bf738';
  1345. }
  1346. else {
  1347. document.getElementById("tableheader").rows[i].cells[5].style.color = 'red';
  1348. }
  1349. }
  1350. mainRowCount = json["rows"].length;
  1351. mainInterval = setInterval(mainScroll, 3000);
  1352. //加载完成,重置刷新时间。
  1353. currentTime01 = refreshTime01;
  1354. }
  1355. });
  1356. }
  1357. function load06() {
  1358. //加载数据
  1359. $.get("rpt.ashx?m=Load06", function (data) {
  1360. //更新图表数据
  1361. var json = JSON.parse(data);
  1362. if (json["success"] == true) {
  1363. let onedate1 = [];
  1364. let onedate2 = [];
  1365. let onedate3 = [];
  1366. var num = (json["rows"].length);
  1367. for (var i = 0; i < num; i++) {
  1368. onedate3.push(json["rows"][i]["检验数"]);
  1369. onedate2.push(json["rows"][i]["废品率"]);
  1370. onedate1.push(json["rows"][i]["GOODSCODE"]);
  1371. }
  1372. window.chart06.data.datasets[0].data = onedate2;
  1373. window.chart06.data.datasets[1].data = onedate3;
  1374. window.chart06.data.labels = onedate1;
  1375. window.chart06.update();
  1376. }
  1377. //加载完成,重置刷新时间。
  1378. currentTime01 = refreshTime01;
  1379. });
  1380. }
  1381. //每周大小件大工序产量
  1382. function load07() {
  1383. //加载数据
  1384. $.get("rpt.ashx?m=Load07", function (data) {
  1385. var json = JSON.parse(data);
  1386. if (json["success"] == true) {
  1387. let onedate1 = [];
  1388. let onedate2 = [];
  1389. let onedate3 = [];
  1390. onedate1.push((json["rows"][0]["SMALLGDD"]));
  1391. onedate1.push((json["rows"][0]["SMALLHALF"]));
  1392. onedate1.push((json["rows"][0]["SMALLGLAZE"]));
  1393. onedate1.push((json["rows"][0]["SMALLKILN"]));
  1394. onedate1.push((json["rows"][0]["SMALLCHECK"]));
  1395. onedate1.push((json["rows"][0]["SMALLPACK"]));
  1396. onedate2.push((json["rows"][0]["BIGGDD"]));
  1397. onedate2.push((json["rows"][0]["BIGHALF"]));
  1398. onedate2.push((json["rows"][0]["BIGGLAZE"]));
  1399. onedate2.push((json["rows"][0]["BIGKILN"]));
  1400. onedate2.push((json["rows"][0]["BIGCHECK"]));
  1401. onedate2.push((json["rows"][0]["BIGPACK"]));
  1402. window.chart07.data.datasets[1].data = onedate1;
  1403. window.chart07.data.datasets[0].data = onedate2;
  1404. window.chart07.update();
  1405. }
  1406. //加载完成,重置刷新时间。
  1407. currentTime01 = refreshTime01;
  1408. });
  1409. }
  1410. //每周产品检验报废率
  1411. function load08() {
  1412. //加载数据
  1413. $.get("rpt.ashx?m=Load10", function (data) {
  1414. //更新图表数据
  1415. var json = JSON.parse(data);
  1416. if (json["success"] == true) {
  1417. let onedate1 = [];
  1418. let onedate2 = [];
  1419. let onedate3 = [];
  1420. var num = (json["rows"].length);
  1421. for (var i = 0; i < num; i++) {
  1422. onedate3.push(json["rows"][i]["检验数"]);
  1423. onedate2.push(json["rows"][i]["废品率"]);
  1424. onedate1.push(json["rows"][i]["GOODSCODE"]);
  1425. }
  1426. window.chart10.data.datasets[0].data = onedate2;
  1427. window.chart10.data.datasets[1].data = onedate3;
  1428. window.chart10.data.labels = onedate1;
  1429. window.chart10.update();
  1430. }
  1431. //加载完成,重置刷新时间。
  1432. currentTime01 = refreshTime01;
  1433. });
  1434. }
  1435. //品管抽检数据展示
  1436. function load09() {
  1437. //加载数据
  1438. $.get("rpt.ashx?m=Load09", function (data) {
  1439. //更新图表数据
  1440. var json = JSON.parse(data);
  1441. if (json["success"] == true) {
  1442. let onedate1 = [];
  1443. let onedate2 = [];
  1444. let onedate3 = [];
  1445. let onedate4 = [];
  1446. for (var i = 0; i < json["rows"].length; i++) {
  1447. onedate4.push((json["rows"][i]["INSPECTIONQUANTITY"]));
  1448. onedate1.push((json["rows"][i]["WANCHENGLV"]));
  1449. onedate2.push((json["rows"][i]["HEGELV"]));
  1450. onedate3.push(json["rows"][i]["PLANDATE"]);
  1451. }
  1452. window.chart09.data.datasets[0].data = onedate1;
  1453. window.chart09.data.datasets[1].data = onedate2;
  1454. window.chart09.data.datasets[2].data = onedate4;
  1455. window.chart09.data.labels = onedate3;
  1456. window.chart09.update();
  1457. }
  1458. //加载完成,重置刷新时间。
  1459. currentTime01 = refreshTime01;
  1460. });
  1461. }
  1462. //每周产品检验报废率
  1463. function load11() {
  1464. //加载数据
  1465. $.get("rpt.ashx?m=Load91", function (data) {
  1466. //更新图表数据
  1467. var json = JSON.parse(data);
  1468. if (json["success"] == true) {
  1469. let onedate1 = [];
  1470. let onedate2 = [];
  1471. let onedate3 = [];
  1472. var num = (json["rows"].length);
  1473. for (var i = 0; i < num; i++) {
  1474. onedate3.push(json["rows"][i]["缺陷数"]);
  1475. onedate2.push(json["rows"][i]["缺陷占比"]);
  1476. onedate1.push(json["rows"][i]["缺陷名称"]);
  1477. }
  1478. window.chart11.data.datasets[0].data = onedate2;
  1479. window.chart11.data.datasets[1].data = onedate3;
  1480. window.chart11.data.labels = onedate1;
  1481. window.chart11.update();
  1482. }
  1483. //加载完成,重置刷新时间。
  1484. currentTime01 = refreshTime01;
  1485. });
  1486. }
  1487. </script>
  1488. </body>
  1489. </html>