Merge branch 'master' of ssh://192.168.0.149:29418/高精2.0
This commit is contained in:
@@ -21,7 +21,7 @@
|
|||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<el-card>
|
<el-card>
|
||||||
<el-table v-loading="loading0" :data="tableData" height="650" style="width: 100%;" border @expand-change="searchTable2">
|
<el-table v-loading="loading0" :data="tableData" :row-key="getRowKeys" :expand-row-keys="expands" height="650" style="width: 100%;" border @expand-change="searchTable2">
|
||||||
<el-table-column type="expand">
|
<el-table-column type="expand">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-table :data="tableData2" border style="text-align: center" size="mini">
|
<el-table :data="tableData2" border style="text-align: center" size="mini">
|
||||||
@@ -334,6 +334,9 @@ import { wsuri, name } from '@/utils/request'
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
a: 1,
|
||||||
|
b: 1,
|
||||||
|
expands: [],
|
||||||
opname: '', // 用来通知工位刷新数据
|
opname: '', // 用来通知工位刷新数据
|
||||||
msg: '',
|
msg: '',
|
||||||
num: 0,
|
num: 0,
|
||||||
@@ -368,6 +371,44 @@ export default {
|
|||||||
this.initWebsocket()
|
this.initWebsocket()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getRowKeys(row) {
|
||||||
|
console.log(row)
|
||||||
|
return row.零件图号
|
||||||
|
},
|
||||||
|
selectMachine(row) {
|
||||||
|
this.process = []
|
||||||
|
this.planDate = []
|
||||||
|
this.worker = []
|
||||||
|
this.colorCode = []
|
||||||
|
this.realDate = []
|
||||||
|
this.tableData2 = []
|
||||||
|
getTable2(row.零件图号).then(response => {
|
||||||
|
for (let k = 0; k < response.data.length; k++) {
|
||||||
|
this.process[k] = response.data[k].工艺名称简称
|
||||||
|
this.planDate[k] = response.data[k].计划日期_短
|
||||||
|
this.realDate[k] = response.data[k].完成日期_短
|
||||||
|
if (response.data[k].工艺编号 === 29) {
|
||||||
|
response.data[k].员工姓名 = '备料'
|
||||||
|
}
|
||||||
|
if (response.data[k].工序间是否外协 === 2) {
|
||||||
|
response.data[k].员工姓名 = '外协'
|
||||||
|
}
|
||||||
|
if (response.data[k].员工姓名 === '超级管理员') {
|
||||||
|
response.data[k].员工姓名 = '无'
|
||||||
|
}
|
||||||
|
this.worker[k] = response.data[k].员工姓名
|
||||||
|
if (response.data[k].工序状态 === 5) { // 灰色是已经完成 未入库
|
||||||
|
this.colorCode[k] = 'grey'
|
||||||
|
} else {
|
||||||
|
this.colorCode[k] = response.data[k].进度颜色
|
||||||
|
}
|
||||||
|
if (response.data[k].工序间是否外协 === 2) {
|
||||||
|
this.colorCode[k] = 'lightblue'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.tableData2.push(response.data[0])
|
||||||
|
})
|
||||||
|
},
|
||||||
initWebsocket() { // 初始化websocket
|
initWebsocket() { // 初始化websocket
|
||||||
this.websock = new WebSocket(wsuri)// 这里面的this都指向vue
|
this.websock = new WebSocket(wsuri)// 这里面的this都指向vue
|
||||||
this.websock.onopen = this.websocketopen
|
this.websock.onopen = this.websocketopen
|
||||||
@@ -377,7 +418,6 @@ export default {
|
|||||||
},
|
},
|
||||||
websocketopen() { // 打开
|
websocketopen() { // 打开
|
||||||
console.log('WebSocket连接成功')
|
console.log('WebSocket连接成功')
|
||||||
// MessageBox('提示', '连接成功')
|
|
||||||
this.websock.send('LIN,' + name)
|
this.websock.send('LIN,' + name)
|
||||||
},
|
},
|
||||||
websocketonmessage(msg) { // 数据接收
|
websocketonmessage(msg) { // 数据接收
|
||||||
@@ -389,11 +429,8 @@ export default {
|
|||||||
},
|
},
|
||||||
websocketerror() { // 失败
|
websocketerror() { // 失败
|
||||||
console.log('WebSocket连接失败')
|
console.log('WebSocket连接失败')
|
||||||
// MessageBox('提示', '连接失败');
|
|
||||||
// this.socketConnect = false
|
|
||||||
},
|
},
|
||||||
Refresh() {
|
Refresh() {
|
||||||
// this.initWebsocket()
|
|
||||||
this.websock.send('TOBS?MES?' + this.MachineValue + '?MES|SequenceAdjustment|' + this.MachineValue + '|1')
|
this.websock.send('TOBS?MES?' + this.MachineValue + '?MES|SequenceAdjustment|' + this.MachineValue + '|1')
|
||||||
},
|
},
|
||||||
// 初始化获取工位
|
// 初始化获取工位
|
||||||
@@ -425,6 +462,21 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
searchTable2(row) {
|
searchTable2(row) {
|
||||||
|
if (this.a === 1) {
|
||||||
|
this.expands.push(row.零件图号)
|
||||||
|
this.b = row.零件图号
|
||||||
|
this.a = 0
|
||||||
|
} else {
|
||||||
|
if (this.b === row.零件图号) {
|
||||||
|
this.expands = []
|
||||||
|
this.a = 1
|
||||||
|
} else {
|
||||||
|
this.expands = []
|
||||||
|
this.expands.push(row.零件图号)
|
||||||
|
this.a = 0
|
||||||
|
this.b = row.零件图号
|
||||||
|
}
|
||||||
|
}
|
||||||
this.process = []
|
this.process = []
|
||||||
this.planDate = []
|
this.planDate = []
|
||||||
this.worker = []
|
this.worker = []
|
||||||
|
|||||||
@@ -545,12 +545,12 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
this.checkbox_number = true
|
this.checkbox_number = true
|
||||||
}
|
}
|
||||||
if(this.startTime === '' || this.startTime === null) {
|
if (this.startTime === '' || this.startTime === null) {
|
||||||
this.startTime_check = 0
|
this.startTime_check = 0
|
||||||
} else {
|
} else {
|
||||||
this.startTime_check = 1
|
this.startTime_check = 1
|
||||||
}
|
}
|
||||||
if(this.endTime === '' || this.endTime === null) {
|
if (this.endTime === '' || this.endTime === null) {
|
||||||
this.endTime_check = 0
|
this.endTime_check = 0
|
||||||
} else {
|
} else {
|
||||||
this.endTime_check = 1
|
this.endTime_check = 1
|
||||||
|
|||||||
Reference in New Issue
Block a user