|
|
@ -12,17 +12,18 @@ |
|
|
@current-change="handleQcSelect" |
|
|
@current-change="handleQcSelect" |
|
|
@row-click="handleQcSelect" |
|
|
@row-click="handleQcSelect" |
|
|
style="width: 100%;" |
|
|
style="width: 100%;" |
|
|
|
|
|
:max-height="qcTableHeight" |
|
|
class="qc-table"> |
|
|
class="qc-table"> |
|
|
<el-table-column prop="qcName" label="姓名" width="80" align="center" /> |
|
|
<el-table-column prop="qcName" label="姓名" width="80" align="center" /> |
|
|
<el-table-column prop="region" label="负责区域" min-width="90" show-overflow-tooltip /> |
|
|
<el-table-column prop="region" label="负责区域" min-width="90" show-overflow-tooltip /> |
|
|
<el-table-column label="操作" width="80" align="center" fixed="right"> |
|
|
<el-table-column label="操作" width="80" align="center" fixed="right"> |
|
|
<template slot-scope="scope"> |
|
|
<template slot-scope="scope"> |
|
|
<!-- 只有当主表选中了数据且状态为已下达时才显示排程按钮 --> |
|
|
|
|
|
|
|
|
<!-- 只有当主表选中了数据且状态为已下达或已排程时才显示排程按钮 --> |
|
|
<el-link |
|
|
<el-link |
|
|
v-if="hasSelectedData && currentStatusDb === 'Audited'" |
|
|
|
|
|
|
|
|
v-if="hasSelectedData && (currentStatusDb === 'Audited' || currentStatusDb === 'Scheduled')" |
|
|
type="primary" |
|
|
type="primary" |
|
|
style="cursor: pointer;" |
|
|
style="cursor: pointer;" |
|
|
@click.stop="openScheduleDialog(null, scope.row)">排程</el-link> |
|
|
|
|
|
|
|
|
@click.stop="openScheduleDialog(null, scope.row)">{{ currentStatusDb === 'Scheduled' ? '修改' : '排程' }}</el-link> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
</el-table> |
|
|
</el-table> |
|
|
@ -106,6 +107,7 @@ export default { |
|
|
selectedQc: null, |
|
|
selectedQc: null, |
|
|
scheduleDays: [], |
|
|
scheduleDays: [], |
|
|
loading: false, |
|
|
loading: false, |
|
|
|
|
|
qcTableHeight: 500, |
|
|
scheduleDialogVisible: false, |
|
|
scheduleDialogVisible: false, |
|
|
scheduleForm: { |
|
|
scheduleForm: { |
|
|
qcOperator: '', |
|
|
qcOperator: '', |
|
|
@ -144,8 +146,22 @@ export default { |
|
|
console.log('[排程视图] 组件已挂载') |
|
|
console.log('[排程视图] 组件已挂载') |
|
|
// 组件挂载时自动加载QC列表和排程数据 |
|
|
// 组件挂载时自动加载QC列表和排程数据 |
|
|
this.loadQcList() |
|
|
this.loadQcList() |
|
|
|
|
|
// 计算QC表格高度 |
|
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
|
this.calculateQcTableHeight() |
|
|
|
|
|
}) |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
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排程视图(供父组件调用) |
|
|
// 强制刷新当前选中的QC排程视图(供父组件调用) |
|
|
forceRefresh() { |
|
|
forceRefresh() { |
|
|
console.log('[排程视图] forceRefresh 被调用') |
|
|
console.log('[排程视图] forceRefresh 被调用') |
|
|
@ -226,6 +242,14 @@ export default { |
|
|
planEndDate: '', |
|
|
planEndDate: '', |
|
|
remark: '' |
|
|
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 |
|
|
this.scheduleDialogVisible = true |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
@ -434,17 +458,17 @@ export default { |
|
|
background: #fff; |
|
|
background: #fff; |
|
|
display: flex; |
|
|
display: flex; |
|
|
flex-direction: column; |
|
|
flex-direction: column; |
|
|
height: 220px; |
|
|
|
|
|
|
|
|
height: 280px; |
|
|
width: 100%; |
|
|
width: 100%; |
|
|
|
|
|
|
|
|
.card-header { |
|
|
.card-header { |
|
|
padding: 8px 10px; |
|
|
|
|
|
|
|
|
padding: 10px 12px; |
|
|
background: #f5f7fa; |
|
|
background: #f5f7fa; |
|
|
border-bottom: 2px solid #dcdfe6; |
|
|
border-bottom: 2px solid #dcdfe6; |
|
|
display: flex; |
|
|
display: flex; |
|
|
justify-content: space-between; |
|
|
justify-content: space-between; |
|
|
align-items: center; |
|
|
align-items: center; |
|
|
height: 40px; |
|
|
|
|
|
|
|
|
height: 45px; |
|
|
flex-shrink: 0; |
|
|
flex-shrink: 0; |
|
|
|
|
|
|
|
|
.date-label { |
|
|
.date-label { |
|
|
@ -460,11 +484,11 @@ export default { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.card-body { |
|
|
.card-body { |
|
|
padding: 8px; |
|
|
|
|
|
|
|
|
padding: 10px; |
|
|
display: flex; |
|
|
display: flex; |
|
|
flex-direction: column; |
|
|
flex-direction: column; |
|
|
gap: 6px; |
|
|
|
|
|
height: calc(100% - 40px); |
|
|
|
|
|
|
|
|
gap: 8px; |
|
|
|
|
|
height: calc(100% - 45px); |
|
|
overflow-y: auto; |
|
|
overflow-y: auto; |
|
|
|
|
|
|
|
|
&::-webkit-scrollbar { |
|
|
&::-webkit-scrollbar { |
|
|
@ -483,7 +507,7 @@ export default { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.task-item { |
|
|
.task-item { |
|
|
padding: 8px; |
|
|
|
|
|
|
|
|
padding: 10px; |
|
|
background: #f5f7fa; |
|
|
background: #f5f7fa; |
|
|
border: 1px solid #dcdfe6; |
|
|
border: 1px solid #dcdfe6; |
|
|
border-radius: 3px; |
|
|
border-radius: 3px; |
|
|
@ -498,20 +522,20 @@ export default { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.task-no { |
|
|
.task-no { |
|
|
font-size: 12px; |
|
|
|
|
|
|
|
|
font-size: 13px; |
|
|
font-weight: bold; |
|
|
font-weight: bold; |
|
|
color: #409eff; |
|
|
color: #409eff; |
|
|
margin-bottom: 4px; |
|
|
|
|
|
|
|
|
margin-bottom: 5px; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.task-supplier { |
|
|
.task-supplier { |
|
|
font-size: 11px; |
|
|
|
|
|
|
|
|
font-size: 12px; |
|
|
color: #606266; |
|
|
color: #606266; |
|
|
word-wrap: break-word; |
|
|
word-wrap: break-word; |
|
|
word-break: break-all; |
|
|
word-break: break-all; |
|
|
white-space: normal; |
|
|
white-space: normal; |
|
|
line-height: 1.4; |
|
|
|
|
|
margin-bottom: 3px; |
|
|
|
|
|
|
|
|
line-height: 1.5; |
|
|
|
|
|
margin-bottom: 4px; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.task-address { |
|
|
.task-address { |
|
|
|