|
|
@ -127,7 +127,8 @@ export default { |
|
|
|
readData: {}, |
|
|
|
timeOut: null, |
|
|
|
timer: null, |
|
|
|
devIp: '' |
|
|
|
devIp: '', |
|
|
|
devId: '' |
|
|
|
} |
|
|
|
}, |
|
|
|
computed: { |
|
|
@ -231,7 +232,7 @@ export default { |
|
|
|
console.log(isCover) |
|
|
|
return await new Promise(async(resolve, reject) => { |
|
|
|
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) { |
|
|
|
data.coverLabel = true |
|
|
|
} |
|
|
@ -240,24 +241,28 @@ export default { |
|
|
|
this.coverBindingVisible = true |
|
|
|
resolve() |
|
|
|
} 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) |
|
|
|
if (writeRes.code === '0') { |
|
|
|
this.step = 5 |
|
|
|
resolve() |
|
|
|
} 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() |
|
|
|
} 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() |
|
|
|
} |
|
|
|
} else { |
|
|
@ -289,6 +294,7 @@ export default { |
|
|
|
async opened() { |
|
|
|
if (!this.isBinding) { |
|
|
|
const devInfo = await this.getDevId() |
|
|
|
this.devId = devInfo.deviceId |
|
|
|
this.devIp = devInfo.deviceIp + ':' + devInfo.devicePort |
|
|
|
await this.tryConnect({ op: 'RFID_CheckStatus', sDevID: devInfo.deviceId, ip: this.devIp }) |
|
|
|
await this.readEpc({ op: 'RFID_ReadEpc', sDevID: devInfo.deviceId, ip: this.devIp }) |
|
|
|