From 5a8860f2479afc915fdecdc1dcf071e33944db7a Mon Sep 17 00:00:00 2001 From: xuhuajiao <13476289682@163.com> Date: Wed, 24 Dec 2025 18:39:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=87=E7=AD=BE=E6=89=93=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 2 +- public/static/config.js | 7 +- src/api/RFID/RFID.js | 2 +- .../caseManage/caseList/index.vue | 33 ++- src/views/archivesManage/safeDoor/index.vue | 2 +- src/views/components/printRfid.vue | 213 +++++++++++++++--- 6 files changed, 211 insertions(+), 48 deletions(-) diff --git a/.env.development b/.env.development index 899990c..f528759 100644 --- a/.env.development +++ b/.env.development @@ -16,7 +16,7 @@ VUE_APP_BASE_API = 'http://192.168.99.72:7090' VUE_APP_WS_API = 'ws://192.168.99.72:7090' VUE_APP_WEBRTCSTREAMER_API = '127.0.0.1:8000' VUE_APP_SDEVID = "D003" -VUE_APP_PRINTNJ='http://192.168.99.72:9100' +VUE_APP_PRINTNJ='http://127.0.0.1:9001/' # 是否启用 babel-plugin-dynamic-import-node插件 VUE_CLI_BABEL_TRANSPILE_MODULES = true diff --git a/public/static/config.js b/public/static/config.js index d5d1163..e08b360 100644 --- a/public/static/config.js +++ b/public/static/config.js @@ -3,10 +3,5 @@ window.g = { ApiUrl: 'http://192.168.99.72:7090', // 配置服务器地址 ApiWebRtcServerUrl: '127.0.0.1:8000', // 配置监控视频服务器地址 sDevID:'D003', // 桌面式RFID读写器, - printNJ:'http://192.168.99.72:9100', - ZMINConfig:{ // 标签打印机 - ip:'127.0.0.1', - port:'1808', - filePath:'/home/it0/zmin/新标签01.lsf' - } + printNJ:'http://127.0.0.1:9001',// 打印机服务 } \ No newline at end of file diff --git a/src/api/RFID/RFID.js b/src/api/RFID/RFID.js index e04ec9f..892d6d4 100644 --- a/src/api/RFID/RFID.js +++ b/src/api/RFID/RFID.js @@ -27,7 +27,7 @@ export function writeEPC(params) { export function codeEpc(params) { return request({ - url: 'api/RFID/CodeEpc', + url: 'api/RFID/CodeEPC', method: 'get', params }) diff --git a/src/views/archivesManage/caseManage/caseList/index.vue b/src/views/archivesManage/caseManage/caseList/index.vue index 511b748..f9e9c6a 100644 --- a/src/views/archivesManage/caseManage/caseList/index.vue +++ b/src/views/archivesManage/caseManage/caseList/index.vue @@ -299,15 +299,36 @@ export default { // 5. 处理不同返回状态 if (result.code === '0') { console.log('生成epc成功') - // if (!result || !result.epc) { - // this.$message.warning('读取到的标签缺少EPC信息', { offset: 8 }) - // return - // } + const epcData = result.epc || result.EPC this.$message.success('EPC数据获取成功,开始打印...') - await this.$refs.printRFID.handlePrint(epcData) - console.log('打印调用成功,EPC数据:', epcData) + // 2. 构造多条模板数据 + // const printDataList = [ + // { elemID: 'epc-id', actualData: epcData }, + // // { elemID: 'tid-id', actualData: tidData }, + // { elemID: 'case-id', actualData: this.crud.selections[0].id }, + // { elemID: 'case-name', actualData: this.crud.selections[0].caseName } + // ] + + // // 3. 调用打印方法 + // const printResult = await this.$refs.printRFID.handlePrint(printDataList) + // console.log('打印数据:', printResult) + // this.$message.success('绑定打印成功', { offset: 8 }) + // this.crud.refresh() + const caseId = this.crud.selections[0].id // 获取盒ID + const printDataList = [ + { elemID: 'epc-id', actualData: epcData, caseId: caseId }, + { elemID: 'case-name', actualData: this.crud.selections[0].caseName, caseId: caseId } + ] + try { + const printResult = await this.$refs.printRFID.handlePrint(printDataList) + console.log('打印完成:', printResult) + this.$message.success('绑定打印成功', { offset: 8 }) + this.crud.refresh() + } catch (error) { + console.error('操作失败:', error) + } } else if (result.code === '-1') { this.$message.error(result.message || '写入失败', { offset: 8 }) } else if (result.code === '-1000') { diff --git a/src/views/archivesManage/safeDoor/index.vue b/src/views/archivesManage/safeDoor/index.vue index ab8fb03..0e423db 100644 --- a/src/views/archivesManage/safeDoor/index.vue +++ b/src/views/archivesManage/safeDoor/index.vue @@ -322,7 +322,7 @@ export default { span { font-size: 14px; - color: #666; + color: #fff; font-weight: normal; margin-left: 8px; } diff --git a/src/views/components/printRfid.vue b/src/views/components/printRfid.vue index ed76067..99b3ad8 100644 --- a/src/views/components/printRfid.vue +++ b/src/views/components/printRfid.vue @@ -9,6 +9,7 @@