update - 消息提醒

master
yinq 7 months ago
parent 1aaee8921a
commit 9fbaa544c3

@ -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')
},

Loading…
Cancel
Save