加工顺序调整

This commit is contained in:
zhangdingyu
2019-03-09 16:19:48 +08:00
parent bc48a04198
commit 2c20ebaa6e

View File

@@ -14,7 +14,7 @@
</el-option>
</el-select>
<el-button type="success" class="el-icon-search" size="small" style="margin: 10px 0 0 10px" @click="searchTable();pageCurrent=1;pageSize=10;total = 0">查询</el-button>
<el-button type="success" class="el-icon-refresh" size="small" style="margin: 10px 0 0 10px" @click="Refresh">刷新工位</el-button>
<el-badge :value="num" :max="99" class="item">
<el-button size="small" type="text" @click="dialogFormVisible=true;Jurisdiction()">调序权限</el-button>
</el-badge>
@@ -330,9 +330,12 @@
<script>
import { getMachine, getMachine2, searchtable, getTable2, Order, JurisdictionControl } from '@/api/ManufacturingCenter/MachiningSequenceAdjustment'
import { wsuri, name } from '@/utils/request'
export default {
data() {
return {
opname: '', // 用来通知工位刷新数据
msg: '',
num: 0,
count: 0,
dialogFormVisible: false,
@@ -362,8 +365,37 @@ export default {
created() {
this.Jurisdiction()
this.fetchData()
this.initWebsocket()
},
methods: {
initWebsocket() { // 初始化websocket
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连接成功')
// MessageBox('提示', '连接成功')
this.websock.send('LIN,' + name)
},
websocketonmessage(msg) { // 数据接收
console.log(msg)
this.msg = msg
},
websocketclose() { // 关闭
console.log('WebSocket关闭')
},
websocketerror() { // 失败
console.log('WebSocket连接失败')
// MessageBox('提示', '连接失败');
// this.socketConnect = false
},
Refresh() {
// this.initWebsocket()
this.websock.send('TOBS?MES?' + this.MachineValue + '?MES|SequenceAdjustment|' + this.MachineValue + '|1')
},
// 初始化获取工位
fetchData() {
this.MachineValue = ''
@@ -437,13 +469,21 @@ export default {
})
},
JurisdictionControl1(row) {
this.opname = row.MES终端号
JurisdictionControl(row.MES终端号, 1).then(response => {
this.Jurisdiction()
return this.opname
}).then(data => {
this.websock.send('TOBS?MES?' + data + '?MES|PartsSequentialAuthority|' + data + '|1')
})
},
JurisdictionControl2(row) {
this.opname = row.MES终端号
JurisdictionControl(row.MES终端号, 2).then(response => {
this.Jurisdiction()
return this.opname
}).then(data => {
this.websock.send('TOBS?MES?' + data + '?MES|PartsSequentialAuthority|' + data + '|0')
})
},
// 上移