| | |
| | | :status="toProgressPercentage(row?.completionStatus) >= 100 ? 'success' : ''" /> |
| | | </template> |
| | | <template #todayReportState="{ row }"> |
| | | {{ formatTodayReportState(row?.todayReportState) }} |
| | | <el-tag :type="todayReportStateTagType(row?.todayReportState)" |
| | | size="small"> |
| | | {{ formatTodayReportState(row?.todayReportState) }} |
| | | </el-tag> |
| | | </template> |
| | | <template #totalReportDurationMinutes="{ row }"> |
| | | {{ formatDurationHours(row?.totalReportDurationMinutes) }} |
| | | </template> |
| | | </PIMTable> |
| | | </div> |
| | |
| | | width: "80", |
| | | }, |
| | | { |
| | | label: "今日报工状态", |
| | | prop: "todayReportState", |
| | | dataType: "slot", |
| | | slot: "todayReportState", |
| | | width: "110", |
| | | }, |
| | | { |
| | | label: "工单编号", |
| | | prop: "workOrderNo", |
| | | width: "140", |
| | |
| | | width: "140", |
| | | }, |
| | | { |
| | | label: "今日报工状态", |
| | | prop: "todayReportState", |
| | | dataType: "slot", |
| | | slot: "todayReportState", |
| | | width: "140", |
| | | }, |
| | | { |
| | | label: "计划工时(小时)", |
| | | prop: "salaryQuota", |
| | | width: "140", |
| | | }, |
| | | { |
| | | label: "系统核算时间(小时)", |
| | | prop: "totalReportDurationMinutes", |
| | | dataType: "slot", |
| | | slot: "totalReportDurationMinutes", |
| | | width: "160", |
| | | }, |
| | | { |
| | | label: "计划开始时间", |
| | |
| | | if (state === 2) return "已开始"; |
| | | if (state === 3) return "已结束"; |
| | | return "-"; |
| | | }; |
| | | const formatDurationHours = val => { |
| | | const minutes = Number(val); |
| | | if (!Number.isFinite(minutes) || minutes < 0) return "-"; |
| | | return (minutes / 60).toFixed(2); |
| | | }; |
| | | const todayReportStateTagType = val => { |
| | | const state = Number(val); |
| | | if (state === 1) return "info"; |
| | | if (state === 2) return "success"; |
| | | if (state === 3) return "warning"; |
| | | return "info"; |
| | | }; |
| | | |
| | | // 查询列表 |
| | |
| | | |
| | | addProductMain(params) |
| | | .then(res => { |
| | | proxy.$modal.msgSuccess("报工成功"); |
| | | proxy.$modal.msgSuccess( |
| | | currentReportState.value === 1 ? "开始报工成功" : "结束报工成功" |
| | | ); |
| | | reportDialogVisible.value = false; |
| | | getList(); |
| | | }) |
| | | .catch(() => { |
| | | ElMessageBox.alert("报工失败", "提示", { |
| | | confirmButtonText: "确定", |
| | | }); |
| | | }); |
| | | }); |
| | | }; |
| | |
| | | text-align: center; |
| | | margin-top: 20px; |
| | | } |
| | | |
| | | </style> |
| | | |
| | | <style lang="scss"> |