快乐的昕的电脑
2025-10-11 cf2f4219a6c6469ee901e004314597ffcd4132d2
components/mold.vue
@@ -261,16 +261,17 @@
            this.toolModel = '';
         },
            async fetchFormData() {
                const payload = {
                    workOrderNo: this.workOrderNo,
                    machineNo: this.machineNo,
                };
                const res = await this.$post({
                    url: '/MesCutterLedger/GetFormData',
                    data: JSON.stringify({
                        workOrderNo: this.workOrderNo,
                        machineNo: this.machineNo
                    }),
                    data: JSON.stringify(payload),
                    headers: { 'Content-Type': 'application/json' }
                });
                if (res.status === 0) {
                    this.toolRecords = res.data; // 假设后端直接返回表格数组
                    this.toolRecords = res.data;
                } else {
                    this.$showMessage(res.message || '获取表单数据失败');
                }
@@ -280,9 +281,7 @@
            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>