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.

1303 lines
49 KiB

  1. @{
  2. ViewBag.Title = "Form";
  3. Layout = "~/Views/Shared/_Form.cshtml";
  4. }
  5. <script src="~/Content/js/echarts/echarts5.3.3.min.js"></script>
  6. <script src="~/Content/js/echarts/echarts-gl.min.js"></script>
  7. <style>
  8. .ui-jqgrid tr.jqgrow td {
  9. overflow: hidden;
  10. }
  11. .ui-jqgrid .ui-jqgrid-btable tbody tr.jqgrow td {
  12. overflow: hidden !important;
  13. }
  14. .btn-primary {
  15. margin-right: 2px;
  16. }
  17. html {
  18. height: 100%;
  19. }
  20. .topRow {
  21. height: 54px;
  22. background-color: #031c7bc2;
  23. padding-bottom: 5px;
  24. }
  25. body {
  26. height: 100%;
  27. FONT-SIZE: 9px;
  28. /*FONT-SIZE: 18px;*/
  29. background-color: black;
  30. --CustTitlecolor: #0bd4d4; /*表标题颜色*/ /*#4D5457 #000000bf*/
  31. --Custbackgroundcolor: #031c7bc2; /*#031c7b;*/ /*表整体颜色*/
  32. --CustSelect: #103764; /*选中颜色*/ /*悬浮颜色*/
  33. --Custcolor: white; /*字体颜色*/
  34. --CustBorderColor: #031c7bc2; /*边框颜色*/
  35. --CustRow1: #0e59a5d4; /*偶行颜色*/
  36. --CustRow2: #031c7bc2; /*奇行颜色*/
  37. }
  38. /*大标题*/
  39. .TopName {
  40. vertical-align: middle;
  41. text-align: center;
  42. font-size: 24px;
  43. font-weight: 700;
  44. /*color:var(--CustTitlecolor);*/
  45. color: white;
  46. }
  47. /*logo标题*/
  48. .TopNamelogo {
  49. vertical-align: middle;
  50. text-align: left;
  51. font-size: 24px;
  52. font-weight: 700;
  53. color: white;
  54. }
  55. .logoclass {
  56. height: 24px;
  57. }
  58. #logolabel {
  59. /*width:80%;*/
  60. }
  61. .time {
  62. vertical-align: middle;
  63. text-align: center;
  64. font-size: 20px;
  65. color: white;
  66. }
  67. .formdiv {
  68. height: 100% !important;
  69. margin-bottom: 2px;
  70. margin-top: 5px;
  71. margin-left: 10px;
  72. margin-right: 10px;
  73. }
  74. .thclass {
  75. width: 100px;
  76. font-weight: 500;
  77. text-align: right;
  78. }
  79. table {
  80. height: 100%;
  81. }
  82. html, body {
  83. height: 100% !important;
  84. }
  85. form {
  86. height: 98% !important;
  87. background-color: black;
  88. }
  89. .bootstrap-select .dropdown-toggle .filter-option-inner-inner {
  90. height: 24px !important;
  91. }
  92. /*表列表头颜色*/
  93. .table > thead:first-child > tr:first-child > th {
  94. background-color: var(--Custbackgroundcolor);
  95. color: var(--CustTitlecolor);
  96. }
  97. /*表整体颜色*/
  98. .ui-jqgrid {
  99. background-color: var(--Custbackgroundcolor);
  100. color: var(--Custcolor);
  101. /*border: 1px solid var(--CustBorderColor);*/
  102. border: none;
  103. }
  104. .ui-jqgrid .table-bordered td {
  105. /*border: 0.5px solid var(--CustBorderColor);*/
  106. border: none;
  107. border-left: none;
  108. border-right: none;
  109. }
  110. /*悬浮颜色*/
  111. .table > tbody > tr.active > td, .table > tbody > tr.active > th, .table > tbody > tr > td.active,
  112. .table > tbody > tr > th.active, .table > tfoot > tr.active > td, .table > tfoot > tr.active > th,
  113. .table > tfoot > tr > td.active, .table > tfoot > tr > th.active, .table > thead > tr.active > td,
  114. .table > thead > tr.active > th, .table > thead > tr > td.active, .table > thead > tr > th.active {
  115. background-color: var(--CustSelect);
  116. color: var(--Custcolor);
  117. }
  118. /*选中颜色*/
  119. .table > tbody > tr.success > td, .table > tbody > tr.success > th, .table > tbody > tr > td.success,
  120. .table > tbody > tr > th.success, .table > tfoot > tr.success > td, .table > tfoot > tr.success > th,
  121. .table > tfoot > tr > td.success, .table > tfoot > tr > th.success, .table > thead > tr.success > td,
  122. .table > thead > tr.success > th, .table > thead > tr > td.success, .table > thead > tr > th.success {
  123. background-color: var(--CustSelect);
  124. color: var(--Custcolor);
  125. }
  126. /*偶行颜色*/
  127. div > div > div > table > tbody > tr:nth-child(2n) {
  128. background-color: var(--CustRow1);
  129. color: white;
  130. border: none;
  131. }
  132. /*奇行颜色*/
  133. div > div > div > table > tbody > tr:nth-child(2n+1) {
  134. background-color: var(--CustRow2);
  135. color: white;
  136. border: none;
  137. }
  138. form > div > table > tbody > tr > td {
  139. padding-bottom: 5px;
  140. padding-top: 5px;
  141. padding-left: 5px;
  142. padding-right: 5px;
  143. }
  144. ::-webkit-scrollbar-thumb {
  145. background-color: var(--CustTitlecolor);
  146. }
  147. #tdXX1 > div > div > canvas {
  148. height: 100% !important;
  149. }
  150. #tdXX1 > div > div {
  151. height: 100% !important;
  152. }
  153. /*.ui-jqgrid .ui-jqgrid-htable thead th {
  154. padding:4px 2px 4px 2px;
  155. }*/
  156. .table > tbody > tr > td, .table > tbody > tr > th, .table > tfoot > tr > td,
  157. .table > tfoot > tr > th, .table > thead > tr > td, .table > thead > tr > th {
  158. padding: 4px 2px 4px 2px;
  159. }
  160. </style>
  161. <link href="~/Content/css/CommonReport/CommonReport.css" rel="stylesheet" />
  162. <script src="~/Content/js/CommonReport/CommonReport.js"></script>
  163. <script src="~/Content/js/datepicker/WdatePicker.js"></script>
  164. <link href="~/Content/css/bootstrap/bootstrap-select.css" rel="stylesheet" />
  165. <script src="~/Content/js/bootstrap/bootstrap-select.min.js"></script>
  166. <script>
  167. var HeightToDel = 100;
  168. var timer;//刷新数据时间
  169. var TBBackColor = "#031c7bc2";
  170. var TBTitleFontColor = "#0bd4d4";
  171. var GunDongRate = 2 * 1000;//单位毫秒 //表格滚动间隔时间
  172. var DataF = 300;//单位秒 //刷新数据时间
  173. var IsFirstShow = false;
  174. var GunDongRow = 1;
  175. $(function () {
  176. //显示时间
  177. getTime();
  178. gridList();
  179. $(window).resize(function () {
  180. // gridList1();
  181. GunDongRow = 0;
  182. });
  183. // scrollBody();
  184. //刷新数据
  185. timer = setInterval(function () {
  186. gridList();
  187. }, DataF * 1000);
  188. });
  189. function gridList() {
  190. SetPanel1();
  191. SetPanel5();
  192. SetPanel2();
  193. SetPanel4();
  194. SetPanel3();
  195. // gridList1();
  196. }
  197. function getTime() {
  198. var days = new Array("日", "一", "二", "三", "四", "五", "六");
  199. var currentDT = new Date();
  200. var y, m, date, day, hs, ms, ss, theDateStr;
  201. y = currentDT.getFullYear(); //四位整数表示的年份
  202. m = currentDT.getMonth() < 10 ? '0' + (currentDT.getMonth() + 1) : (currentDT.getMonth() + 1); //月
  203. date = currentDT.getDate() < 10 ? '0' + currentDT.getDate() : currentDT.getDate(); //日
  204. day = currentDT.getDay(); //星期
  205. hs = currentDT.getHours() < 10 ? '0' + currentDT.getHours() : currentDT.getHours(); //时
  206. ms = currentDT.getMinutes() < 10 ? '0' + currentDT.getMinutes() : currentDT.getMinutes(); //分
  207. ss = currentDT.getSeconds() < 10 ? '0' + currentDT.getSeconds() : currentDT.getSeconds(); //秒
  208. theDateStr = y + "-" + m + "-" + date + " " + hs + ":" + ms + ":" + ss;
  209. //填充到组件中
  210. $("#timeStr").text(theDateStr);
  211. // setTimeout 在执行时,是在载入后延迟指定时间后,去执行一次表达式,仅执行一次
  212. window.setTimeout(getTime, 1000);
  213. }
  214. //生产进度看板-层析柱(Qty)
  215. function SetPanel1()
  216. {
  217. var myChart = echarts.init(document.getElementById('panel1'));
  218. myChart.showLoading(); //数据加载完之前先显示一段简单的loading动画
  219. var colors = ['#91cc75','#5470c6', '#fac858', '#1abc9c', '#FF0000', '#0080ff', '#7030A0'];
  220. //var Y_Show = ['电装', '机械装配', '总装', '仪表配置', '调试测试', 'FAT', 'FQC'];
  221. var Y_Show = [ '机械装配', '总装', '调试测试', 'FAT', 'FQC'];
  222. var X_Show = ['完成', '在制','总数'];
  223. var DataList = new Array();//[[38, 0, 2, 0, 4, 37, 138], [12, 4, 18, 11, 98, 10, 0] ];
  224. var DataPercent = new Array();//[50, 4, 20,11,102, 47,138];
  225. $.ajax({
  226. url: "/SRM/WatchPanel/GetWIPQty1?" + Math.random(),
  227. data: { XX: "XX" },
  228. dataType: "json",
  229. async: false,
  230. success: function (result) {
  231. //请求成功时执行该函数内容,result即为服务器返回的json对象
  232. if (result && result != null && result.length > 0) {
  233. var Qry1 = new Array();
  234. var Qry2 = new Array();
  235. Y_Show = new Array();
  236. DataPercent = new Array();
  237. for (var i = 0; i < result.length; i++) {
  238. Y_Show.push(result[i].PROJECTSTR);
  239. Qry2.push(result[i].COMQTY);//完成
  240. Qry1.push(result[i].WIPQTY);//在制
  241. DataPercent.push(result[i].ZQTY);//总数量
  242. }
  243. DataList.push(Qry2);
  244. DataList.push(Qry1);
  245. var seriesData = new Array();
  246. for (var i = 0; i < 2; i++) {
  247. var obj = {
  248. name: X_Show[i],
  249. type: 'bar',
  250. stack: 'total',
  251. color: colors[i],
  252. barMaxWidth: 32,
  253. label: {
  254. normal: {
  255. show: true,
  256. distance: -1,
  257. position: 'insideRight',
  258. formatter: function (param) {
  259. if (param.seriesName == "完成")
  260. { return '{a|' + param.value + '}{b|}'; }
  261. else {
  262. return '{c|' + param.value + '}{b| ' + DataPercent[param.dataIndex] + '}';
  263. }
  264. },
  265. rich: {
  266. a: {
  267. color: 'black',
  268. },
  269. b: {
  270. color: colors[2],
  271. width: 2,
  272. fontWeight: 700,
  273. },
  274. c: {
  275. color: 'white',
  276. },
  277. }
  278. }
  279. },
  280. emphasis: {
  281. focus: 'series'
  282. },
  283. data: DataList[i]
  284. };
  285. seriesData.push(obj);
  286. }
  287. var objp = {
  288. name: X_Show[2],
  289. type: 'line',
  290. show: false,
  291. color: colors[2],
  292. // stack: 'total',
  293. label: {
  294. normal: {
  295. show: false,
  296. }
  297. },
  298. emphasis: {
  299. focus: 'series'
  300. },
  301. data: DataList[2]
  302. };
  303. seriesData.push(objp);
  304. myChart.hideLoading(); //隐藏加载动画
  305. myChart.setOption({ //加载数据图表
  306. title: {
  307. show: true,
  308. text: '生产进度看板-层析柱(Qty)',
  309. textStyle: {
  310. fontSize: 18,
  311. color: TBTitleFontColor,
  312. },
  313. },
  314. tooltip: {
  315. trigger: 'axis',
  316. axisPointer: {
  317. type: 'shadow' // 'shadow' as default; can also be 'line' or 'shadow'
  318. }
  319. },
  320. backgroundColor: TBBackColor,
  321. legend: {
  322. data: X_Show, icon: "rect",
  323. top: 30,
  324. textStyle: { color: colors, }, fontWeight: 700,
  325. },
  326. grid: {
  327. show: false,
  328. left: 70,
  329. right: 30,
  330. top: 60,
  331. bottom: 30,
  332. },
  333. xAxis: {
  334. axisLine: {
  335. lineStyle: {
  336. color: "white"
  337. }
  338. },
  339. splitLine: { show: false, },
  340. type: 'value'
  341. },
  342. yAxis: {
  343. axisLine: {
  344. lineStyle: {
  345. color: "white"
  346. }
  347. },
  348. splitLine: { show: false, },
  349. type: 'category',
  350. data: Y_Show
  351. },
  352. series: seriesData
  353. });
  354. }
  355. else {
  356. myChart.hideLoading();//隐藏加载动画
  357. alert("生产进度看板-层析柱(Qty)没有抓取到相关数据");
  358. }
  359. },
  360. error: function (errorMsg) {
  361. alert("生产进度看板-层析柱(Qty)请求数据失败!", "error");
  362. myChart.hideLoading();
  363. }
  364. });
  365. }
  366. //生产进度-设备(Qty)
  367. function SetPanel5()
  368. {
  369. var myChart = echarts.init(document.getElementById('panel5'));
  370. myChart.showLoading(); //数据加载完之前先显示一段简单的loading动画
  371. var colors = ['#91cc75', '#5470c6', '#fac858', '#1abc9c', '#FF0000', '#0080ff', '#7030A0'];
  372. var Y_Show = ['电装', '机械装配', '总装', '仪表配置', '调试测试', 'FAT', 'FQC'];
  373. var X_Show = ['完成', '在制', '总数'];
  374. var DataList = new Array();//[[38, 0, 2, 0, 4, 37, 138], [12, 4, 18, 11, 98, 10, 0] ];
  375. var DataPercent = new Array();//[50, 4, 20,11,102, 47,138];
  376. $.ajax({
  377. url: "/SRM/WatchPanel/GetWIPQty5?" + Math.random(),
  378. data: { XX: "XX" },
  379. dataType: "json",
  380. async: false,
  381. success: function (result) {
  382. //请求成功时执行该函数内容,result即为服务器返回的json对象
  383. if (result && result != null && result.length > 0) {
  384. var Qry1 = new Array();
  385. var Qry2 = new Array();
  386. Y_Show = new Array();
  387. DataPercent = new Array();
  388. for (var i = 0; i < result.length; i++) {
  389. Y_Show.push(result[i].PROJECTSTR);
  390. Qry2.push(result[i].COMQTY);//完成
  391. Qry1.push(result[i].WIPQTY);//在制
  392. DataPercent.push(result[i].ZQTY);//总数量
  393. }
  394. DataList.push(Qry2);
  395. DataList.push(Qry1);
  396. var seriesData = new Array();
  397. for (var i = 0; i < 2; i++) {
  398. var obj = {
  399. name: X_Show[i],
  400. type: 'bar',
  401. stack: 'total',
  402. color: colors[i],
  403. barMaxWidth: 32,
  404. label: {
  405. normal: {
  406. show: true,
  407. distance: -1,
  408. position: 'insideRight',
  409. formatter: function (param) {
  410. if (param.seriesName == "完成")
  411. { return '{a|' + param.value + '}{b|}'; }
  412. else {
  413. return '{c|' + param.value + '}{b| ' + DataPercent[param.dataIndex] + '}';
  414. }
  415. },
  416. rich: {
  417. a: {
  418. color: 'black',
  419. },
  420. b: {
  421. color: colors[2],
  422. width: 2,
  423. fontWeight: 700,
  424. },
  425. c: {
  426. color: 'white',
  427. },
  428. }
  429. }
  430. },
  431. emphasis: {
  432. focus: 'series'
  433. },
  434. data: DataList[i]
  435. };
  436. seriesData.push(obj);
  437. }
  438. var objp = {
  439. name: X_Show[2],
  440. type: 'line',
  441. show: false,
  442. color: colors[2],
  443. // stack: 'total',
  444. label: {
  445. normal: {
  446. show: false,
  447. }
  448. },
  449. emphasis: {
  450. focus: 'series'
  451. },
  452. data: DataList[2]
  453. };
  454. seriesData.push(objp);
  455. myChart.hideLoading(); //隐藏加载动画
  456. myChart.setOption({ //加载数据图表
  457. title: {
  458. show: true,
  459. text: '生产进度-设备(Qty)',
  460. textStyle: {
  461. fontSize: 18,
  462. color: TBTitleFontColor,
  463. },
  464. },
  465. tooltip: {
  466. trigger: 'axis',
  467. axisPointer: {
  468. type: 'shadow' // 'shadow' as default; can also be 'line' or 'shadow'
  469. }
  470. },
  471. backgroundColor: TBBackColor,
  472. legend: {
  473. data: X_Show, icon: "rect",
  474. top: 30,
  475. textStyle: { color: colors, }, fontWeight: 700,
  476. },
  477. grid: {
  478. show: false,
  479. left: 70,
  480. right: 30,
  481. top: 60,
  482. bottom: 30,
  483. },
  484. xAxis: {
  485. axisLine: {
  486. lineStyle: {
  487. color: "white"
  488. }
  489. },
  490. splitLine:{ show:false,},
  491. type: 'value'
  492. },
  493. yAxis: {
  494. axisLine: {
  495. lineStyle: {
  496. color: "white"
  497. }
  498. },
  499. splitLine: { show: false, },
  500. type: 'category',
  501. data: Y_Show
  502. },
  503. series: seriesData
  504. });
  505. }
  506. else {
  507. myChart.hideLoading();//隐藏加载动画
  508. alert("生产进度-设备(Qty)没有抓取到相关数据");
  509. }
  510. },
  511. error: function (errorMsg) {
  512. alert("生产进度-设备(Qty)请求数据失败!", "error");
  513. myChart.hideLoading();
  514. }
  515. });
  516. }
  517. //生产进度 柱状图 (在制数 完成数 )
  518. function SetPanel2()
  519. {
  520. var myChart = echarts.init(document.getElementById('panel2'));
  521. myChart.showLoading(); //数据加载完之前先显示一段简单的loading动画
  522. // var colors = ['#2DB1EF', '#fac858', '#1abc9c', '#FF0000', '#0080ff', '#7030A0'];
  523. var colors = ['#5470c6', '#91cc75', '#ee6666', '#73c0de', '#3ba272', '#fc8452', '#9a60b4', '#ea7ccc'];
  524. var X_Show = ['待开工', '已开工'];
  525. var DataList = new Array();
  526. //var DataList = [200,372];
  527. //var DataPercent = ['35%', '65%'];
  528. $.ajax({
  529. url: "/SRM/WatchPanel/GetWIPQty2?" + Math.random(),
  530. data: { XX: "XX" },
  531. dataType: "json",
  532. async: false,
  533. success: function (result) {
  534. //请求成功时执行该函数内容,result即为服务器返回的json对象
  535. if (result && result != null && result.length > 0) {
  536. for (var i = 0; i < result.length; i++) {
  537. DataList.push(result[i].DKGQTY);
  538. DataList.push(result[i].YKGQTY);
  539. }
  540. myChart.hideLoading(); //隐藏加载动画
  541. myChart.setOption({ //加载数据图表
  542. color:colors,
  543. tooltip: {
  544. trigger: 'item',
  545. formatter: '{b},{c},{d}%'
  546. },
  547. legend: {
  548. show:true,
  549. // top: '5%',
  550. left: '0',
  551. orient: "vertical",
  552. textStyle: { color: colors,fontWeight:700, },
  553. },
  554. backgroundColor: TBBackColor,
  555. series: [
  556. {
  557. type: 'pie',
  558. // radius: DataPercent,
  559. avoidLabelOverlap: false,
  560. radius: [60, 130],
  561. label: {
  562. show: true,
  563. position: 'inside',
  564. formatter: '{c}',
  565. },
  566. labelLine: {
  567. show: false
  568. },
  569. data: [
  570. { value: DataList[0], name: X_Show[0] },
  571. { value: DataList[1], name: X_Show[1] },
  572. ]
  573. }
  574. ]
  575. });
  576. }
  577. else {
  578. myChart.hideLoading();//隐藏加载动画
  579. alert("待开工没有抓取到相关数据");
  580. }
  581. },
  582. error: function (errorMsg) {
  583. alert("待开工请求数据失败!", "error");
  584. myChart.hideLoading();
  585. }
  586. });
  587. }
  588. //设备类型在制数
  589. function SetPanel3old()
  590. {
  591. var myChart = echarts.init(document.getElementById('panel3'));
  592. myChart.showLoading(); //数据加载完之前先显示一段简单的loading动画
  593. var colors = ['#4F81BD', '#fac858', '#1abc9c', '#FF0000', '#0080ff', '#7030A0'];
  594. var Y_Show = ['ECA柱', '过滤系统', '双柱', '仪表配置', '设备1',
  595. '设备3', '其他', 'OAS柱', '双柱4', '仪表',
  596. '设备4', '其他3', 'OAS柱5', '单柱', '配置',
  597. '无设备'];
  598. var DataPercent = [2, 2,11,1,3,1,11,1,1,33,15,4,15,26,15,1];
  599. var seriesData = new Array();
  600. //$.ajax({
  601. // url: "/SRM/WatchPanel/GetWIPQty3?" + Math.random(),
  602. // data: { XX: "XX" },
  603. // dataType: "json",
  604. // async: false,
  605. // success: function (result) {
  606. // //请求成功时执行该函数内容,result即为服务器返回的json对象
  607. // if (result && result != null && result.length > 0) {
  608. // for (var i = 0; i < result.length; i++) {
  609. // Y_Show.push(result[i].EQPTYPENAME);
  610. // DataPercent.push(result[i].QTY);
  611. // }
  612. for (var i = 0; i < Y_Show.length; i++) {
  613. var obj = {
  614. name: Y_Show[i],
  615. value: DataPercent[i],
  616. label: {
  617. show: true,
  618. position: "inside",
  619. formatter: function (point, params, dom, rect, size) {
  620. return point.name + ':' + point.value;
  621. }
  622. },
  623. };
  624. seriesData.push(obj);
  625. }
  626. myChart.hideLoading(); //隐藏加载动画
  627. myChart.setOption({ //加载数据图表
  628. title: {
  629. show: true,
  630. text: '设备类型在制数',
  631. textStyle: {
  632. fontSize: 18,
  633. color: TBTitleFontColor,
  634. },
  635. },
  636. tooltip: {
  637. formatter: function (point, params, dom, rect, size) {
  638. return point.name + ':' + point.value;
  639. }
  640. },
  641. backgroundColor: TBBackColor,
  642. series: [{
  643. type: 'treemap',
  644. data: seriesData,
  645. }],
  646. });
  647. // }
  648. // else {
  649. // myChart.hideLoading();//隐藏加载动画
  650. // alert("设备类型在制数没有抓取到相关数据");
  651. // }
  652. // },
  653. // error: function (errorMsg) {
  654. // alert("设备类型在制数请求数据失败!", "error");
  655. // myChart.hideLoading();
  656. // }
  657. //});
  658. }
  659. //设备类型在制数
  660. function SetPanel3() {
  661. var myChart = echarts.init(document.getElementById('panel3'));
  662. myChart.showLoading(); //数据加载完之前先显示一段简单的loading动画
  663. // var colors = ['#4F81BD', '#fac858', '#1abc9c', '#FF0000', '#0080ff', '#7030A0'];
  664. var colors = ['#5470c6', '#91cc75', '#fac858', '#ee6666', '#73c0de', '#3ba272', '#fc8452', '#9a60b4', '#ea7ccc',
  665. '#5470c6', '#91cc75', '#fac858', '#ee6666', '#73c0de', '#3ba272', '#fc8452', '#9a60b4', '#ea7ccc',
  666. '#5470c6', '#91cc75', '#fac858', '#ee6666', '#73c0de', '#3ba272', '#fc8452', '#9a60b4', '#ea7ccc',
  667. '#5470c6', '#91cc75', '#fac858', '#ee6666', '#73c0de', '#3ba272', '#fc8452', '#9a60b4', '#ea7ccc']
  668. //new Array();//
  669. var Y_Show = new Array();// ['ECA柱', '过滤系统', '双柱', '仪表配置', '设备1', '设备3', '其他', 'OAS柱', '双柱4', '仪表', '设备4', '其他3', 'OAS柱5', '单柱', '配置', '无设备'];
  670. var DataPercent = new Array();// [2, 2, 11, 1, 3, 1, 11, 1, 1, 33, 15, 4, 15, 26, 15, 1];
  671. var seriesData = new Array();
  672. $.ajax({
  673. url: "/SRM/WatchPanel/GetWIPQty3?" + Math.random(),
  674. data: { XX: "XX" },
  675. dataType: "json",
  676. async: false,
  677. success: function (result) {
  678. if (result && result != null && result.length > 0) {
  679. for (var i = 0; i < result.length; i++) {
  680. Y_Show.push(result[i].EQPTYPENAME);
  681. DataPercent.push(result[i].QTY);
  682. }
  683. for (var i = 0; i < Y_Show.length; i++) {
  684. var obj = {
  685. name: Y_Show[i],
  686. value: DataPercent[i],
  687. label: {
  688. show: true,
  689. formatter: function (point, params, dom, rect, size) {
  690. return point.name + ':' + point.value;
  691. },
  692. color: colors[i],
  693. fontSize:14,
  694. },
  695. };
  696. seriesData.push(obj);
  697. }
  698. myChart.hideLoading(); //隐藏加载动画
  699. myChart.setOption({ //加载数据图表
  700. title: {
  701. show: true,
  702. text: '设备类型在制数',
  703. textStyle: {
  704. fontSize: 18,
  705. color: TBTitleFontColor,
  706. },
  707. },
  708. tooltip: {
  709. formatter: function (point, params, dom, rect, size) {
  710. return point.name + ':' + point.value;
  711. }
  712. },
  713. backgroundColor: TBBackColor,
  714. color: colors,
  715. series: [
  716. {
  717. top: 20,
  718. //name: 'Nightingale Chart',
  719. type: 'pie',
  720. radius: [60, 130],
  721. //center: ['50%', '50%'],
  722. //roseType: 'area',
  723. itemStyle: {
  724. borderRadius: 5
  725. },
  726. data: seriesData
  727. }
  728. ]
  729. });
  730. }
  731. else {
  732. myChart.hideLoading();//隐藏加载动画
  733. alert("设备类型在制数没有抓取到相关数据");
  734. }
  735. },
  736. error: function (errorMsg) {
  737. alert("设备类型在制数请求数据失败!", "error");
  738. myChart.hideLoading();
  739. }
  740. });
  741. }
  742. function SetPanel4()//待开工项目(Qty)
  743. {
  744. var myChart = echarts.init(document.getElementById('panel4'));
  745. myChart.showLoading(); //数据加载完之前先显示一段简单的loading动画
  746. var colors = ['#4F81BD', '#fac858', '#1abc9c', '#FF0000', '#0080ff', '#7030A0'];
  747. var QtyList = new Array();// [22, 36, 42, 52, 44, 3, 2];
  748. var MonthList = new Array();// ['6月', '7月', '8月', '9月', '10月', '11月', '12月', ];
  749. $.ajax({
  750. url: "/SRM/WatchPanel/GetWIPQty4?" + Math.random(),
  751. data: { XX: "XX" },
  752. dataType: "json",
  753. async: false,
  754. success: function (result) {
  755. //请求成功时执行该函数内容,result即为服务器返回的json对象
  756. if (result && result != null && result.length > 0) {
  757. var Qry1 = new Array();
  758. for (var i = 0; i < result.length; i++) {
  759. QtyList.push(result[i].QTY);
  760. MonthList.push(result[i].MONTHSTR);
  761. }
  762. myChart.hideLoading(); //隐藏加载动画
  763. myChart.setOption({ //加载数据图表
  764. title: {
  765. show: true,
  766. text: '待开工项目(Qty)',
  767. textStyle: {
  768. fontSize: 18,
  769. color: TBTitleFontColor,
  770. },
  771. },
  772. tooltip: {
  773. formatter: function (point, params, dom, rect, size) {
  774. return point.value[0] + ':' + point.value[1];
  775. }
  776. },
  777. backgroundColor: TBBackColor,
  778. tooltip: {
  779. trigger: 'axis',
  780. formatter: function (params) {
  781. var showHtm = "";
  782. showHtm = params[0].name + ":" + params[0].data;
  783. return showHtm;
  784. }
  785. },
  786. xAxis: {
  787. offset: 12,
  788. data: MonthList, type: 'category',
  789. axisPointer: { type: 'shadow' },
  790. axisLine: {
  791. lineStyle: {
  792. color: "white"
  793. },
  794. }
  795. },
  796. yAxis: [{
  797. type: 'value', position: 'left',
  798. axisLabel: {
  799. formatter: '{value}'
  800. },
  801. axisLine: {
  802. show: false,
  803. lineStyle: {
  804. color: "white"
  805. },
  806. },
  807. splitLine: {
  808. show: false
  809. }
  810. }
  811. ],
  812. series: [{
  813. name: '数量',
  814. type: 'pictorialBar',
  815. symbolSize: [30, 14],
  816. symbolOffset: [0, -7],
  817. symbolPosition: 'end',
  818. z: 24,
  819. //color: "#2DB1EF",
  820. color: {
  821. type: 'radial',
  822. x: 0.5,
  823. y: 0.5,
  824. r: 0.5,
  825. colorStops: [{
  826. offset: 0, color: '#376db0'//'#4F81BD' // 0% 处的颜色
  827. }, {
  828. offset: 1, color: '#2DB1EF' // 100% 处的颜色
  829. }],
  830. global: false // 缺省为 false
  831. },
  832. data: QtyList,
  833. barMaxWidth: 30,
  834. yAxisIndex: 0,
  835. label: {
  836. normal: {
  837. show: false,
  838. }
  839. }
  840. },
  841. {
  842. name: '数量',
  843. type: 'pictorialBar',
  844. symbolSize: [30, 14],
  845. symbolOffset: [0, 7],
  846. z: 12,
  847. color: {
  848. type: 'linear',
  849. x: 0,
  850. y: 0,
  851. x2: 1,
  852. y2: 0,
  853. colorStops: [{
  854. offset: 0, color: '#376db0' // 0% 处的颜色
  855. },
  856. {
  857. offset: 0, color: '#2DB1EF' // 50% 处的颜色
  858. },
  859. {
  860. offset: 1, color: '#376db0' // 100% 处的颜色
  861. }],
  862. global: false // 缺省为 false
  863. },
  864. data: QtyList,
  865. barMaxWidth: 30,
  866. yAxisIndex: 0,
  867. label: {
  868. normal: {
  869. show: false,
  870. }
  871. }
  872. },
  873. {
  874. name: '数量',
  875. type: 'bar',
  876. data: QtyList,
  877. barMaxWidth: 30,
  878. yAxisIndex: 0,
  879. color: {
  880. type: 'linear',
  881. x: 0,
  882. y: 0,
  883. x2: 1,
  884. y2: 0,
  885. colorStops: [{
  886. offset: 0, color: '#376db0' // 0% 处的颜色
  887. },
  888. {
  889. offset: 0, color: '#2DB1EF' // 50% 处的颜色
  890. },
  891. {
  892. offset: 1, color: '#376db0' // 100% 处的颜色
  893. }],
  894. global: false // 缺省为 false
  895. },
  896. z: 15,
  897. label: {
  898. normal: {
  899. show: true,
  900. position: 'top',
  901. color: 'white',
  902. offset: [0, -20],
  903. }
  904. }
  905. }
  906. ]
  907. });
  908. }
  909. else {
  910. myChart.hideLoading();//隐藏加载动画
  911. alert("待开工项目(Qty)没有抓取到相关数据");
  912. }
  913. },
  914. error: function (errorMsg) {
  915. alert("待开工项目(Qty)请求数据失败!", "error");
  916. myChart.hideLoading();
  917. }
  918. });
  919. }
  920. //自动滚动
  921. //function scrollBody() {
  922. // timer = setInterval(function () {
  923. // var ob3 = $('#gridList1').getGridParam("records");
  924. // var div = $('#gridList1').closest('.ui-jqgrid-bdiv')[0];
  925. // var offsetHeight = div.offsetHeight;
  926. // var scrollHeight = div.scrollHeight - offsetHeight;
  927. // if (GunDongRow == 0) {
  928. // var hh = offsetHeight;
  929. // //GunDongRow = Math.floor(hh / 30.3);//一页一页的滚动
  930. // GunDongRow = 1;//一行一行的滚动
  931. // }
  932. // // div.scrollTop = div.scrollTop + 1;
  933. // if (div.scrollTop >= scrollHeight) {//循环滚动
  934. // scrollHeight = div.scrollHeight - offsetHeight;//如果在滚动过程中添加过数据,需要重新结算scrollHeight
  935. // if (div.scrollTop >= scrollHeight) {
  936. // div.scrollTop = 0; //循环滚动,重置滚动头即可
  937. // IsFirstShow = true;
  938. // }
  939. // if (div.scrollTop >= ob3 * 30.4) {
  940. // div.scrollTop = 0; //循环滚动,重置滚动头即可
  941. // IsFirstShow = true;
  942. // }
  943. // }
  944. // if (!IsFirstShow) {
  945. // div.scrollTop = div.scrollTop + (GunDongRow * 30.3);
  946. // }
  947. // else { IsFirstShow = false; }
  948. // }, GunDongRate);
  949. //}
  950. function GetAllCols1() {
  951. var _cols = new Array();
  952. //项目号 客户名称 设备类型 产品名称 产品型号 序列号 计划开工日期 计划完工日期 数量 设备编号 生产工单号
  953. //项目进度条 项目阶段 状态 生产确认表 电装开始 电装完成 机械装配开始 机械装配完成 总装开始 总装完成 仪表配置开始
  954. //仪表配置完成 调试测试开始 调试测试完成 FAT开始 FAT完成 FQC OQC 产品类型
  955. _cols.push({ label: 'ID', name: 'ID', width: 80, align: 'left', hidden: true, });
  956. _cols.push({ label: '项目号', name: '项目号', width: 100, align: 'left', });
  957. _cols.push({ label: '设备类型', name: '设备类型', width: 100, align: 'left', });
  958. _cols.push({ label: '产品型号', name: '产品型号', width: 190, align: 'left', });
  959. _cols.push({ label: '设备编号', name: '设备编号', width: 150, align: 'left', });
  960. _cols.push({ label: '计划开工日期', name: '计划开工日期', width: 120, align: 'left', });
  961. _cols.push({ label: '生产工单号', name: '生产工单号', width: 120, align: 'left', });
  962. _cols.push({ label: '项目阶段', name: '项目阶段', width: 150, align: 'left', });
  963. _cols.push({
  964. label: '状态', name: '状态', width: 110, align: 'left',
  965. cellattr: function addCellAttr(rowId, val, rawObject, cm, rdata) {
  966. if (val=="延期") {
  967. return "style='color:red'";
  968. }
  969. }
  970. });
  971. _cols.push({ label: '计划完工日期', name: '计划完工日期', width: 120, align: 'left', });
  972. _cols.push({
  973. label: '项目进度条', name: '项目进度条', width: 200, align: 'left',
  974. formatter: function (cellvalue, options, rowObject) {
  975. var str_retrun = '<div id="JDText_' + rowObject.ID + '" style="width: 99%;height:98%;"></div>';
  976. return cellvalue = str_retrun;
  977. }
  978. });
  979. _cols.push({ label: '项目进度条值', name: '项目进度条值', width: 50, align: 'left', hidden: true, });
  980. _cols.push({ label: '', name: '', width: 10, align: 'left', sortable: false });
  981. // _cols.push({ label: '客户名称', name: '客户名称', width: 90, align: 'left', });
  982. // _cols.push({ label: '产品名称', name: '产品名称', width: 125, align: 'left', });
  983. // _cols.push({ label: '序列号', name: '序列号', width: 60, align: 'left', });
  984. //_cols.push({ label: '数量', name: '数量', width: 40, align: 'left', });//hidden: true,
  985. //_cols.push({ label: '待装配', name: '生产确认表', width: 60, align: 'left', });
  986. //_cols.push({ label: '电装开始', name: '电装开始', width: 60, align: 'left', });
  987. //_cols.push({ label: '电装完成', name: '电装完成', width: 60, align: 'left', });
  988. //_cols.push({ label: '机械装配开始', name: '机械装配开始', width: 60, align: 'left', });
  989. //_cols.push({ label: '机械装配完成', name: '机械装配完成', width: 60, align: 'left', });
  990. //_cols.push({ label: '总装开始', name: '总装开始', width: 60, align: 'left', });
  991. //_cols.push({ label: '总装完成', name: '总装完成', width: 60, align: 'left', });
  992. //_cols.push({ label: '仪表配置开始', name: '仪表配置开始', width: 60, align: 'left', });
  993. //_cols.push({ label: '仪表配置完成', name: '仪表配置完成', width: 60, align: 'left', });
  994. //_cols.push({ label: '调试测试开始', name: '调试测试开始', width: 60, align: 'left', });
  995. //_cols.push({ label: '调试测试完成', name: '调试测试完成', width: 60, align: 'left', });
  996. //_cols.push({ label: 'FAT开始', name: 'FAT开始', width: 60, align: 'left', });
  997. //_cols.push({ label: 'FAT完成', name: 'FAT完成', width: 60, align: 'left', });
  998. //_cols.push({ label: 'FQC', name: 'FQC', width: 60, align: 'left', });
  999. //_cols.push({ label: 'OQC', name: 'OQC', width: 60, align: 'left', });
  1000. //_cols.push({ label: '产品类型', name: '产品类型', width: 60, align: 'left', });
  1001. return _cols;
  1002. }
  1003. //function gridList1() {
  1004. // document.getElementById("gridPanel1").innerHTML = ' <table id="gridList1"></table> ';//重置grid
  1005. // var _cols = GetAllCols1();
  1006. // var $gridList = $("#gridList1");
  1007. // var queryJson = {
  1008. // }
  1009. // $gridList.dataGrid({
  1010. // url: "/SRM/WatchPanel/GetGridJson_WIPJinDu?" + Math.random(),
  1011. // postData: { queryJson: JSON.stringify(queryJson) },
  1012. // height: $("#form1").height()*0.5 - HeightToDel,
  1013. // colModel: _cols,
  1014. // // caption: '生产进度汇总表',
  1015. // // sortname: " ",
  1016. // rowNum: 5000,
  1017. // viewrecords: true,
  1018. // rownumbers: true,
  1019. // multiselect: false,
  1020. // gridComplete: function () {
  1021. // $("#gridList1").jqGrid('setLabel', 'rn', '序号', { 'text-align': 'center', 'vertical-align': 'middle' }, '');
  1022. // var strIds = $("#gridList1").jqGrid("getDataIDs");
  1023. // for (var i = 0; i < strIds.length; i++) {
  1024. // var ID = $("#gridList1").jqGrid("getCell", strIds[i], "ID");
  1025. // var QTY = $("#gridList1").jqGrid("getCell", strIds[i], "项目进度条值");
  1026. // JDPictureSet("JDText_" + ID, QTY);
  1027. // }
  1028. // }
  1029. // });
  1030. //}
  1031. function JDPictureSet(JDDivID, JDQty) {
  1032. var myChart = echarts.init(document.getElementById(JDDivID));
  1033. myChart.setOption({ //加载数据图表
  1034. title: {
  1035. show: false,
  1036. },
  1037. tooltip: {
  1038. show: false,
  1039. },
  1040. legend: { show: false, },
  1041. grid: { show: false, },
  1042. xAxis: {
  1043. type: 'value',
  1044. axisLine: { show: false },
  1045. axisTick: { show: false },
  1046. axisLabel: { show: false },
  1047. splitLine: { show: false },
  1048. max: 100,
  1049. min: 0,
  1050. },
  1051. yAxis: {
  1052. axisLine: { show: false },
  1053. axisTick: { show: false },
  1054. axisLabel: { show: false },
  1055. splitLine: { show: false },
  1056. type: 'category',
  1057. },
  1058. series: [
  1059. {
  1060. type: 'bar',
  1061. data: [JDQty],
  1062. label: {
  1063. show: true,
  1064. formatter: '{c}%',
  1065. color: "white"
  1066. },
  1067. itemStyle: {
  1068. color: "#91cc75"
  1069. }
  1070. }
  1071. ]
  1072. });
  1073. }
  1074. </script>
  1075. <form id="form1">
  1076. <div class="formdiv">
  1077. <table class="form">
  1078. <tr class="topRow">
  1079. <td style="text-align:right;width:18%">
  1080. <label class="radio-inline" id="logolabel">
  1081. <img src="~/Content/img/Panellogo.png" border="0" class="logoclass" />
  1082. </label>
  1083. </td>
  1084. <td style="width:18%">
  1085. <div class="TopNamelogo" id="TopNamelogo">利穗科技</div>
  1086. </td>
  1087. <td style="width:28%">
  1088. <div class="TopName" id="TopName">生产进度看板</div>
  1089. </td>
  1090. <td style="width:8%">
  1091. <a href="PanelWIPDetail_SX" style="float:right;color:antiquewhite;font-size:18px" >(明细)</a>
  1092. </td>
  1093. <td style="width:28%">
  1094. <div class="time" id="timeStr"></div>
  1095. </td>
  1096. </tr>
  1097. <tr style="height:100%;">
  1098. <td colspan="2" id="tdXX1">
  1099. @*<div id="panel1" style="width: 100%;height:100%;"></div>*@
  1100. <table class="form">
  1101. <tr style="width: 100%;height:50%;">
  1102. <td><div id="panel1" style="width: 100%;height:100%;"></div></td>
  1103. </tr>
  1104. <tr style="width: 100%;height:50%;">
  1105. <td><div id="panel5" style="width: 100%;height:100%;"></div></td>
  1106. </tr>
  1107. </table>
  1108. </td>
  1109. <td>
  1110. <table class="form">
  1111. <tr style="width: 100%;height:50%;">
  1112. <td><div id="panel2" style="width: 100%;height:100%;"></div></td>
  1113. </tr>
  1114. <tr style="width: 100%;height:50%;">
  1115. <td><div id="panel3" style="width: 100%;height:100%;"></div></td>
  1116. </tr>
  1117. </table>
  1118. </td>
  1119. <td colspan="2">
  1120. <div id="panel4" style="width: 100%;height:100%;"></div>
  1121. </td>
  1122. </tr>
  1123. @*<tr style="width:100%;height:50%;">
  1124. <td colspan="5">
  1125. <div class="gridPanel" id="gridPanel1">
  1126. <table id="gridList1"></table>
  1127. </div>
  1128. </td>
  1129. </tr>*@
  1130. </table>
  1131. </div>
  1132. </form>