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