| | |
| | | <el-table-column type="index" label="序号" width="56" align="center" :resizable="false"></el-table-column> |
| | | <el-table-column prop="deviceId" label="报工来源" align="center" :resizable="false"> |
| | | <template #default="scope"> |
| | | {{ scope?.row?.workerName ?? '' }}/{{ scope?.row?.deviceName ?? '' }} |
| | | {{ scope?.row?.workerName ?? '--' }}/{{ scope?.row?.deviceName ?? '--' }} |
| | | </template> |
| | | </el-table-column> |
| | | <!-- TODO: 条码字段还没加 --> |
| | | <el-table-column prop="xxx" label="条码" align="center" :resizable="false">条码</el-table-column> |
| | | <el-table-column prop="barCode" label="条码" align="center" :resizable="false">条码</el-table-column> |
| | | <el-table-column prop="reportAmount" label="报工数量" align="center" :resizable="false" /> |
| | | <el-table-column prop="finishAmount" label="完成数量" align="center" :resizable="false" /> |
| | | <el-table-column prop="startTime" label="开始时间" align="center" :resizable="false"> |
| | |
| | | {{ formatDate(scope.row.endTime) }} |
| | | </template> |
| | | </el-table-column> |
| | | <!-- TODO: 工时字段还没加--> |
| | | <el-table-column prop="xxx" label="工时" align="center" :resizable="false" /> |
| | | <el-table-column prop="workerTime" label="工时" align="center" :resizable="false"> |
| | | <template #default="scope"> |
| | | {{ formatDuration(scope.row.workerTime) }} |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | </el-dialog> |
| | |
| | | import { apiGetReportingRecordList } from '@/api' |
| | | import type { ReportingRecord } from '@/api/reporting' |
| | | import { useTasksStore } from '@/stores/tasks' |
| | | import { isNumber } from 'lodash-es' |
| | | |
| | | export interface BaseModalProps { |
| | | /** 是否展示模态框 */ |
| | |
| | | const time = useDateFormat(timestamp * 1000, 'YYYY-MM-DD HH:mm:ss', { locales: 'zh-cn' }) |
| | | return time.value |
| | | } |
| | | |
| | | /** |
| | | * 接受秒数,返回格式化后的 时分秒字符串 |
| | | * @param duration 秒数 |
| | | * @returns {string} 格式化后的 时分秒字符串 |
| | | */ |
| | | function formatDuration(duration: number): string { |
| | | if (duration < 0 || !isNumber(duration)) { |
| | | return '--' |
| | | } |
| | | const h = Math.floor(duration / 3600) |
| | | const m = Math.floor((duration % 3600) / 60) |
| | | const s = Math.floor(duration % 60) |
| | | return `${h > 0 ? h + '时' : ''}${m > 0 ? m + '分钟' : ''}${s}秒` |
| | | } |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |