From 6d1a797fd3c4109c94eef5272391a1bf22c7bcdb Mon Sep 17 00:00:00 2001 From: 18796357645 <674126018@qq.com> Date: Sat, 19 Jul 2025 11:59:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BC=BA=E7=9C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/deviceManage/index.vue | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/pages/deviceManage/index.vue b/pages/deviceManage/index.vue index 4b18d80..74908d0 100644 --- a/pages/deviceManage/index.vue +++ b/pages/deviceManage/index.vue @@ -544,8 +544,31 @@ export default { operationData (type) { if (type == "PRINT") { + // 检查设备名称是否为空 + if (!this.deviceName || this.deviceName.trim() === '') { + uni.showToast({ + title: '请输入设备名称', + icon: 'none', + duration: 2000 + }); + return; + } + + // 检查设备状态 if (this.deviceDetail.status == 0 && this.deviceDetail.status != -1) { - this.sendWsCommand(type); + // 显示确认提示框 + uni.showModal({ + title: '确认打印', + content: '请确认门关闭并且设备处于可打印状态!', + confirmText: '确认执行', + cancelText: '取消', + success: (res) => { + if (res.confirm) { + // 用户确认后执行打印 + this.sendWsCommand(type); + } + } + }); } } if (type == "CONTINUE") {