28 changed files with 831 additions and 225 deletions
-
2.env.development
-
2.env.production
-
2public/static/config.js
-
1src/assets/styles/yxk-admin.scss
-
6src/views/archivesManage/RFIDArchives/borrowerManage/index.vue
-
28src/views/archivesManage/RFIDArchives/borrowerManage/module/addBorrower.vue
-
10src/views/archivesManage/RFIDArchives/components/archiveDetail.vue
-
2src/views/archivesManage/RFIDArchives/components/lendArchivesList.vue
-
226src/views/archivesManage/RFIDArchives/returnArchives/index.vue
-
108src/views/archivesManage/RFIDArchives/toLend/index.vue
-
5src/views/archivesManage/RFIDArchives/toLend/module/lendRecord.vue
-
26src/views/archivesManage/archivesList/archivesAnjuan/index.vue
-
14src/views/archivesManage/archivesList/archivesJuannei/index.vue
-
2src/views/archivesManage/archivesList/module/archivesInfo/index.vue
-
34src/views/archivesManage/archivesSearch/index.vue
-
2src/views/archivesManage/lendManage/components/archiveDetail.vue
-
2src/views/archivesManage/lendManage/components/lendArchivesList.vue
-
5src/views/archivesManage/outInStorage/inStorage/module/inDialog.vue
-
336src/views/components/BindingTagDlg-olc.vue
-
180src/views/components/BindingTagDlg.vue
-
10src/views/components/category/PreviewForm.vue
-
24src/views/storeManage/deviceManage/index.vue
-
4src/views/storeManage/warehouse3D/archivesStorage/index.vue
-
2src/views/storeManage/warehouse3D/collateRoom/index.vue
-
13src/views/storeManage/warehouse3D/deseCabinet/index.vue
-
2src/views/storeManage/warehouse3D/index.vue
-
4src/views/storeManage/warehouse3D/module/hkVideo.vue
-
4src/views/storeManage/warehouse3DConfig/index.vue
@ -1,6 +1,6 @@ |
|||
window.g = { |
|||
AXIOS_TIMEOUT: 10000, |
|||
ApiUrl: 'http://192.168.1.100:7070', // 配置服务器地址
|
|||
ApiUrl: 'http://192.168.99.100:7080', // 配置服务器地址
|
|||
ApiWebRtcServerUrl: '127.0.0.1:8000', // 配置监控视频服务器地址
|
|||
sDevID:'D003' // 桌面式RFID读写器
|
|||
} |
|||
@ -0,0 +1,336 @@ |
|||
<template> |
|||
<div> |
|||
<el-dialog ref="bindingTagDialog" class="bindingDialog" :title="bindingTitle" :visible.sync="bindingVisible" :close-on-click-modal="false" :before-close="handleClose" @opened="opened"> |
|||
<span class="dialog-right-top" /> |
|||
<span class="dialog-left-bottom" /> |
|||
<div class="setting-dialog"> |
|||
<div class="binding-wrap"> |
|||
<div v-if="isBinding" class="rebinding"> |
|||
<span>TID</span> |
|||
<el-input v-model="tidCode" placeholder="请输入内容" /> |
|||
</div> |
|||
<div v-else class="binding-flow"> |
|||
<div class="step-item"> |
|||
<!-- step-active 完成 step-loading 进行种 --> |
|||
<span class="step-left-num" :class="{ 'step-active': 1 <= step, 'step-loading': 1 === step }">1</span> |
|||
<div class="step-right-cont"> |
|||
<p class="step-title">第一步<span>连接读写器</span></p> |
|||
<p class="step-tip" :class="{ 'tip-error': 1 === errorStep, 'tip-active': 1 <= step }">{{ step1Message }}</p> |
|||
<!-- err: 连接失败,请检查网络 --> |
|||
<!-- err: 当前电脑未绑定读写器,请到档案设备里进行绑定 --> |
|||
</div> |
|||
</div> |
|||
<div class="step-item"> |
|||
<span class="step-left-num" :class="{ 'step-active': 2 <= step, 'step-loading': 2 === step }">2</span> |
|||
<div class="pulse1" /> |
|||
<div class="pulse2" /> |
|||
<div class="pulse3" /> |
|||
<div class="step-right-cont"> |
|||
<p class="step-title">第二步<span>放入标签</span></p> |
|||
<p class="step-tip" :class="{ 'tip-error': 2 === errorStep, 'tip-active': 2 <= step }">{{ step2Message }}</p> |
|||
<!-- tip: 请放入标签 --> |
|||
<!-- tip: 已放入标签 --> |
|||
<!-- err: 未读取到标签,请重新放入 --> |
|||
</div> |
|||
</div> |
|||
<div class="step-item"> |
|||
<span class="step-left-num" :class="{ 'step-active': 3 <= step, 'step-loading': 3 === step }">3</span> |
|||
<div class="step-right-cont"> |
|||
<p class="step-title">第三步<span>读取标签</span></p> |
|||
<p class="step-tip" :class="{ 'tip-error': 3 === errorStep, 'tip-active': 3 <= step }">{{ step3Message }}</p> |
|||
<!-- tip: 放入标签后开始读取标签 --> |
|||
<!-- tip: 读取成功 --> |
|||
<!-- err: 当前标签存在多个,请取出多余的标签只保留一张! --> |
|||
</div> |
|||
</div> |
|||
<div class="step-item"> |
|||
<span class="step-left-num" :class="{ 'step-active': 4 <= step, 'step-loading': 4 === step }">4</span> |
|||
<div class="step-right-cont"> |
|||
<p class="step-title">第四步<span>开始绑定</span></p> |
|||
<p class="step-tip" :class="{ 'tip-error': 4 === errorStep, 'tip-active': 4 <= step }">{{ step4Message }}</p> |
|||
<!-- tip: 标签读取成功后,开始绑定档案 --> |
|||
<!-- tip: 绑定中 --> |
|||
<!-- err: 当前标签已被绑定,是否覆盖? --> |
|||
<!-- 3s后 弹出覆盖绑定dialog --> |
|||
<!-- tip: 已覆盖 --> |
|||
<!-- err: 绑定失败,请拿走当前标签 --> |
|||
</div> |
|||
</div> |
|||
<div class="step-item"> |
|||
<span class="step-left-num" :class="{ 'step-active': 5 === step }">5</span> |
|||
<div class="step-right-cont"> |
|||
<p class="step-title">第五步<span>绑定成功</span></p> |
|||
<p class="step-tip" :class="{ 'tip-error': 5 === errorStep,'tip-active': 5 === step }">{{ step5Message }}</p> |
|||
<!-- tip: 当前标签与档案绑定成功 --> |
|||
<!-- tip: 绑定成功 --> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div v-if="isBinding" slot="footer" class="dialog-footer"> |
|||
<el-button type="primary" @click="nextStep">下一步</el-button> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</el-dialog> |
|||
|
|||
<!-- 是否覆盖 --> |
|||
<el-dialog ref="coverBindingDialog" title="覆盖绑定" :append-to-body="true" :visible.sync="coverBindingVisible" :before-close="handleCoverBindingClose"> |
|||
<span class="dialog-right-top" /> |
|||
<span class="dialog-left-bottom" /> |
|||
<div class="setting-dialog"> |
|||
<div class="dialog-delt"> |
|||
<p><span>当前标签已被绑定,是否覆盖?</span></p> |
|||
</div> |
|||
<div slot="footer" class="dialog-footer"> |
|||
<el-button type="primary" @click="doCoverBinding">确定覆盖</el-button> |
|||
<el-button type="text" @click="cancel">取消</el-button> |
|||
</div> |
|||
</div> |
|||
</el-dialog> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import RFID from '@/api/RFID/RFID' |
|||
import { bingdingLabel } from '@/api/storeManage/tagManage/bindTagList' |
|||
export default { |
|||
name: 'BindingTagDlg', |
|||
components: {}, |
|||
mixins: [], |
|||
props: { |
|||
bindingId: { |
|||
type: String, |
|||
default: '' |
|||
}, |
|||
bindingType: { |
|||
type: Number, |
|||
default: 1 |
|||
}, |
|||
bindingTxt: { |
|||
type: String, |
|||
default: '档案' |
|||
} |
|||
}, |
|||
data() { |
|||
return { |
|||
isBinding: false, // 读取标签是否被覆盖 |
|||
bindingVisible: false, // 绑定标签对话框是否显示 |
|||
tidCode: '', |
|||
coverBindingVisible: false, |
|||
step: 1, |
|||
errorStep: 0, |
|||
step1Message: '连接中', |
|||
step2Message: '请放入标签', |
|||
step3Message: '放入标签后开始读取标签', |
|||
step4Message: '标签读取成功后,开始绑定档案', |
|||
step5Message: '当前标签与' + this.bindingTxt + '绑定成功', |
|||
readData: {}, |
|||
timeOut: null, |
|||
timer: null, |
|||
devIp: '', |
|||
devId: '' |
|||
} |
|||
}, |
|||
computed: { |
|||
bindingTitle: function() { |
|||
return this.isBinding ? '重新绑定' : '绑定标签' |
|||
} |
|||
}, |
|||
beforeDestroy() { |
|||
// 清除定时器 |
|||
clearTimeout(this.timeOut) |
|||
this.timeOut = null |
|||
}, |
|||
methods: { |
|||
initData() { |
|||
this.step = 1 |
|||
this.errorStep = 0 |
|||
this.step1Message = '连接中' |
|||
this.step2Message = '请放入标签' |
|||
this.step3Message = '放入标签后开始读取标签' |
|||
this.step4Message = '标签读取成功后,开始绑定档案' |
|||
this.step5Message = '当前标签与' + this.bindingTxt + '绑定成功' |
|||
this.isBinding = false |
|||
this.coverLabel = false |
|||
this.tidCode = '' |
|||
}, |
|||
async checkStatus(param) { |
|||
return RFID.checkStatus(param).then((res) => { |
|||
res = JSON.parse(res) |
|||
if (res.code && res.code === '0') { |
|||
this.step = 2 |
|||
this.step1Message = '连接成功' |
|||
return true |
|||
} else { |
|||
this.errorStep = 1 |
|||
if (res.code && res.code === '-1') { |
|||
this.step1Message = '读写器状态异常(例如读写器USB线未插入)' |
|||
} else if (res.code === '-1000') { |
|||
this.step1Message = '读写器超时未响应(例如终端读写服务未开启或网络异常)' |
|||
} |
|||
} |
|||
}) |
|||
}, |
|||
readEpc(param) { |
|||
return new Promise((resolve, reject) => { |
|||
RFID.readEpc(param).then(res => { |
|||
res = JSON.parse(res) |
|||
if (res.code && res.code === '0') { |
|||
this.step = 3 |
|||
this.errorStep = 0 |
|||
this.step2Message = '已放入标签' |
|||
if (res.data.length > 1) { |
|||
this.errorStep = 3 |
|||
this.step3Message = '当前标签存在多个,请取出多余的标签只保留一张!' |
|||
clearTimeout(this.timer) |
|||
this.timer = setTimeout(() => { |
|||
resolve(this.readEpc(param)) |
|||
}, 2000) |
|||
} else if (res.data.length === 1) { |
|||
this.readData = res.data[0] |
|||
this.step3Message = '读取成功!' |
|||
this.step = 4 |
|||
resolve() |
|||
} |
|||
} else if (res.code && res.code === '-2') { |
|||
this.errorStep = 2 |
|||
this.step2Message = '未读取到标签,请重新放入' |
|||
this.step = 2 |
|||
clearTimeout(this.timer) |
|||
this.timer = setTimeout(() => { |
|||
resolve(this.readEpc(param)) |
|||
}, 2000) |
|||
} else { |
|||
this.errorStep = 2 |
|||
this.step2Message = '读取标签失败' |
|||
reject() |
|||
} |
|||
}) |
|||
}) |
|||
}, |
|||
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) |
|||
break |
|||
} catch (e) { |
|||
err = e |
|||
this.errorStep = 1 |
|||
this.step1Message = '连接失败,请检查网络' |
|||
} |
|||
} |
|||
if (res) return res |
|||
// this.timeOut = setTimeout(() => { |
|||
// this.$refs.bindingTagDialog.handleClose() |
|||
// }, 3000) |
|||
throw err |
|||
}, |
|||
async startBind(isCover) { |
|||
console.log(isCover) |
|||
return await new Promise(async(resolve, reject) => { |
|||
this.step4Message = '绑定中' |
|||
const data = { id: this.bindingId, labelType: this.bindingType, tid: this.readData.tid } |
|||
if (isCover || this.readData.tid === this.tidCode) { |
|||
data.coverLabel = true |
|||
} |
|||
const res = await bingdingLabel(data) |
|||
if (res === '当前标签已被绑定') { |
|||
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, 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.errorStep = 5 |
|||
this.step5Message = writeRes.message |
|||
reject() |
|||
} else if (writeRes.code === '-1000') { |
|||
// this.$message({ |
|||
// message: '读写器超时未响应', |
|||
// type: 'error', |
|||
// duration: 2500 |
|||
// }) |
|||
this.errorStep = 5 |
|||
this.step5Message = '读写器超时未响应' |
|||
reject() |
|||
} |
|||
} else { |
|||
this.step5Message = '绑定失败' |
|||
this.errorStep = 5 |
|||
reject() |
|||
} |
|||
}) |
|||
}, |
|||
async getDevId() { |
|||
return await new Promise(async(resolve, reject) => { |
|||
const mac = await RFID.getDeviceMac() |
|||
if (!mac || mac === '') { |
|||
this.step1Message = '获取mac地址失败' |
|||
this.errorStep = 1 |
|||
reject('获取mac地址失败') |
|||
} else { |
|||
const dev = await RFID.getDeviceIdByMac(mac) |
|||
if (!dev || dev === {} || !dev.deviceId) { |
|||
this.step1Message = '当前电脑未绑定读写器,请到档案设备里进行绑定' |
|||
this.errorStep = 1 |
|||
reject('当前电脑未绑定读写器,请到档案设备里进行绑定') |
|||
} else { |
|||
resolve(dev) |
|||
} |
|||
} |
|||
}) |
|||
}, |
|||
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 }) |
|||
await this.startBind() |
|||
} |
|||
}, |
|||
async nextStep() { |
|||
this.isBinding = false |
|||
this.opened() |
|||
}, |
|||
// 关闭 |
|||
handleClose(done) { |
|||
this.coverBindingVisible = false |
|||
this.$emit('refresh') |
|||
done() |
|||
this.initData() |
|||
if (this.timer) { |
|||
clearTimeout(this.timer) |
|||
} |
|||
}, |
|||
handleCoverBindingClose(done) { |
|||
done() |
|||
this.bindingVisible = false |
|||
this.initData() |
|||
}, |
|||
doCoverBinding() { |
|||
this.coverBindingVisible = false |
|||
this.startBind(true) |
|||
}, |
|||
cancel() { |
|||
this.$refs.coverBindingDialog.handleClose() |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
@import "~@/assets/styles/archives-manage.scss"; |
|||
</style> |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue