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.

625 lines
14 KiB

4 weeks ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 weeks ago
​
4 weeks ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 weeks ago
​
​
​
4 weeks ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 weeks ago
​
4 weeks ago
​
​
​
​
​
​
​
​
​
​
​
4 weeks ago
​
​
4 weeks ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 weeks ago
​
​
​
​
​
​
​
​
​
​
​
4 weeks ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 weeks ago
​
​
​
4 weeks ago
4 weeks ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 weeks ago
​
4 weeks ago
​
​
​
​
​
4 weeks ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 weeks ago
​
4 weeks ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 weeks ago
​
​
​
4 weeks ago
4 weeks ago
4 weeks ago
​
​
4 weeks ago
4 weeks ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <template>
  2. <div class="picking-board-screen">
  3. <!-- 装饰背景 -->
  4. <div class="bg-decoration">
  5. <div class="decoration-line line-1"></div>
  6. <div class="decoration-line line-2"></div>
  7. <div class="decoration-line line-3"></div>
  8. <div class="decoration-circle circle-1"></div>
  9. <div class="decoration-circle circle-2"></div>
  10. </div>
  11. <!-- 顶部标题栏 -->
  12. <div class="screen-header">
  13. <!-- CCL Logo -->
  14. <div class="header-logo">
  15. <img src="~@/assets/img/cclbai.png" alt="CCL Logo" class="logo-img">
  16. </div>
  17. <div class="header-decoration left"></div>
  18. <div class="header-center">
  19. <div class="title-glow"></div>
  20. <h1 class="screen-title">异常区域看板
  21. <span class="ws-status-dot" :class="connectionClass" :title="connectionText"></span>
  22. </h1>
  23. </div>
  24. <div class="header-decoration right"></div>
  25. <div class="header-time">
  26. <div class="time-icon"></div>
  27. <div class="time-text">{{ currentTime }}</div>
  28. </div>
  29. </div>
  30. <!-- 主内容区 -->
  31. <div class="screen-content">
  32. <!-- 周转箱拣选面板 -->
  33. <div class="picking-panel">
  34. <!-- 面板标题 -->
  35. <!-- 数据表格 -->
  36. <!-- 行多时在表体内定时下滚,鼠标进入暂停,表头保持可见 - rqrq -->
  37. <div ref="tableViewport" class="panel-table" @mouseenter="scrollPaused = true" @mouseleave="scrollPaused = false">
  38. <table class="data-table error-area-table">
  39. <colgroup>
  40. <col style="width: 20%">
  41. <col style="width: 20%">
  42. <col style="width: 60%">
  43. </colgroup>
  44. <thead>
  45. <tr>
  46. <th>位置</th>
  47. <th>栈板</th>
  48. <th>异常信息</th>
  49. </tr>
  50. </thead>
  51. <tbody>
  52. <tr v-for="(item, idx) in boardList" :key="idx + '-' + item.palletId">
  53. <td class="text-center">{{ item.locationCode || '-' }}</td>
  54. <td class="text-center">{{ item.palletId || '-' }}</td>
  55. <td class="text-left error-message">{{ item.errorMessage || '-' }}</td>
  56. </tr>
  57. </tbody>
  58. </table>
  59. </div>
  60. </div>
  61. </div>
  62. <!-- 底部装饰 -->
  63. <div class="screen-footer">
  64. <div class="footer-line"></div>
  65. </div>
  66. </div>
  67. </template>
  68. <script>
  69. import { getErrorAreaBoard } from '@/api/haianWarehouse/errorAreaBoard'
  70. // 外观沿用海安看板。每 5 秒无锁查 site=54、区域 A09 的栈板 - rqrq
  71. export default {
  72. name: 'HaianErrorAreaBoard54',
  73. data() {
  74. return {
  75. currentTime: '',
  76. timeInterval: null,
  77. serverTimeOffset: 0,
  78. refreshCheckInterval: null,
  79. pollTimer: null,
  80. queryLoading: false,
  81. // 第一次请求中为黄,查询成功为绿,失败为红。没有栈板也保持绿灯 - rqrq
  82. connectionState: 'connecting',
  83. boardList: [],
  84. scrollTimer: null,
  85. scrollPaused: false,
  86. scrollResumeAt: 0
  87. }
  88. },
  89. computed: {
  90. connectionClass () {
  91. return {
  92. 'is-connecting': this.connectionState === 'connecting',
  93. 'is-connected': this.connectionState === 'connected',
  94. 'is-disconnected': this.connectionState === 'disconnected'
  95. }
  96. },
  97. connectionText () {
  98. return { connecting: '正在查询异常区域', connected: '数据正常', disconnected: '查询失败' }[this.connectionState]
  99. }
  100. },
  101. mounted() {
  102. this.currentTime = '等待服务器时间同步...'
  103. this.timeInterval = setInterval(() => {
  104. this.updateTime()
  105. }, 1000)
  106. this.startRefreshCheck()
  107. // 每 5 秒查一次 A09。上一轮没回来就跳过,避免请求叠在一起 - rqrq
  108. this.getDataList()
  109. this.pollTimer = setInterval(() => {
  110. this.getDataList()
  111. }, 5000)
  112. // 和人工分拣一样每 60 毫秒走 1 像素;内容没超出时方法内直接返回 - rqrq
  113. this.scrollTimer = setInterval(this.scrollTable, 60)
  114. },
  115. beforeDestroy() {
  116. if (this.timeInterval) {
  117. clearInterval(this.timeInterval)
  118. }
  119. if (this.refreshCheckInterval) {
  120. clearInterval(this.refreshCheckInterval)
  121. }
  122. if (this.pollTimer) {
  123. clearInterval(this.pollTimer)
  124. }
  125. if (this.scrollTimer) {
  126. clearInterval(this.scrollTimer)
  127. }
  128. },
  129. methods: {
  130. startRefreshCheck() {
  131. this.refreshCheckInterval = setInterval(() => {
  132. this.checkAndRefreshPage()
  133. }, 60000)
  134. this.checkAndRefreshPage()
  135. },
  136. checkAndRefreshPage() {
  137. const now = new Date()
  138. if (now.getHours() === 5 && now.getMinutes() === 10) {
  139. location.reload()
  140. }
  141. },
  142. // 查询成功亮绿灯,没有栈板也亮绿灯。查询失败亮红灯并清空表 - rqrq
  143. getDataList() {
  144. if (this.queryLoading) return
  145. this.queryLoading = true
  146. getErrorAreaBoard({ site: '54' }).then(({ data }) => {
  147. if (data && data.code === 0 && data.row && data.row.site === '54' && data.row.available === true) {
  148. this.connectionState = 'connected'
  149. this.boardList = Array.isArray(data.row.rows) ? data.row.rows : []
  150. return
  151. }
  152. this.connectionState = 'disconnected'
  153. this.boardList = []
  154. }).catch(() => {
  155. this.connectionState = 'disconnected'
  156. this.boardList = []
  157. }).finally(() => {
  158. this.queryLoading = false
  159. })
  160. },
  161. updateTime() {
  162. const now = new Date(new Date().getTime() + this.serverTimeOffset)
  163. const year = now.getFullYear()
  164. const month = String(now.getMonth() + 1).padStart(2, '0')
  165. const day = String(now.getDate()).padStart(2, '0')
  166. const hours = String(now.getHours()).padStart(2, '0')
  167. const minutes = String(now.getMinutes()).padStart(2, '0')
  168. const seconds = String(now.getSeconds()).padStart(2, '0')
  169. const weekDays = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六']
  170. const weekDay = weekDays[now.getDay()]
  171. this.currentTime = `${year}-${month}-${day} ${hours}:${minutes}:${seconds} ${weekDay}`
  172. },
  173. // 到底停留 2 秒再回顶。没有数据或表格没超出可视高度时不滚 - rqrq
  174. scrollTable () {
  175. const viewport = this.$refs.tableViewport
  176. if (!viewport || this.scrollPaused || !this.boardList.length || Date.now() < this.scrollResumeAt) return
  177. if (viewport.scrollHeight <= viewport.clientHeight) return
  178. if (viewport.scrollTop + viewport.clientHeight >= viewport.scrollHeight - 1) {
  179. viewport.scrollTop = 0
  180. this.scrollResumeAt = Date.now() + 2000
  181. } else {
  182. viewport.scrollTop += 1
  183. }
  184. }
  185. }
  186. }
  187. </script>
  188. <style scoped lang="scss">
  189. /* ===== 整体容器 ===== */
  190. .picking-board-screen {
  191. width: 100vw;
  192. height: 100vh;
  193. background: linear-gradient(135deg, #5f8cc3 0%, #749cc8 100%);
  194. position: relative;
  195. overflow: hidden;
  196. font-family: 'Microsoft YaHei', 'PingFang SC', Arial, sans-serif;
  197. }
  198. /* ===== 装饰背景 ===== */
  199. .bg-decoration {
  200. display: none;
  201. }
  202. /* ===== 顶部标题区 ===== */
  203. /* 左右等宽,标题留在中间,时间和标题不再叠在一起 - rqrq */
  204. .screen-header {
  205. position: relative;
  206. height: 60px;
  207. display: grid;
  208. grid-template-columns: minmax(240px, 1fr) auto minmax(240px, 1fr);
  209. align-items: center;
  210. padding: 0 20px;
  211. z-index: 10;
  212. border-bottom: 2px solid rgba(23, 179, 163, 0.4);
  213. background: linear-gradient(180deg, rgba(23, 179, 163, 0.08) 0%, transparent 100%);
  214. }
  215. /* CCL Logo */
  216. .header-logo {
  217. position: absolute;
  218. left: 20px;
  219. top: 50%;
  220. transform: translateY(-50%);
  221. z-index: 20;
  222. }
  223. .logo-img {
  224. height: 40px;
  225. width: auto;
  226. filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
  227. transition: all 0.3s ease;
  228. &:hover {
  229. filter: drop-shadow(0 4px 12px rgba(23, 179, 163, 0.5));
  230. transform: scale(1.05);
  231. }
  232. }
  233. .header-decoration {
  234. display: none;
  235. }
  236. .header-center {
  237. position: relative;
  238. text-align: center;
  239. }
  240. .title-glow {
  241. display: none;
  242. }
  243. .screen-title {
  244. position: relative;
  245. font-size: 34px;
  246. font-weight: bold;
  247. color: #ffffff;
  248. margin: 0;
  249. letter-spacing: 3px;
  250. text-shadow: 0 0 20px rgba(23, 179, 163, 0.5);
  251. }
  252. .ws-status-dot {
  253. display: inline-block;
  254. width: 12px;
  255. height: 12px;
  256. margin-left: 12px;
  257. border-radius: 50%;
  258. vertical-align: middle;
  259. background: #22c55e;
  260. box-shadow: 0 0 10px rgba(34, 197, 94, 0.8);
  261. &.is-connecting {
  262. background: #f59e0b;
  263. box-shadow: 0 0 12px rgba(245, 158, 11, 0.85);
  264. }
  265. &.is-disconnected {
  266. background: #ef4444;
  267. box-shadow: 0 0 12px rgba(239, 68, 68, 0.85);
  268. animation: ws-status-blink 1s steps(1, end) infinite;
  269. }
  270. }
  271. @keyframes ws-status-blink {
  272. 0%, 50% {
  273. opacity: 1;
  274. }
  275. 50.01%, 100% {
  276. opacity: 0.2;
  277. }
  278. }
  279. .title-subtitle {
  280. font-size: 12px;
  281. color: rgba(255, 255, 255, 0.8);
  282. letter-spacing: 2px;
  283. margin-top: 3px;
  284. font-family: Arial, sans-serif;
  285. text-transform: uppercase;
  286. }
  287. /* 时间只占右上角文字,不留底块,避免罩住中间标题 - rqrq */
  288. .header-time {
  289. position: absolute;
  290. right: 24px;
  291. top: 50%;
  292. transform: translateY(-50%);
  293. display: flex;
  294. align-items: center;
  295. line-height: 1;
  296. padding: 0;
  297. background: transparent;
  298. }
  299. .time-icon {
  300. font-size: 14px;
  301. color: #17B3A3;
  302. }
  303. .time-text {
  304. font-size: 16px;
  305. color: #ffffff;
  306. font-family: 'Consolas', 'Courier New', monospace;
  307. font-weight: 500;
  308. letter-spacing: 1px;
  309. }
  310. /* ===== 主内容区 ===== */
  311. .screen-content {
  312. position: relative;
  313. z-index: 1;
  314. padding: 8px 15px;
  315. height: calc(100vh - 60px);
  316. overflow-y: auto;
  317. &::-webkit-scrollbar {
  318. width: 6px;
  319. }
  320. &::-webkit-scrollbar-track {
  321. background: rgba(23, 179, 163, 0.1);
  322. }
  323. &::-webkit-scrollbar-thumb {
  324. background: rgba(23, 179, 163, 0.5);
  325. border-radius: 3px;
  326. &:hover {
  327. background: rgba(23, 179, 163, 0.7);
  328. }
  329. }
  330. }
  331. /* ===== 拣选面板 ===== */
  332. .picking-panel {
  333. width: 100%;
  334. height: calc(100vh - 80px);
  335. box-sizing: border-box;
  336. padding: 10px;
  337. background: rgba(70, 90, 120, 0.9);
  338. backdrop-filter: blur(10px);
  339. border: 1px solid rgba(23, 179, 163, 0.5);
  340. border-radius: 12px;
  341. box-shadow:
  342. 0 8px 32px rgba(0, 0, 0, 0.4),
  343. inset 0 1px 0 rgba(255, 255, 255, 0.1);
  344. overflow: hidden;
  345. transition: all 0.3s ease;
  346. display: flex;
  347. flex-direction: column;
  348. &:hover {
  349. border-color: rgba(23, 179, 163, 0.5);
  350. box-shadow:
  351. 0 12px 48px rgba(0, 0, 0, 0.5),
  352. 0 0 30px rgba(23, 179, 163, 0.2);
  353. transform: translateY(-2px);
  354. }
  355. }
  356. /* ===== 面板标题栏 ===== */
  357. .panel-title-bar {
  358. background: linear-gradient(135deg, rgba(23, 179, 163, 0.3) 0%, rgba(23, 179, 163, 0.15) 100%);
  359. border-bottom: 1px solid rgba(23, 179, 163, 0.3);
  360. padding: 15px 20px;
  361. display: flex;
  362. justify-content: space-between;
  363. align-items: center;
  364. }
  365. .title-left {
  366. display: flex;
  367. align-items: center;
  368. gap: 15px;
  369. flex: 1;
  370. }
  371. .title-icon {
  372. font-size: 16px;
  373. color: #64D8CB;
  374. }
  375. .title-text {
  376. display: flex;
  377. align-items: center;
  378. gap: 8px;
  379. flex-wrap: wrap;
  380. }
  381. .title-main {
  382. font-size: 24px;
  383. font-weight: bold;
  384. color: #ffffff;
  385. text-shadow: 0 0 10px rgba(100, 216, 203, 0.5);
  386. }
  387. /* ===== 数据表格 ===== */
  388. /* 滚动容器不能留内边距,否则粘性表头停在内边距下沿,数据行会露到表头上面 - rqrq */
  389. .panel-table {
  390. padding: 0;
  391. flex: 1;
  392. overflow-y: auto;
  393. &::-webkit-scrollbar {
  394. width: 6px;
  395. }
  396. &::-webkit-scrollbar-track {
  397. background: rgba(23, 179, 163, 0.05);
  398. }
  399. &::-webkit-scrollbar-thumb {
  400. background: rgba(23, 179, 163, 0.3);
  401. border-radius: 3px;
  402. &:hover {
  403. background: rgba(23, 179, 163, 0.5);
  404. }
  405. }
  406. }
  407. .data-table {
  408. width: 100%;
  409. border-collapse: separate;
  410. border-spacing: 0;
  411. thead {
  412. position: sticky;
  413. top: 0;
  414. z-index: 2;
  415. tr {
  416. background: #1b6676;
  417. }
  418. th {
  419. background: #1b6676;
  420. padding: 5px 6px;
  421. color: #fcfdfd;
  422. font-size: 16px;
  423. font-weight: bold;
  424. text-align: center;
  425. border-bottom: 2px solid rgba(23, 179, 163, 0.4);
  426. text-shadow: 0 0 10px rgba(100, 216, 203, 0.5);
  427. white-space: nowrap;
  428. &:first-child {
  429. border-top-left-radius: 8px;
  430. }
  431. &:last-child {
  432. border-top-right-radius: 8px;
  433. }
  434. }
  435. }
  436. tbody {
  437. tr {
  438. background: rgba(60, 80, 105, 0.6);
  439. transition: all 0.3s ease;
  440. &:nth-child(even) {
  441. background: rgba(70, 90, 115, 0.7);
  442. }
  443. &:hover {
  444. background: rgba(23, 179, 163, 0.15);
  445. box-shadow: 0 4px 12px rgba(23, 179, 163, 0.2);
  446. }
  447. &:last-child {
  448. td:first-child {
  449. border-bottom-left-radius: 8px;
  450. }
  451. td:last-child {
  452. border-bottom-right-radius: 8px;
  453. }
  454. }
  455. }
  456. td {
  457. padding: 4px 6px;
  458. color: rgba(255, 255, 255, 0.9);
  459. font-size: 15px;
  460. border-bottom: 1px solid rgba(23, 179, 163, 0.15);
  461. &.text-center {
  462. text-align: center;
  463. }
  464. &.text-left {
  465. text-align: left;
  466. }
  467. &.text-right {
  468. text-align: right;
  469. }
  470. }
  471. }
  472. }
  473. /* 异常信息列占 60%,长文本换行,不把位置和栈板挤没 - rqrq */
  474. .error-area-table {
  475. table-layout: fixed;
  476. td.error-message {
  477. word-break: break-all;
  478. white-space: normal;
  479. }
  480. }
  481. /* ===== 状态徽章 ===== */
  482. .status-badge {
  483. display: inline-block;
  484. padding: 4px 12px;
  485. border-radius: 12px;
  486. font-size: 14px;
  487. font-weight: bold;
  488. text-align: center;
  489. min-width: 80px;
  490. box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  491. &.status-success {
  492. background: linear-gradient(135deg, #10b981, #34d399);
  493. color: #ffffff;
  494. box-shadow: 0 0 15px rgba(16, 185, 129, 0.5);
  495. }
  496. &.status-warning {
  497. background: linear-gradient(135deg, #10b981, #34d399);
  498. color: #ffffff;
  499. box-shadow: 0 0 15px rgba(16, 185, 129, 0.5);
  500. }
  501. &.status-pending {
  502. background: linear-gradient(135deg, #f59e0b, #fbbf24);
  503. color: #ffffff;
  504. box-shadow: 0 0 15px rgba(245, 158, 11, 0.5);
  505. }
  506. }
  507. /* ===== 底部装饰 ===== */
  508. .screen-footer {
  509. display: none;
  510. }
  511. /* ===== 响应式适配 ===== */
  512. @media screen and (max-width: 1600px) {
  513. .screen-title {
  514. font-size: 30px;
  515. letter-spacing: 3px;
  516. }
  517. .title-main {
  518. font-size: 22px;
  519. }
  520. }
  521. @media screen and (min-width: 2560px) {
  522. .screen-title {
  523. font-size: 38px;
  524. }
  525. .panel-title-bar {
  526. padding: 16px 24px;
  527. }
  528. .title-main {
  529. font-size: 28px;
  530. }
  531. .data-table {
  532. thead th {
  533. font-size: 20px;
  534. padding: 6px 12px;
  535. }
  536. tbody td {
  537. font-size: 20px;
  538. padding: 4px 12px;
  539. }
  540. }
  541. .status-badge {
  542. font-size: 18px;
  543. padding: 4px 10px;
  544. min-width: 100px;
  545. }
  546. }
  547. </style>