|
|
@@ -54,6 +54,7 @@
|
|
|
<template #headLeft>
|
|
|
<div class="flex flex-row items-center gap-2">
|
|
|
<a-button type="primary" @click="openDownloadModal">打包下载</a-button>
|
|
|
+ <a-button @click="openExportExcelModal">导出Excel</a-button>
|
|
|
<span>{{ progressHint }}</span>
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -143,6 +144,31 @@
|
|
|
</a-form-item>
|
|
|
</a-form>
|
|
|
</a-modal>
|
|
|
+
|
|
|
+ <a-modal
|
|
|
+ v-model:open="showExportExcelModal"
|
|
|
+ title="导出自查表汇总Excel"
|
|
|
+ @ok="handleExportExcel"
|
|
|
+ :confirmLoading="exporting"
|
|
|
+ okText="导出"
|
|
|
+ cancelText="取消"
|
|
|
+ >
|
|
|
+ <a-form layout="vertical">
|
|
|
+ <a-form-item label="年份">
|
|
|
+ <a-input-number v-model:value="exportYear" :min="2020" :max="2030" style="width: 100%" />
|
|
|
+ </a-form-item>
|
|
|
+ <a-form-item label="等级">
|
|
|
+ <a-select v-model:value="exportLevel" style="width: 100%">
|
|
|
+ <a-select-option v-for="opt in selfAssessmentLevelOptions" :key="opt.id" :value="opt.id">{{ opt.name }}</a-select-option>
|
|
|
+ </a-select>
|
|
|
+ </a-form-item>
|
|
|
+ <a-form-item label="状态">
|
|
|
+ <a-select v-model:value="exportProgress" style="width: 100%">
|
|
|
+ <a-select-option v-for="opt in downloadProgressOptions" :key="opt.id" :value="opt.id">{{ opt.name }}</a-select-option>
|
|
|
+ </a-select>
|
|
|
+ </a-form-item>
|
|
|
+ </a-form>
|
|
|
+ </a-modal>
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
@@ -175,6 +201,12 @@ const downloading = ref(false);
|
|
|
const downloadYear = ref(new Date().getFullYear() - 1);
|
|
|
const downloadProgress = ref(-100);
|
|
|
|
|
|
+const showExportExcelModal = ref(false);
|
|
|
+const exporting = ref(false);
|
|
|
+const exportYear = ref(new Date().getFullYear() - 1);
|
|
|
+const exportLevel = ref(0);
|
|
|
+const exportProgress = ref(-100);
|
|
|
+
|
|
|
const dataStats = ref<Awaited<ReturnType<typeof AssessmentContentApi.getDataCount>>|null>(null);
|
|
|
|
|
|
const checkProgressLabels: Record<string, string> = {
|
|
|
@@ -407,6 +439,31 @@ function openDownloadModal() {
|
|
|
showDownloadModal.value = true;
|
|
|
}
|
|
|
|
|
|
+function openExportExcelModal() {
|
|
|
+ exportProgress.value = lastSelfAssessmentProgress.value;
|
|
|
+ exportLevel.value = lastSelfAssessmentLevel.value;
|
|
|
+ showExportExcelModal.value = true;
|
|
|
+}
|
|
|
+
|
|
|
+async function handleExportExcel() {
|
|
|
+ exporting.value = true;
|
|
|
+ try {
|
|
|
+ const progress = exportProgress.value > -50 ? exportProgress.value : undefined;
|
|
|
+ const level = exportLevel.value > 0 ? exportLevel.value : undefined;
|
|
|
+ await AssessmentContentApi.exportCheckExcel({
|
|
|
+ year: exportYear.value,
|
|
|
+ progress,
|
|
|
+ level,
|
|
|
+ });
|
|
|
+ showExportExcelModal.value = false;
|
|
|
+ message.success('导出成功');
|
|
|
+ } catch (e: any) {
|
|
|
+ message.error(e?.message || '导出失败');
|
|
|
+ } finally {
|
|
|
+ exporting.value = false;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
watch(route, () => {
|
|
|
listRef.value?.reload();
|
|
|
})
|