| | |
| | | |
| | | // 新增:刷新按钮处理方法 |
| | | async handleRefresh() { |
| | | // 刷新刀具列表和表单数据 |
| | | this.fetchTools(''); |
| | | if (this.machineNo && this.workOrderNo) { |
| | | await this.fetchFormData(); |
| | | await this.fetchDefaultToolFromWorkOrder(); |
| | | // 刷新后赋值第一行 currentCjNum |
| | | if (this.toolRecords.length > 0) { |
| | | this.$set(this.toolRecords[0], 'currentCjNum', this.workOrderCurrentCjNum); |
| | | } |
| | | } |
| | | this.$showMessage('刷新完成'); |
| | | }, |
| | |
| | | this.fetchTools(''); |
| | | this.machineNo = uni.getStorageSync('machineNo') || ''; |
| | | this.workOrderNo = uni.getStorageSync('daa001') || ''; |
| | | // 去除默认预警值 (90% -> 0.9) |
| | | //this.lifeWarnInput = '90'; |
| | | |
| | | if (this.machineNo && this.workOrderNo) { |
| | | this.fetchFormData(); |
| | | this.fetchDefaultToolFromWorkOrder(); |
| | | this.fetchFormData().then(async () => { |
| | | await this.fetchDefaultToolFromWorkOrder(); |
| | | // 进入页面时赋值第一行 currentCjNum |
| | | if (this.toolRecords.length > 0) { |
| | | this.$set(this.toolRecords[0], 'currentCjNum', this.workOrderCurrentCjNum); |
| | | } |
| | | }); |
| | | } else { |
| | | console.warn('机台号或工单号为空,无法获取表单数据'); |
| | | } |