快乐的昕的电脑
2025-12-03 d0af866d532da9c8108ce863dda5bb3019bb3d3a
新增:刷新按钮处理方法
已修改1个文件
16 ■■■■■ 文件已修改
components/mold.vue 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
components/mold.vue
@@ -210,11 +210,14 @@
            // 新增:刷新按钮处理方法
            async handleRefresh() {
                // 刷新刀具列表和表单数据
                this.fetchTools('');
                if (this.machineNo && this.workOrderNo) {
                    await this.fetchFormData();
                    await this.fetchDefaultToolFromWorkOrder();
                    // 刷新后赋值第一行 currentCjNum
                    if (this.toolRecords.length > 0) {
                        this.$set(this.toolRecords[0], 'currentCjNum', this.workOrderCurrentCjNum);
                    }
                }
                this.$showMessage('刷新完成');
            },
@@ -667,12 +670,15 @@
            this.fetchTools('');
            this.machineNo = uni.getStorageSync('machineNo') || '';
            this.workOrderNo = uni.getStorageSync('daa001') || '';
            // 去除默认预警值 (90% -> 0.9)
            //this.lifeWarnInput = '90';
            if (this.machineNo && this.workOrderNo) {
                this.fetchFormData();
                this.fetchDefaultToolFromWorkOrder();
                this.fetchFormData().then(async () => {
                    await this.fetchDefaultToolFromWorkOrder();
                    // 进入页面时赋值第一行 currentCjNum
                    if (this.toolRecords.length > 0) {
                        this.$set(this.toolRecords[0], 'currentCjNum', this.workOrderCurrentCjNum);
                    }
                });
            } else {
                console.warn('机台号或工单号为空,无法获取表单数据');
            }