快乐的昕的电脑
2025-10-11 cf2f4219a6c6469ee901e004314597ffcd4132d2
调试1
已修改1个文件
19 ■■■■■ 文件已修改
components/mold.vue 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
components/mold.vue
@@ -261,30 +261,27 @@
                this.toolModel = '';
            },
            async fetchFormData() {
                const formData = new FormData();
                formData.append('workOrderNo', this.workOrderNo);
                formData.append('machineNo', this.machineNo);
                const payload = {
                    workOrderNo: this.workOrderNo,
                    machineNo: this.machineNo,
                };
                const res = await this.$post({
                    url: '/MesCutterLedger/GetFormData',
                    data: formData,
                    // 不要设置 Content-Type,让浏览器自动设置
                    data: JSON.stringify(payload),
                    headers: { 'Content-Type': 'application/json' }
                });
                if (res.status === 0) {
                    this.toolRecords = res.data;
                } else {
                    this.$showMessage(res.message || '获取表单数据失败');
                }
            },
            }
        },
        mounted() {
            this.fetchTools('');
            this.machineNo = uni.getStorageSync('machineNo') || '';
            this.workOrderNo = uni.getStorageSync('daa001') || '';
            if (this.machineNo && this.workOrderNo) {
                this.fetchFormData();
            }
            if (this.machineNo && this.workOrderNo) {this.fetchFormData();}
        }
    };
</script>