Browse Source

绑定读写器ip端口号更改

master
z_yu 2 years ago
parent
commit
f8ea0825cb
  1. 32
      src/views/components/BindingTagDlg.vue

32
src/views/components/BindingTagDlg.vue

@ -127,7 +127,8 @@ export default {
readData: {}, readData: {},
timeOut: null, timeOut: null,
timer: null, timer: null,
devIp: ''
devIp: '',
devId: ''
} }
}, },
computed: { computed: {
@ -231,7 +232,7 @@ export default {
console.log(isCover) console.log(isCover)
return await new Promise(async(resolve, reject) => { return await new Promise(async(resolve, reject) => {
this.step4Message = '绑定中' this.step4Message = '绑定中'
const data = { id: this.bindingId, labelType: this.bindingType, tid: this.readData.tid, ip: this.devIp }
const data = { id: this.bindingId, labelType: this.bindingType, tid: this.readData.tid }
if (isCover || this.readData.tid === this.tidCode) { if (isCover || this.readData.tid === this.tidCode) {
data.coverLabel = true data.coverLabel = true
} }
@ -240,24 +241,28 @@ export default {
this.coverBindingVisible = true this.coverBindingVisible = true
resolve() resolve()
} else if (res === 1) { } else if (res === 1) {
let writeRes = await RFID.writeEPC({ op: 'RFID_WriteEPC', sDevID: this.devId, EAS: '1', Type: this.bindingType, Code: this.bindingId, Tid: this.readData.tid })
let writeRes = await RFID.writeEPC({ op: 'RFID_WriteEPC', sDevID: this.devId, EAS: '1', Type: this.bindingType, Code: this.bindingId, Tid: this.readData.tid, ip: this.devIp })
writeRes = JSON.parse(writeRes) writeRes = JSON.parse(writeRes)
if (writeRes.code === '0') { if (writeRes.code === '0') {
this.step = 5 this.step = 5
resolve() resolve()
} else if (writeRes.code === '-1') { } else if (writeRes.code === '-1') {
this.$message({
message: writeRes.message,
type: 'error',
duration: 2500
})
// this.$message({
// message: writeRes.message,
// type: 'error',
// duration: 2500
// })
this.errorStep = 5
this.step5Message = writeRes.message
reject() reject()
} else if (writeRes.code === '-1000') { } else if (writeRes.code === '-1000') {
this.$message({
message: '读写器超时未响应',
type: 'error',
duration: 2500
})
// this.$message({
// message: '',
// type: 'error',
// duration: 2500
// })
this.errorStep = 5
this.step5Message = '读写器超时未响应'
reject() reject()
} }
} else { } else {
@ -289,6 +294,7 @@ export default {
async opened() { async opened() {
if (!this.isBinding) { if (!this.isBinding) {
const devInfo = await this.getDevId() const devInfo = await this.getDevId()
this.devId = devInfo.deviceId
this.devIp = devInfo.deviceIp + ':' + devInfo.devicePort this.devIp = devInfo.deviceIp + ':' + devInfo.devicePort
await this.tryConnect({ op: 'RFID_CheckStatus', sDevID: devInfo.deviceId, ip: this.devIp }) await this.tryConnect({ op: 'RFID_CheckStatus', sDevID: devInfo.deviceId, ip: this.devIp })
await this.readEpc({ op: 'RFID_ReadEpc', sDevID: devInfo.deviceId, ip: this.devIp }) await this.readEpc({ op: 'RFID_ReadEpc', sDevID: devInfo.deviceId, ip: this.devIp })

Loading…
Cancel
Save