This commit is contained in:
chenjianan
2019-05-15 15:17:26 +08:00
15 changed files with 396 additions and 47 deletions

View File

@@ -0,0 +1,153 @@
<template>
<div>
<el-card>
<el-badge :value="value" class="item" style="margin-bottom: 10px; float: right">
<el-button size="small" @click="openWindow">Andon信息</el-button>
</el-badge>
<el-table
:data="tableData"
style="width: 100%;"
size="mini"
height="800"
highlight-current-row
border>
<el-table-column align="center" label="工位号">
<template slot-scope="scope">
<el-button type="text">{{ scope.row.工位号 }}</el-button>
</template>
</el-table-column>
<el-table-column align="center" label="登陆人">
<template slot-scope="scope">
<el-tag v-if="scope.row.姓名===''||scope.row.姓名===null" slot="reference" size="small" style="width: 80px" type="warning">未登录</el-tag>
<el-tag v-else slot="reference" type="success" size="small" style="width: 80px"> {{ scope.row.姓名 }} </el-tag>
</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>
</el-card>
<el-dialog
:visible.sync="dialogVisible"
width="60%">
<el-table
:data="tableDataMassage"
style="width: 100%;"
size="mini"
height="500"
highlight-current-row
border>
<el-table-column align="center" label="工位号">
<template slot-scope="scope">
<el-button type="text">{{ scope.row.工位号 }}</el-button>
</template>
</el-table-column>
<el-table-column align="center" label="登陆人">
<template slot-scope="scope">
<el-tag v-if="scope.row.姓名===''||scope.row.姓名===null" slot="reference" size="small" style="width: 80px" type="warning">未登录</el-tag>
<el-tag v-else slot="reference" type="success" size="small" style="width: 80px"> {{ scope.row.姓名 }} </el-tag>
</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>
</el-dialog>
</div>
</template>
<script>
import { ANDON_countselect } from '@/api/ManufacturingCenter/AntonMonitoring'
import { wsuri, name1 } from '@/utils/request'
export default {
data() {
return {
tableData: [],
timer_ANDON: '',
andonMsg: '',
Name: '',
massage: [],
dialogVisible: false,
tableDataMassage: [],
value: 0
}
},
mounted() {
this.ANDON_countselect()
this.timer_ANDON = setInterval(this.search(), 60 * 1000 * 5) // ANDON看板 5 分钟一刷新
},
created() {
this.initWebpack()
},
methods: {
ANDON_countselect() {
ANDON_countselect().then(response => {
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()
}
},
// 关闭
websocketclose() {
console.log('WebSocket关闭')
},
// 失败
websocketerror() {
console.log('WebSocket连接失败')
},
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>
<style scoped>
.el-card{
margin-left: 2px;
margin-top: 2px;
margin-bottom: 2px;
margin-right: 2px;
}
</style>

View File

@@ -75,6 +75,16 @@
{{ scope.row.发货节点 }}
</template>
</el-table-column>
<el-table-column label="设备预验节点" align="center" width="150px">
<template slot-scope="scope">
{{ scope.row.设备预验收节点 }}
</template>
</el-table-column>
<el-table-column label="安装调试节点" align="center" width="150px">
<template slot-scope="scope">
{{ scope.row.安装调试节点 }}
</template>
</el-table-column>
<el-table-column label="客户名称" align="center" width="280px">
<template slot-scope="scope">
{{ scope.row.客户名称 }}
@@ -455,6 +465,12 @@ export default {
if (response.data.rows[i].发货节点 !== '' && response.data.rows[i].发货节点 !== null) {
response.data.rows[i].发货节点 = response.data.rows[i].发货节点.split(' ')[0]
}
if (response.data.rows[i].设备预验收节点 !== '' && response.data.rows[i].设备预验收节点 !== null) {
response.data.rows[i].设备预验收节点 = response.data.rows[i].设备预验收节点.split(' ')[0]
}
if (response.data.rows[i].安装调试节点 !== '' && response.data.rows[i].安装调试节点 !== null) {
response.data.rows[i].安装调试节点 = response.data.rows[i].安装调试节点.split(' ')[0]
}
if (response.data.rows[i].机床设计完成时间 !== '' && response.data.rows[i].机床设计完成时间 !== null) {
response.data.rows[i].机床设计完成时间 = response.data.rows[i].机床设计完成时间.split(' ')[0]
}
@@ -503,6 +519,8 @@ export default {
机床数量: response.data.rows[i].机床数量,
合同签订日期: response.data.rows[i].合同签订日期,
发货节点: response.data.rows[i].发货节点,
设备预验收节点: response.data.rows[i].设备预验收节点,
安装调试节点: response.data.rows[i].安装调试节点,
客户名称: response.data.rows[i].客户名称,
机床设计者: response.data.rows[i].机床设计者,
机床设计完成时间: response.data.rows[i].机床设计完成时间,

View File

@@ -89,6 +89,16 @@
<span :class="colorJudge(scope.row.发货节点)">{{ scope.row.发货节点 === '1900-01-01 00:00:00' ? '' : scope.row.发货节点 }}</span>
</template>
</el-table-column>
<el-table-column label="设备预验节点" align="center" width="150px">
<template slot-scope="scope">
{{ scope.row.设备预验收节点 }}
</template>
</el-table-column>
<el-table-column label="安装调试节点" align="center" width="150px">
<template slot-scope="scope">
{{ scope.row.安装调试节点 }}
</template>
</el-table-column>
<el-table-column label="审图(计划开始)" align="center" min-width="170px">
<template slot-scope="scope">
{{ scope.row.审图计划开始时间 === '1900-01-01 00:00:00' ? '' : scope.row.审图计划开始时间 }}
@@ -455,9 +465,54 @@ export default {
if (response.data[i].发货节点 !== '' && response.data[i].发货节点 !== null) {
response.data[i].发货节点 = response.data[i].发货节点.split(' ')[0]
}
if (response.data.rows[i].设备预验收节点 !== '' && response.data.rows[i].设备预验收节点 !== null) {
response.data.rows[i].设备预验收节点 = response.data.rows[i].设备预验收节点.split(' ')[0]
}
if (response.data.rows[i].安装调试节点 !== '' && response.data.rows[i].安装调试节点 !== null) {
response.data.rows[i].安装调试节点 = response.data.rows[i].安装调试节点.split(' ')[0]
}
if (response.data[i].审图计划开始时间 !== '' && response.data[i].审图计划开始时间 !== null) {
response.data[i].审图计划开始时间 = response.data[i].审图计划开始时间.split(' ')[0]
}
if (response.data[i].审图计划完成时间 !== '' && response.data[i].审图计划完成时间 !== null) {
response.data[i].审图计划完成时间 = response.data[i].审图计划完成时间.split(' ')[0]
}
if (response.data[i].审图实际完成时间 !== '' && response.data[i].审图实际完成时间 !== null) {
response.data[i].审图实际完成时间 = response.data[i].审图实际完成时间.split(' ')[0]
}
if (response.data[i].机床设计完成时间 !== '' && response.data[i].机床设计完成时间 !== null) {
response.data[i].机床设计完成时间 = response.data[i].机床设计完成时间.split(' ')[0]
}
if (response.data[i].机床设计实际完成时间 !== '' && response.data[i].机床设计实际完成时间 !== null) {
response.data[i].机床设计实际完成时间 = response.data[i].机床设计实际完成时间.split(' ')[0]
}
if (response.data[i].采购完成时间 !== '' && response.data[i].采购完成时间 !== null) {
response.data[i].采购完成时间 = response.data[i].采购完成时间.split(' ')[0]
}
if (response.data[i].采购实际完成时间 !== '' && response.data[i].采购实际完成时间 !== null) {
response.data[i].采购实际完成时间 = response.data[i].采购实际完成时间.split(' ')[0]
}
if (response.data[i].备料完成时间 !== '' && response.data[i].备料完成时间 !== null) {
response.data[i].备料完成时间 = response.data[i].备料完成时间.split(' ')[0]
}
if (response.data[i].备料实际完成时间 !== '' && response.data[i].备料实际完成时间 !== null) {
response.data[i].备料实际完成时间 = response.data[i].备料实际完成时间.split(' ')[0]
}
if (response.data[i].机床生产完成时间 !== '' && response.data[i].机床生产完成时间 !== null) {
response.data[i].机床生产完成时间 = response.data[i].机床生产完成时间.split(' ')[0]
}
if (response.data[i].机床生产实际完成时间 !== '' && response.data[i].机床生产实际完成时间 !== null) {
response.data[i].机床生产实际完成时间 = response.data[i].机床生产实际完成时间.split(' ')[0]
}
if (response.data[i].机床装配完成时间 !== '' && response.data[i].机床装配完成时间 !== null) {
response.data[i].机床装配完成时间 = response.data[i].机床装配完成时间.split(' ')[0]
}
if (response.data[i].机床装配实际完成时间 !== '' && response.data[i].机床装配实际完成时间 !== null) {
response.data[i].机床装配实际完成时间 = response.data[i].机床装配实际完成时间.split(' ')[0]
}
}
this.loading = false
console.log(response.data)
console.log(response.data, 222222)
this.tableData = response.data
}).then(() => {
searchtable2(this.machineValue, 1).then(response => {