Browse Source

离线模式RFID解除绑定

master
z_yu 2 years ago
parent
commit
f3b032d484
  1. 16
      src/views/archivesManage/lendManage/mixins/lending.js

16
src/views/archivesManage/lendManage/mixins/lending.js

@ -177,7 +177,7 @@ export const lendingCrud = {
const MAX_NUM_RETRIES = 3
for (let i = 0; i < MAX_NUM_RETRIES; i++) {
let writeRes = await RFID.writeEPC(params)
console.log('writeRes', writeRes)
// console.log('writeRes', writeRes)
writeRes = JSON.parse(writeRes)
if (writeRes.code === '0') {
this.isKey = !this.isKey
@ -292,7 +292,7 @@ export const lendingCrud = {
})
},
async opened(ase) {
console.log(11111)
// console.log(11111)
this.btnDisabled = true
this.ase = ase
const devInfo = await this.getDevId()
@ -300,7 +300,7 @@ export const lendingCrud = {
this.devIp = devInfo.deviceIp + ':' + devInfo.devicePort
await this.tryConnect({ op: 'RFID_CheckStatus', sDevID: devInfo.deviceId, ip: this.devIp })
for (let tipTableIndex = 0; tipTableIndex < this.tipTable.length; tipTableIndex++) {
console.log('tipTableIndex', tipTableIndex)
// console.log('tipTableIndex', tipTableIndex)
if (this.tipTable[tipTableIndex].warnState !== '已解除' && this.tipTable[tipTableIndex].warnState !== '已恢复' && this.tipTable[tipTableIndex].warnState !== '解除失败' && this.tipTable[tipTableIndex].warnState !== '恢复失败') {
await this.readEpc({ op: 'RFID_ReadEpc', sDevID: devInfo.deviceId, ip: this.devIp }, tipTableIndex)
}
@ -324,6 +324,7 @@ export const lendingCrud = {
},
async checkStatus(param) {
return RFID.checkStatus(param).then((res) => {
// console.log('checkStatus-Res', res)
res = JSON.parse(res)
if (res.code && res.code === '0') {
this.$message.success('连接成功')
@ -339,25 +340,24 @@ export const lendingCrud = {
},
async tryConnect(param) {
let res
let err
const MAX_NUM_RETRIES = 3
for (let i = 0; i < MAX_NUM_RETRIES; i++) {
try {
res = await this.checkStatus(param)
console.log(2222)
// console.log('res', res)
break
} catch (e) {
err = e
this.$message.error('连接失败,请检查网络')
}
}
// console.log('res', res)
if (res) {
console.log(3333)
// console.log(3333)
return res
}
this.btnDisabled = false
this.unbindWarnLoading = false
throw err
throw new Error('读写器异常')
},
// 只要有一条未解除/恢复成功即errorTip
alarmErrorTip() {

Loading…
Cancel
Save