| | |
| | | }, |
| | | methods: { |
| | | async fetchTools(searchKey) { |
| | | // 注意:body 直接是字符串 |
| | | const res = await fetch('/api/MesOrderSta/QueryTools', { |
| | | method: 'POST', |
| | | headers: { 'Content-Type': 'application/json' }, |
| | | body: JSON.stringify(searchKey) // 这里 searchKey 是字符串 |
| | | // 使用 this.$post 发送 POST 请求,body 直接传字符串 |
| | | const res = await this.$post({ |
| | | url: '/MesOrderSta/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() { |