From 28b121a4f762b4d854a7058c99a91b8deb4a843e Mon Sep 17 00:00:00 2001 From: qiankanghui Date: Tue, 23 Jun 2026 13:52:52 +0800 Subject: [PATCH] =?UTF-8?q?feat(inspection):=20=E4=BC=98=E5=8C=96=E6=A3=80?= =?UTF-8?q?=E9=AA=8C=E6=8E=92=E7=A8=8B=E7=95=8C=E9=9D=A2=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 为QC表格添加最大高度限制 - 扩展排程按钮显示条件,支持已排程状态下显示修改按钮 - 根据表格行数动态计算QC表格高度 - 优化界面样式,调整卡片高度、内边距和字体大小 - 实现已排程数据的回显功能,支持修改现有排程信息 --- .../inspection/com_inspectionScheduleView.vue | 54 +++++++++++++------ 1 file changed, 39 insertions(+), 15 deletions(-) diff --git a/src/views/modules/inspection/com_inspectionScheduleView.vue b/src/views/modules/inspection/com_inspectionScheduleView.vue index 4d4fb9a..2e3cad8 100644 --- a/src/views/modules/inspection/com_inspectionScheduleView.vue +++ b/src/views/modules/inspection/com_inspectionScheduleView.vue @@ -12,17 +12,18 @@ @current-change="handleQcSelect" @row-click="handleQcSelect" style="width: 100%;" + :max-height="qcTableHeight" class="qc-table"> @@ -106,6 +107,7 @@ export default { selectedQc: null, scheduleDays: [], loading: false, + qcTableHeight: 500, scheduleDialogVisible: false, scheduleForm: { qcOperator: '', @@ -144,8 +146,22 @@ export default { console.log('[排程视图] 组件已挂载') // 组件挂载时自动加载QC列表和排程数据 this.loadQcList() + // 计算QC表格高度 + this.$nextTick(() => { + this.calculateQcTableHeight() + }) }, methods: { + // 计算QC表格高度 + calculateQcTableHeight() { + // 计算10行数据的高度 + // Element UI mini尺寸的表格,每行高度约为40px(包含边框) + const rowHeight = 40 + const headerHeight = 45 // 表头高度 + const rowCount = 10 // 显示10行数据 + + this.qcTableHeight = (rowHeight * rowCount) + headerHeight + 2 // 加2px用于边框 + }, // 强制刷新当前选中的QC排程视图(供父组件调用) forceRefresh() { console.log('[排程视图] forceRefresh 被调用') @@ -226,6 +242,14 @@ export default { planEndDate: '', remark: '' } + + // 如果是已排程状态,加载当前排程数据用于修改 + if (this.currentStatusDb === 'Scheduled' && this.currentRow && this.currentRow.planStartDate) { + this.scheduleForm.planStartDate = this.currentRow.planStartDate || '' + this.scheduleForm.planEndDate = this.currentRow.planEndDate || this.currentRow.planStartDate || '' + this.scheduleForm.remark = this.currentRow.remark || '' + } + this.scheduleDialogVisible = true }, @@ -434,17 +458,17 @@ export default { background: #fff; display: flex; flex-direction: column; - height: 220px; + height: 280px; width: 100%; .card-header { - padding: 8px 10px; + padding: 10px 12px; background: #f5f7fa; border-bottom: 2px solid #dcdfe6; display: flex; justify-content: space-between; align-items: center; - height: 40px; + height: 45px; flex-shrink: 0; .date-label { @@ -460,11 +484,11 @@ export default { } .card-body { - padding: 8px; + padding: 10px; display: flex; flex-direction: column; - gap: 6px; - height: calc(100% - 40px); + gap: 8px; + height: calc(100% - 45px); overflow-y: auto; &::-webkit-scrollbar { @@ -483,7 +507,7 @@ export default { } .task-item { - padding: 8px; + padding: 10px; background: #f5f7fa; border: 1px solid #dcdfe6; border-radius: 3px; @@ -498,20 +522,20 @@ export default { } .task-no { - font-size: 12px; + font-size: 13px; font-weight: bold; color: #409eff; - margin-bottom: 4px; + margin-bottom: 5px; } .task-supplier { - font-size: 11px; + font-size: 12px; color: #606266; word-wrap: break-word; word-break: break-all; white-space: normal; - line-height: 1.4; - margin-bottom: 3px; + line-height: 1.5; + margin-bottom: 4px; } .task-address {