diff --git a/pages/deviceManage/index.vue b/pages/deviceManage/index.vue index 32d53cf..5116a4a 100644 --- a/pages/deviceManage/index.vue +++ b/pages/deviceManage/index.vue @@ -188,22 +188,16 @@ - 暂停打印 @@ -216,9 +210,7 @@ 退出打印 @@ -558,17 +550,18 @@ 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) { + // 检查设备名称是否为空 + if (!this.deviceName || this.deviceName.trim() === '') { + uni.showToast({ + title: '请输入设备名称', + icon: 'none', + duration: 2000 + }); + return; + } + // 显示确认提示框 uni.showModal({ title: '确认打印', @@ -586,40 +579,45 @@ export default { } if (type === "CONTINUE") { // 检查设备状态 - if (this.deviceDetail.status === 0) { - uni.showToast({ - title: "当前设备空闲,禁止继续打印", - icon: "none", - duration: 1500 - }); - console.log("设备未就绪,禁止继续打印"); + if (this.deviceDetail.status === 0 || this.printInfo.status !== 6) { return; } - if (this.printInfo.status !== 6) { - uni.showToast({ - title: "当前设备未暂定,禁止继续打印", - icon: "none", - duration: 1500 - }); - return; - } - - this.sendWsCommand(type); + // 显示确认提示框 + uni.showModal({ + title: '确认打印', + content: '确定要继续执行打印吗?', + confirmText: '确认执行', + cancelText: '取消', + success: (res) => { + if (res.confirm) { + // 用户确认后执行打印 + this.sendWsCommand(type); + } + } + }); } if (type == 'PAUSE') { - if ((this.deviceDetail.status == 1 || this.deviceDetail.status == 2 || this.printInfo.status == 3) && this.deviceDetail.status != -1) { - uni.showModal({ - title: '提示', - content: '确定要暂停打印吗?', - confirmText: '确定', - cancelText: '取消', - success: (res) => { - if (res.confirm) { - this.sendWsCommand(type); - } - } - }); + + console.log(this.deviceDetail.status ===0) + if (this.printInfo.status === 6 || this.deviceDetail.status ===0){ + // uni.showToast({ + // title: "当前设备已暂定,禁止操作", + // icon: "none", + // duration: 1500 + // }); + return; } + uni.showModal({ + title: '提示', + content: '确定要暂停打印吗?', + confirmText: '确定', + cancelText: '取消', + success: (res) => { + if (res.confirm) { + this.sendWsCommand(type); + } + } + }); } if (type == 'EXIT') { if (this.deviceDetail.status != 0 && this.deviceDetail.status != -1) {