From df96fbfdd4faf7379d6caffa59ca3c24adfcb1a6 Mon Sep 17 00:00:00 2001
From: 快乐的昕的电脑 <快乐的昕的电脑@DESKTOP-C2BQPQU>
Date: 星期二, 18 十一月 2025 17:24:23 +0800
Subject: [PATCH] 调试

---
 pages/index.vue |   78 +++++++++++++++++++++-----------------
 1 files changed, 43 insertions(+), 35 deletions(-)

diff --git a/pages/index.vue b/pages/index.vue
index 39809e9..3550da3 100644
--- a/pages/index.vue
+++ b/pages/index.vue
@@ -552,43 +552,51 @@
 				}
 				return str;
 			},
-            cancel() {
-                if (!this.machineNo) {
-                    return;
-                }
+            methods: {
+                // 鍒�鍏风粦瀹氬垽鏂挬瀛�
+                hasBindedCutter() {
+                    const currentOrder = this.isShowTableData[0];
+                    return (
+                        currentOrder &&
+                        (
+                            (currentOrder.outToolId && currentOrder.outToolId.toString().trim() !== '') ||
+                            (currentOrder.outToolCode && currentOrder.outToolCode.trim() !== '') ||
+                            (currentOrder.outToolName && currentOrder.outToolName.trim() !== '')
+                        )
+                    );
+                },
 
-                const currentOrder = this.isShowTableData[0];
-                if (
-                    currentOrder &&
-                    (
-                        (currentOrder.outToolId && currentOrder.outToolId.toString().trim() !== '') ||
-                        (currentOrder.outToolCode && currentOrder.outToolCode.trim() !== '') ||
-                        (currentOrder.outToolName && currentOrder.outToolName.trim() !== '')
-                    )
-                ) {
-                    uni.showToast({
-                        title: '褰撳墠宸ュ崟宸茬粦瀹氬垁鍏凤紝涓嶈兘娓呯┖閲嶉��',
-                        icon: 'error',
-                        duration: 2000
-                    });
-                    return;
-                }
-
-                let editDate = this.formatDate(new Date());
-                this.selectedIndexs = [];
-
-                this.$post({
-                    url: "/MesOrderSelect/Remove",
-                    data: {
-                        machineNo: this.machineNo,
-                        editDate: editDate
-                    },
-                }).then(res => {
-                    if (res.data.tbBillList > 0) {
-                        this.isShowTableData = [];
+                cancel() {
+                    if (!this.machineNo) {
+                        return;
                     }
-                });
-            },
+
+                    // 浣跨敤閽╁瓙鍒ゆ柇
+                    if (this.hasBindedCutter()) {
+                        uni.showToast({
+                            title: '褰撳墠宸ュ崟宸茬粦瀹氬垁鍏凤紝涓嶈兘娓呯┖閲嶉��',
+                            icon: 'error',
+                            duration: 2000
+                        });
+                        return;
+                    }
+
+                    let editDate = this.formatDate(new Date());
+                    this.selectedIndexs = [];
+
+                    this.$post({
+                        url: "/MesOrderSelect/Remove",
+                        data: {
+                            machineNo: this.machineNo,
+                            editDate: editDate
+                        },
+                    }).then(res => {
+                        if (res.data.tbBillList > 0) {
+                            this.isShowTableData = [];
+                        }
+                    });
+                },
+
 			formatDate(date) {
 				let year = date.getFullYear(); // 鑾峰彇骞翠唤
 				let month = String(date.getMonth() + 1).padStart(2, '0'); // 鑾峰彇鏈堜唤骞惰ˉ闆�

--
Gitblit v1.9.3