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.

613 lines
20 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. <style>
  7. .ui-jqgrid tr.jqgrow td {
  8. overflow: hidden;
  9. }
  10. .ui-jqgrid .ui-jqgrid-btable tbody tr.jqgrow td {
  11. overflow: hidden !important;
  12. }
  13. .btn-primary {
  14. margin-right: 2px;
  15. }
  16. html {
  17. height: 100%;
  18. }
  19. .topRow {
  20. height: 54px;
  21. width:100%;
  22. }
  23. body {
  24. height: 100%;
  25. FONT-SIZE: 18px;
  26. }
  27. .TopName {
  28. vertical-align: middle;
  29. text-align: center;
  30. font-size: 24px;
  31. font-weight: 700;
  32. }
  33. .time {
  34. vertical-align: middle;
  35. text-align: center;
  36. font-size: 20px;
  37. }
  38. td {
  39. padding-bottom:5px;
  40. padding-left:2px;
  41. padding-right:2px;
  42. }
  43. .formdiv {
  44. height: calc(100% - 54px) !important;
  45. margin-left: 10px;
  46. margin-right: 10px;
  47. }
  48. .thclass {
  49. width: 100px;
  50. font-weight: 500;
  51. text-align: right;
  52. }
  53. table {
  54. height: 100%;
  55. }
  56. html, body {
  57. height: 100% !important;
  58. }
  59. form {
  60. height: 98% !important;
  61. background-color: #d9d9d9;
  62. }
  63. .echartDiv {
  64. height:100%;
  65. width:100%;
  66. }
  67. /*.bootstrap-select .dropdown-toggle .filter-option-inner-inner {
  68. height: 24px !important;
  69. }*/
  70. </style>
  71. <link href="~/Content/css/CommonReport/CommonReport.css" rel="stylesheet" />
  72. <script src="~/Content/js/CommonReport/CommonReport.js"></script>
  73. <script src="~/Content/js/datepicker/WdatePicker.js"></script>
  74. <link href="~/Content/css/bootstrap/bootstrap-select.css" rel="stylesheet" />
  75. <script src="~/Content/js/bootstrap/bootstrap-select.min.js"></script>
  76. <script>
  77. var timer;//刷新数据时间
  78. $(function () {
  79. //显示时间
  80. getTime();
  81. gridList();
  82. //刷新数据
  83. timer = setInterval(function () {
  84. gridList();
  85. }, 30 * 1000);
  86. });
  87. function gridList() {
  88. SetPanel1();
  89. SetPanel2();
  90. SetPanel3();
  91. SetPanel4();
  92. }
  93. function getTime() {
  94. var days = new Array("日", "一", "二", "三", "四", "五", "六");
  95. var currentDT = new Date();
  96. var y, m, date, day, hs, ms, ss, theDateStr;
  97. y = currentDT.getFullYear(); //四位整数表示的年份
  98. m = currentDT.getMonth() < 10 ? '0' + (currentDT.getMonth() + 1) : (currentDT.getMonth() + 1); //月
  99. date = currentDT.getDate() < 10 ? '0' + currentDT.getDate() : currentDT.getDate(); //日
  100. day = currentDT.getDay(); //星期
  101. hs = currentDT.getHours() < 10 ? '0' + currentDT.getHours() : currentDT.getHours(); //时
  102. ms = currentDT.getMinutes() < 10 ? '0' + currentDT.getMinutes() : currentDT.getMinutes(); //分
  103. ss = currentDT.getSeconds() < 10 ? '0' + currentDT.getSeconds() : currentDT.getSeconds(); //秒
  104. theDateStr = y + "-" + m + "-" + date + " " + hs + ":" + ms + ":" + ss;
  105. //填充到组件中
  106. $("#timeStr").text(theDateStr);
  107. // setTimeout 在执行时,是在载入后延迟指定时间后,去执行一次表达式,仅执行一次
  108. window.setTimeout(getTime, 1000);
  109. }
  110. //收货进度
  111. function SetPanel1()
  112. {
  113. var myChart = echarts.init(document.getElementById('panel1'));
  114. myChart.showLoading(); //数据加载完之前先显示一段简单的loading动画
  115. var colors = ['#4F81BD', '#fa9258', '#9d9b9b', '#FF0000', '#0080ff', '#7030A0'];
  116. var X_Show = new Array();// ['已检待入','优先待检', '待检'];
  117. var DataList = new Array();//[260, 36,152];
  118. var DataPercent = new Array();//['58%', '8%', '34%'];
  119. $.ajax({
  120. url: "/SRM/WatchPanel/GetRCVJingDu?" + Math.random(),
  121. data: { XX: "" },
  122. dataType: "json",
  123. async: false,
  124. success: function (result) {
  125. //请求成功时执行该函数内容,result即为服务器返回的json对象
  126. if (result && result != null && result.length > 0) {
  127. for (var i = 0; i < result.length; i++) {
  128. //QTY CKTYPE Qtypercent
  129. X_Show.push(result[i].CKTYPE);
  130. DataList.push(result[i].QTY);
  131. DataPercent.push(result[i].Qtypercent);
  132. }
  133. myChart.setOption({ //加载数据图表
  134. color: colors,
  135. title: {
  136. show: true,
  137. text: '收货进度',
  138. textStyle: {
  139. fontSize: 20,
  140. color: "black"
  141. },
  142. },
  143. backgroundColor: '#1abc9c',
  144. tooltip: {
  145. trigger: 'item',
  146. formatter: '{b},{c}' + '<br>' + '{d}%'
  147. },
  148. legend: {
  149. left: 'right',
  150. orient: "vertical"
  151. },
  152. series: [
  153. {
  154. type: 'pie',
  155. radius: DataPercent,
  156. avoidLabelOverlap: false,
  157. label: {
  158. show: true,
  159. position: 'inside',
  160. formatter: '{b},{c},{d}%'
  161. },
  162. labelLine: {
  163. show: false
  164. },
  165. data: [
  166. { value: DataList[0], name: X_Show[0] },
  167. { value: DataList[1], name: X_Show[1] },
  168. { value: DataList[2], name: X_Show[2] },
  169. ]
  170. }
  171. ]
  172. });
  173. myChart.hideLoading(); //隐藏加载动画
  174. }
  175. else {
  176. myChart.hideLoading();//隐藏加载动画
  177. alert("收货进度没有抓取到相关数据");
  178. }
  179. },
  180. error: function (errorMsg) {
  181. alert("收货进度图表请求数据失败!", "error");
  182. myChart.hideLoading();
  183. }
  184. });
  185. }
  186. //配料进度
  187. function SetPanel2() {
  188. var myChart = echarts.init(document.getElementById('panel2'));
  189. myChart.showLoading(); //数据加载完之前先显示一段简单的loading动画
  190. var colors = ['#ffff00', '#4F81BD', '#1abc9c', '#FF0000', '#0080ff', '#7030A0'];
  191. var X_Show = new Array();// ['待配料', '已配料'];
  192. var DataList = new Array();//[200, 372];
  193. var DataPercent = new Array();// ['35%', '65%'];
  194. $.ajax({
  195. url: "/SRM/WatchPanel/GetPeiLiaoJingDu?" + Math.random(),
  196. data: { XX: "" },
  197. dataType: "json",
  198. async: false,
  199. success: function (result) {
  200. //请求成功时执行该函数内容,result即为服务器返回的json对象
  201. if (result && result != null && result.length > 0) {
  202. for (var i = 0; i < result.length; i++) {
  203. //QTY CKTYPE Qtypercent
  204. X_Show.push(result[i].CKTYPE);
  205. DataList.push(result[i].QTY);
  206. DataPercent.push(result[i].Qtypercent);
  207. }
  208. myChart.hideLoading(); //隐藏加载动画
  209. myChart.setOption({ //加载数据图表
  210. title: {
  211. show: true,
  212. text: '配料进度',
  213. textStyle: {
  214. fontSize: 20,
  215. color: "black"
  216. },
  217. },
  218. color: colors,
  219. backgroundColor: '#1abc9c',
  220. tooltip: {
  221. trigger: 'item',
  222. formatter: '{b},{c}' + '<br>' + '{d}%'
  223. },
  224. legend: {
  225. left: 'right',
  226. orient: "vertical"
  227. },
  228. series: [
  229. {
  230. type: 'pie',
  231. radius: DataPercent,
  232. avoidLabelOverlap: false,
  233. label: {
  234. show: true,
  235. position: 'inside',
  236. formatter: '{b},{c},{d}%'
  237. },
  238. //emphasis: {
  239. // label: {
  240. // show: true,
  241. // fontSize: '40',
  242. // fontWeight: 'bold'
  243. // }
  244. //},
  245. labelLine: {
  246. show: false
  247. },
  248. data: [
  249. { value: DataList[0], name: X_Show[0] },
  250. { value: DataList[1], name: X_Show[1] },
  251. ]
  252. }
  253. ]
  254. });
  255. }
  256. else {
  257. myChart.hideLoading();//隐藏加载动画
  258. alert("配料没有抓取到相关数据");
  259. }
  260. },
  261. error: function (errorMsg) {
  262. alert("配料图表请求数据失败!", "error");
  263. myChart.hideLoading();
  264. }
  265. });
  266. }
  267. //到货数量(item)
  268. function SetPanel3() {
  269. var myChart = echarts.init(document.getElementById('panel3'));
  270. myChart.showLoading(); //数据加载完之前先显示一段简单的loading动画
  271. var colors = ['#4F81BD', '#fac858', '#1abc9c', '#FF0000', '#0080ff', '#7030A0'];
  272. 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];
  273. var MonthList = new Array();
  274. //for (var i = 29; i > 0 ; i--) {
  275. // let nowDate = new Date();
  276. // nowDate = nowDate.setDate(nowDate.getDate() - i);
  277. // var dd = new Date(parseInt(nowDate));
  278. // var DStr = (dd.getMonth() + 1).toString() + '/' + dd.getDate().toString();
  279. // MonthList.push(DStr);
  280. //}
  281. $.ajax({
  282. url: "/SRM/WatchPanel/GetRCVQty?" + Math.random(),
  283. data: { XX: "" },
  284. dataType: "json",
  285. async: false,
  286. success: function (result) {
  287. //请求成功时执行该函数内容,result即为服务器返回的json对象
  288. if (result && result != null && result.length > 0) {
  289. for (var i = 0; i < result.length; i++) {
  290. QtyList.push(result[i].QTY);
  291. MonthList.push(result[i].日期);
  292. }
  293. myChart.hideLoading(); //隐藏加载动画
  294. myChart.setOption({ //加载数据图表
  295. title: {
  296. text: '到货数量(item)',
  297. textStyle: {
  298. fontSize: 20,
  299. color: "white"
  300. },
  301. },
  302. color: colors,
  303. legend: {
  304. show: false,
  305. textStyle: {
  306. color: "white"
  307. }
  308. },
  309. tooltip: {
  310. trigger: 'axis',
  311. formatter: function (params) {
  312. var showHtm = "";
  313. showHtm = params[0].name + ":" + params[0].data;
  314. return showHtm;
  315. }
  316. },
  317. backgroundColor: 'black',
  318. grid: {
  319. show: false,
  320. left: 30,
  321. right: 30,
  322. top: 60,
  323. bottom: 30,
  324. },
  325. xAxis: {
  326. data: MonthList, type: 'category',
  327. axisPointer: { type: 'shadow' },
  328. axisLine: {
  329. lineStyle: {
  330. color: "white"
  331. },
  332. }
  333. },
  334. yAxis: [{
  335. type: 'value', position: 'left',
  336. axisLabel: {
  337. formatter: '{value}'
  338. },
  339. axisLine: {
  340. show: false,
  341. lineStyle: {
  342. color: "white"
  343. },
  344. },
  345. splitLine: {
  346. show: false
  347. }
  348. }
  349. ],
  350. series: [{
  351. name: '数量',
  352. type: 'line',
  353. data: QtyList,
  354. barMaxWidth: 10,
  355. yAxisIndex: 0,
  356. label: {
  357. normal: {
  358. show: true,
  359. position: 'top',
  360. color: 'white',
  361. }
  362. }
  363. }
  364. ]
  365. });
  366. }
  367. else {
  368. myChart.hideLoading();//隐藏加载动画
  369. alert("到货数量没有抓取到相关数据");
  370. }
  371. },
  372. error: function (errorMsg) {
  373. alert("到货数量图表请求数据失败!", "error");
  374. myChart.hideLoading();
  375. }
  376. });
  377. }
  378. //入库数量(item)
  379. function SetPanel4() {
  380. var myChart = echarts.init(document.getElementById('panel4'));
  381. myChart.showLoading(); //数据加载完之前先显示一段简单的loading动画
  382. var colors = ['#4F81BD', '#fac858', '#1abc9c', '#FF0000', '#0080ff', '#7030A0'];
  383. 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];
  384. var MonthList = new Array();
  385. $.ajax({
  386. url: "/SRM/WatchPanel/GetWareInQty?" + Math.random(),
  387. data: { XX: "" },
  388. dataType: "json",
  389. async: false,
  390. success: function (result) {
  391. //请求成功时执行该函数内容,result即为服务器返回的json对象
  392. if (result && result != null && result.length > 0) {
  393. for (var i = 0; i < result.length; i++) {
  394. QtyList.push(result[i].QTY);
  395. MonthList.push(result[i].日期);
  396. }
  397. myChart.hideLoading(); //隐藏加载动画
  398. myChart.setOption({ //加载数据图表
  399. title: {
  400. text: '入库数量(item)',
  401. textStyle: {
  402. fontSize: 20,
  403. color: "white"
  404. },
  405. },
  406. color: colors,
  407. legend: {
  408. show: false,
  409. textStyle: {
  410. color: "white"
  411. }
  412. },
  413. tooltip: {
  414. trigger: 'axis',
  415. formatter: function (params) {
  416. var showHtm = "";
  417. showHtm = params[0].name + ":" + params[0].data;
  418. return showHtm;
  419. }
  420. },
  421. backgroundColor: 'black',
  422. grid: {
  423. show: false,
  424. left: 30,
  425. right: 30,
  426. top: 60,
  427. bottom: 30,
  428. },
  429. xAxis: {
  430. data: MonthList, type: 'category',
  431. axisPointer: { type: 'shadow' },
  432. axisLine: {
  433. lineStyle: {
  434. color: "white"
  435. },
  436. }
  437. },
  438. yAxis: [{
  439. type: 'value', position: 'left',
  440. axisLabel: {
  441. formatter: '{value}'
  442. },
  443. axisLine: {
  444. show: false,
  445. lineStyle: {
  446. color: "white"
  447. },
  448. },
  449. splitLine: {
  450. show: false
  451. }
  452. }
  453. ],
  454. series: [{
  455. name: '数量',
  456. type: 'line',
  457. data: QtyList,
  458. barMaxWidth: 10,
  459. yAxisIndex: 0,
  460. label: {
  461. normal: {
  462. show: true,
  463. position: 'top',
  464. color: 'white',
  465. }
  466. }
  467. }
  468. ]
  469. });
  470. }
  471. else {
  472. myChart.hideLoading();//隐藏加载动画
  473. alert("入库数量没有抓取到相关数据");
  474. }
  475. },
  476. error: function (errorMsg) {
  477. alert("入库数量图表请求数据失败!", "error");
  478. myChart.hideLoading();
  479. }
  480. });
  481. }
  482. </script>
  483. <form id="form1">
  484. <div class="topRow">
  485. <table class="form" >
  486. <tr >
  487. <td style="width:25%">
  488. <div></div>
  489. </td>
  490. <td colspan="2" style="width:50%">
  491. <div class="TopName" id="TopName">仓储管理看板</div>
  492. </td>
  493. <td style="width:25%">
  494. <div class="time" id="timeStr"></div>
  495. </td>
  496. </tr>
  497. </table>
  498. </div>
  499. <div class="formdiv">
  500. <table class="form">
  501. <tr style="width:100%;height:50%;">
  502. <td colspan="2">
  503. <div id="panel1" class="echartDiv"></div>
  504. </td>
  505. <td colspan="2">
  506. <div id="panel2" class="echartDiv"></div>
  507. </td>
  508. </tr>
  509. <tr style="width:100%;height:50%;">
  510. <td colspan="2">
  511. <div id="panel3" class="echartDiv"></div>
  512. </td>
  513. <td colspan="2">
  514. <div id="panel4" class="echartDiv"></div>
  515. </td>
  516. </tr>
  517. </table>
  518. </div>
  519. </form>