tjx
2025-11-04 6b89f08dd48f79bc4f248c747535f62a4ac55de7
components/mold.vue
@@ -7,7 +7,6 @@
                <view class="form-cell">
                    <label class="form-label">刀具编号:</label>
                    <input class="input small-font" v-model="selectedToolNo" placeholder="请通过刀具目录选择" disabled />
                    <!-- 移除的按钮位置 -->
                </view>
                <view class="form-cell">
                    <label class="form-label">设置使用上限:</label>
@@ -40,16 +39,16 @@
                    <button class="btn-blue large-btn" @click="openToolDialog" :disabled="loadingTools">刀具目录</button>
                </view>
            </view>
        </view>  <!-- 这里闭合 top-section-grid -->
        <!-- 操作按钮 - 移出 top-section-grid -->
        <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>
        </view>
            <!-- 操作按钮 -->
            <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>
            </view>
            <!-- 刀具目录弹窗 -->
            <view v-if="showToolDialog" class="dialog-overlay">
        <!-- 刀具目录弹窗 -->
        <view v-if="showToolDialog" class="dialog-overlay">
                <view class="dialog">
                    <view class="form-group">
                        <input v-model="searchKey" placeholder="输入刀具编码、名称模糊搜索" class="input" @input="onSearchKeyInput" />
@@ -76,10 +75,10 @@
                        </div>
                    </view>
                </view>
            </view>
        </view>
            <!-- 刀具使用记录表格 -->
            <view class="table-section">
        <!-- 刀具使用记录表格 -->
        <view class="table-section">
                <table class="styled-table">
                    <thead>
                        <tr>
@@ -118,14 +117,14 @@
                        </tr>
                    </tbody>
                </table>
            </view>
        </view>
            <!-- 说明 -->
            <!--<view class="tool-desc">
        <p style="color:red;">'使用上限'以下刀时的'使用上限'为计算标准</p>
        <p style="color:red;">寿命比预警值默认为90%</p>
    </view>-->
        </view>
    </view>
</template>
<script>
@@ -681,7 +680,7 @@
        align-items: center;
        flex: 1;
        margin: 0 8px;
        min-height: 40px;
        min-height: 44px;
    }
    .form-label {
@@ -691,6 +690,7 @@
        color: #333;
        white-space: nowrap;
        margin-right: 8px;
        flex-shrink: 0;
    }
    .input {
@@ -698,7 +698,7 @@
        font-size: 16px;
        border: 1px solid #dcdfe6;
        flex: 1;
        margin-right: 8px;
        margin-right: 0;
        border-radius: 4px;
        background: #fff;
        min-width: 0;
@@ -729,6 +729,7 @@
        height: 36px;
        box-sizing: border-box;
        transition: all 0.3s;
        flex-shrink: 0;
    }
        .btn-blue:hover {
@@ -800,15 +801,27 @@
        background: #fff;
        padding: 3vh 3vw;
        border-radius: 18px;
        width: 100vw;
        max-width: 1200px;
        min-height: 60vh;
        width: 90vw;
        max-width: 1600px;
        min-height: 70vh;
        max-height: 85vh;
        box-sizing: border-box;
        box-shadow: 0 8px 32px rgba(0,0,0,0.12);
        display: flex;
        flex-direction: column;
    }
    .form-group {
        display: flex;
        gap: 12px;
        align-items: center;
        margin-bottom: 2vh;
        flex-shrink: 0;
    }
    .form-group .input {
        width: 24vw;
        flex: 1;
        min-width: 300px;
        border-radius: 6px;
        background: #f8f8f8;
    }
@@ -817,25 +830,29 @@
        display: flex;
        flex-wrap: wrap;
        margin: 1vh 0;
        max-height: 40vh;
        flex: 1;
        overflow-y: auto;
        gap: 10px 0;
        gap: 12px;
        align-content: flex-start;
    }
    .tool-btn {
        flex: 0 0 24%;
        flex: 0 0 calc(20% - 10px);
        box-sizing: border-box;
        margin: 5px 1% 5px 0;
        padding: 12px 18px;
        padding: 10px 12px;
        background: #f5f5f5;
        border: 1px solid #d0d0d0;
        border-radius: 8px;
        cursor: pointer;
        color: #333;
        text-align: left;
        font-size: 1vw;
        font-size: 13px;
        min-height: 50px;
        transition: background 0.15s, color 0.15s;
        word-break: break-all;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        line-height: 1.4;
    }
        .tool-btn.active {
@@ -848,10 +865,11 @@
    .dialog-actions {
        display: flex;
        justify-content: space-between;
        align-items: flex-end;
        align-items: center;
        margin-top: 2vh;
        padding-top: 2vh;
        border-top: 1px solid #eee;
        flex-shrink: 0;
    }
        .dialog-actions > div:first-child {
@@ -867,16 +885,23 @@
            align-items: center;
        }
        .dialog-actions .btn-blue {
            padding: 10px 24px;
            font-size: 16px;
            min-width: 100px;
        }
    .btn-disabled {
        background: #f2f2f2;
        color: #bbb;
        color: #999;
        border: none;
        padding: 14px 36px;
        border-radius: 10px;
        font-size: 1.1vw;
        font-weight: bold;
        padding: 10px 24px;
        border-radius: 4px;
        font-size: 16px;
        font-weight: 500;
        cursor: not-allowed;
        box-shadow: none;
        min-width: 100px;
    }
    /* 表格样式 */
@@ -1006,15 +1031,17 @@
    /* 新增大按钮样式 */
    .btn-blue.large-btn {
        padding: 12px 24px;
        font-size: 18px;
        height: 44px;
        min-width: 120px;
        padding: 8px 24px;
        font-size: 16px;
        height: 36px;
        min-width: 100px;
    }
    /* 调整表单单元格布局以适应大按钮 */
    .form-cell:last-child {
        justify-content: flex-end;
    /* 调整表单单元格布局以适应按钮 */
    .form-row .form-cell:last-child {
        justify-content: center;
        flex: 0 0 auto;
        min-width: 120px;
    }
</style>