KLHCManager.js 41 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062
  1. //var bootstrap = function ($, learun) {
  2. $(function () {
  3. "use strict";
  4. var tabName = 'fj1';
  5. function GetTodayInOutPie(data) {
  6. var dom = document.getElementById(tabName + 'todayinoutpie');
  7. var myChart = echarts.init(dom, null, {
  8. renderer: 'canvas',
  9. useDirtyRect: false
  10. });
  11. var app = {};
  12. var option;
  13. option = {
  14. title: {
  15. text: data.total,
  16. textStyle: {
  17. color: '#1C3554',
  18. },
  19. subtext: '今日任务总数',
  20. subtextStyle: {
  21. color: '#5A5E66',
  22. },
  23. left: 'center',
  24. top: '37%'
  25. },
  26. tooltip: {
  27. trigger: 'item'
  28. },
  29. legend: {
  30. top: '1%',
  31. left: 'center'
  32. },
  33. series: [
  34. {
  35. name: '出入库统计',
  36. type: 'pie',
  37. radius: ['40%', '70%'],
  38. avoidLabelOverlap: false,
  39. itemStyle: {
  40. normal: {
  41. label: {
  42. show: false
  43. },
  44. labelLine: {
  45. show: false
  46. },
  47. color: function (colors) {
  48. var colorList = [
  49. '#9287e7',
  50. '#40A0FF',
  51. '#F7CA4D',
  52. '#23B89A',
  53. '#9287e7',
  54. '#40A0FF',
  55. '#F7CA4D',
  56. '#23B89A',
  57. ];
  58. return colorList[colors.dataIndex];
  59. }
  60. }
  61. },
  62. label: {
  63. show: false,
  64. position: 'center'
  65. },
  66. emphasis: {
  67. label: {
  68. show: true,
  69. fontSize: 40,
  70. fontWeight: 'bold'
  71. }
  72. },
  73. labelLine: {
  74. show: false
  75. },
  76. data: data.datas
  77. //[
  78. //{ value: 1048, name: '出库任务' },
  79. //{ value: 735, name: '入库任务' },
  80. //{ value: 580, name: '移库任务' }
  81. //]
  82. }
  83. ]
  84. };
  85. if (option && typeof option === 'object') {
  86. myChart.setOption(option);
  87. }
  88. window.addEventListener('resize', myChart.resize);
  89. }
  90. function Get7daysTaskBar(data) {
  91. var dom = document.getElementById(tabName + 'sevendaysTask');
  92. var myChart = echarts.init(dom, null, {
  93. renderer: 'canvas',
  94. useDirtyRect: false
  95. });
  96. var app = {};
  97. var option;
  98. const labelOption = {
  99. show: true,
  100. position: 'insideBottom',
  101. distance: 15,
  102. align: 'left',
  103. verticalAlign: 'middle',
  104. rotate: 90,
  105. formatter: '{c} {name|{a}}',
  106. fontSize: 16,
  107. rich: {
  108. name: {}
  109. }
  110. };
  111. option = {
  112. tooltip: {
  113. trigger: 'axis',
  114. axisPointer: {
  115. type: 'cross',
  116. crossStyle: {
  117. color: '#999'
  118. }
  119. }
  120. },
  121. color: ['#40A0FF', '#23B89A'],
  122. //tooltip: {
  123. // trigger: 'axis',
  124. // axisPointer: {
  125. // type: 'shadow'
  126. // }
  127. //},
  128. legend: {
  129. left: '57%',//调整位置
  130. data: ['出库', '入库']
  131. },
  132. xAxis: [
  133. {
  134. type: 'category',
  135. axisTick: { show: false },
  136. data: data.xAxis,// ['5-10', '5-11', '5-12', '5-13', '5-14', '5-15', '5-16'],
  137. }
  138. ],
  139. yAxis: [
  140. {
  141. /* interval: 50,*/
  142. axisLabel: {
  143. formatter: '{value}'
  144. },
  145. type: 'value'
  146. }
  147. ],
  148. series: [
  149. {
  150. name: '出库',
  151. type: 'bar',
  152. //label: labelOption,
  153. emphasis: {
  154. focus: 'series'
  155. },
  156. lineStyle: { // 设置线条的style等
  157. normal: {
  158. color: '#40A0FF', // 折线线条颜色:红色
  159. },
  160. },
  161. itemStyle: {
  162. normal: {
  163. label: {
  164. show: true,
  165. position: 'top',
  166. },
  167. //这里是颜色
  168. color: function (params) {
  169. //注意,如果颜色太少的话,后面颜色不会自动循环,最好多定义几个颜色
  170. var colorList = ['#40A0FF'];
  171. return colorList[params.dataIndex]
  172. }
  173. }, // 移入当前的柱状图时改变颜色
  174. emphasis: {
  175. color: '#40A0FF',
  176. }
  177. },
  178. data: data.series[0].data//[22, 18, 19, 34, 29]
  179. },
  180. {
  181. name: '入库',
  182. type: 'bar',
  183. barGap: 0,
  184. //label: labelOption,
  185. emphasis: {
  186. focus: 'series'
  187. },
  188. lineStyle: { // 设置线条的style等
  189. normal: {
  190. color: '#23B89A', // 折线线条颜色:红色
  191. },
  192. },
  193. itemStyle: {
  194. normal: {
  195. label: {
  196. show: true,
  197. position: 'top',
  198. },
  199. //这里是颜色
  200. color: function (params) {
  201. //注意,如果颜色太少的话,后面颜色不会自动循环,最好多定义几个颜色
  202. var colorList = ['#23B89A'];
  203. return colorList[params.dataIndex]
  204. }
  205. },
  206. emphasis: {
  207. color: '#23B89A',
  208. }
  209. },
  210. data: data.series[1].data//[32, 32, 30, 34, 39]
  211. }
  212. ]
  213. };
  214. if (option && typeof option === 'object') {
  215. myChart.setOption(option);
  216. }
  217. }
  218. function GetWarehouseCellPie(data) {
  219. var chartDom = document.getElementById('fj1WarehouseCell');
  220. var myChart = echarts.init(chartDom);
  221. var option;
  222. option = {
  223. tooltip: {
  224. trigger: 'item'
  225. },
  226. legend: {
  227. data: ['已使用', '空闲', '禁用', '锁定'],
  228. //orient: 'vertical',
  229. orient: 'horizontal',
  230. bottom: '-5',
  231. // left: 'center',
  232. // top: "50",
  233. //right: '-80%',
  234. textStyle: { color: "#000000" },//字体颜色
  235. //icon: "circle"//图例形状设置
  236. //orient: 'vertical',
  237. //right: 'right'
  238. //left: '77%',//调整位置
  239. },
  240. series: [
  241. {
  242. name: '货位使用情况',
  243. type: 'pie',
  244. radius: '60%',
  245. data: data
  246. //[{ value: 1048, name: '已使用' },
  247. //{ value: 735, name: '空闲' },
  248. //{ value: 580, name: '禁用' },
  249. //{ value: 484, name: '锁定' }]
  250. , itemStyle: {
  251. normal: {
  252. label: {
  253. show: true,
  254. formatter: '{b}:{c}({d}%)'
  255. },
  256. labelLine: {
  257. show: true
  258. },
  259. color: function (colors) {
  260. var colorList = [
  261. '#D4A800', '#258E3C',
  262. '#CC0000',
  263. '#6A5ACD',
  264. ];
  265. return colorList[colors.dataIndex];
  266. }
  267. }
  268. },
  269. label: {
  270. show: false,
  271. position: 'center'
  272. },
  273. emphasis: {
  274. label: {
  275. show: true,
  276. fontSize: 40,
  277. fontWeight: 'bold'
  278. },
  279. itemStyle: {
  280. shadowBlur: 10,
  281. shadowOffsetX: 0,
  282. shadowColor: 'rgba(0, 0, 0, 0.5)'
  283. }
  284. },
  285. labelLine: {
  286. show: false
  287. }
  288. }
  289. ]
  290. };
  291. option && myChart.setOption(option);
  292. }
  293. function GetTunnelWarehouseCellBar(data) {
  294. var dom = document.getElementById(tabName + 'TunnelWarehouseCell');
  295. var myChart = echarts.init(dom, null, {
  296. renderer: 'canvas',
  297. useDirtyRect: false
  298. });
  299. var app = {};
  300. var option;
  301. //https://blog.csdn.net/fu983531588/article/details/121338767
  302. //Echarts绘制横向柱状图(圆角+渐变) https://blog.csdn.net/weixin_43953710/article/details/106694317
  303. //https://blog.csdn.net/lilycheng1986/article/details/121853940
  304. //var data = [{ "qty": 16, "total": 1732 }, { "qty": 787, "total": 1732 }, { "qty": 841, "total": 1700 }];
  305. var barWidth = 20;
  306. //option = {
  307. // grid: {
  308. // top: '5%',
  309. // left: '25%',
  310. // right: '25%',
  311. // bottom: '0%',
  312. // containLabel: true // 显示范围包含坐标刻度
  313. // },
  314. // //grid: {
  315. // // top: '10px',
  316. // // left: '120px',
  317. // // bottom: '30px',
  318. // //},
  319. // xAxis: {
  320. // show: false
  321. // },
  322. // yAxis: {
  323. // type: 'category',
  324. // inverse: true, // 倒叙
  325. // axisLabel: {
  326. // margin: 0,
  327. // align: 'left',
  328. // formatter: (val) => {
  329. // return `${val}`;
  330. // }
  331. // },
  332. // axisLine: {
  333. // show: false // 轴线
  334. // },
  335. // axisTick: {
  336. // show: false // 刻度线
  337. // },
  338. // data: ['栏目1', '栏目2', '栏目3']
  339. // },
  340. // series: [
  341. // {
  342. // type: 'bar',
  343. // showBackground: true,
  344. // barWidth: 10,
  345. // barMaxWidth: 20,
  346. // barMinWidth: 5,
  347. // label: {
  348. // show: true,
  349. // position: 'left',
  350. // offset: [100, 0],
  351. // valueAnimation: true,
  352. // fontFamily: 'monospace',
  353. // fontSize: 12,
  354. // textStyle: {
  355. // //数值样式
  356. // color: "#1C3554",
  357. // fontSize: 12
  358. // },
  359. // formatter: function (params) {
  360. // return params.data.realValue + '/' + params.data.value;
  361. // },
  362. // // distance: -22
  363. // },
  364. // itemStyle: {
  365. // normal: {
  366. // barBorderRadius: [0, 20, 20, 0], //设置圆角方向[上,右,下,左]
  367. // //这里是颜色
  368. // color: function (params) {
  369. // //注意,如果颜色太少的话,后面颜色不会自动循环,最好多定义几个颜色
  370. // var colorList = ['#40A0FF'];
  371. // return colorList[params.dataIndex]
  372. // }
  373. // }
  374. // },
  375. // data: data.map(function (item) {
  376. // return {
  377. // realValue: item.qty,
  378. // value: item.total,
  379. // };
  380. // }),
  381. // }
  382. // ]
  383. //};
  384. option = {
  385. //backgroundColor: 'black',
  386. grid: {
  387. top: '15%',
  388. left: '25%',
  389. right: '25%',
  390. bottom: '0%',
  391. containLabel: true // 显示范围包含坐标刻度
  392. },
  393. xAxis: {
  394. show: false,
  395. },
  396. yAxis: {
  397. data: data.map(item => item.tunnel),
  398. inverse: true,
  399. splitLine: {
  400. show: false,
  401. },
  402. axisLabel: {
  403. textStyle: { fontSize: '80%', color: '#5A5E66' },
  404. },
  405. axisLine: {
  406. show: false,
  407. },
  408. axisTick: false,
  409. },
  410. series: [
  411. {
  412. type: 'bar',
  413. barWidth: barWidth,
  414. barGap: '5%',
  415. barCategoryGap: '5%',/*多个并排柱子设置柱子之间的间距*/
  416. zlevel: 2,
  417. data: data.map(function (item) {
  418. return {
  419. value: item.qty
  420. };
  421. }),
  422. itemStyle: {
  423. normal: {
  424. barBorderRadius: [0, 20, 20, 0], //设置圆角方向[上,右,下,左]
  425. //这里是颜色
  426. color: function (params) {
  427. //注意,如果颜色太少的话,后面颜色不会自动循环,最好多定义几个颜色
  428. var colorList = ['#40A0FF'];
  429. return colorList[params.dataIndex]
  430. }
  431. }
  432. }
  433. },
  434. {
  435. type: 'bar',
  436. barWidth: barWidth,
  437. distance: 15,// 标签距离柱条的距离
  438. barGap: '-100%',
  439. barCategoryGap: '5%',/*多个并排柱子设置柱子之间的间距*/
  440. data: data.map(function (item) {
  441. return {
  442. value: item.total,
  443. realValue: item.qty,
  444. total: item.total,
  445. };
  446. }),
  447. label: {
  448. normal: {
  449. show: true,
  450. precision: 1,
  451. position: 'right',
  452. offset: [10, 0],
  453. valueAnimation: true,
  454. fontFamily: 'monospace',
  455. fontSize: 12,
  456. textStyle: {
  457. //数值样式
  458. color: "#1C3554",
  459. fontSize: 12
  460. },
  461. formatter: function (params) {
  462. return params.data.realValue + '/' + params.data.total;
  463. },
  464. }
  465. },
  466. itemStyle: {
  467. borderRadius: [0, 20, 20, 0],
  468. normal: {
  469. barBorderRadius: [0, 20, 20, 0], //设置圆角方向[上,右,下,左]
  470. //这里是颜色
  471. color: function (params) {
  472. //注意,如果颜色太少的话,后面颜色不会自动循环,最好多定义几个颜色
  473. var colorList = ['#E1E5E8'];
  474. return colorList[params.dataIndex]
  475. }
  476. }, // 移入当前的柱状图时改变颜色
  477. }
  478. },
  479. ],
  480. };
  481. if (option && typeof option === 'object') {
  482. myChart.setOption(option);
  483. }
  484. window.addEventListener('resize', myChart.resize);
  485. }
  486. function GettodaysHourTask(data) {
  487. var chartDom = document.getElementById(tabName + 'todaysHourTask');
  488. var myChart = echarts.init(chartDom, null, {
  489. renderer: 'canvas',
  490. useDirtyRect: false
  491. });
  492. var option;
  493. option = {
  494. tooltip: {
  495. trigger: 'axis',
  496. axisPointer: {
  497. type: 'cross',
  498. label: {
  499. backgroundColor: '#6a7985'
  500. }
  501. }
  502. },
  503. legend: {
  504. left: '57%',//调整位置
  505. top: '30',
  506. data: ['出库', '入库']
  507. },
  508. grid: {
  509. left: '3%',
  510. right: '4%',
  511. bottom: '1%',
  512. containLabel: true
  513. },
  514. xAxis: [
  515. {
  516. //type: 'category',
  517. boundaryGap: false,
  518. data: data.xAxis,//['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23']
  519. }
  520. ],
  521. yAxis: [
  522. {
  523. axisLabel: {
  524. formatter: '{value}'
  525. },
  526. axisLine: {
  527. show: true
  528. },
  529. type: 'value'
  530. }
  531. ],
  532. series: [
  533. {
  534. name: '出库',
  535. type: 'line',
  536. //stack: 'Total',
  537. label: {
  538. show: true,
  539. position: 'top'
  540. },
  541. lineStyle: { // 设置线条的style等
  542. normal: {
  543. color: '#40A0FF', // 折线线条颜色:红色
  544. },
  545. },
  546. itemStyle: {
  547. normal: {
  548. //这里是颜色
  549. color: function (params) {
  550. //注意,如果颜色太少的话,后面颜色不会自动循环,最好多定义几个颜色
  551. var colorList = ['#40A0FF'];
  552. return colorList[params.dataIndex]
  553. }
  554. }
  555. },
  556. areaStyle: {},
  557. emphasis: {
  558. focus: 'series'
  559. },
  560. data: data.series[0].data//[78, 93, 76, 55, 68, 89, 82]
  561. },
  562. {
  563. name: '入库',
  564. type: 'line',
  565. //stack: 'Total',
  566. label: {
  567. show: true,
  568. position: 'top'
  569. },
  570. areaStyle: {},
  571. lineStyle: { // 设置线条的style等
  572. normal: {
  573. color: '#23B89A', // 折线线条颜色:红色
  574. },
  575. },
  576. itemStyle: {
  577. normal: {
  578. //这里是颜色
  579. color: function (params) {
  580. //注意,如果颜色太少的话,后面颜色不会自动循环,最好多定义几个颜色
  581. var colorList = ['#23B89A'];
  582. return colorList[params.dataIndex]
  583. }
  584. }
  585. },
  586. emphasis: {
  587. focus: 'series'
  588. },
  589. data: data.series[1].data//[38, 23, 36, 45, 58, 59, 62]
  590. }
  591. ]
  592. };
  593. option && myChart.setOption(option);
  594. }
  595. function GetHourTask(data) {
  596. var chartDom = document.getElementById(tabName + 'HourTask');
  597. var myChart = echarts.init(chartDom, null, {
  598. renderer: 'canvas',
  599. useDirtyRect: false
  600. });
  601. var option;
  602. option = {
  603. tooltip: {
  604. trigger: 'axis',
  605. axisPointer: {
  606. type: 'cross',
  607. label: {
  608. backgroundColor: '#6a7985'
  609. }
  610. }
  611. },
  612. legend: {
  613. left: '57%',//调整位置
  614. top: '30',
  615. data: ['出库', '入库']
  616. },
  617. grid: {
  618. left: '3%',
  619. right: '4%',
  620. bottom: '1%',
  621. containLabel: true
  622. },
  623. xAxis: [
  624. {
  625. //type: 'category',
  626. boundaryGap: false,
  627. data: data.xAxis,//['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23']
  628. }
  629. ],
  630. yAxis: [
  631. {
  632. axisLabel: {
  633. formatter: '{value}'
  634. },
  635. axisLine: {
  636. show: true
  637. },
  638. type: 'value'
  639. }
  640. ],
  641. series: [
  642. {
  643. name: '出库',
  644. type: 'line',
  645. //stack: 'Total',
  646. label: {
  647. show: true,
  648. position: 'top'
  649. },
  650. lineStyle: { // 设置线条的style等
  651. normal: {
  652. color: '#40A0FF', // 折线线条颜色:红色
  653. },
  654. },
  655. itemStyle: {
  656. normal: {
  657. //这里是颜色
  658. color: function (params) {
  659. //注意,如果颜色太少的话,后面颜色不会自动循环,最好多定义几个颜色
  660. var colorList = ['#40A0FF'];
  661. return colorList[params.dataIndex]
  662. }
  663. }
  664. },
  665. areaStyle: {},
  666. emphasis: {
  667. focus: 'series'
  668. },
  669. data: data.series[0].data//[78, 93, 76, 55, 68, 89, 82]
  670. },
  671. {
  672. name: '入库',
  673. type: 'line',
  674. //stack: 'Total',
  675. label: {
  676. show: true,
  677. position: 'top'
  678. },
  679. areaStyle: {},
  680. lineStyle: { // 设置线条的style等
  681. normal: {
  682. color: '#23B89A', // 折线线条颜色:红色
  683. },
  684. },
  685. itemStyle: {
  686. normal: {
  687. //这里是颜色
  688. color: function (params) {
  689. //注意,如果颜色太少的话,后面颜色不会自动循环,最好多定义几个颜色
  690. var colorList = ['#23B89A'];
  691. return colorList[params.dataIndex]
  692. }
  693. }
  694. },
  695. emphasis: {
  696. focus: 'series'
  697. },
  698. data: data.series[1].data//[38, 23, 36, 45, 58, 59, 62]
  699. }
  700. ]
  701. };
  702. option && myChart.setOption(option);
  703. }
  704. function GetTaskGoodsTypesData(data) {
  705. var dom = document.getElementById(tabName + 'BomType');
  706. var myChart = echarts.init(dom, null, {
  707. renderer: 'canvas',
  708. useDirtyRect: false
  709. });
  710. var option;
  711. option = {
  712. tooltip: {
  713. trigger: 'item',
  714. position: ['20%', '50%']
  715. },
  716. legend: {
  717. data: data.map(item => item.name),
  718. orient: 'vertical',
  719. top: "15",
  720. //right: '-80%',
  721. textStyle: { color: "#000000" },//字体颜色
  722. //icon: "circle"//图例形状设置
  723. //orient: 'vertical',
  724. //right: 'right'
  725. left: '66%',//调整位置
  726. tooltip: {
  727. show: true,
  728. trigger: 'item',//鼠标移动上去展示全称
  729. },
  730. formatter: function (params) {
  731. var val = "";
  732. if (!!params && params.length > 6) {
  733. val = params.substr(0, 12) + '...';
  734. return val;
  735. } else {
  736. return params;
  737. }
  738. },
  739. },
  740. series: [
  741. {
  742. name: '物料占比',
  743. type: 'pie',
  744. radius: ['30%', '60%'],
  745. avoidLabelOverlap: false,
  746. itemStyle: {
  747. normal: {
  748. label: {
  749. show: false
  750. },
  751. labelLine: {
  752. show: false
  753. },
  754. color: function (colors) {
  755. var colorList = [
  756. '#12D8E4',
  757. '#75B1FF',
  758. '#3383FF',
  759. '#FFCD7E',
  760. '#FF8A8A',
  761. '#23B89A',
  762. '#F4BD37',
  763. '#D8E7FC',
  764. '#E46989',
  765. ];
  766. return colorList[colors.dataIndex];
  767. }
  768. }
  769. },
  770. label: {
  771. show: false,
  772. position: 'center'
  773. },
  774. emphasis: {
  775. label: {
  776. show: true,
  777. fontSize: 40,
  778. fontWeight: 'bold'
  779. }
  780. },
  781. labelLine: {
  782. show: false
  783. },
  784. data: data
  785. // [
  786. // { value: 1048, name: '出库任务' },
  787. // { value: 735, name: '入库任务' },
  788. // { value: 580, name: '移库任务' }
  789. //]
  790. }
  791. ]
  792. };
  793. if (option && typeof option === 'object') {
  794. myChart.setOption(option);
  795. }
  796. window.addEventListener('resize', myChart.resize);
  797. }
  798. function init() {
  799. GetTodayTaskInOutPie(1);
  800. top.learun.httpAsyncGet(top.$.rootUrl + '/' + Tenant + '/AdminDesktopHome/Get7daysTaskBar?warehouse=' + tabName, function (res) {
  801. if (res.code > 0) {
  802. Get7daysTaskBar(res.data);
  803. }
  804. });
  805. top.learun.httpAsyncGet(top.$.rootUrl + '/' + Tenant + '/AdminDesktopHome/GettodaysHourTask?warehouse=' + tabName, function (res) {
  806. if (res.code > 0) {
  807. GettodaysHourTask(res.data);
  808. }
  809. });
  810. top.learun.httpAsyncGet(top.$.rootUrl + '/' + Tenant + '/AdminDesktopHome/GetHourTask?warehouse=' + tabName, function (res) {
  811. if (res.code > 0) {
  812. GetHourTask(res.data);
  813. }
  814. });
  815. top.learun.httpAsyncGet(top.$.rootUrl + '/' + Tenant + '/Report/GetLocationUsageReportList?queryJson=%7B%7D', function (res) {
  816. if (res.code > 0) {
  817. var datas = [];
  818. var WarehouseCellPie = [];
  819. let MaterilLocation = 0, SpareLocation = 0, StopLocation = 0, LockLocation = 0;
  820. res.data.sort((a, b) => a.Sort - b.Sort)
  821. MaterilLocation += res.data[0].MaterilLocation;
  822. SpareLocation += res.data[0].SpareLocation;
  823. StopLocation += res.data[0].StopLocation;
  824. LockLocation += res.data[0].LockLocation;
  825. datas.push({ tunnel: '桁架一', qty: res.data[1].MaterilLocation, total: res.data[1].AllLocationTotal });
  826. datas.push({ tunnel: '桁架二', qty: res.data[2].MaterilLocation, total: res.data[2].AllLocationTotal });
  827. datas.push({ tunnel: '桁架三', qty: res.data[3].MaterilLocation, total: res.data[3].AllLocationTotal });
  828. //var data = [{ "qty": 16, "total": 1732 }, { "qty": 787, "total": 1732 }, { "qty": 841, "total": 1700 }];
  829. GetTunnelWarehouseCellBar(datas);
  830. WarehouseCellPie.push({ value: MaterilLocation, name: '已使用' });
  831. WarehouseCellPie.push({ value: SpareLocation, name: '空闲' });
  832. WarehouseCellPie.push({ value: StopLocation, name: '禁用' });
  833. WarehouseCellPie.push({ value: LockLocation, name: '锁定' });
  834. GetWarehouseCellPie(WarehouseCellPie);
  835. }
  836. });
  837. GetTaskGoodsTypes(1);
  838. }
  839. function GetTodayTaskInOutPie(data) {
  840. top.learun.httpAsyncGet(top.$.rootUrl + '/' + Tenant + '/AdminDesktopHome/GetTodayTaskInOutPie?bctime=' + data + '&warehouse=' + tabName, function (res) {
  841. if (res.code > 0) {
  842. var datas = [];
  843. for (var i = 0; i < res.data.tasks.length; i++) {
  844. if (res.data.tasks[i].name == '出库') {
  845. $("#" + tabName + "outtoday").text(res.data.tasks[i].value);
  846. datas.push({ value: res.data.tasks[i].value, name: "出库" });
  847. }
  848. else if (res.data.tasks[i].name == '入库') {
  849. $("#" + tabName + "intoday").text(res.data.tasks[i].value);
  850. datas.push({ value: res.data.tasks[i].value, name: "入库" });
  851. }
  852. else if (res.data.tasks[i].name == '移库') {
  853. $("#" + tabName + "movetoday").text(res.data.tasks[i].value);
  854. datas.push({ value: res.data.tasks[i].value, name: "移库" });
  855. }
  856. else if (res.data.tasks[i].name == '组盘') {
  857. $("#" + tabName + "SetPlate").text(res.data.tasks[i].value);
  858. datas.push({ value: res.data.tasks[i].value, name: "组盘" });
  859. }
  860. }
  861. GetTodayInOutPie({ total: res.data.total, datas: datas });
  862. }
  863. });
  864. }
  865. function GetTaskGoodsTypes(data) {
  866. top.learun.httpAsyncGet(top.$.rootUrl + '/' + Tenant + '/AdminDesktopHome/GetTaskGoodsTypes?warehouse=' + tabName + '&bctime=' + data, function (res) {
  867. if (res.code > 0) {
  868. GetTaskGoodsTypesData(res.data);
  869. }
  870. });
  871. }
  872. function GetDailyStatistics(data, begin, end) {
  873. let url = '';
  874. if (data) {
  875. url = top.$.rootUrl + '/' + Tenant + '/AdminDesktopHome/GetDailyStatistics?bctime=' + data + '&begintime=' + begin + '&endtime=' + end;
  876. }
  877. else {
  878. url = top.$.rootUrl + '/' + Tenant + '/AdminDesktopHome/GetDailyStatistics?begintime=' + begin + '&endtime=' + end;
  879. }
  880. top.learun.httpAsyncGet(url, function (res) {
  881. $("#btn_Search").removeAttr('disabled');
  882. if (res.code > 0) {
  883. //
  884. var orderhtml = "";
  885. var orderres = eval(res.data.rows);
  886. $.each(orderres, function (index, orderres) {
  887. orderhtml += "<div style='position:relative;width:100%;'>";
  888. orderhtml += "<label class='portal-panel-content-lable'>" + orderres.WarehouseName + "</label>";
  889. orderhtml += "<label class='portal-panel-content-lable'>" + orderres.TrussNorthQty + "</label>";
  890. orderhtml += "<label class='portal-panel-content-lable'>" + orderres.TrussSouthQty + "</label>";
  891. orderhtml += "<label class='portal-panel-content-lable'>" + orderres.CircularSouthQty + "</label>";
  892. orderhtml += "<label class='portal-panel-content-lable'>" + orderres.CircularNorthQty + "</label>";
  893. orderhtml += "<label class='portal-panel-content-lable'>" + orderres.DailySummary + "</label>";
  894. orderhtml += "<label class='portal-panel-content-lable'>" + orderres.FullNormalQty + "</label>";
  895. orderhtml += "<label class='portal-panel-content-lable'>" + orderres.EmptyAbnormalQty + "</label>";
  896. orderhtml += "<label class='portal-panel-content-lable'>" + orderres.EmptyAutomaticQty + "</label>";
  897. orderhtml += "<label class='portal-panel-content-lable'>" + orderres.EmptyWarehouseQty + "</label>";
  898. orderhtml += "</div>";
  899. });
  900. $("#dailylst").html(orderhtml);
  901. }
  902. });
  903. }
  904. function bind() {
  905. $('#dailybegin').val(YStartDate);
  906. $('#dailyend').val(YEndDate);
  907. $('.' + tabName + 'todaytask').on('click', function () {
  908. let bctime = $(this).attr("bctime");
  909. for (var i = 0; i < $("." + tabName + "todaytask").length; i++) {
  910. $($("." + tabName + "todaytask")[i]).removeClass("btn-primary");
  911. $($("." + tabName + "todaytask")[i]).addClass("btn-default");
  912. }
  913. $(this).removeClass("btn-default");
  914. $(this).addClass("btn-primary");
  915. GetTodayTaskInOutPie(bctime);
  916. });
  917. $('.' + tabName + 'todaytype').on('click', function () {
  918. let bctime = $(this).attr("bctime");
  919. for (var i = 0; i < $("." + tabName + "todaytype").length; i++) {
  920. $($("." + tabName + "todaytype")[i]).removeClass("btn-primary");
  921. $($("." + tabName + "todaytype")[i]).addClass("btn-default");
  922. }
  923. $(this).removeClass("btn-default");
  924. $(this).addClass("btn-primary");
  925. GetTaskGoodsTypes(bctime);
  926. });
  927. $('.fjdailytime').on('click', function () {
  928. let bctime = $(this).attr("bctime");
  929. for (var i = 0; i < $(".fjdailytime").length; i++) {
  930. $($(".fjdailytime")[i]).removeClass("btn-primary");
  931. $($(".fjdailytime")[i]).addClass("btn-default");
  932. }
  933. $(this).removeClass("btn-default");
  934. $(this).addClass("btn-primary");
  935. GetDailyStatistics(bctime, '', '');
  936. });
  937. //$('#lr_left_list a').click(function (e) {
  938. // $(this).tab('show');
  939. //})
  940. $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
  941. // 获取已激活的标签页的名称
  942. //tabName = $(e.target).text();
  943. var seltab = $(e.target).attr("tabvalue");
  944. tabName = "fj" + seltab;
  945. if (seltab == 'daily') {
  946. $('.' + tabName + 'time' + ':first')[0].click();
  947. return;
  948. }
  949. $('.' + tabName + 'todaytask').on('click', function () {
  950. let bctime = $(this).attr("bctime");
  951. for (var i = 0; i < $("." + tabName + "todaytask").length; i++) {
  952. $($("." + tabName + "todaytask")[i]).removeClass("btn-primary");
  953. $($("." + tabName + "todaytask")[i]).addClass("btn-default");
  954. }
  955. $(this).removeClass("btn-default");
  956. $(this).addClass("btn-primary");
  957. GetTodayTaskInOutPie(bctime);
  958. });
  959. $('.' + tabName + 'todaytype').on('click', function () {
  960. let bctime = $(this).attr("bctime");
  961. for (var i = 0; i < $("." + tabName + "todaytype").length; i++) {
  962. $($("." + tabName + "todaytype")[i]).removeClass("btn-primary");
  963. $($("." + tabName + "todaytype")[i]).addClass("btn-default");
  964. }
  965. $(this).removeClass("btn-default");
  966. $(this).addClass("btn-primary");
  967. GetTaskGoodsTypes(bctime);
  968. });
  969. init();
  970. $('.' + tabName + 'todaytask' + ':first')[0].click();
  971. $('.' + tabName + 'todaytype' + ':first')[0].click();
  972. });
  973. // 查询
  974. $('#btn_Search').on('click', function () {
  975. var begin = $('#dailybegin').val();
  976. var end = $('#dailyend').val();
  977. if (begin.length <= 0) {
  978. alert('时间输入不能为空!');
  979. return;
  980. }
  981. if (end.length <= 0) {
  982. alert('时间输入不能为空!');
  983. return;
  984. }
  985. $("#btn_Search").attr('disabled', true);
  986. GetDailyStatistics(null, begin, end);
  987. //top.learun.httpAsyncGet(top.$.rootUrl + '/' + Tenant + '/AdminDesktopHome/GetDailyStatistics?begintime=' + begin + '&endtime=' + begin, function (res) {
  988. // if (res.code > 0) {
  989. // //
  990. // var orderhtml = "";
  991. // var orderres = eval(res.data.rows);
  992. // $.each(orderres, function (index, orderres) {
  993. // orderhtml += "<div style='position:relative;width:100%;'>";
  994. // orderhtml += "<label class='portal-panel-content-lable'>" + orderres.WarehouseName + "</label>";
  995. // orderhtml += "<label class='portal-panel-content-lable'>" + orderres.TrussNorthQty + "</label>";
  996. // orderhtml += "<label class='portal-panel-content-lable'>" + orderres.TrussSouthQty + "</label>";
  997. // orderhtml += "<label class='portal-panel-content-lable'>" + orderres.CircularSouthQty + "</label>";
  998. // orderhtml += "<label class='portal-panel-content-lable'>" + orderres.CircularNorthQty + "</label>";
  999. // orderhtml += "<label class='portal-panel-content-lable'>" + orderres.DailySummary + "</label>";
  1000. // orderhtml += "<label class='portal-panel-content-lable'>" + orderres.FullNormalQty + "</label>";
  1001. // orderhtml += "<label class='portal-panel-content-lable'>" + orderres.EmptyAbnormalQty + "</label>";
  1002. // orderhtml += "<label class='portal-panel-content-lable'>" + orderres.EmptyAutomaticQty + "</label>";
  1003. // orderhtml += "<label class='portal-panel-content-lable'>" + orderres.EmptyWarehouseQty + "</label>";
  1004. // orderhtml += "</div>";
  1005. // });
  1006. // $("#dailylst").html(orderhtml);
  1007. // }
  1008. //});
  1009. });
  1010. }
  1011. bind();
  1012. init();
  1013. });