From f8ea0825cb6da654e45618113f0b5a400096289d Mon Sep 17 00:00:00 2001 From: z_yu <1534695664@qq.com> Date: Thu, 8 Sep 2022 15:12:28 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=91=E5=AE=9A=E8=AF=BB=E5=86=99=E5=99=A8ip?= =?UTF-8?q?=E7=AB=AF=E5=8F=A3=E5=8F=B7=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/components/BindingTagDlg.vue | 32 +++++++++++++++----------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/src/views/components/BindingTagDlg.vue b/src/views/components/BindingTagDlg.vue index e868ea7..326254f 100644 --- a/src/views/components/BindingTagDlg.vue +++ b/src/views/components/BindingTagDlg.vue @@ -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 })