diff --git a/src/views/components/BindingTagDlg.vue b/src/views/components/BindingTagDlg.vue index acc0686..e868ea7 100644 --- a/src/views/components/BindingTagDlg.vue +++ b/src/views/components/BindingTagDlg.vue @@ -127,7 +127,7 @@ export default { readData: {}, timeOut: null, timer: null, - devId: '' + devIp: '' } }, computed: { @@ -231,7 +231,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 } + const data = { id: this.bindingId, labelType: this.bindingType, tid: this.readData.tid, ip: this.devIp } if (isCover || this.readData.tid === this.tidCode) { data.coverLabel = true } @@ -281,17 +281,17 @@ export default { this.errorStep = 1 reject('当前电脑未绑定读写器,请到档案设备里进行绑定') } else { - resolve(dev.deviceId) + resolve(dev) } } }) }, async opened() { if (!this.isBinding) { - this.devId = await this.getDevId() - // this.devId = 'D001' - await this.tryConnect({ op: 'RFID_CheckStatus', sDevID: this.devId }) - await this.readEpc({ op: 'RFID_ReadEpc', sDevID: this.devId }) + const devInfo = await this.getDevId() + 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 }) await this.startBind() } },