快乐的昕的电脑
2025-11-18 df96fbfdd4faf7379d6caffa59ca3c24adfcb1a6
调试
已修改1个文件
22 ■■■■■ 文件已修改
pages/index.vue 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/index.vue
@@ -552,20 +552,27 @@
                }
                return str;
            },
            cancel() {
                if (!this.machineNo) {
                    return;
                }
            methods: {
                // 刀具绑定判断钩子
                hasBindedCutter() {
                const currentOrder = this.isShowTableData[0];
                if (
                    return (
                    currentOrder &&
                    (
                        (currentOrder.outToolId && currentOrder.outToolId.toString().trim() !== '') ||
                        (currentOrder.outToolCode && currentOrder.outToolCode.trim() !== '') ||
                        (currentOrder.outToolName && currentOrder.outToolName.trim() !== '')
                    )
                ) {
                    );
                },
                cancel() {
                    if (!this.machineNo) {
                        return;
                    }
                    // 使用钩子判断
                    if (this.hasBindedCutter()) {
                    uni.showToast({
                        title: '当前工单已绑定刀具,不能清空重选',
                        icon: 'error',
@@ -589,6 +596,7 @@
                    }
                });
            },
            formatDate(date) {
                let year = date.getFullYear(); // 获取年份
                let month = String(date.getMonth() + 1).padStart(2, '0'); // 获取月份并补零