From 9fbaa544c391a21f51f927a3851ee1971f295fc8 Mon Sep 17 00:00:00 2001 From: yinq Date: Fri, 26 Apr 2024 17:42:29 +0800 Subject: [PATCH] =?UTF-8?q?update=20-=20=E6=B6=88=E6=81=AF=E6=8F=90?= =?UTF-8?q?=E9=86=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layout/components/Navbar.vue | 67 ++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue index b893f27..83c7656 100644 --- a/src/layout/components/Navbar.vue +++ b/src/layout/components/Navbar.vue @@ -56,6 +56,9 @@ import SizeSelect from '@/components/SizeSelect' import Search from '@/components/HeaderSearch' import RuoYiGit from '@/components/RuoYi/Git' import RuoYiDoc from '@/components/RuoYi/Doc' +import { parseTime } from '@//utils/ruoyi' +import { listExceptionProcess } from '@//api/report/exceptionProcess' +import { getInfo } from '@//api/login' export default { components: { @@ -91,7 +94,71 @@ export default { } } }, + data() { + return { + // 查询参数 + queryParams: { + pageNum: 1, + pageSize: 10, + productionUserFlag: '1', + }, + // 用户岗位List + postList: [], + } + }, + created() { + this.openAlarm() + //获取用户岗位 10=生产班长,81=质量管理员,5=生产部经理,6=质量部经理 + getInfo().then(res => { + this.postList = res.postList + if (this.postList.includes(81)) { + this.queryParams.qualityUserFlag = '9' + this.exceptionProcessTask(); + }else if (this.postList.includes(5)) { + this.queryParams.productionManagerFlag = '9' + this.exceptionProcessTask(); + }else if (this.postList.includes(6)) { + this.queryParams.qualityManagerFlag = '9' + this.exceptionProcessTask(); + } + }) + }, methods: { + // 不合格品流程任务 + exceptionProcessTask() { + let self = this; + let params = { ...this.queryParams } + listExceptionProcess(params).then(response => { + if (response.total > 0){ + self.openAlarm(); + } + }) + setInterval(function() { + listExceptionProcess(params).then(response => { + if (response.total > 0){ + self.openAlarm(); + } + }) + }, 300000); + }, + // 打开右下角异常 + openAlarm() { + this.$notify({ + title: "不合格流程待处理提示", + position: "bottom-right", + message: this.$createElement( + "div", + { + on: { + click: () => { + this.$tab.openPage("不合格品流程管理","/quality/exceptionProcess", null); + }, + }, + }, + [this.$createElement("el-button", {}, ["点击查看"])] + ), + }); + }, toggleSideBar() { this.$store.dispatch('app/toggleSideBar') },