| | |
| | | |
| | | // 新增:刷新按钮处理方法 |
| | | async handleRefresh() { |
| | | // 刷新刀具列表和表单数据 |
| | | this.fetchTools(''); |
| | | if (this.machineNo && this.workOrderNo) { |
| | | await this.fetchFormData(); |
| | | await this.fetchDefaultToolFromWorkOrder(); |
| | | // 只更新第一行 currentCjNum |
| | | if (this.toolRecords.length > 0) { |
| | | const cjNum = await this.fetchCurrentCjNum(this.toolRecords[0].no); |
| | | this.$set(this.toolRecords[0], 'currentCjNum', cjNum); |
| | | } |
| | | } |
| | | this.$showMessage('刷新完成'); |
| | | }, |
| | |
| | | //this.lifeWarnInput = '90'; |
| | | |
| | | if (this.machineNo && this.workOrderNo) { |
| | | this.fetchFormData().then(async () => { |
| | | // 加载工单刀具信息 |
| | | await this.fetchDefaultToolFromWorkOrder(); |
| | | // 进入页面时加载第一行 currentCjNum |
| | | if (this.toolRecords.length > 0) { |
| | | const cjNum = await this.fetchCurrentCjNum(this.toolRecords[0].no); |
| | | this.$set(this.toolRecords[0], 'currentCjNum', cjNum); |
| | | } |
| | | }); |
| | | this.fetchFormData(); |
| | | this.fetchDefaultToolFromWorkOrder(); |
| | | } else { |
| | | console.warn('机台号或工单号为空,无法获取表单数据'); |
| | | } |