快乐的昕的电脑
2025-10-18 aa096d5f3823934b71c3dd65cb376f486eb3e469
components/WorkOrderPrint.vue
@@ -29,11 +29,11 @@
                        <td>{{ order.daa003 || '-' }}</td>
                        <td>{{ planQtyDisplay }}</td>
                        <td>{{ machineNo || '-' }}</td>
                        <td>{{ initCjNum }}</td><!--初始采集数-->
                        <td>{{ currentCjNum }}</td><!--报工时采集数-->
                        <td>{{ calculatedTotalProduction }}</td><!--报工数(计算)-->
                        <td>{{ order.initCjNum }}</td><!--初始采集数-->
                        <td>{{ order.currentCjNum }}</td><!--报工时采集数-->
                        <td>{{ order.currentCjNum - order.initCjNum }}</td><!--报工数(计算)-->
                        <td>{{ calculatedDefectiveCount }}</td><!--不良数-->
                        <td>{{ sQuantity }}</td><!--良品数(计算)-->
                        <td>{{ realTimeOkCount }}</td><!--良品数(计算)-->
                     </tr>
                     <!-- 历史报工记录行 -->
                     <tr v-for="(r, idx) in reportingHistory" :key="idx">
@@ -215,7 +215,19 @@
            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); },