| | |
| | | <td>{{ order.currentCjNum }}</td><!--报工时采集数--> |
| | | <td>{{ order.currentCjNum - order.initCjNum }}</td><!--报工数(计算)--> |
| | | <td>{{ calculatedDefectiveCount }}</td><!--不良数--> |
| | | <td>{{ order.currentCjNum - order.initCjNum - calculatedDefectiveCount }}</td><!--良品数(计算)--> |
| | | <td>{{ realTimeOkCount }}</td><!--良品数(计算)--> |
| | | </tr> |
| | | <!-- 历史报工记录行 --> |
| | | <tr v-for="(r, idx) in reportingHistory" :key="idx"> |
| | |
| | | reportingHistory: [] |
| | | } |
| | | }, |
| | | computed: { |
| | | computed: { |
| | | //良品数实时计算 |
| | | realTimeDefectiveCount() { |
| | | // 优先用输入框的值,否则用接口数据 |
| | | const val = Number(this.customAmount); |
| | | if (!isNaN(val) && this.customAmount !== '') return val; |
| | | return this.calculatedDefectiveCount; |
| | | }, |
| | | realTimeOkCount() { |
| | | // 良品数 = 报工数(计算) - 不良数 |
| | | const total = (this.order.currentCjNum || 0) - (this.order.initCjNum || 0); |
| | | return total - this.realTimeDefectiveCount; |
| | | }, |
| | | calculatedCurrentCount() { return (this.productionCount || 0) - (this.initialValue || 0); }, |
| | | calculatedTotalProduction() { return (this.kgQty || 0); }, // 若需恢复旧逻辑可用 (this.kgQty||0)+this.calculatedCurrentCount |
| | | calculatedDefectiveCount() { return this.calculatedTotalProduction - (this.sQuantity || 0); }, |