快乐的昕的电脑
2025-12-03 aea34c64bd4259e3cd16efc1a6c376ec3b2410b5
第一行“使用次数”“寿命比%”仅在“在机”时实时显示,否则显示原始数据。
已修改1个文件
27 ■■■■■ 文件已修改
components/mold.vue 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
components/mold.vue
@@ -116,22 +116,32 @@
                                {{ item.downCount != null ? item.downCount : '' }}
                            </template>
                        </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 v-if="!item.downTime">
                                    {{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>
                            </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">
                            <template v-if="idx === 0">
                                <!-- 第一行实时计算寿命比% -->
                                {{item.currentCjNum != null && item.upCount != null && item.useLimit != null && Number(item.useLimit) > 0 ? Math.round((Number(item.currentCjNum) - Number(item.upCount)) / Number(item.useLimit) * 100) + '%' : (item.lifePercent != null ? item.lifePercent : '') }}
                                <!-- 第一行实时计算寿命比%,若为下机则不实时显示 -->
                                <template v-if="!item.downTime">
                                    {{item.currentCjNum != null && item.upCount != null && item.useLimit != null && Number(item.useLimit) > 0 ? Math.round((Number(item.currentCjNum) - Number(item.upCount)) / Number(item.useLimit) * 100) + '%' : (item.lifePercent != null ? item.lifePercent : '') }}
                                </template>
                                <template v-else>
                                    {{ item.lifePercent != null ? item.lifePercent : '' }}
                                </template>
                            </template>
                            <template v-else>
                                {{ item.lifePercent }}
@@ -147,7 +157,7 @@
                        </td>
                    </tr>
                    <tr v-if="!toolRecords.length">
                        <td colspan="11">暂无数据</td>
                        <td colspan="12">暂无数据</td>
                    </tr>
                </tbody>
            </table>
@@ -209,7 +219,7 @@
            toolModel() { this.isDirty = true; }
        },
        methods: {
    //查询当前数采数,作为下刀计数实时显示
            //查询当前数采数,作为下刀计数实时显示
            async fetchCurrentCjNum(toolNo) {
                if (!this.machineNo) return null;
                try {
@@ -1193,5 +1203,4 @@
        margin-right: 16px;
        flex: none !important; /* 关键:彻底禁止flex拉伸 */
    }
</style>