快乐的昕的电脑
2025-10-09 68a1318b769f46f87f2a094b40d07e6c3c983697
components/mold.vue
@@ -117,21 +117,19 @@
      },
      methods: {
            async fetchTools(searchKey) {
                // 注意:body 直接是字符串
                const res = await fetch('/api/MesOrderSta/QueryTools', {
                    method: 'POST',
                    headers: { 'Content-Type': 'application/json' },
                    body: JSON.stringify(searchKey) // 这里 searchKey 是字符串
                // 传递对象,而不是字符串
                const res = await this.$post({
                    url: '/MesCutterLedger/QueryTools',
                    data:searchKey
                });
                const data = await res.json();
                if (data.status === 0) {
                    this.filteredTools = data.data.tbBillList.map(t => ({
                if (res.status === 0) {
                    this.filteredTools = res.data.tbBillList.map(t => ({
                        no: t.cutterId || t.no,
                        name: t.cutterName || t.name,
                        model: t.cutterModel || t.model
                    }));
                } else {
                    this.$showMessage(data.message || '查询失败');
                    this.$showMessage(res.message || '查询失败');
                }
            },
         async searchTool() {