| | |
| | | this.$showMessage('使用上限已保存(示例)'); |
| | | } |
| | | }, |
| | | methods: { |
| | | async fetchFormData() { |
| | | const res = await this.$post({ |
| | | url: '/MesCutterLedger/GetFormData', |
| | | data: JSON.stringify({ |
| | | workOrderNo: this.workOrderNo, |
| | | machineNo: this.machineNo |
| | | }), |
| | | 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') || ''; // 读取本地缓存的工单编号 |
| | | this.workOrderNo = uni.getStorageSync('daa001') || ''; // 读取本地缓存的工单编号 |
| | | this.fetchFormData(); // 页面加载时获取表单数据 |
| | | } |
| | | }; |
| | | </script> |