From 749b366b2af987479d3e13a3dd1a478781211bb7 Mon Sep 17 00:00:00 2001
From: 快乐的昕的电脑 <快乐的昕的电脑@DESKTOP-C2BQPQU>
Date: 星期一, 13 十月 2025 15:36:44 +0800
Subject: [PATCH] BUG修改

---
 components/mold.vue |   21 +++++++++------------
 1 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/components/mold.vue b/components/mold.vue
index d490fa0..e964aca 100644
--- a/components/mold.vue
+++ b/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 && this.workOrderNo.trim() !== '' ? this.workOrderNo : null,
+                    machineNo: this.machineNo && this.machineNo.trim() !== '' ? this.machineNo : null,
+                };
                 const res = await this.$post({
-                    url: '/MesCutterLedger/GetFormData',
-                    data: formData,
-                    // 涓嶈璁剧疆 Content-Type锛岃娴忚鍣ㄨ嚜鍔ㄨ缃�
+                    url: '/api/MesCutterLedger/GetFormData', // 鍔犱笂 /api 鍓嶇紑
+                    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>

--
Gitblit v1.9.3