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 @@ + + +