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