From 857a3948d60c3e1b55c3f4f98e1ce5b17f085908 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A0=82=E7=B3=96?= <2178503051@qq.com> Date: Mon, 8 Jun 2026 10:05:52 +0800 Subject: [PATCH] =?UTF-8?q?feat(wms):=20=E6=96=B0=E5=A2=9E=E9=92=A2?= =?UTF-8?q?=E5=8D=B7=E9=80=9A=E7=94=A8=E7=BB=B4=E5=BA=A6=E5=91=8A=E8=AD=A6?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 新增告警信息路由页面与API接口 2. 在导航栏添加告警入口与未读红点提示 3. 实现告警列表查询、处理、忽略、删除与导出功能 4. 每分钟自动刷新告警状态检查 --- klp-ui/src/api/wms/materialWarning.js | 44 ++ klp-ui/src/layout/components/Navbar.vue | 41 ++ klp-ui/src/router/index.js | 6 + .../views/wms/coil/materialWarning/index.vue | 384 ++++++++++++++++++ 4 files changed, 475 insertions(+) create mode 100644 klp-ui/src/api/wms/materialWarning.js create mode 100644 klp-ui/src/views/wms/coil/materialWarning/index.vue diff --git a/klp-ui/src/api/wms/materialWarning.js b/klp-ui/src/api/wms/materialWarning.js new file mode 100644 index 00000000..d19def3d --- /dev/null +++ b/klp-ui/src/api/wms/materialWarning.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询钢卷通用维度告警(长度/厚度/宽度)列表 +export function listMaterialWarning(query) { + return request({ + url: '/wms/materialWarning/list', + method: 'get', + params: query + }) +} + +// 查询钢卷通用维度告警(长度/厚度/宽度)详细 +export function getMaterialWarning(warningId) { + return request({ + url: '/wms/materialWarning/' + warningId, + method: 'get' + }) +} + +// 新增钢卷通用维度告警(长度/厚度/宽度) +export function addMaterialWarning(data) { + return request({ + url: '/wms/materialWarning', + method: 'post', + data: data + }) +} + +// 修改钢卷通用维度告警(长度/厚度/宽度) +export function updateMaterialWarning(data) { + return request({ + url: '/wms/materialWarning', + method: 'put', + data: data + }) +} + +// 删除钢卷通用维度告警(长度/厚度/宽度) +export function delMaterialWarning(warningId) { + return request({ + url: '/wms/materialWarning/' + warningId, + method: 'delete' + }) +} diff --git a/klp-ui/src/layout/components/Navbar.vue b/klp-ui/src/layout/components/Navbar.vue index ff424959..6c7fbf48 100644 --- a/klp-ui/src/layout/components/Navbar.vue +++ b/klp-ui/src/layout/components/Navbar.vue @@ -11,6 +11,11 @@
+
+ + + +
@@ -51,6 +56,7 @@ import Hamburger from '@/components/Hamburger' import Screenfull from '@/components/Screenfull' // import SizeSelect from '@/components/SizeSelect' import Search from '@/components/HeaderSearch' +import { listMaterialWarning } from '@/api/wms/materialWarning' // import RuoYiGit from '@/components/RuoYi/Git' // import RuoYiDoc from '@/components/RuoYi/Doc' @@ -65,6 +71,12 @@ export default { // RuoYiGit, // RuoYiDoc }, + data() { + return { + hasWarning: false, + warningTimer: null + } + }, computed: { ...mapGetters([ 'sidebar', @@ -99,6 +111,16 @@ export default { gotoTodo() { this.$router.push({ path: '/wms/todo' }) }, + gotoWarning() { + this.$router.push({ path: '/wms/materialWarning' }) + }, + checkWarning() { + listMaterialWarning({ pageNum: 1, pageSize: 1, warningStatus: '0' }).then(response => { + this.hasWarning = response.total > 0 + }).catch(() => { + this.hasWarning = false + }) + }, async logout() { this.$confirm('确定注销并退出系统吗?', '提示', { confirmButtonText: '确定', @@ -110,6 +132,18 @@ export default { }) }).catch(() => {}); } + }, + mounted() { + this.checkWarning() + this.warningTimer = setInterval(() => { + this.checkWarning() + }, 60000) + }, + beforeDestroy() { + if (this.warningTimer) { + clearInterval(this.warningTimer) + this.warningTimer = null + } } } @@ -216,6 +250,13 @@ export default { } } } + + .nav-badge { + ::v-deep .el-badge__content.is-fixed { + top: 14px; + right: 14px; + } + } } } \ No newline at end of file diff --git a/klp-ui/src/router/index.js b/klp-ui/src/router/index.js index 6643f3d8..4b6f9614 100644 --- a/klp-ui/src/router/index.js +++ b/klp-ui/src/router/index.js @@ -118,6 +118,12 @@ export const constantRoutes = [ component: () => import('@/views/wms/coil/info'), name: 'CoilInfo', meta: { title: '数字钢卷', icon: 'checkbox' } + }, + { + path: 'materialWarning', + component: () => import('@/views/wms/coil/materialWarning/index'), + name: 'MaterialWarning', + meta: { title: '告警信息', icon: 'warning' } } ], }, diff --git a/klp-ui/src/views/wms/coil/materialWarning/index.vue b/klp-ui/src/views/wms/coil/materialWarning/index.vue new file mode 100644 index 00000000..2394a325 --- /dev/null +++ b/klp-ui/src/views/wms/coil/materialWarning/index.vue @@ -0,0 +1,384 @@ + + +