warehouseTwo.html 41 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8" />
  5. <meta name="viewport" content="width=1920" />
  6. <title>无人线边仓库看板</title>
  7. <link rel="stylesheet" href="./css/common.css" />
  8. <link rel="stylesheet" href="./css/board2.css" />
  9. <script type="text/javascript" src="./plugin/jquery.min.js"></script>
  10. <script type="text/javascript" src="./plugin/echarts.min.js"></script>
  11. <script type="text/javascript" src="./plugin/vue.min.js"></script>
  12. <script type="text/javascript" src="./js/util.js"></script>
  13. <script type="text/javascript" src="./js/common.js"></script>
  14. <script src="./plugin/datav.min.js"></script>
  15. <script type="text/javascript" src="./js/chart.js"></script>
  16. </head>
  17. <script>
  18. $(window).load(function () {
  19. $(".loading").fadeOut();
  20. });
  21. //动态设置视口
  22. const setSize = () => {
  23. // 获取html元素
  24. const html = document.getElementsByTagName("html")[0];
  25. // 获取屏幕宽度
  26. const pageWidth = html.getBoundingClientRect().width;
  27. // 动态计算字体大小(rem)
  28. html.style.fontSize = pageWidth / 20 + "px";
  29. };
  30. setSize();
  31. window.addEventListener("resize", setSize, false);
  32. </script>
  33. <body>
  34. <div class="loading">
  35. <div class="load_box">
  36. <img src="./images/loading.gif" /> 看板加载中,请稍等...
  37. </div>
  38. </div>
  39. <div id="app" class="container">
  40. <div class="head">
  41. <h1>无人线边仓库看板</h1>
  42. <span id="showTime"></span>
  43. </div>
  44. <div class="box">
  45. <span class="title maintain-title">工装设备维修记录</span>
  46. <span class="maintain maintain-all"
  47. >当月维修总数:{{repairDatas.repairQuantity}}</span
  48. >
  49. <span class="maintain maintain-complete"
  50. >已维修数:{{repairDatas.repairCompletedQuantity}}</span
  51. >
  52. <span class="maintain maintain-incomplete"
  53. >待维修数:{{repairDatas.repairUncompletedQuantity}}</span
  54. >
  55. <div>
  56. <dv-scroll-board
  57. ref="scrollBoard1"
  58. style="
  59. height: 2.2rem;
  60. position: absolute;
  61. width: 5.2rem;
  62. top: 1.06rem;
  63. left: 0.3rem;
  64. "
  65. :config="maintainConfig"
  66. />
  67. </div>
  68. </div>
  69. <div class="box">
  70. <span class="title checkout-title">工装设备检验记录</span>
  71. <span class="checkout checkout-all"
  72. >当月检验总数:{{checkoutDatas.inspectionQuantity}}</span
  73. >
  74. <span class="checkout checkout-complete"
  75. >已检验数:{{checkoutDatas.inspectionCompletedQuantity}}</span
  76. >
  77. <span class="checkout checkout-incomplete"
  78. >待检验数:{{checkoutDatas.inspectionUncompletedQuantity}}</span
  79. >
  80. <div>
  81. <dv-scroll-board
  82. ref="scrollBoard2"
  83. style="
  84. height: 2.2rem;
  85. position: absolute;
  86. width: 5.2rem;
  87. top: 4.7rem;
  88. left: 0.3rem;
  89. "
  90. :config="checkoutConfig"
  91. />
  92. </div>
  93. </div>
  94. <div class="box">
  95. <span class="title check-title">工装设备检验图表</span>
  96. <div
  97. style="
  98. height: 2.5rem;
  99. position: absolute;
  100. width: 4.86rem;
  101. top: 7.9rem;
  102. left: 0.44rem;
  103. "
  104. id="checkoutChart"
  105. ></div>
  106. </div>
  107. <div class="box">
  108. <span class="title inventory-name">{{ inventoryDatas.name }}</span>
  109. <span class="inventory clamp-all">工装总数</span>
  110. <span class="inventory clamp-all-count"
  111. >{{ inventoryDatas.clampQuantity }}</span
  112. >
  113. <span class="inventory clamp-complete">已盘数</span>
  114. <span class="inventory clamp-complete-count"
  115. >{{ inventoryDatas.clampInventoriedQuantity }}</span
  116. >
  117. <span class="inventory clamp-incomplete">未盘数</span>
  118. <span class="inventory clamp-incomplete-count"
  119. >{{ inventoryDatas.clampNotInventoriedQuantity }}</span
  120. >
  121. <span class="inventory device-all">设备总数</span>
  122. <span class="inventory device-all-count"
  123. >{{ inventoryDatas.instrumentQuantity }}</span
  124. >
  125. <span class="inventory device-complete">已盘数</span>
  126. <span class="inventory device-complete-count"
  127. >{{ inventoryDatas.instrumentInventoriedQuantity }}</span
  128. >
  129. <span class="inventory device-incomplete">未盘数</span>
  130. <span class="inventory device-incomplete-count"
  131. >{{ inventoryDatas.instrumentNotInventoriedQuantity }}</span
  132. >
  133. </div>
  134. <div class="box">
  135. <span class="title agv-task-title">AGV 任务执行记录</span>
  136. <div>
  137. <dv-scroll-board
  138. ref="scrollBoard3"
  139. style="
  140. height: 2.8rem;
  141. position: absolute;
  142. width: 7.8rem;
  143. top: 7.4rem;
  144. left: 6rem;
  145. "
  146. :config="agvTaskConfig"
  147. />
  148. </div>
  149. </div>
  150. <div class="box">
  151. <span class="title agv-year-title">AGV 年任务统计</span>
  152. <div
  153. style="
  154. height: 3rem;
  155. position: absolute;
  156. width: 5.6rem;
  157. top: 0.82rem;
  158. right: 0.1rem;
  159. "
  160. id="agvYearChart"
  161. ></div>
  162. </div>
  163. <div class="box">
  164. <span class="title agv-record-title">AGV 任务执行统计</span>
  165. <div
  166. style="
  167. height: 2.5rem;
  168. position: absolute;
  169. width: 4.86rem;
  170. top: 4.3rem;
  171. right: 0.44rem;
  172. "
  173. id="agvTotalChart"
  174. ></div>
  175. </div>
  176. <div class="box">
  177. <span class="title device-time-title">设备使用时长</span>
  178. <div>
  179. <dv-scroll-board
  180. ref="scrollBoard4"
  181. style="
  182. height: 2.3rem;
  183. position: absolute;
  184. width: 5rem;
  185. top: 7.86rem;
  186. right: 0.4rem;
  187. "
  188. :config="deviceTimeConfig"
  189. />
  190. </div>
  191. </div>
  192. </div>
  193. <div class="back"></div>
  194. <script>
  195. var app = new Vue({
  196. el: "#app",
  197. data() {
  198. return {
  199. timer: null,
  200. checkoutChart: null,
  201. agvYearChart: null,
  202. agvTotalChart: null,
  203. chartDatas: null,
  204. maintainConfig: {
  205. header: [
  206. // '<span style="color:#ffffff;font-size:0.14rem">序号</span>',
  207. '<span style="color:#ffffff;font-size:0.14rem">名称</span>',
  208. '<span style="color:#ffffff;font-size:0.14rem">类型</span>',
  209. '<span style="color:#ffffff;font-size:0.14rem">维修原因</span>',
  210. '<span style="color:#ffffff;font-size:0.14rem">维修时间</span>',
  211. ],
  212. columnWidth: [140, 80, 120, 140],
  213. data: [],
  214. align: ["center", "center", "center", "center"],
  215. headerBGC: "transparent",
  216. oddRowBGC: "transparent",
  217. evenRowBGC: "transparent",
  218. },
  219. checkoutConfig: {
  220. header: [
  221. // '<span style="color:#ffffff;font-size:0.14rem">序号</span>',
  222. '<span style="color:#ffffff;font-size:0.14rem">名称</span>',
  223. '<span style="color:#ffffff;font-size:0.14rem">类型</span>',
  224. '<span style="color:#ffffff;font-size:0.14rem">送检时间</span>',
  225. '<span style="color:#ffffff;font-size:0.14rem">返回时间</span>',
  226. ],
  227. columnWidth: [140, 80, 120, 140],
  228. data: [],
  229. align: ["center", "center", "center", "center"],
  230. headerBGC: "transparent",
  231. oddRowBGC: "transparent",
  232. evenRowBGC: "transparent",
  233. },
  234. agvTaskConfig: {
  235. header: [
  236. // '<span style="color:#ffffff;font-size:0.14rem">序号</span>',
  237. '<span style="color:#ffffff;font-size:0.14rem">名称</span>',
  238. '<span style="color:#ffffff;font-size:0.14rem">类型</span>',
  239. // '<span style="color:#ffffff;font-size:0.14rem">状态</span>',
  240. '<span style="color:#ffffff;font-size:0.14rem">起点位置</span>',
  241. '<span style="color:#ffffff;font-size:0.14rem">终点位置</span>',
  242. '<span style="color:#ffffff;font-size:0.14rem">下达时间</span>',
  243. // '<span style="color:#ffffff;font-size:0.14rem">执行时间</span>',
  244. '<span style="color:#ffffff;font-size:0.14rem">完成时间</span>',
  245. ],
  246. columnWidth: [120, 110, 90, 90, 160, 160],
  247. data: [],
  248. align: [
  249. "center",
  250. "center",
  251. "center",
  252. "center",
  253. "center",
  254. "center",
  255. // "center",
  256. ],
  257. headerBGC: "transparent",
  258. oddRowBGC: "transparent",
  259. evenRowBGC: "transparent",
  260. },
  261. deviceTimeConfig: {
  262. header: [
  263. // '<span style="color:#ffffff;font-size:0.14rem">序号</span>',
  264. '<span style="color:#ffffff;font-size:0.14rem">名称</span>',
  265. '<span style="color:#ffffff;font-size:0.14rem">编号</span>',
  266. '<span style="color:#ffffff;font-size:0.14rem">类型</span>',
  267. '<span style="color:#ffffff;font-size:0.14rem">使用时长</span>',
  268. ],
  269. columnWidth: [140, 160, 70, 126],
  270. data: [],
  271. align: ["center", "center", "center", "center"],
  272. headerBGC: "transparent",
  273. oddRowBGC: "transparent",
  274. evenRowBGC: "transparent",
  275. },
  276. tableDatas: [],
  277. repairDatas: {},
  278. repairLineDatas: [],
  279. checkoutDatas: {},
  280. checkoutLineDatas: [],
  281. inventoryDatas: {},
  282. chartDatas: [],
  283. agvTaskDatas: [],
  284. agvMonthDatas: [],
  285. useTimeData: [],
  286. agvComplete: 0,
  287. agvUnComplete: 0,
  288. };
  289. },
  290. methods: {
  291. // 获取当前展示的仓库id
  292. getWarehouseId() {
  293. const _self = this;
  294. const params = getQueryString();
  295. _self.warehouseId = params.warehouseId;
  296. },
  297. // 绘制工装设备检验图
  298. createCheckoutChart() {
  299. const _self = this;
  300. const checkoutOption = drawCheckoutChart();
  301. initChart(_self.checkoutChart, checkoutOption);
  302. },
  303. // 绘制Agv年任务统计图
  304. createAgvYearChart() {
  305. const _self = this;
  306. const agvYearOption = drawAgvYearChart();
  307. initChart(_self.agvYearChart, agvYearOption);
  308. },
  309. // 绘制AGV任务执行统计图
  310. createAgvTotalChart() {
  311. const _self = this;
  312. const agvTotalOption = drawAgvTotalChart();
  313. initChart(_self.agvTotalChart, agvTotalOption);
  314. },
  315. // 获取看板信息
  316. getWarehouseInfo() {
  317. const _self = this;
  318. const url = "/api/InventoryRepairResource/queryBoardData";
  319. const params = [["warehouseId", _self.warehouseId]];
  320. // const success = {
  321. // errorCode: 0,
  322. // errorMessage: null,
  323. // data: {
  324. // cfCheckVouchBoardResponse: {
  325. // checkVouchId: 643723837739072,
  326. // name: "测试盘点单",
  327. // documentNo: "20260100001",
  328. // warehouseId: null,
  329. // warehouseName: "CF",
  330. // clampQuantity: 0,
  331. // clampInventoriedQuantity: 0,
  332. // clampNotInventoriedQuantity: 0,
  333. // instrumentQuantity: 0,
  334. // instrumentInventoriedQuantity: 0,
  335. // instrumentNotInventoriedQuantity: 0,
  336. // },
  337. // cfInventoryRepairBoardResponse: {
  338. // repairQuantity: 8,
  339. // repairCompletedQuantity: 6,
  340. // repairUncompletedQuantity: 2,
  341. // cfInventoryRepairLineBoardResponses: [
  342. // {
  343. // index: 1,
  344. // name: "测试工装01489",
  345. // no: "01489",
  346. // type: "工装",
  347. // repairReason: "ces234",
  348. // repairTime: "2026-01-30 00:00:00",
  349. // completeRepairTime: "2026-01-22 00:00:00",
  350. // },
  351. // {
  352. // index: 2,
  353. // name: "测试设备02991",
  354. // no: "02991",
  355. // type: "设备",
  356. // repairReason: "ces3",
  357. // repairTime: "2026-01-29 00:00:00",
  358. // completeRepairTime: "2026-01-30 00:00:00",
  359. // },
  360. // {
  361. // index: 3,
  362. // name: "测试工装01492",
  363. // no: "01492",
  364. // type: "工装",
  365. // repairReason: "坏了送去维修",
  366. // repairTime: "2026-01-22 00:00:00",
  367. // completeRepairTime: "2026-01-23 00:00:00",
  368. // },
  369. // {
  370. // index: 4,
  371. // name: "测试工装01485",
  372. // no: "01485",
  373. // type: "工装",
  374. // repairReason: "测试123",
  375. // repairTime: "2026-01-21 00:00:00",
  376. // completeRepairTime: "2026-01-22 00:00:00",
  377. // },
  378. // {
  379. // index: 5,
  380. // name: "测试设备02996",
  381. // no: "02996",
  382. // type: "设备",
  383. // repairReason: "1111111111111",
  384. // repairTime: "2026-01-21 00:00:00",
  385. // completeRepairTime: null,
  386. // },
  387. // {
  388. // index: 6,
  389. // name: "测试工装01393",
  390. // no: "01393",
  391. // type: "工装",
  392. // repairReason: null,
  393. // repairTime: "2026-01-20 00:00:00",
  394. // completeRepairTime: "2026-01-21 00:00:00",
  395. // },
  396. // {
  397. // index: 7,
  398. // name: "测试工装01497",
  399. // no: "01497",
  400. // type: "工装",
  401. // repairReason: "2222222",
  402. // repairTime: "2026-01-19 00:00:00",
  403. // completeRepairTime: null,
  404. // },
  405. // {
  406. // index: 8,
  407. // name: "测试设备03000",
  408. // no: "03000",
  409. // type: "设备",
  410. // repairReason: "测试1",
  411. // repairTime: "2026-01-11 00:00:00",
  412. // completeRepairTime: "2026-01-13 00:00:00",
  413. // },
  414. // ],
  415. // },
  416. // cfInventoryInspectionBoardResponse: {
  417. // inspectionQuantity: 6,
  418. // inspectionCompletedQuantity: 4,
  419. // inspectionUncompletedQuantity: 2,
  420. // cfInventoryInspectionLineBoardResponses: [
  421. // {
  422. // index: 1,
  423. // name: "测试设备02996",
  424. // no: "02996",
  425. // type: "设备",
  426. // inspectionReason: "需要检验",
  427. // inspectionTime: "2026-01-27 00:00:00",
  428. // completeInspectionTime: null,
  429. // },
  430. // {
  431. // index: 2,
  432. // name: "测试设备02982",
  433. // no: "02982",
  434. // type: "设备",
  435. // inspectionReason: "需要检验",
  436. // inspectionTime: "2026-01-24 00:00:00",
  437. // completeInspectionTime: "2026-01-25 00:00:00",
  438. // },
  439. // {
  440. // index: 3,
  441. // name: "测试工装01496",
  442. // no: "01496",
  443. // type: "工装",
  444. // inspectionReason: "这是一个测试",
  445. // inspectionTime: "2026-01-21 00:00:00",
  446. // completeInspectionTime: null,
  447. // },
  448. // {
  449. // index: 4,
  450. // name: "测试设备02995",
  451. // no: "02995",
  452. // type: "设备",
  453. // inspectionReason: "需要检验",
  454. // inspectionTime: "2026-01-21 00:00:00",
  455. // completeInspectionTime: "2026-01-22 00:00:00",
  456. // },
  457. // {
  458. // index: 5,
  459. // name: "测试工装01491",
  460. // no: "01491",
  461. // type: "工装",
  462. // inspectionReason: "这是一个测试",
  463. // inspectionTime: "2026-01-20 00:00:00",
  464. // completeInspectionTime: "2026-01-21 00:00:00",
  465. // },
  466. // {
  467. // index: 6,
  468. // name: "测试工装01493",
  469. // no: "01493",
  470. // type: "工装",
  471. // inspectionReason: "这是一个测试",
  472. // inspectionTime: "2026-01-10 00:00:00",
  473. // completeInspectionTime: "2026-01-29 00:00:00",
  474. // },
  475. // ],
  476. // },
  477. // cfInventoryChartBoardResponse: {
  478. // cfInventoryChartClampLineBoardResponses: [
  479. // {
  480. // monthName: "2026-1",
  481. // quantity: 3,
  482. // },
  483. // {
  484. // monthName: "2025-12",
  485. // quantity: 0,
  486. // },
  487. // {
  488. // monthName: "2025-11",
  489. // quantity: 0,
  490. // },
  491. // {
  492. // monthName: "2025-10",
  493. // quantity: 0,
  494. // },
  495. // {
  496. // monthName: "2025-9",
  497. // quantity: 0,
  498. // },
  499. // {
  500. // monthName: "2025-8",
  501. // quantity: 0,
  502. // },
  503. // {
  504. // monthName: "2025-7",
  505. // quantity: 0,
  506. // },
  507. // {
  508. // monthName: "2025-6",
  509. // quantity: 0,
  510. // },
  511. // {
  512. // monthName: "2025-5",
  513. // quantity: 0,
  514. // },
  515. // {
  516. // monthName: "2025-4",
  517. // quantity: 0,
  518. // },
  519. // {
  520. // monthName: "2025-3",
  521. // quantity: 0,
  522. // },
  523. // {
  524. // monthName: "2025-2",
  525. // quantity: 0,
  526. // },
  527. // ],
  528. // cfInventoryChartInstrumentLineBoardResponses: [
  529. // {
  530. // monthName: "2026-1",
  531. // quantity: 3,
  532. // },
  533. // {
  534. // monthName: "2025-12",
  535. // quantity: 0,
  536. // },
  537. // {
  538. // monthName: "2025-11",
  539. // quantity: 0,
  540. // },
  541. // {
  542. // monthName: "2025-10",
  543. // quantity: 0,
  544. // },
  545. // {
  546. // monthName: "2025-9",
  547. // quantity: 0,
  548. // },
  549. // {
  550. // monthName: "2025-8",
  551. // quantity: 0,
  552. // },
  553. // {
  554. // monthName: "2025-7",
  555. // quantity: 0,
  556. // },
  557. // {
  558. // monthName: "2025-6",
  559. // quantity: 0,
  560. // },
  561. // {
  562. // monthName: "2025-5",
  563. // quantity: 0,
  564. // },
  565. // {
  566. // monthName: "2025-4",
  567. // quantity: 0,
  568. // },
  569. // {
  570. // monthName: "2025-3",
  571. // quantity: 0,
  572. // },
  573. // {
  574. // monthName: "2025-2",
  575. // quantity: 0,
  576. // },
  577. // ],
  578. // },
  579. // cfInventoryAgvBoardResponse: {
  580. // completeQuantity: 25,
  581. // incompleteQuantity: 0,
  582. // agvTaskList: [
  583. // {
  584. // type: "成品下架",
  585. // createTime: "2026-01-20 18:32:19",
  586. // executeTime: "2026-01-20 18:32:20",
  587. // endTime: "2026-01-20 18:32:25",
  588. // agvName: "LeanwoAGV",
  589. // status: "已完成",
  590. // positionNo: "LT-1-2",
  591. // positionEndNo: "SD-1-1",
  592. // },
  593. // {
  594. // type: "料箱上架",
  595. // createTime: "2026-01-20 18:31:53",
  596. // executeTime: "2026-01-20 18:32:00",
  597. // endTime: "2026-01-20 18:32:05",
  598. // agvName: "LeanwoAGV",
  599. // status: "已完成",
  600. // positionNo: "SL-1-1",
  601. // positionEndNo: "LT-1-2",
  602. // },
  603. // {
  604. // type: "成品下架",
  605. // createTime: "2026-01-20 18:30:31",
  606. // executeTime: "2026-01-20 18:30:40",
  607. // endTime: "2026-01-20 18:30:45",
  608. // agvName: "LeanwoAGV",
  609. // status: "已完成",
  610. // positionNo: "LT-1-2",
  611. // positionEndNo: "SD-1-1",
  612. // },
  613. // {
  614. // type: "料箱上架",
  615. // createTime: "2026-01-20 18:29:34",
  616. // executeTime: "2026-01-20 18:29:40",
  617. // endTime: "2026-01-20 18:29:45",
  618. // agvName: "LeanwoAGV",
  619. // status: "已完成",
  620. // positionNo: "SL-1-1",
  621. // positionEndNo: "LT-1-2",
  622. // },
  623. // {
  624. // type: "成品下架",
  625. // createTime: "2026-01-20 18:18:48",
  626. // executeTime: "2026-01-20 18:19:00",
  627. // endTime: "2026-01-20 18:26:02",
  628. // agvName: "LeanwoAGV",
  629. // status: "已完成",
  630. // positionNo: "LT-1-2",
  631. // positionEndNo: "SD-1-1",
  632. // },
  633. // {
  634. // type: "料箱上架",
  635. // createTime: "2026-01-20 18:17:04",
  636. // executeTime: "2026-01-20 18:17:10",
  637. // endTime: "2026-01-20 18:17:16",
  638. // agvName: "LeanwoAGV",
  639. // status: "已完成",
  640. // positionNo: "SL-1-1",
  641. // positionEndNo: "LT-1-2",
  642. // },
  643. // {
  644. // type: "成品下架",
  645. // createTime: "2026-01-20 18:05:38",
  646. // executeTime: "2026-01-20 18:06:23",
  647. // endTime: "2026-01-20 18:08:29",
  648. // agvName: "LeanwoAGV",
  649. // status: "已完成",
  650. // positionNo: "LT-1-2",
  651. // positionEndNo: "SD-1-1",
  652. // },
  653. // {
  654. // type: "料箱上架",
  655. // createTime: "2026-01-20 18:03:20",
  656. // executeTime: "2026-01-20 18:03:30",
  657. // endTime: "2026-01-20 18:03:36",
  658. // agvName: "LeanwoAGV",
  659. // status: "已完成",
  660. // positionNo: "SL-1-1",
  661. // positionEndNo: "LT-1-2",
  662. // },
  663. // {
  664. // type: "成品下架",
  665. // createTime: "2026-01-20 17:59:52",
  666. // executeTime: "2026-01-20 18:00:00",
  667. // endTime: "2026-01-20 18:00:05",
  668. // agvName: "LeanwoAGV",
  669. // status: "已完成",
  670. // positionNo: "LT-1-2",
  671. // positionEndNo: "SD-1-1",
  672. // },
  673. // {
  674. // type: "料箱上架",
  675. // createTime: "2026-01-20 17:57:24",
  676. // executeTime: "2026-01-20 17:57:30",
  677. // endTime: "2026-01-20 17:57:35",
  678. // agvName: "LeanwoAGV",
  679. // status: "已完成",
  680. // positionNo: "SL-1-1",
  681. // positionEndNo: "LT-1-2",
  682. // },
  683. // ],
  684. // agvMonthTaskList: [
  685. // {
  686. // monthName: "2026-1",
  687. // groundCount: 2,
  688. // stereoscopicCount: 23,
  689. // },
  690. // {
  691. // monthName: "2025-12",
  692. // groundCount: 0,
  693. // stereoscopicCount: 0,
  694. // },
  695. // {
  696. // monthName: "2025-11",
  697. // groundCount: 0,
  698. // stereoscopicCount: 0,
  699. // },
  700. // {
  701. // monthName: "2025-10",
  702. // groundCount: 0,
  703. // stereoscopicCount: 0,
  704. // },
  705. // {
  706. // monthName: "2025-9",
  707. // groundCount: 0,
  708. // stereoscopicCount: 0,
  709. // },
  710. // {
  711. // monthName: "2025-8",
  712. // groundCount: 0,
  713. // stereoscopicCount: 0,
  714. // },
  715. // {
  716. // monthName: "2025-7",
  717. // groundCount: 0,
  718. // stereoscopicCount: 0,
  719. // },
  720. // {
  721. // monthName: "2025-6",
  722. // groundCount: 0,
  723. // stereoscopicCount: 0,
  724. // },
  725. // {
  726. // monthName: "2025-5",
  727. // groundCount: 0,
  728. // stereoscopicCount: 0,
  729. // },
  730. // {
  731. // monthName: "2025-4",
  732. // groundCount: 0,
  733. // stereoscopicCount: 0,
  734. // },
  735. // {
  736. // monthName: "2025-3",
  737. // groundCount: 0,
  738. // stereoscopicCount: 0,
  739. // },
  740. // {
  741. // monthName: "2025-2",
  742. // groundCount: 0,
  743. // stereoscopicCount: 0,
  744. // },
  745. // ],
  746. // },
  747. // cfInventoryUseTimeBoardResponse: [
  748. // {
  749. // invName: "测试工装00002",
  750. // invNo: "00002",
  751. // type: "工装",
  752. // useTime: "19天5时49分",
  753. // },
  754. // {
  755. // invName: "测试工装00001",
  756. // invNo: "00001",
  757. // type: "工装",
  758. // useTime: "18天22时48分",
  759. // },
  760. // {
  761. // invName: "测试工装00015",
  762. // invNo: "00015",
  763. // type: "工装",
  764. // useTime: "17天6时46分",
  765. // },
  766. // {
  767. // invName: "工装101",
  768. // invNo: "62255351027308800009",
  769. // type: "工装",
  770. // useTime: "15天2时23分",
  771. // },
  772. // {
  773. // invName: "工装-1",
  774. // invNo: "62255351027308800002",
  775. // type: "工装",
  776. // useTime: "3天22时31分",
  777. // },
  778. // ],
  779. // },
  780. // };
  781. ajaxGet(url, params).then((success) => {
  782. if (success.errorCode === 0) {
  783. const {
  784. cfCheckVouchBoardResponse,
  785. cfInventoryRepairBoardResponse,
  786. } = success.data;
  787. const {
  788. cfInventoryInspectionBoardResponse,
  789. cfInventoryChartBoardResponse,
  790. cfInventoryAgvBoardResponse,
  791. cfInventoryUseTimeBoardResponse,
  792. } = success.data;
  793. _self.updateInventory(cfCheckVouchBoardResponse);
  794. _self.updateRepair(
  795. cfInventoryRepairBoardResponse.cfInventoryRepairLineBoardResponses,
  796. );
  797. _self.updateCheck(
  798. cfInventoryInspectionBoardResponse.cfInventoryInspectionLineBoardResponses,
  799. );
  800. _self.updateCount(
  801. cfInventoryRepairBoardResponse,
  802. cfInventoryInspectionBoardResponse,
  803. );
  804. _self.updateChart(cfInventoryChartBoardResponse);
  805. _self.updateAgvTask(cfInventoryAgvBoardResponse.agvTaskList);
  806. _self.updateAgvMonthTask(
  807. cfInventoryAgvBoardResponse.agvMonthTaskList,
  808. );
  809. _self.updateAgvTotalTask(
  810. cfInventoryAgvBoardResponse.completeQuantity,
  811. cfInventoryAgvBoardResponse.incompleteQuantity,
  812. );
  813. _self.updateUseTime(cfInventoryUseTimeBoardResponse);
  814. } else {
  815. console.log(success.errorMessage);
  816. }
  817. });
  818. },
  819. // 更新盘点单信息
  820. updateInventory(dtos) {
  821. const _self = this;
  822. if (!isObjectEqual(dtos, _self.inventoryDatas)) {
  823. _self.inventoryDatas = dtos;
  824. }
  825. },
  826. // 更新维修单信息
  827. updateRepair(dtos) {
  828. const _self = this;
  829. if (!isObjectEqual(dtos, _self.repairLineDatas)) {
  830. const processedData = dtos.map((item, index) => {
  831. return [
  832. // index + 1,
  833. item.name || "",
  834. item.type || "",
  835. item.repairReason || "",
  836. item.completeRepairTime
  837. ? item.completeRepairTime.substring(0, 10)
  838. : "",
  839. ];
  840. });
  841. _self.maintainConfig.data = JSON.parse(
  842. JSON.stringify(processedData),
  843. );
  844. // 强制更新组件
  845. _self.$nextTick(() => {
  846. if (_self.$refs.scrollBoard1) {
  847. _self.$refs.scrollBoard1.updateRows(
  848. _self.maintainConfig.data,
  849. );
  850. }
  851. });
  852. _self.repairLineDatas = dtos;
  853. }
  854. },
  855. // 更新检验单信息
  856. updateCheck(dtos) {
  857. const _self = this;
  858. if (!isObjectEqual(dtos, _self.checkoutLineDatas)) {
  859. const processedData = dtos.map((item, index) => {
  860. return [
  861. // index + 1,
  862. item.name || "",
  863. item.type || "",
  864. item.inspectionTime
  865. ? item.inspectionTime.substring(0, 10)
  866. : "",
  867. item.completeInspectionTime
  868. ? item.completeInspectionTime.substring(0, 10)
  869. : "",
  870. ];
  871. });
  872. _self.checkoutConfig.data = JSON.parse(
  873. JSON.stringify(processedData),
  874. );
  875. // 强制更新组件
  876. _self.$nextTick(() => {
  877. if (_self.$refs.scrollBoard2) {
  878. _self.$refs.scrollBoard2.updateRows(
  879. _self.checkoutConfig.data,
  880. );
  881. }
  882. });
  883. _self.checkoutLineDatas = dtos;
  884. }
  885. },
  886. // 更新维修检查数量
  887. updateCount(repair, checkout) {
  888. const _self = this;
  889. const repairCount = {
  890. repairQuantity: repair.repairQuantity,
  891. repairCompletedQuantity: repair.repairCompletedQuantity,
  892. repairUncompletedQuantity: repair.repairUncompletedQuantity,
  893. };
  894. const checkoutCount = {
  895. inspectionQuantity: checkout.inspectionQuantity,
  896. inspectionCompletedQuantity: checkout.inspectionCompletedQuantity,
  897. inspectionUncompletedQuantity:
  898. checkout.inspectionUncompletedQuantity,
  899. };
  900. if (!isObjectEqual(repairCount, _self.repairDatas)) {
  901. _self.repairDatas = repairCount;
  902. }
  903. if (!isObjectEqual(checkoutCount, _self.checkoutDatas)) {
  904. _self.checkoutDatas = checkoutCount;
  905. }
  906. },
  907. // 更新agv任务列表
  908. updateAgvTask(dtos) {
  909. const _self = this;
  910. if (!isObjectEqual(dtos, _self.agvTaskDatas)) {
  911. const processedData = dtos.map((item, index) => {
  912. return [
  913. // index + 1,
  914. item.agvName || "",
  915. item.type || "",
  916. item.positionNo || "",
  917. item.positionEndNo || "",
  918. item.createTime || "",
  919. // item.executeTime || "",
  920. item.endTime || "",
  921. ];
  922. });
  923. _self.agvTaskConfig.data = JSON.parse(
  924. JSON.stringify(processedData),
  925. );
  926. // 强制更新组件
  927. _self.$nextTick(() => {
  928. if (_self.$refs.scrollBoard3) {
  929. _self.$refs.scrollBoard3.updateRows(_self.agvTaskConfig.data);
  930. }
  931. });
  932. _self.agvTaskDatas = dtos;
  933. }
  934. },
  935. // 更新工装设备检验表数据
  936. updateChart(dtos) {
  937. const _self = this;
  938. if (!isObjectEqual(dtos, _self.chartDatas)) {
  939. // 工装数据
  940. const clampData =
  941. dtos.cfInventoryChartClampLineBoardResponses || [];
  942. // 设备数据
  943. const instrumentData =
  944. dtos.cfInventoryChartInstrumentLineBoardResponses || [];
  945. // 按日期排序(日期小的在前)
  946. const sortedClampData = [...clampData].sort((a, b) => {
  947. return new Date(a.monthName) - new Date(b.monthName);
  948. });
  949. const sortedInstrumentData = [...instrumentData].sort((a, b) => {
  950. return new Date(a.monthName) - new Date(b.monthName);
  951. });
  952. // 排序后的月份
  953. const xDatas =
  954. sortedClampData.map((item) => item.monthName) || [];
  955. // 创建月份到数量的映射,确保日期对应
  956. const clampMap = new Map();
  957. sortedClampData.forEach((item) => {
  958. clampMap.set(item.monthName, item.quantity);
  959. });
  960. const instrumentMap = new Map();
  961. sortedInstrumentData.forEach((item) => {
  962. instrumentMap.set(item.monthName, item.quantity);
  963. });
  964. // 根据x轴数据顺序提取对应的数量数据
  965. const clampQuantities = xDatas.map(
  966. (month) => clampMap.get(month) || 0,
  967. );
  968. const instrumentQuantities = xDatas.map(
  969. (month) => instrumentMap.get(month) || 0,
  970. );
  971. // 更新图表
  972. if (_self.checkoutChart) {
  973. _self.checkoutChart.setOption({
  974. xAxis: {
  975. data: xDatas,
  976. },
  977. series: [
  978. { name: "工装", data: clampQuantities },
  979. { name: "设备", data: instrumentQuantities },
  980. ],
  981. });
  982. }
  983. _self.chartDatas = dtos;
  984. }
  985. },
  986. // 更新agv年任务统计(地面库、立体库)
  987. updateAgvMonthTask(dto) {
  988. const _self = this;
  989. if (!isObjectEqual(dto, _self.agvMonthDatas)) {
  990. const newData = dto.reverse();
  991. const xDatas = newData.map((item) => item.monthName);
  992. const groundCount = dto.map((item) => item.groundCount);
  993. const stereoscopicCount = dto.map(
  994. (item) => item.stereoscopicCount,
  995. );
  996. _self.agvYearChart.setOption({
  997. xAxis: { data: xDatas },
  998. series: [
  999. { name: "地面库", data: groundCount },
  1000. { name: "立体库", data: stereoscopicCount },
  1001. ],
  1002. });
  1003. _self.agvMonthDatas = dto;
  1004. }
  1005. },
  1006. // 更新agv任务统计(已完成、未完成)
  1007. updateAgvTotalTask(completeQuantity, incompleteQuantity) {
  1008. const _self = this;
  1009. if (
  1010. completeQuantity !== _self.agvComplete ||
  1011. incompleteQuantity !== _self.agvUnComplete
  1012. ) {
  1013. const countData = [
  1014. { name: "已完成", value: completeQuantity },
  1015. { name: "未完成", value: incompleteQuantity },
  1016. ];
  1017. _self.agvTotalChart.setOption({
  1018. series: [{ name: "任务统计", data: countData }],
  1019. });
  1020. _self.agvComplete = completeQuantity;
  1021. _self.agvUnComplete = incompleteQuantity;
  1022. }
  1023. },
  1024. // 更新设备使用时长
  1025. updateUseTime(dtos) {
  1026. const _self = this;
  1027. if (!isObjectEqual(dtos, _self.useTimeData)) {
  1028. const processedData = dtos.map((item, index) => {
  1029. return [
  1030. // index + 1,
  1031. item.invName || "",
  1032. item.invNo || "",
  1033. item.type || "",
  1034. item.useTime || "",
  1035. ];
  1036. });
  1037. _self.deviceTimeConfig.data = JSON.parse(
  1038. JSON.stringify(processedData),
  1039. );
  1040. // 强制更新组件
  1041. _self.$nextTick(() => {
  1042. if (_self.$refs.scrollBoard4) {
  1043. _self.$refs.scrollBoard4.updateRows(
  1044. _self.deviceTimeConfig.data,
  1045. );
  1046. }
  1047. });
  1048. _self.useTimeData = dtos;
  1049. }
  1050. },
  1051. // 屏幕自适应
  1052. resizeChart() {
  1053. const _self = this;
  1054. _self.checkoutChart && _self.checkoutChart.resize();
  1055. _self.agvYearChart && _self.agvYearChart.resize();
  1056. _self.agvTotalChart && _self.agvTotalChart.resize();
  1057. },
  1058. cancalDebounce: debounce(function () {
  1059. this.resizeChart();
  1060. }, 200),
  1061. },
  1062. mounted() {
  1063. const _self = this;
  1064. _self.getWarehouseId();
  1065. _self.checkoutChart = getElement("checkoutChart");
  1066. _self.agvYearChart = getElement("agvYearChart");
  1067. _self.agvTotalChart = getElement("agvTotalChart");
  1068. _self.$nextTick(() => {
  1069. _self.createCheckoutChart();
  1070. _self.createAgvYearChart();
  1071. _self.createAgvTotalChart();
  1072. _self.getWarehouseInfo();
  1073. window.addEventListener("resize", _self.cancalDebounce);
  1074. });
  1075. _self.timer = setInterval(() => {
  1076. _self.getWarehouseInfo();
  1077. }, 3000);
  1078. },
  1079. beforeUnmount() {
  1080. const _self = this;
  1081. clearInterval(_self.timer);
  1082. _self.timer = null;
  1083. },
  1084. });
  1085. </script>
  1086. </body>
  1087. </html>