ANDON监控
This commit is contained in:
@@ -1,31 +1,18 @@
|
|||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
import state from '@/store'
|
import state from '@/store'
|
||||||
import router from '@/router'
|
import router from '@/router'
|
||||||
// 电子看板_线体上下线数量统计_查询
|
|
||||||
export function ANDON_countselect() {
|
|
||||||
return request({
|
|
||||||
url: '',
|
|
||||||
method: 'post',
|
|
||||||
data: {
|
|
||||||
UserID: state.state.user.id,
|
|
||||||
ModularID: router.currentRoute.path,
|
|
||||||
type: '1',
|
|
||||||
name: 'ANDON_大屏幕显示',
|
|
||||||
param: 'WorkShopType=A'
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
export function ANDON_opselect(opname) {
|
|
||||||
return request({
|
|
||||||
url: '',
|
|
||||||
method: 'post',
|
|
||||||
data: {
|
|
||||||
UserID: state.state.user.id,
|
|
||||||
ModularID: router.currentRoute.path,
|
|
||||||
type: '1',
|
|
||||||
name: 'ANDON_办公室监控_消息通知',
|
|
||||||
param: 'WorkShopType=A' + '&工位号=' + opname + '=string'
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
|
export function searchTable(check, dateRange0, dateRange1, pageCurrent, pageSize) {
|
||||||
|
return request({
|
||||||
|
url: '',
|
||||||
|
method: 'post',
|
||||||
|
data: {
|
||||||
|
UserID: state.state.user.id,
|
||||||
|
ModularID: router.currentRoute.path,
|
||||||
|
type: '1',
|
||||||
|
name: 'ANDON监控_查询',
|
||||||
|
param: `日期_check=${check}&开始时间=${dateRange0}&结束时间=${dateRange1}`,
|
||||||
|
Pagination: pageCurrent + '&' + pageSize
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -617,7 +617,8 @@ export default {
|
|||||||
if (row.完成日期 !== '') {
|
if (row.完成日期 !== '') {
|
||||||
return 'CompleteColor'
|
return 'CompleteColor'
|
||||||
}
|
}
|
||||||
}, // 重置表单
|
},
|
||||||
|
// 重置表单
|
||||||
callOff(formName) {
|
callOff(formName) {
|
||||||
this.dialogFormVisible = false
|
this.dialogFormVisible = false
|
||||||
this.$refs[formName].resetFields()
|
this.$refs[formName].resetFields()
|
||||||
|
|||||||
@@ -1,243 +1,120 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<el-card>
|
<el-card>
|
||||||
<el-badge :value="value" class="item" style="margin-bottom: 10px; float: right">
|
<el-date-picker
|
||||||
<el-button size="small" @click="openWindow">Andon信息</el-button>
|
v-model="dateRange"
|
||||||
</el-badge>
|
size="small"
|
||||||
<el-table :data="tableData" style="width: 100%;" size="mini" height="800" highlight-current-row border stripe>
|
type="daterange"
|
||||||
<el-table-column align="center" label="照片" width="50">
|
align="center"
|
||||||
<template slot-scope="scope">
|
style="width: 300px;margin: 5px"
|
||||||
<el-popover v-if="scope.row.文件标识 && scope.row.文件标识 !== 'null'" placement="top-start" width="200" trigger="hover">
|
value-format="yyyy-MM-dd"
|
||||||
<el-button type="text" style="float:right" @click="deletePhoto(scope.row)">删除</el-button>
|
format="yyyy-MM-dd"
|
||||||
<el-image :src="scope.row.文件标识 && scope.row.文件标识 !== 'null' ? (readFile + scope.row.文件标识 + '.' + scope.row.文件后缀) : readFile + '123.jpg'">
|
range-separator="~"
|
||||||
<div slot="error" class="image-slot">
|
start-placeholder="开始日期"
|
||||||
<i class="el-icon-picture-outline"/>
|
end-placeholder="结束日期"/>
|
||||||
</div>
|
<el-button type="primary" plain size="small" icon="el-icon-search" style="margin-left: 10px" @click="total1=0;pageCurrent1=1;pageSize1=50;searchTable()">查询</el-button>
|
||||||
</el-image>
|
|
||||||
<el-image slot="reference" :src="scope.row.文件标识 && scope.row.文件标识 !== 'null' ? (readFile + scope.row.文件标识 + '.' + scope.row.文件后缀) : readFile + '123.jpg'" style="width:30px;">
|
|
||||||
<div slot="error" class="image-slot">
|
|
||||||
<i class="el-icon-picture-outline"/>
|
|
||||||
</div>
|
|
||||||
</el-image>
|
|
||||||
</el-popover>
|
|
||||||
<span v-else>—</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column align="center" label="工位号">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-button type="text" @click="openNew(scope.row.工位号)">{{ scope.row.工位号 }}</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column align="center" label="登陆人">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<span v-if="scope.row.姓名===''||scope.row.姓名===null" slot="reference" size="small" style="width: 80px" type="warning">未登录</span>
|
|
||||||
<span v-else slot="reference" type="success" size="small" style="width: 80px"> {{ scope.row.姓名 }} </span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column align="center" label="呼叫类型">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<div v-if="scope.row.呼叫备注===''|| scope.row.呼叫备注===null"><div style="width: 12px;height: 12px;border-radius: 50%;background-color: rgb(103, 194, 58);display: inline-block;margin:0px 5px 0 0"/>正常工作</div>
|
|
||||||
<div v-else ><div style="width: 12px;height: 12px;border-radius: 50%;background-color: red;display: inline-block;margin:0px 5px 0 0"/>{{ scope.row.呼叫备注 }}</div>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="操作" fixed="right" align="center" width="200">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-button
|
|
||||||
:disabled="scope.row.文件标识 && scope.row.文件标识 !== 'null'"
|
|
||||||
size="mini"
|
|
||||||
type="text"
|
|
||||||
icon="el-icon-picture"
|
|
||||||
@click="handlePicture(scope.row)">上传图片</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
</el-card>
|
</el-card>
|
||||||
<el-dialog :visible.sync="dialogVisible" width="60%">
|
<el-card>
|
||||||
<el-table :data="tableDataMassage" style="width: 100%;" size="mini" height="500" highlight-current-row border>
|
<el-table v-loading="loading" :data="tableData" :row-class-name="tableRowClassName" style="width: 100%;" size="mini" height="700" highlight-current-row border>
|
||||||
<el-table-column align="center" label="工位号">
|
<el-table-column align="center" label="报警工位">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button type="text">{{ scope.row.工位号 }}</el-button>
|
{{ scope.row.工位号 }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" label="登陆人">
|
<el-table-column align="center" label="报警人">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-tag v-if="scope.row.姓名===''||scope.row.姓名===null" slot="reference" size="small" style="width: 80px" type="warning">未登录</el-tag>
|
{{ scope.row.呼叫人 }}
|
||||||
<el-tag v-else slot="reference" type="success" size="small" style="width: 80px"> {{ scope.row.姓名 }} </el-tag>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" label="呼叫类型">
|
<el-table-column align="center" label="报警类型">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<div v-if="scope.row.呼叫备注===''|| scope.row.呼叫备注===null"><div style="width: 12px;height: 12px;border-radius: 50%;background-color: rgb(103, 194, 58);display: inline-block;margin:0px 5px 0 0"/>正常工作</div>
|
{{ scope.row.编号描述 }}
|
||||||
<div v-else ><div style="width: 12px;height: 12px;border-radius: 50%;background-color: red;display: inline-block;margin:0px 5px 0 0"/>{{ scope.row.呼叫备注 }}</div>
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="报警内容">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.安东明细描述 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="报警时间">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.呼叫时间 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="复位时间">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.解除时间 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="处理时长">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.处理时长 }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
</el-dialog>
|
<div class="block" style="margin-top: 10px;">
|
||||||
<el-dialog :visible.sync="dialogFormVisible" title="上传图片" center style="height: 800px" width="30%">
|
<el-pagination
|
||||||
<el-upload
|
:current-page="pageCurrent1"
|
||||||
id="invoiceScan"
|
:page-sizes="[50, 100, 150, 200]"
|
||||||
ref="upload"
|
:page-size="pageSize1"
|
||||||
:multiple="true"
|
:total="total1"
|
||||||
:auto-upload="false"
|
style="display:inline-block;width:50%"
|
||||||
:on-success="uploadSuccess"
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
:before-upload="beforeUpload"
|
@size-change="handleSizeChange1"
|
||||||
:on-exceed="warningExceed"
|
@current-change="handleCurrentChange1"/>
|
||||||
:limit="limit"
|
|
||||||
:action="upload+'?num='+ OPId"
|
|
||||||
list-type="picture-card">
|
|
||||||
<i class="el-icon-plus"/>
|
|
||||||
</el-upload>
|
|
||||||
<div slot="footer" class="dialog-footer">
|
|
||||||
<el-button @click="dialogFormVisible=false">取消</el-button>
|
|
||||||
<el-button type="primary" style="width: 70px" @click="submitPerson()">确定</el-button>
|
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-card>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { ANDON_countselect } from '@/api/ManufacturingCenter/AntonMonitoring'
|
import { searchTable } from '@/api/ManufacturingCenter/AntonMonitoring'
|
||||||
import { wsuri, name1, uploadOP } from '@/utils/request'
|
import { getNowShotTime } from '@/utils/tool'
|
||||||
import { readFile } from '@/utils/request'
|
|
||||||
import request from '@/utils/request'
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
readFile: readFile,
|
dateRange: [],
|
||||||
limit: 9999,
|
|
||||||
tableData: [],
|
tableData: [],
|
||||||
timer_ANDON: '',
|
loading: false,
|
||||||
andonMsg: '',
|
total1: 0,
|
||||||
Name: '',
|
pageCurrent1: 1,
|
||||||
upload: uploadOP,
|
pageSize1: 50
|
||||||
dialogFormVisible: false,
|
|
||||||
OPId: '',
|
|
||||||
massage: [],
|
|
||||||
dialogVisible: false,
|
|
||||||
tableDataMassage: [],
|
|
||||||
value: 0
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
|
||||||
this.ANDON_countselect()
|
|
||||||
this.timer_ANDON = setInterval(this.search(), 60 * 1000 * 5) // ANDON看板 5 分钟一刷新
|
|
||||||
},
|
|
||||||
created() {
|
created() {
|
||||||
this.initWebpack()
|
this.dateRange[0] = getNowShotTime()
|
||||||
|
this.dateRange[1] = getNowShotTime()
|
||||||
|
this.searchTable()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
deletePhoto(row) {
|
searchTable() {
|
||||||
this.$confirm('此操作将永久删除该图片, 是否继续?', '提示', {
|
this.loading = true
|
||||||
confirmButtonText: '确定',
|
this.tableData = []
|
||||||
cancelButtonText: '取消',
|
var check1
|
||||||
type: 'warning'
|
this.dateRange ? check1 = 1 : (check1 = 0, this.dateRange = '')
|
||||||
}).then(() => {
|
searchTable(check1, this.dateRange[0], this.dateRange[1], this.pageCurrent1, this.pageSize1).then(response => {
|
||||||
request({
|
this.tableData = response.data.rows
|
||||||
url: '',
|
this.total1 = response.data.total
|
||||||
method: 'post',
|
this.loading = false
|
||||||
data: {
|
|
||||||
type: '4',
|
|
||||||
name: `delete from 设备管理_设备监控_图片 where 工位 = '${row.工位号}'`
|
|
||||||
}
|
|
||||||
}).then(response => {
|
|
||||||
if (response.data[0].result === '1') {
|
|
||||||
this.$message.success('删除成功')
|
|
||||||
this.ANDON_countselect()
|
|
||||||
} else {
|
|
||||||
this.$message.error('删除失败')
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}).catch(() => {
|
|
||||||
this.$message({
|
|
||||||
type: 'info',
|
|
||||||
message: '取消删除'
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
openNew(val) {
|
// 完成日期变色
|
||||||
window.open(`http://192.168.1.231:8008/#/EquipmentConditionAnalysis?opname=${val}`, '_blank')
|
tableRowClassName({ row, rowIndex }) {
|
||||||
},
|
row.index = rowIndex
|
||||||
ANDON_countselect() {
|
if (!row.解除时间) {
|
||||||
ANDON_countselect().then(response => {
|
return 'ANDON_Uncomplete'
|
||||||
this.tableData = response.data
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 初始化websocket
|
|
||||||
initWebpack() {
|
|
||||||
this.websock = new WebSocket(wsuri)// 这里面的this都指向vue
|
|
||||||
this.websock.onopen = this.websocketopen
|
|
||||||
this.websock.onmessage = this.websocketonmessage
|
|
||||||
this.websock.onclose = this.websocketclose
|
|
||||||
this.websock.onerror = this.websocketerror
|
|
||||||
},
|
|
||||||
// 打开
|
|
||||||
websocketopen() {
|
|
||||||
console.log('WebSocket连接成功')
|
|
||||||
this.websock.send('{<' + name1 + '>}')
|
|
||||||
},
|
|
||||||
// 数据接收
|
|
||||||
websocketonmessage(msg) {
|
|
||||||
console.log(msg)
|
|
||||||
this.andonMsg = msg.data.split('|')[3]
|
|
||||||
this.Name = msg.data.split('|')[2]
|
|
||||||
if (this.andonMsg === '1') {
|
|
||||||
this.search()
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 关闭
|
handleSizeChange1(val) {
|
||||||
websocketclose() {
|
this.pageCurrent1 = 1
|
||||||
console.log('WebSocket关闭')
|
this.pageSize1 = val
|
||||||
|
this.searchTable()
|
||||||
},
|
},
|
||||||
// 失败
|
handleCurrentChange1(val) {
|
||||||
websocketerror() {
|
this.pageCurrent1 = val
|
||||||
console.log('WebSocket连接失败')
|
this.searchTable()
|
||||||
},
|
|
||||||
uploadSuccess(res) { // 上传成功回调
|
|
||||||
if (res[0].result === '1') {
|
|
||||||
this.$message.success('增加成功')
|
|
||||||
this.dialogFormVisible = false
|
|
||||||
this.ANDON_countselect()
|
|
||||||
this.$refs.upload.clearFiles()
|
|
||||||
} else {
|
|
||||||
this.$message.error('增加失败')
|
|
||||||
}
|
|
||||||
},
|
|
||||||
beforeUpload(file) { // 上传前检测
|
|
||||||
const isJPG = /^image\/.*/.test(file.type)
|
|
||||||
if (!isJPG) {
|
|
||||||
this.$message.error('只能上传图片。。')
|
|
||||||
}
|
|
||||||
return isJPG
|
|
||||||
},
|
|
||||||
warningExceed() {
|
|
||||||
this.$message.error('仅可上传五张照片')
|
|
||||||
},
|
|
||||||
handlePicture(row) {
|
|
||||||
this.dialogFormVisible = true
|
|
||||||
this.OPId = row.工位号
|
|
||||||
},
|
|
||||||
submitPerson() {
|
|
||||||
this.$refs.upload.submit()
|
|
||||||
},
|
|
||||||
search() {
|
|
||||||
this.tableDataMassage = []
|
|
||||||
ANDON_countselect().then(response => {
|
|
||||||
this.tableData = response.data
|
|
||||||
return response.data
|
|
||||||
}).then(data => {
|
|
||||||
for (let i = 0; i < data.length; i++) {
|
|
||||||
if (data[i].呼叫备注 !== null) {
|
|
||||||
this.tableDataMassage.push(data[i])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.value = this.tableDataMassage.length
|
|
||||||
})
|
|
||||||
},
|
|
||||||
openWindow() {
|
|
||||||
this.dialogVisible = true
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -249,3 +126,8 @@ export default {
|
|||||||
margin-right: 2px;
|
margin-right: 2px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
<style>
|
||||||
|
.ANDON_Uncomplete{
|
||||||
|
background: #9bd7fc !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
@@ -146,7 +146,6 @@ export default {
|
|||||||
this.dateRange ? check2 = 1 : (check2 = 0, this.dateRange = '')
|
this.dateRange ? check2 = 1 : (check2 = 0, this.dateRange = '')
|
||||||
this.personValue ? check3 = 1 : check3 = 0
|
this.personValue ? check3 = 1 : check3 = 0
|
||||||
searchTable1(this.radio, check1, this.billNames, check2, this.dateRange[0], this.dateRange[1], check3, this.personValue, this.pageCurrent1, this.pageSize1).then(response => {
|
searchTable1(this.radio, check1, this.billNames, check2, this.dateRange[0], this.dateRange[1], check3, this.personValue, this.pageCurrent1, this.pageSize1).then(response => {
|
||||||
console.log(response.data)
|
|
||||||
this.loading1 = false
|
this.loading1 = false
|
||||||
this.tableData1 = response.data.rows
|
this.tableData1 = response.data.rows
|
||||||
this.total1 = response.data.total
|
this.total1 = response.data.total
|
||||||
|
|||||||
Reference in New Issue
Block a user