feat: 新增报告审核模块及api基础功能
parent
462a54c0f4
commit
0702d247bd
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,61 @@
|
|||||||
|
<template>
|
||||||
|
<ElDialog
|
||||||
|
:model-value="visible"
|
||||||
|
:title="title"
|
||||||
|
width="80%"
|
||||||
|
top="4vh"
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
append-to-body
|
||||||
|
destroy-on-close
|
||||||
|
class="doc-preview-dialog"
|
||||||
|
@update:model-value="(v: boolean) => emit('update:visible', v)"
|
||||||
|
>
|
||||||
|
<div class="preview-body">
|
||||||
|
<FaDocxPreview
|
||||||
|
v-if="fileUrl"
|
||||||
|
:src="fileUrl"
|
||||||
|
:readonly="true"
|
||||||
|
class="preview-no-outline"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</ElDialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { computed } from "vue";
|
||||||
|
import FaDocxPreview from "@/components/business/fa-docx-preview/index.vue";
|
||||||
|
|
||||||
|
defineOptions({ name: "DocPreviewDialog" });
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
visible: boolean;
|
||||||
|
title?: string;
|
||||||
|
fileUrl?: string;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
"update:visible": [v: boolean];
|
||||||
|
}>();
|
||||||
|
|
||||||
|
const title = computed(() => props.title || "文档预览");
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
:deep(.doc-preview-dialog .el-dialog__body) {
|
||||||
|
padding: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.preview-body {
|
||||||
|
height: calc(100vh - 180px);
|
||||||
|
background: #f5f7fa;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 隐藏左侧大纲栏和展开按钮,仅保留文档预览区域 */
|
||||||
|
// .preview-body :deep(.outline-sidebar) {
|
||||||
|
// display: none;
|
||||||
|
// }
|
||||||
|
// .preview-body :deep(.outline-expand-btn) {
|
||||||
|
// display: none;
|
||||||
|
// }
|
||||||
|
</style>
|
||||||
@ -0,0 +1,121 @@
|
|||||||
|
<template>
|
||||||
|
<ElDialog
|
||||||
|
:model-value="visible"
|
||||||
|
title="任务详情"
|
||||||
|
width="640px"
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
append-to-body
|
||||||
|
@update:model-value="(v: boolean) => emit('update:visible', v)"
|
||||||
|
>
|
||||||
|
<ElDescriptions v-if="task" :column="2" border size="default">
|
||||||
|
<ElDescriptionsItem label="任务名称" :span="2">
|
||||||
|
{{ task.task_name }}
|
||||||
|
</ElDescriptionsItem>
|
||||||
|
<ElDescriptionsItem label="审核状态">
|
||||||
|
<ElTag :type="statusTagType(task.status)" effect="light">
|
||||||
|
{{ statusText(task.status) }}
|
||||||
|
</ElTag>
|
||||||
|
</ElDescriptionsItem>
|
||||||
|
<ElDescriptionsItem label="审核进度">
|
||||||
|
<ElProgress
|
||||||
|
v-if="task.status === 1"
|
||||||
|
:percentage="task.progress ?? 0"
|
||||||
|
:stroke-width="8"
|
||||||
|
status="success"
|
||||||
|
/>
|
||||||
|
<span v-else-if="task.status === 2" class="progress-text">已完成 100%</span>
|
||||||
|
<span v-else-if="task.status === 3" class="progress-text error">审核失败</span>
|
||||||
|
<span v-else class="progress-text">未开始</span>
|
||||||
|
</ElDescriptionsItem>
|
||||||
|
<ElDescriptionsItem label="审查人">
|
||||||
|
{{ task.reviewer_name || "-" }}
|
||||||
|
</ElDescriptionsItem>
|
||||||
|
<ElDescriptionsItem label="模板名称">
|
||||||
|
{{ task.template_name || "-" }}
|
||||||
|
</ElDescriptionsItem>
|
||||||
|
<ElDescriptionsItem label="审核文档" :span="2">
|
||||||
|
<span v-if="task.original_name">
|
||||||
|
<ElLink type="primary" @click="onPreviewDoc">
|
||||||
|
<ElIcon style="margin-right:4px"><View /></ElIcon>
|
||||||
|
{{ task.original_name }}
|
||||||
|
</ElLink>
|
||||||
|
</span>
|
||||||
|
<span v-else>-</span>
|
||||||
|
</ElDescriptionsItem>
|
||||||
|
<ElDescriptionsItem label="开始时间">
|
||||||
|
{{ formatDateTime(task.start_time) }}
|
||||||
|
</ElDescriptionsItem>
|
||||||
|
<ElDescriptionsItem label="结束时间">
|
||||||
|
{{ formatDateTime(task.end_time) }}
|
||||||
|
</ElDescriptionsItem>
|
||||||
|
<ElDescriptionsItem label="创建时间">
|
||||||
|
{{ formatDateTime(task.created_time) }}
|
||||||
|
</ElDescriptionsItem>
|
||||||
|
<ElDescriptionsItem label="更新时间">
|
||||||
|
{{ formatDateTime(task.updated_time) }}
|
||||||
|
</ElDescriptionsItem>
|
||||||
|
<ElDescriptionsItem v-if="task.description" label="备注" :span="2">
|
||||||
|
{{ task.description }}
|
||||||
|
</ElDescriptionsItem>
|
||||||
|
</ElDescriptions>
|
||||||
|
<template #footer>
|
||||||
|
<ElButton @click="emit('update:visible', false)">关闭</ElButton>
|
||||||
|
<ElButton v-if="task?.file_url" type="primary" @click="onPreviewDoc">
|
||||||
|
查看文档
|
||||||
|
</ElButton>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<DocPreviewDialog
|
||||||
|
v-model:visible="docPreviewVisible"
|
||||||
|
:title="task?.original_name || '审核文档'"
|
||||||
|
:file-url="task?.file_url"
|
||||||
|
/>
|
||||||
|
</ElDialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { ref } from "vue";
|
||||||
|
import { View } from "@element-plus/icons-vue";
|
||||||
|
import type { ReviewTaskItem } from "@/api/module_report/review";
|
||||||
|
import DocPreviewDialog from "./DocPreviewDialog.vue";
|
||||||
|
|
||||||
|
defineOptions({ name: "TaskDetailDialog" });
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
visible: boolean;
|
||||||
|
task?: ReviewTaskItem | null;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
"update:visible": [v: boolean];
|
||||||
|
}>();
|
||||||
|
|
||||||
|
const docPreviewVisible = ref(false);
|
||||||
|
|
||||||
|
function statusText(s: number) {
|
||||||
|
return ["未审查", "审查中", "审查完成", "审查失败"][s] ?? "未知";
|
||||||
|
}
|
||||||
|
function statusTagType(s: number): "info" | "warning" | "success" | "danger" {
|
||||||
|
return ["info", "warning", "success", "danger"][s] as any;
|
||||||
|
}
|
||||||
|
|
||||||
|
function formatDateTime(value?: string): string {
|
||||||
|
if (!value) return "-";
|
||||||
|
const d = new Date(value);
|
||||||
|
if (Number.isNaN(d.getTime())) return value;
|
||||||
|
const pad = (n: number) => String(n).padStart(2, "0");
|
||||||
|
return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())} ${pad(d.getHours())}:${pad(d.getMinutes())}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
function onPreviewDoc() {
|
||||||
|
docPreviewVisible.value = true;
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.progress-text {
|
||||||
|
font-size: 13px;
|
||||||
|
color: #606266;
|
||||||
|
&.error { color: #f56c6c; }
|
||||||
|
}
|
||||||
|
</style>
|
||||||
Loading…
Reference in New Issue