feat: 展示报工归属拆分摘要
This commit is contained in:
parent
5f6deee796
commit
28b7b76815
@ -47,6 +47,7 @@
|
||||
<view class="row">
|
||||
<view class="row-left">
|
||||
<text class="value">{{item.employeeName}} · {{item.reportDate}}</text>
|
||||
<text wx:if="{{item.sourceReportDatesText}}" class="allocation-summary">原始报工日期 {{item.sourceReportDatesText}}</text>
|
||||
<text class="subtitle">考勤点 {{item.attendancePointName || '-'}}</text>
|
||||
<text class="subtitle">{{item.employeePhone}} · {{item.projectNo}} / {{item.productName}}</text>
|
||||
<text class="subtitle">{{item.processDisplayName || item.productName || '-'}}</text>
|
||||
|
||||
@ -21,6 +21,14 @@
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.allocation-summary {
|
||||
display: block;
|
||||
margin-top: 6rpx;
|
||||
color: #4b5563;
|
||||
font-size: 24rpx;
|
||||
line-height: 1.45;
|
||||
}
|
||||
|
||||
.cleaning-watermark {
|
||||
position: absolute;
|
||||
right: 28rpx;
|
||||
|
||||
@ -51,6 +51,7 @@
|
||||
<text class="subtitle">考勤点 {{item.attendancePointName || '-'}}</text>
|
||||
<text class="subtitle">{{item.timeRangeText}}</text>
|
||||
<text class="subtitle">{{item.metrics.shiftDistributionText || ''}}</text>
|
||||
<text wx:if="{{item.allocationSummaryText}}" class="allocation-summary">归属拆分:{{item.allocationSummaryText}}</text>
|
||||
</view>
|
||||
<text class="pill {{item.status === 'approved' ? 'success' : 'warn'}}">{{item.statusName}}</text>
|
||||
</view>
|
||||
|
||||
@ -53,6 +53,14 @@
|
||||
border-color: #aebbd0;
|
||||
}
|
||||
|
||||
.allocation-summary {
|
||||
display: block;
|
||||
margin-top: 6rpx;
|
||||
color: #4b5563;
|
||||
font-size: 24rpx;
|
||||
line-height: 1.45;
|
||||
}
|
||||
|
||||
.cleaning-watermark {
|
||||
position: absolute;
|
||||
right: 28rpx;
|
||||
|
||||
18
utils/api.js
18
utils/api.js
@ -544,6 +544,19 @@ const formatWorkTime = minutes => {
|
||||
return `${Math.round(safeMinutes * 100) / 100}分钟`
|
||||
}
|
||||
|
||||
const toCamelAllocation = row => ({
|
||||
allocationDate: row.allocation_date || '',
|
||||
dayMinutes: Number(row.day_minutes || 0),
|
||||
overtimeMinutes: Number(row.overtime_minutes || 0),
|
||||
nightMinutes: Number(row.night_minutes || 0),
|
||||
effectiveMinutes: Number(row.effective_minutes || 0),
|
||||
goodQty: Number(row.good_qty || 0),
|
||||
defectQty: Number(row.defect_qty || 0),
|
||||
scrapQty: Number(row.scrap_qty || 0),
|
||||
changeoverCount: Number(row.changeover_count || 0),
|
||||
referenceWage: Number(row.reference_wage || 0),
|
||||
})
|
||||
|
||||
const toCamelReportItem = row => {
|
||||
const defectQty = Number(row.defect_qty || 0)
|
||||
const scrapQty = Number(row.scrap_qty || 0)
|
||||
@ -620,6 +633,7 @@ const toCamelReportItem = row => {
|
||||
corrections,
|
||||
correctionPairs,
|
||||
hasCorrections: correctionPairs.length > 0,
|
||||
allocations: (row.allocations || []).map(toCamelAllocation),
|
||||
}
|
||||
}
|
||||
|
||||
@ -714,6 +728,7 @@ const toCamelReport = row => {
|
||||
canUnvoid: !!row.can_unvoid,
|
||||
canEdit: !!row.can_edit,
|
||||
isModified: !!row.is_modified,
|
||||
allocationSummaryText: row.allocation_summary_text || '',
|
||||
deviceSegments,
|
||||
items,
|
||||
isCleaning,
|
||||
@ -1555,6 +1570,9 @@ const listDashboard = async (filters = {}) => {
|
||||
reportCount: row.report_count,
|
||||
effectiveMinutes: row.effective_minutes,
|
||||
shiftDistributionText: row.shift_distribution_text || '',
|
||||
sourceReportDate: row.source_report_date || '',
|
||||
sourceReportDates: row.source_report_dates || [],
|
||||
sourceReportDatesText: (row.source_report_dates || []).join('、'),
|
||||
shiftDayMinutes: row.shift_day_minutes || 0,
|
||||
shiftOvertimeMinutes: row.shift_overtime_minutes || 0,
|
||||
shiftNightMinutes: row.shift_night_minutes || 0,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user