From df499252aa425d30cd9ae4697e8f6ceeacb62098 Mon Sep 17 00:00:00 2001
From: 快乐的昕的电脑 <快乐的昕的电脑@DESKTOP-C2BQPQU>
Date: 星期二, 23 十二月 2025 13:53:12 +0800
Subject: [PATCH] 添加上刀下刀记录界面
---
components/mold.vue | 89 +++++++++++++++++++++++++++++++++-----------
1 files changed, 67 insertions(+), 22 deletions(-)
diff --git a/components/mold.vue b/components/mold.vue
index 7e21efb..6f3e30b 100644
--- a/components/mold.vue
+++ b/components/mold.vue
@@ -48,7 +48,7 @@
<view class="button-row">
<button class="save-btn" @click="handleUpTool" :disabled="submitting || loadingForm">涓婂垁鎻愪氦(=璋冩満寮�濮�)</button>
<button class="save-btn" @click="handleDownTool" :disabled="submitting || loadingForm">涓嬪垁鎻愪氦</button>
- <button class="cancel-btn" @click="cancel" :disabled="submitting || loadingForm">鍙栨秷</button>
+ <button class="cancel-btn" @click="cancel" :disabled="submitting || loadingForm">娓呯┖鍒�鍏烽�夋嫨</button>
</view>
<!-- 鍒�鍏风洰褰曞脊绐� -->
@@ -86,17 +86,18 @@
<table class="styled-table">
<thead>
<tr>
- <th style="width:8%">鍒�鍏风紪鍙�</th>
- <th style="width:14%">鍒�鍏峰悕绉�</th>
- <th style="width:12%">涓婂垁鏃堕棿</th>
- <th class="num" style="width:8%">涓婂垁璁℃暟</th>
- <th style="width:12%">涓嬪垁鏃堕棿</th>
- <th class="num" style="width:8%">涓嬪垁璁℃暟</th>
- <th class="num" style="width:8%">浣跨敤娆℃暟</th>
- <th class="num" style="width:8%">浣跨敤涓婇檺</th>
- <th class="num" style="width:8%">瀵垮懡姣�%</th>
- <th class="num" style="width:8%">瀵垮懡姣旈璀﹀��</th>
- <th style="width:8%">棰勮鐘舵��</th>
+ <th style="width:7%">鍒�鍏风紪鍙�</th>
+ <th style="width:12%">鍒�鍏峰悕绉�</th>
+ <th style="width:10%">涓婂垁鏃堕棿</th>
+ <th class="num" style="width:7%">涓婂垁璁℃暟</th>
+ <th style="width:10%">涓嬪垁鏃堕棿</th>
+ <th class="num" style="width:7%">涓嬪垁璁℃暟</th>
+ <th class="num" style="width:7%">浣跨敤娆℃暟</th>
+ <th class="num" style="width:7%">浣跨敤涓婇檺</th>
+ <th class="num" style="width:7%">瀵垮懡姣�%</th>
+ <th class="num" style="width:7%">瀵垮懡姣旈璀﹀��</th>
+ <th style="width:7%">棰勮鐘舵��</th>
+ <th style="width:7%">鍒�鍏峰湪鏈虹姸鎬�</th>
</tr>
</thead>
<tbody>
@@ -109,23 +110,60 @@
<!-- 鍙湁绗竴琛屾樉绀� currentCjNum锛屽叾瀹冭鏄剧ず downCount -->
<td class="num">
<template v-if="idx === 0">
- {{ item.currentCjNum != null ? item.currentCjNum : '' }}
+ <!-- 绗竴琛岋細涓嬫満鏃朵笉瀹炴椂鏄剧ず currentCjNum锛屾樉绀� downCount -->
+ <template v-if="!item.downTime">
+ {{ item.currentCjNum != null ? item.currentCjNum : '' }}
+ </template>
+ <template v-else>
+ {{ item.downCount != null ? item.downCount : '' }}
+ </template>
</template>
<template v-else>
{{ item.downCount != null ? item.downCount : '' }}
</template>
</td>
- <td class="num">{{ item.useCount != null ? item.useCount : '' }}</td>
+ <!--浣跨敤娆℃暟-->
+ <td class="num">
+ <template v-if="idx === 0">
+ <!-- 绗竴琛屽疄鏃惰绠椾娇鐢ㄦ鏁帮紝鑻ヤ负涓嬫満鍒欎笉瀹炴椂鏄剧ず -->
+ <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">
+ <!-- 绗竴琛屽疄鏃惰绠楀鍛芥瘮%锛岃嫢涓轰笅鏈哄垯涓嶅疄鏃舵樉绀� -->
+ <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 }}
+ </template>
+ </td>
<td class="num">{{ item.lifeWarn }}</td>
<td :class="item.warnStatus === '棰勮' ? 'warn-cell' : (item.warnStatus === '姝e父' ? 'ok-cell' : '')">
<span v-if="item.warnStatus === '棰勮'" class="warn-badge">璀﹀憡</span>
<span v-else>{{ item.warnStatus }}</span>
</td>
+ <td>
+ {{ item.downTime ? '涓嬫満' : '鍦ㄦ満' }}<!--鍦ㄦ満鐘舵��-->
+ </td>
</tr>
<tr v-if="!toolRecords.length">
- <td colspan="11">鏆傛棤鏁版嵁</td>
+ <td colspan="12">鏆傛棤鏁版嵁</td>
</tr>
</tbody>
</table>
@@ -187,7 +225,7 @@
toolModel() { this.isDirty = true; }
},
methods: {
- //鏌ヨ褰撳墠鏁伴噰鏁帮紝浣滀负涓嬪垁璁℃暟瀹炴椂鏄剧ず
+ //鏌ヨ褰撳墠鏁伴噰鏁帮紝浣滀负涓嬪垁璁℃暟瀹炴椂鏄剧ず
async fetchCurrentCjNum(toolNo) {
if (!this.machineNo) return null;
try {
@@ -751,11 +789,12 @@
.form-label {
width: auto;
- font-weight: bold;
+ font-weight: 500;
color: #333;
white-space: nowrap;
margin-right: 4px;
flex-shrink: 0;
+ font-size: 22px;
}
.input {
@@ -768,6 +807,7 @@
min-width: 0;
height: 56px !important;
box-sizing: border-box;
+ font-size: 22px;
}
.input.small-font {
@@ -865,12 +905,15 @@
color: white;
border: none;
text-align: center;
- border-radius: 6px;
- transition: background 0.2s;
+ border-radius: 4px;
+ transition: all 0.3s;
+ font-size: 22px;
+ font-weight: 500;
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.cancel-btn {
- background-color: #eee;
+ background-color: #f5f5f5;
color: #333;
}
@@ -991,6 +1034,7 @@
.dialog-actions .btn-blue {
padding: 10px 24px;
min-width: 120px;
+ font-size: 22px;
}
.btn-disabled {
@@ -1032,6 +1076,7 @@
padding: 16px 10px;
font-weight: bold;
text-align: center;
+ font-size: 22px;
}
table.styled-table tbody td {
@@ -1039,6 +1084,7 @@
padding: 14px 10px;
vertical-align: middle;
text-align: center;
+ font-size: 22px;
}
.table-section table th:first-child, .table-section table td:first-child {
@@ -1171,5 +1217,4 @@
margin-right: 16px;
flex: none !important; /* 鍏抽敭锛氬交搴曠姝lex鎷変几 */
}
-
</style>
\ No newline at end of file
--
Gitblit v1.9.3