| | |
| | | {{ item.downCount != null ? item.downCount : '' }} |
| | | </template> |
| | | </td> |
| | | <td class="num">{{ item.useCount != null ? item.useCount : '' }}</td> |
| | | <!--<td class="num">{{ item.useCount != null ? item.useCount : '' }}</td>--><!--使用次数--> |
| | | <td class="num"> |
| | | <template v-if="idx === 0"> |
| | | <!-- 第一行实时计算使用次数 --> |
| | | {{item.currentCjNum != null && item.upCount != null ? (Number(item.currentCjNum) - Number(item.upCount)) : (item.useCount != null ? item.useCount : '') }} |
| | | </template> |
| | | <template v-else> |
| | | {{ item.useCount != null ? item.useCount : '' }} |
| | | </template> |
| | | </td> |
| | | <td class="num">{{ item.useLimit != null ? item.useLimit : '' }}</td> |
| | | <td class="num">{{ item.lifePercent }}</td> |
| | | <td class="num">{{ item.lifeWarn }}</td> |
| | |
| | | if (this.machineNo && this.workOrderNo) { |
| | | await this.fetchFormData(); |
| | | await this.fetchDefaultToolFromWorkOrder(); |
| | | // 只更新第一行 currentCjNum |
| | | // 刷新后赋值第一行 currentCjNum |
| | | if (this.toolRecords.length > 0) { |
| | | const cjNum = await this.fetchCurrentCjNum(this.toolRecords[0].no); |
| | | this.$set(this.toolRecords[0], 'currentCjNum', cjNum); |
| | | 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().then(async () => { |
| | | // 加载工单刀具信息 |
| | | await this.fetchDefaultToolFromWorkOrder(); |
| | | // 进入页面时加载第一行 currentCjNum |
| | | // 进入页面时赋值第一行 currentCjNum |
| | | if (this.toolRecords.length > 0) { |
| | | const cjNum = await this.fetchCurrentCjNum(this.toolRecords[0].no); |
| | | this.$set(this.toolRecords[0], 'currentCjNum', cjNum); |
| | | this.$set(this.toolRecords[0], 'currentCjNum', this.workOrderCurrentCjNum); |
| | | } |
| | | }); |
| | | } else { |