-
5
+
4
-
第五步绑定成功
-
{{ step5Message }}
+
第四步绑定成功
+
{{ step4Message }}
@@ -117,13 +111,13 @@ export default {
bindingVisible: false, // 绑定标签对话框是否显示
tidCode: '',
coverBindingVisible: false,
- step: 1,
+ step: 1, // 核心修改2:初始步骤改为1(新的第一步:放入标签)
errorStep: 0,
- step1Message: '连接中',
- step2Message: '请放入标签',
- step3Message: '放入标签后开始读取标签',
- step4Message: '标签读取成功后,开始绑定档案',
- step5Message: '当前标签与' + this.bindingTxt + '绑定成功',
+ // 核心修改3:步骤消息同步重命名(原step2→step1,原step3→step2...)
+ step1Message: '请放入标签', // 原step2Message
+ step2Message: '放入标签后开始读取标签', // 原step3Message
+ step3Message: '标签读取成功后,开始绑定档案', // 原step4Message
+ step4Message: '当前标签与' + this.bindingTxt + '绑定成功', // 原step5Message
readData: {},
timeOut: null,
timer: null,
@@ -143,95 +137,60 @@ export default {
},
methods: {
initData() {
- this.step = 1
+ this.step = 1 // 初始化步骤→新的第一步
this.errorStep = 0
- this.step1Message = '连接中'
- this.step2Message = '请放入标签'
- this.step3Message = '放入标签后开始读取标签'
- this.step4Message = '标签读取成功后,开始绑定档案'
- this.step5Message = '当前标签与' + this.bindingTxt + '绑定成功'
+ // 步骤消息同步初始化(对应新编号)
+ this.step1Message = '请放入标签'
+ this.step2Message = '放入标签后开始读取标签'
+ this.step3Message = '标签读取成功后,开始绑定档案'
+ this.step4Message = '当前标签与' + 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.step = 2 // 核心修改4:读取成功→跳至新的第二步(读取标签)
this.errorStep = 0
- this.step2Message = '已放入标签'
+ this.step1Message = '已放入标签' // 对应新第一步的成功提示
if (res.data.length > 1) {
- this.errorStep = 3
- this.step3Message = '当前标签存在多个,请取出多余的标签只保留一张!'
+ this.errorStep = 2 // 错误关联新第二步
+ this.step2Message = '当前标签存在多个,请取出多余的标签只保留一张!'
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
+ this.step2Message = '读取成功!' // 新第二步的成功提示
+ this.step = 3 // 跳至新的第三步(开始绑定)
resolve()
}
} else if (res.code && res.code === '-2') {
- this.errorStep = 2
- this.step2Message = '未读取到标签,请重新放入'
- this.step = 2
+ this.errorStep = 1 // 错误关联新第一步
+ this.step1Message = '未读取到标签,请重新放入'
+ this.step = 1 // 停留在新第一步
clearTimeout(this.timer)
this.timer = setTimeout(() => {
resolve(this.readEpc(param))
}, 2000)
} else {
- this.errorStep = 2
- this.step2Message = '读取标签失败'
+ this.errorStep = 1 // 错误关联新第一步
+ this.step1Message = '读取标签失败'
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 = '绑定中'
+ this.step3Message = '绑定中' // 新第三步的绑定中提示
const data = { id: this.bindingId, labelType: this.bindingType, tid: this.readData.tid }
if (isCover || this.readData.tid === this.tidCode) {
data.coverLabel = true
@@ -241,42 +200,36 @@ 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, ip: this.devIp })
+ const sDevID = process.env.NODE_ENV === 'production' ? window.g.sDevID : process.env.VUE_APP_SDEVID
+ // , ip: this.devIp
+ let writeRes = await RFID.writeEPC({ op: 'RFID_WriteEPC', sDevID: sDevID, EAS: '1', Type: this.bindingType, Code: this.bindingId, Tid: this.readData.tid })
writeRes = JSON.parse(writeRes)
if (writeRes.code === '0') {
- this.step = 5
+ this.step = 4
+ this.handleClose()
resolve()
} else if (writeRes.code === '-1') {
- // this.$message({
- // message: writeRes.message,
- // type: 'error',
- // duration: 2500
- // })
- this.errorStep = 5
- this.step5Message = writeRes.message
+ this.errorStep = 4
+ this.step4Message = writeRes.message
reject()
} else if (writeRes.code === '-1000') {
- // this.$message({
- // message: '读写器超时未响应',
- // type: 'error',
- // duration: 2500
- // })
- this.errorStep = 5
- this.step5Message = '读写器超时未响应'
+ this.errorStep = 4
+ this.step4Message = '读写器超时未响应'
reject()
}
} else {
- this.step5Message = '绑定失败'
- this.errorStep = 5
+ this.step4Message = '绑定失败'
+ this.errorStep = 4
reject()
}
})
},
+
async getDevId() {
return await new Promise(async(resolve, reject) => {
const mac = await RFID.getDeviceMac()
if (!mac || mac === '') {
- this.step1Message = '获取mac地址失败'
+ this.step1Message = '获取mac地址失败,无法读取标签'
this.errorStep = 1
reject('获取mac地址失败')
} else {
@@ -291,22 +244,32 @@ 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 })
- await this.startBind()
+ try {
+ // const devInfo = await this.getDevId()
+ // this.devId = devInfo.deviceId
+ // this.devIp = devInfo.deviceIp + ':' + devInfo.devicePort
+ // 直接执行新的第一步:读取标签(原第二步逻辑)
+ const sDevID = process.env.NODE_ENV === 'production' ? window.g.sDevID : process.env.VUE_APP_SDEVID
+ // ip: this.devIp
+ await this.readEpc({ op: 'RFID_ReadEpc', sDevID: sDevID })
+ await this.startBind()
+ } catch (err) {
+ console.error('初始化失败:', err)
+ }
}
},
+
async nextStep() {
this.isBinding = false
this.opened()
},
+
// 关闭
handleClose(done) {
+ this.bindingVisible = false
this.coverBindingVisible = false
this.$emit('refresh')
done()
@@ -315,15 +278,18 @@ export default {
clearTimeout(this.timer)
}
},
+
handleCoverBindingClose(done) {
done()
this.bindingVisible = false
this.initData()
},
+
doCoverBinding() {
this.coverBindingVisible = false
this.startBind(true)
},
+
cancel() {
this.$refs.coverBindingDialog.handleClose()
}
diff --git a/src/views/components/category/PreviewForm.vue b/src/views/components/category/PreviewForm.vue
index 25fd6ff..8536c00 100644
--- a/src/views/components/category/PreviewForm.vue
+++ b/src/views/components/category/PreviewForm.vue
@@ -45,13 +45,13 @@
-
+
@@ -421,6 +421,12 @@ export default {
this.setParentsId = parent_id
}
}
+ // barcode
+ console.log(this.addOrUpdateForm['archive_no'])
+ if (this.addOrUpdateForm['archive_no'] !== '') {
+ this.$set(this.addOrUpdateForm, 'barcode', this.addOrUpdateForm['archive_no'])
+ }
+
delete this.addOrUpdateForm.id
this.$refs[formName].validate((valid) => {
if (valid) {
diff --git a/src/views/storeManage/deviceManage/index.vue b/src/views/storeManage/deviceManage/index.vue
index bcf3f8c..7a70822 100644
--- a/src/views/storeManage/deviceManage/index.vue
+++ b/src/views/storeManage/deviceManage/index.vue
@@ -137,11 +137,33 @@ export default {
[CRUD.HOOK.beforeToEdit](crud, form) {
form.deviceDetails = null
},
+ // [CRUD.HOOK.beforeSubmit]() {
+ // this.crud.form.pid = this.defaultExpandedKeys[0]
+ // this.crud.form.remark = this.crud.form.name
+ // console.log(this.crud.form)
+ // console.log(this.crud.data)
+ // if (!this.crud.form.sort) {
+ // this.crud.form.sort = this.crud.data[0].children.reduce((prev, cur) => { return { sort: Math.max(prev.sort, cur.sort) } }).sort + 1
+ // }
+ // },
[CRUD.HOOK.beforeSubmit]() {
this.crud.form.pid = this.defaultExpandedKeys[0]
this.crud.form.remark = this.crud.form.name
+
if (!this.crud.form.sort) {
- this.crud.form.sort = this.crud.data[0].children.reduce((prev, cur) => { return { sort: Math.max(prev.sort, cur.sort) } }).sort + 1
+ let maxSort = 0 // 默认排序值
+
+ if (this.crud.data && this.crud.data.length > 0) {
+ const firstItem = this.crud.data[0]
+ if (firstItem.children && firstItem.children.length > 0) {
+ maxSort = firstItem.children.reduce((prev, cur) => {
+ const currentSort = cur.sort || 0
+ return { sort: Math.max(prev.sort, currentSort) }
+ }, { sort: 0 }).sort
+ }
+ }
+
+ this.crud.form.sort = maxSort + 1
}
},
toDelete(data) {
diff --git a/src/views/storeManage/warehouse3D/archivesStorage/index.vue b/src/views/storeManage/warehouse3D/archivesStorage/index.vue
index 108b193..0177f35 100644
--- a/src/views/storeManage/warehouse3D/archivesStorage/index.vue
+++ b/src/views/storeManage/warehouse3D/archivesStorage/index.vue
@@ -86,7 +86,7 @@ export default {
components: { WarehouseWarning, AccessDoor, hkVideo },
data() {
return {
- roomId: 'D6490DA3D4261E8C26D0E3',
+ roomId: '01A1DC2123C2B75E1A579D',
allDisplayConfigData: [],
displayConfigData: [],
url: '',
@@ -191,7 +191,7 @@ export default {
if (deviceData.toLowerCase().includes('cam')) {
this.open = true
this.$nextTick(() => {
- this.$refs.camera.getVideoUrl(deviceData)
+ this.$refs.camera.getVideoUrl(this.roomId, deviceData)
})
}
}
diff --git a/src/views/storeManage/warehouse3D/collateRoom/index.vue b/src/views/storeManage/warehouse3D/collateRoom/index.vue
index 5e662c8..8148b2d 100644
--- a/src/views/storeManage/warehouse3D/collateRoom/index.vue
+++ b/src/views/storeManage/warehouse3D/collateRoom/index.vue
@@ -140,7 +140,7 @@ export default {
// if (event.data && event.data.data) {
// const data = event.data.data
// _this.deviceId = data
- // if (_this.deviceId.includes('CAM')) {
+ // if (_this.deviceId.toLowerCase().includes('cam')) {
// _this.$nextTick(() => {
// this.$refs.camera.openVideoVisible = true
// this.$refs.camera.videoTitle = _this.deviceId
diff --git a/src/views/storeManage/warehouse3D/deseCabinet/index.vue b/src/views/storeManage/warehouse3D/deseCabinet/index.vue
index b7d7e9e..91d6247 100644
--- a/src/views/storeManage/warehouse3D/deseCabinet/index.vue
+++ b/src/views/storeManage/warehouse3D/deseCabinet/index.vue
@@ -1,7 +1,8 @@
-
{{ deviceData.deviceName }} - {{ deviceData.areaNo }}区 - {{ cabinetNum }} 列
+
+
{{ deviceData.deviceName }} - {{ cabinetNum }} 排
档案总数:{{ archivesNum }}
在库
@@ -112,7 +113,7 @@ export default {
loading: false,
// D6490DA3D4261E8C26D0E3 档案库
// 8F68A6B645B34B00B7ADFE 走廊
- storeroomId: 'D6490DA3D4261E8C26D0E3', // 档案库id
+ storeroomId: '01A1DC2123C2B75E1A579D', // 档案库id
deviceData: null, // 获取密集架data
cabinetNum: null, // 当前列num
isFixed: false, // 是否是固定列
@@ -186,6 +187,7 @@ export default {
this.loading = false
if (item.deviceTypeId.name === '密集架') { // 写死状态
this.deviceData = item
+ console.log('deviceData', item)
this.totalPartRowNum = item.partNo * item.rowNo
let rowNo
if (this.cabinetNum > 8) { // 战备密集架得情况
@@ -213,15 +215,16 @@ export default {
async getInBorrowByQuCol() {
const params = {
deviceId: this.deviceData.id,
- quNo: this.deviceData.areaNo,
+ // quNo: this.deviceData.areaNo,
+ quNo: '1',
colNo: this.cabinetNum
}
CallExternal.FetchInBorrowByQuCol(params).then(data => {
data.forEach(item => {
- if (item.direction === '左') {
+ if (item.direction === 'A面') {
this.left.push(item)
}
- if (item.direction === '右') {
+ if (item.direction === 'B面') {
this.right.push(item)
}
})
diff --git a/src/views/storeManage/warehouse3D/index.vue b/src/views/storeManage/warehouse3D/index.vue
index 22503fa..c9dbadc 100644
--- a/src/views/storeManage/warehouse3D/index.vue
+++ b/src/views/storeManage/warehouse3D/index.vue
@@ -130,7 +130,7 @@ export default {
// }
// console.log('this.camConfigData', this.camConfigData)
// // 摄像头
- // if (data.includes('CAM')) {
+ // if (data.toLowerCase().includes('cam')) {
// const camConfig = this.camConfigData.find((x) => { return x.divPosition === data })
// console.log(1, camConfig)
// if (camConfig && camConfig.isDisplay && camConfig.bindState) {
diff --git a/src/views/storeManage/warehouse3D/module/hkVideo.vue b/src/views/storeManage/warehouse3D/module/hkVideo.vue
index 04ed057..d802b78 100644
--- a/src/views/storeManage/warehouse3D/module/hkVideo.vue
+++ b/src/views/storeManage/warehouse3D/module/hkVideo.vue
@@ -42,8 +42,8 @@ export default {
this.cleanupVideoStream()
},
methods: {
- getVideoUrl(deviceData) {
- displayConfigApi.list({ storeroomId: '', isQueryAll: 1 }).then((res) => {
+ getVideoUrl(roomId, deviceData) {
+ displayConfigApi.list({ storeroomId: roomId, isQueryAll: 1 }).then((res) => {
if (res) {
const camConfig = res.find((x) => { return x.divPosition === deviceData })
console.log(1, camConfig)
diff --git a/src/views/storeManage/warehouse3DConfig/index.vue b/src/views/storeManage/warehouse3DConfig/index.vue
index 24f5a03..44791da 100644
--- a/src/views/storeManage/warehouse3DConfig/index.vue
+++ b/src/views/storeManage/warehouse3DConfig/index.vue
@@ -61,7 +61,7 @@
-
+
{{ item.label }} - {{ item.info }}
@@ -194,7 +194,7 @@ export default {
this.form.deviceInfo = {}
}
let deviceTypeId
- const isCAM = this.form.divPosition.includes('CAM')
+ const isCAM = this.form.divPosition.toLowerCase().includes('cam')
if (isCAM) {
deviceTypeId = this.cameraTypeId
} else if (this.form.divPosition.includes('TOP')) {