| | |
| | | toolModel() { this.isDirty = true; } |
| | | }, |
| | | methods: { |
| | | //查询当前数采数,作为下刀计数实时显示 |
| | | async fetchCurrentCjNum(toolNo) { |
| | | if (!this.machineNo) return null; |
| | | try { |
| | | const res = await this.$post({ |
| | | url: '/Womdaa/GetWomdaasByShow', |
| | | data: JSON.stringify({ machineNo: this.machineNo }), |
| | | headers: { 'Content-Type': 'application/json' } |
| | | }); |
| | | if (res.status === 0 && Array.isArray(res.data?.tbBillList)) { |
| | | const found = res.data.tbBillList.find(x => |
| | | x.cutterId === toolNo || x.cutteR_ID === toolNo |
| | | ); |
| | | return found ? (found.CurrentCjNum ?? found.currentCjNum ?? null) : null; |
| | | } |
| | | } catch (e) { |
| | | console.warn('获取currentCjNum失败', e); |
| | | } |
| | | return null; |
| | | }, |
| | | |
| | | // 新增:刷新按钮处理方法 |
| | | async handleRefresh() { |
| | | // 刷新刀具列表和表单数据 |