This commit is contained in:
朱文强 2025-02-19 14:16:11 +08:00
parent 6fed42bb11
commit e5e5ae1281
9 changed files with 305 additions and 16 deletions

View File

@ -33,6 +33,9 @@
<!-- <el-dropdown-item @click.native="setting = true">
<span>布局设置</span>
</el-dropdown-item> -->
<el-dropdown-item divided @click.native="alarmSet">
<span>{{alarmTip?'关闭报警':'打开报警'}}</span>
</el-dropdown-item>
<el-dropdown-item divided @click.native="logout">
<span>退出登录</span>
</el-dropdown-item>
@ -64,6 +67,12 @@ export default {
Search,
NotifyMessage
},
props:{
alarmTip:{
type: Boolean,
default: false,
},
},
computed: {
...mapGetters([
'sidebar',
@ -89,7 +98,7 @@ export default {
},
data() {
return {
nickname: ''
nickname: '',
};
},
created() {
@ -101,6 +110,9 @@ export default {
toggleSideBar() {
this.$store.dispatch('app/toggleSideBar')
},
alarmSet(){
this.$emit('refreshAlarm');
},
async logout() {
this.$modal.confirm('确定注销并退出系统吗?', '提示').then(() => {
this.$store.dispatch('LogOut').then(() => {

View File

@ -12,7 +12,7 @@
:class="{ hasTagsView: needTagsView, sidebarHide: sidebar.hide }"
class="main-container">
<div :class="{ 'fixed-header': fixedHeader }">
<navbar />
<navbar @refreshAlarm="refreshAlarm" :alarm-tip="alarmTip" />
<tags-view v-if="needTagsView" />
</div>
<app-main />
@ -82,6 +82,8 @@ export default {
instance: {
closed: true,
}, //
timer: null,
alarmTip: true,
};
},
created() {
@ -89,7 +91,6 @@ export default {
axios
.post('http://172.22.22.190/wcs-njlm/business/wcsTask/isonline')
.then((res) => {
console.log(res);
if (res.data.code == 500) {
this.$notify({
title: '设备异常',
@ -102,7 +103,6 @@ export default {
}
})
.catch((error) => {
console.error('There was an error!', error);
this.$notify({
title: '通知',
message: '设备不在线,请稍后重试',
@ -112,11 +112,22 @@ export default {
});
},
methods: {
refreshAlarm() {
if (this.alarmTip) {
clearInterval(this.timer);
this.timer = null;
} else {
this.startFun();
}
this.alarmTip = !this.alarmTip;
},
handleClickOutside() {
this.$store.dispatch('app/closeSideBar', { withoutAnimation: false });
},
startFun() {
setInterval(() => {
clearInterval(this.timer);
this.timer = null;
this.timer = setInterval(() => {
this.getRealAlarm();
}, 10000);
},
@ -149,6 +160,34 @@ export default {
.catch((error) => {
console.error('There was an error!', error);
});
axios
.post('http://172.22.22.14:8080/wcs-njlm/business/wcsTask/isAlarm')
.then((res) => {
res.data.forEach((item, index) => {
if (index < 4) {
if (item.code !== 0) {
this.$notify({
title: '异常',
message: item.msg,
type: 'warning',
duration: 8000,
});
}
} else {
if (item.code > 30) {
this.$notify({
title: '异常',
message: item.msg,
type: 'warning',
duration: 9000,
});
}
}
});
})
.catch((error) => {
console.error('There was an error!', error);
});
},
},
};

View File

@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: zwq
* @LastEditTime: 2024-12-26 11:20:46
* @LastEditTime: 2025-01-07 15:48:54
* @Description:
-->
<template>
@ -214,7 +214,7 @@
<template slot-scope="scope">
<span>
{{
scope.row.region ? regionArr[scope.row.region - 1].name : ''
scope.row.region ? regionArr.filter(item=>{return item.id===scope.row.region})[0].name: ''
}}
</span>
</template>
@ -624,6 +624,7 @@ export default {
return;
}
//
this.dataForm.warehouseId = '1698950657556340737'
this.urlOptions.createURL(this.dataForm).then((response) => {
if (response.data === -1) {
this.$modal.msgWarning('排、列、层不能重复');

View File

@ -47,7 +47,7 @@
<el-table-column prop="region" label="发货区域" width="95">
<template slot-scope="scope">
<span>
{{ regionArr.filter(item=>{return item.id===scope.row.region})[0].name }}
{{ scope.row.region?regionArr.filter(item=>{return item.id===scope.row.region})[0].name:'-' }}
</span>
</template>
</el-table-column>
@ -142,6 +142,7 @@ export default {
deliveryType,
trayType,
region,
regionArr,
tableData: [],
formConfig: [
{

View File

@ -185,20 +185,20 @@ const mainTaskState = [
];
const stackerArr = [
{
name: 'DDJ1',
id: 1,
name: 'DDJ5',
id: 5,
},
{
name: 'DDJ2',
id: 2,
name: 'DDJ6',
id: 6,
},
{
name: 'DDJ3',
id: 3,
name: 'DDJ7',
id: 7,
},
{
name: 'DDJ4',
id: 4,
name: 'DDJ8',
id: 8,
},
];
export default {

View File

@ -112,6 +112,14 @@ const tableProps = [
prop: 'grade',
label: '品质',
},
{
prop: 'cpGrade',
label: '质检初判',
},
{
prop: 'fpGrade',
label: '质检复判',
},
{
prop: 'bugCode',
label: '复判缺陷',
@ -193,6 +201,18 @@ export default {
placeholder: '品质',
param: 'grade',
},
{
type: 'input',
label: '质检初判',
placeholder: '质检初判',
param: 'cpGrade',
},
{
type: 'input',
label: '质检复判',
placeholder: '质检复判',
param: 'fpGrade',
},
{
type: 'input',
label: '入库单号',
@ -243,6 +263,8 @@ export default {
this.listQuery.rollCode = val.rollCode.trim() || null;
this.listQuery.productName = val.productName.trim() || null;
this.listQuery.grade = val.grade.trim() || null;
this.listQuery.cpGrade = val.cpGrade.trim() || null;
this.listQuery.fpGrade = val.fpGrade.trim() || null;
this.listQuery.workOrderCode = val.workOrderCode.trim() || null;
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
this.listQuery.endTime = val.searchTime ? val.searchTime[1] : null;

View File

@ -112,6 +112,14 @@ const tableProps = [
prop: 'grade',
label: '品质',
},
{
prop: 'cpGrade',
label: '质检初判',
},
{
prop: 'fpGrade',
label: '质检复判',
},
{
prop: 'bugCode',
label: '复判缺陷',
@ -193,6 +201,18 @@ export default {
placeholder: '品质',
param: 'grade',
},
{
type: 'input',
label: '质检初判',
placeholder: '质检初判',
param: 'cpGrade',
},
{
type: 'input',
label: '质检复判',
placeholder: '质检复判',
param: 'fpGrade',
},
{
type: 'input',
label: '入库单号',
@ -244,6 +264,8 @@ export default {
this.listQuery.rollCode = val.rollCode.trim() || null;
this.listQuery.productName = val.productName.trim() || null;
this.listQuery.grade = val.grade.trim() || null;
this.listQuery.cpGrade = val.cpGrade.trim() || null;
this.listQuery.fpGrade = val.fpGrade.trim() || null;
this.listQuery.workOrderCode = val.workOrderCode.trim() || null;
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
this.listQuery.endTime = val.searchTime ? val.searchTime[1] : null;

View File

@ -0,0 +1,192 @@
<!--
* @Author: zwq
* @Date: 2024-05-21 14:25:27
* @LastEditors: zwq
* @LastEditTime: 2025-01-09 10:07:00
* @Description:
-->
<template>
<div class="main-body">
<el-divider content-position="left">堆垛机报警信息</el-divider>
<el-row :gutter="20">
<el-col v-for="i in 4" :key="i + 'ddj'" :span="6">
<el-card class="box-card" style="min-width: 240px">
<div slot="header" class="header-card">
堆垛机:
<div class="info">
{{ Info[i - 1].name }}
</div>
</div>
<div>
报警信息:
<div class="info">
{{ Info[i - 1].msg }}
</div>
</div>
<div>
报警编码:
<div class="info">
{{ Info[i - 1].code }}
</div>
</div>
<div class="blinking-warning" v-if="Info[i - 1].code !== 0" />
</el-card>
</el-col>
</el-row>
<el-divider content-position="left">1-2巷道输送线报警信息</el-divider>
<el-row :gutter="20" v-for="l in 2" :key="l + 'line1'">
<el-col v-for="i in 6" :key="i + 'ssx1'" :span="4">
<el-card class="box-card" style="min-width: 240px">
<div slot="header" class="header-card">
输送线:
<div class="info">
{{ Info[i - 1 + 4 + (l - 1) * 6].name }}
</div>
</div>
<div>
报警信息:
<div class="info">{{ Info[i - 1 + 4 + (l - 1) * 6].msg }}</div>
</div>
<div>
报警编码:
<div class="info">{{ Info[i - 1 + 4 + (l - 1) * 6].code }}</div>
</div>
<div
class="blinking-warning"
v-if="Info[i - 1 + 4 + (l - 1) * 6].code > 30" />
</el-card>
</el-col>
</el-row>
<el-divider content-position="left">3-4巷道输送线报警信息</el-divider>
<el-row :gutter="20" v-for="l in 2" :key="l + 'line2'">
<el-col v-for="i in 6" :key="i + 'ssx2'" :span="4">
<el-card class="box-card" style="min-width: 240px">
<div slot="header" class="header-card">
输送线:
<div class="info">
{{ Info[i - 1 + 4 + (l + 1) * 6].name }}
</div>
</div>
<div>
报警信息:
<div class="info">{{ Info[i - 1 + 4 + (l + 1) * 6].msg }}</div>
</div>
<div>
报警编码:
<div class="info">{{ Info[i - 1 + 4 + (l + 1) * 6].code }}</div>
</div>
<div
class="blinking-warning"
v-if="Info[i - 1 + 4 + (l + 1) * 6].code > 30" />
</el-card>
</el-col>
</el-row>
<el-divider content-position="left">检尺门报警信息</el-divider>
<el-row :gutter="20">
<el-col v-for="i in 4" :key="i + 'jcm'" :span="6">
<el-card class="box-card" style="min-width: 240px">
<div slot="header" class="header-card">
检尺门:
<div class="info">
{{ Info[i - 1 + 4 + 24].name }}
</div>
</div>
<div>
报警信息:
<div class="info">
{{ Info[i - 1 + 4 + 24].msg }}
</div>
</div>
<div>
报警编码:
<div class="info">
{{ Info[i - 1 + 4 + 24].code }}
</div>
</div>
<div class="blinking-warning" v-if="Info[i - 1 + 4 + 24].code > 30" />
</el-card>
</el-col>
</el-row>
</div>
</template>
<script>
import axios from 'axios';
export default {
data() {
return {
Info: [],
};
},
created() {
this.getInfo();
this.startFun();
},
methods: {
startFun() {
const timer = setInterval(() => {
this.getInfo();
}, 10000);
this.$once('hook:beforeDestroy', () => {
clearInterval(timer);
});
},
getInfo() {
axios
.post(' http://172.22.22.14:8080/wcs-njlm/business/wcsTask/isAlarm')
.then((res) => {
console.log('实时报警')
console.log(res.data)
this.Info = res.data
})
.catch((error) => {
console.error('There was an error!', error);
});
},
},
};
</script>
<style lang="scss" scoped>
.main-body {
::v-deep .el-card__header {
padding: 5px 20px;
min-height: 25px;
}
::v-deep .el-card__body {
padding: 10px 20px;
}
.box-card {
font-size: 15px;
position: relative;
.header-card {
font-size: 17px;
}
.info {
color: #409eff;
float: right;
}
}
}
.blinking-warning {
position: absolute;
top: 0;
left: 0;
background-color: #ff0000; /* 红色背景 */
animation: blinkWarning 1s infinite; /* 动画名称和持续时间 */
width: 100%;
height: 100%;
}
@keyframes blinkWarning {
0% {
opacity: 0.7; /* 开始状态:不透明 */
}
50% {
opacity: 0; /* 中间状态:完全透明 */
}
100% {
opacity: 0.7; /* 结束状态:不透明 */
}
}
</style>