|
|
@@ -64,9 +64,9 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="url" :label="t('document.document.documentList.url')" min-width="200">
|
|
|
<template #default="scope">
|
|
|
- <div v-if="scope.row.fileName" class="file-name-cell">
|
|
|
- <svg-icon :icon-class="getFileIconClass(scope.row.fileName)" class="file-icon" :size="18" />
|
|
|
- <span class="file-name-text show-overflow-tooltip">{{ scope.row.fileName }}</span>
|
|
|
+ <div v-if="scope.row.actualDocumentName" class="file-name-cell">
|
|
|
+ <svg-icon :icon-class="getFileIconClass(scope.row.actualDocumentName)" class="file-icon" :size="18" />
|
|
|
+ <span class="file-name-text show-overflow-tooltip">{{ scope.row.actualDocumentName }}</span>
|
|
|
</div>
|
|
|
<span v-else>-</span>
|
|
|
</template>
|
|
|
@@ -87,73 +87,96 @@
|
|
|
<!-- 操作列 -->
|
|
|
<el-table-column :label="t('document.document.documentList.action')" width="480" align="center" fixed="right">
|
|
|
<template #default="scope">
|
|
|
- <el-button
|
|
|
- v-if="scope.row.url && scope.row.status === 1"
|
|
|
- v-hasPermi="['document:document:audit']"
|
|
|
- type="primary"
|
|
|
- :icon="Select"
|
|
|
- style="padding: 0 5px; font-size: 10px; height: 24px; --el-button-icon-span-gap: 2px"
|
|
|
- @click="handleAuditClick(scope.row)"
|
|
|
- >
|
|
|
- {{ t('document.document.button.audit') }}
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- v-if="(scope.row.status === 0 || scope.row.status === 2) && scope.row.planSubmitter === userStore.userId"
|
|
|
- v-hasPermi="['document:document:submit']"
|
|
|
- type="success"
|
|
|
- :icon="Upload"
|
|
|
- style="padding: 0 5px; font-size: 10px; height: 24px; --el-button-icon-span-gap: 2px"
|
|
|
- @click="handleSubmit(scope.row)"
|
|
|
- >
|
|
|
- {{ t('document.document.button.submit') }}
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- v-if="(scope.row.status === 0 || scope.row.status === 2) && scope.row.createBy === userStore.userId"
|
|
|
- v-hasPermi="['document:document:confirmSubmit']"
|
|
|
- type="danger"
|
|
|
- icon="Delete"
|
|
|
- style="padding: 0 5px; font-size: 10px; height: 24px; --el-button-icon-span-gap: 2px"
|
|
|
- @click="handleConfirmSubmit(scope.row)"
|
|
|
- >
|
|
|
- {{ t('document.document.button.confirmSubmit') }}
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- v-hasPermi="['document:document:mark']"
|
|
|
- type="warning"
|
|
|
- icon="Flag"
|
|
|
- style="padding: 0 5px; font-size: 10px; height: 24px; --el-button-icon-span-gap: 2px"
|
|
|
- @click="handleMark(scope.row)"
|
|
|
- >
|
|
|
- {{ t('document.document.button.mark') }}
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- v-if="scope.row.ossId"
|
|
|
- type="info"
|
|
|
- icon="Download"
|
|
|
- style="padding: 0 5px; font-size: 10px; height: 24px; --el-button-icon-span-gap: 2px"
|
|
|
- @click="handleDownload(scope.row)"
|
|
|
- >
|
|
|
- {{ t('document.document.button.download') }}
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- v-hasPermi="['document:document:logAudit']"
|
|
|
- type="primary"
|
|
|
- icon="DocumentCopy"
|
|
|
- style="padding: 0 5px; font-size: 10px; height: 24px; --el-button-icon-span-gap: 2px"
|
|
|
- @click="handleViewAuditLog(scope.row)"
|
|
|
- >
|
|
|
- {{ t('document.document.button.viewAuditLog') }}
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- v-if="scope.row.status === 3"
|
|
|
- v-hasPermi="['document:document:filing']"
|
|
|
- type="success"
|
|
|
- icon="UploadFilled"
|
|
|
- style="padding: 0 5px; font-size: 10px; height: 24px; --el-button-icon-span-gap: 2px"
|
|
|
- @click="handleArchive(scope.row)"
|
|
|
- >
|
|
|
- {{ t('document.document.button.archive') }}
|
|
|
- </el-button>
|
|
|
+ <template v-if="scope.row.folderId === 0">
|
|
|
+ <!-- 临时文件夹只显示删除按钮 -->
|
|
|
+ <el-button
|
|
|
+ v-hasPermi="['document:document:specify']"
|
|
|
+ type="primary"
|
|
|
+ icon="Position"
|
|
|
+ style="padding: 0 5px; font-size: 10px; height: 24px; --el-button-icon-span-gap: 2px"
|
|
|
+ @click="handleSpecify(scope.row)"
|
|
|
+ >
|
|
|
+ {{ t('document.document.button.specify') }}
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ v-hasPermi="['document:document:removeTemp']"
|
|
|
+ type="danger"
|
|
|
+ icon="Delete"
|
|
|
+ style="padding: 0 5px; font-size: 10px; height: 24px; --el-button-icon-span-gap: 2px"
|
|
|
+ @click="handleDeleteTemp(scope.row)"
|
|
|
+ >
|
|
|
+ {{ t('document.document.menu.delete') }}
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ <template v-else>
|
|
|
+ <el-button
|
|
|
+ v-if="scope.row.actualDocument && scope.row.status === 1 && scope.row.createBy === userStore.userId"
|
|
|
+ v-hasPermi="['document:document:audit']"
|
|
|
+ type="primary"
|
|
|
+ :icon="Select"
|
|
|
+ style="padding: 0 5px; font-size: 10px; height: 24px; --el-button-icon-span-gap: 2px"
|
|
|
+ @click="handleAuditClick(scope.row)"
|
|
|
+ >
|
|
|
+ {{ t('document.document.button.audit') }}
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ v-if="(scope.row.status === 0 || scope.row.status === 2) && scope.row.planSubmitter === userStore.userId"
|
|
|
+ v-hasPermi="['document:document:submit']"
|
|
|
+ type="success"
|
|
|
+ :icon="Upload"
|
|
|
+ style="padding: 0 5px; font-size: 10px; height: 24px; --el-button-icon-span-gap: 2px"
|
|
|
+ @click="handleSubmit(scope.row)"
|
|
|
+ >
|
|
|
+ {{ t('document.document.button.submit') }}
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ v-if="(scope.row.status === 0 || scope.row.status === 2) && scope.row.createBy === userStore.userId"
|
|
|
+ v-hasPermi="['document:document:confirmSubmit']"
|
|
|
+ type="danger"
|
|
|
+ icon="Delete"
|
|
|
+ style="padding: 0 5px; font-size: 10px; height: 24px; --el-button-icon-span-gap: 2px"
|
|
|
+ @click="handleConfirmSubmit(scope.row)"
|
|
|
+ >
|
|
|
+ {{ t('document.document.button.confirmSubmit') }}
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ v-hasPermi="['document:document:mark']"
|
|
|
+ type="warning"
|
|
|
+ icon="Flag"
|
|
|
+ style="padding: 0 5px; font-size: 10px; height: 24px; --el-button-icon-span-gap: 2px"
|
|
|
+ @click="handleMark(scope.row)"
|
|
|
+ >
|
|
|
+ {{ t('document.document.button.mark') }}
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ v-if="scope.row.actualDocument"
|
|
|
+ type="info"
|
|
|
+ icon="Download"
|
|
|
+ style="padding: 0 5px; font-size: 10px; height: 24px; --el-button-icon-span-gap: 2px"
|
|
|
+ @click="handleDownload(scope.row)"
|
|
|
+ >
|
|
|
+ {{ t('document.document.button.download') }}
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ v-hasPermi="['document:document:logAudit']"
|
|
|
+ type="primary"
|
|
|
+ icon="DocumentCopy"
|
|
|
+ style="padding: 0 5px; font-size: 10px; height: 24px; --el-button-icon-span-gap: 2px"
|
|
|
+ @click="handleViewAuditLog(scope.row)"
|
|
|
+ >
|
|
|
+ {{ t('document.document.button.viewAuditLog') }}
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ v-if="scope.row.status === 3"
|
|
|
+ v-hasPermi="['document:document:filing']"
|
|
|
+ type="success"
|
|
|
+ icon="UploadFilled"
|
|
|
+ style="padding: 0 5px; font-size: 10px; height: 24px; --el-button-icon-span-gap: 2px"
|
|
|
+ @click="handleArchive(scope.row)"
|
|
|
+ >
|
|
|
+ {{ t('document.document.button.archive') }}
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
@@ -191,10 +214,19 @@
|
|
|
|
|
|
<!-- 递交文档对话框 -->
|
|
|
<el-dialog v-model="submitDialog.visible" :title="submitDialog.title" width="500px" append-to-body>
|
|
|
- <el-alert title="仅支持上传 PDF 格式文件" type="info" :closable="false" style="margin-bottom: 20px" />
|
|
|
<el-form ref="submitFormRef" :model="submitForm" :rules="submitRules" label-width="120px">
|
|
|
- <el-form-item :label="t('document.document.submitForm.file')" prop="ossId">
|
|
|
- <fileUpload v-model="submitForm.ossId" :limit="1" :action="'/common/resource/oss/upload'" accept=".pdf" />
|
|
|
+ <el-form-item :label="t('document.document.submitForm.file')" prop="actualDocument">
|
|
|
+ <fileUpload v-model="submitForm.actualDocument" :limit="1" :file-type="['pdf']" :is-show-tip="false" />
|
|
|
+ <div style="color: #909399; font-size: 12px; margin-top: 5px;">仅支持上传 PDF 格式文件,大小不超过 5MB</div>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item :label="t('document.document.submitForm.effectiveDate')" prop="effectiveDate">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="submitForm.effectiveDate"
|
|
|
+ type="date"
|
|
|
+ value-format="YYYY-MM-DD"
|
|
|
+ :placeholder="t('document.document.submitForm.effectiveDatePlaceholder')"
|
|
|
+ style="width: 100%"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<template #footer>
|
|
|
@@ -231,6 +263,104 @@
|
|
|
<el-button type="primary" :loading="auditDialog.loading" @click="handleAuditConfirm">确定</el-button>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
+
|
|
|
+ <!-- 指定文档对话框 -->
|
|
|
+ <el-dialog v-model="specifyDialog.visible" :title="t('document.document.dialog.specifyDocument')" width="900px" append-to-body>
|
|
|
+ <el-form ref="specifyFormRef" :model="specifyForm" :rules="specifyRules" label-width="120px">
|
|
|
+ <el-form-item :label="t('document.document.specifyForm.type')" prop="type">
|
|
|
+ <el-radio-group v-model="specifyForm.type">
|
|
|
+ <el-radio label="missing">{{ t('document.document.specifyForm.specifyMissing') }}</el-radio>
|
|
|
+ <el-radio label="folder">{{ t('document.document.specifyForm.specifyFolder') }}</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+
|
|
|
+ <!-- 指定递交缺失时显示文档列表 -->
|
|
|
+ <div v-if="specifyForm.type === 'missing'" style="margin-top: 20px;">
|
|
|
+ <!-- 搜索栏 -->
|
|
|
+ <el-form :inline="true" style="margin-bottom: 10px;">
|
|
|
+ <el-form-item>
|
|
|
+ <el-input
|
|
|
+ v-model="specifySearchName"
|
|
|
+ :placeholder="t('document.document.specifyForm.searchPlaceholder')"
|
|
|
+ clearable
|
|
|
+ style="width: 240px"
|
|
|
+ @keyup.enter="handleSpecifySearch"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="primary" icon="Search" @click="handleSpecifySearch">{{ t('document.document.button.search') }}</el-button>
|
|
|
+ <el-button icon="Refresh" @click="handleSpecifyReset">{{ t('document.document.button.reset') }}</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+
|
|
|
+ <!-- 文档列表 -->
|
|
|
+ <el-table v-loading="specifyDocumentLoading" :data="specifyDocumentList" border style="width: 100%">
|
|
|
+ <el-table-column prop="name" :label="t('document.document.specifyForm.documentName')" min-width="150" show-overflow-tooltip />
|
|
|
+ <el-table-column prop="folder" :label="t('document.document.specifyForm.folder')" width="120" show-overflow-tooltip />
|
|
|
+ <el-table-column prop="status" :label="t('document.document.specifyForm.status')" width="100" align="center">
|
|
|
+ <template #default="scope">
|
|
|
+ <DocumentStatusTag :status="scope.row.status" />
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="deadline" :label="t('document.document.specifyForm.deadline')" width="160" align="center">
|
|
|
+ <template #default="scope">
|
|
|
+ <span v-if="scope.row.deadline">{{ parseTime(scope.row.deadline) }}</span>
|
|
|
+ <span v-else>-</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="planSubmitter" :label="t('document.document.specifyForm.planSubmitter')" width="120" align="center" />
|
|
|
+ <el-table-column prop="createBy" :label="t('document.document.specifyForm.createBy')" width="120" align="center" />
|
|
|
+ <el-table-column prop="createTime" :label="t('document.document.specifyForm.createTime')" width="160" align="center">
|
|
|
+ <template #default="scope">
|
|
|
+ <span v-if="scope.row.createTime">{{ parseTime(scope.row.createTime) }}</span>
|
|
|
+ <span v-else>-</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column :label="t('document.document.specifyForm.action')" width="100" align="center" fixed="right">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-button
|
|
|
+ v-if="selectedDocumentId !== scope.row.id"
|
|
|
+ type="primary"
|
|
|
+ size="small"
|
|
|
+ @click="handleSelectDocument(scope.row.id)"
|
|
|
+ >
|
|
|
+ {{ t('document.document.specifyForm.select') }}
|
|
|
+ </el-button>
|
|
|
+ <el-tag v-else type="success">{{ t('document.document.specifyForm.selected') }}</el-tag>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ <!-- 分页 -->
|
|
|
+ <pagination
|
|
|
+ v-show="specifyDocumentTotal > 0"
|
|
|
+ v-model:page="specifyQueryParams.pageNum"
|
|
|
+ v-model:limit="specifyQueryParams.pageSize"
|
|
|
+ :total="specifyDocumentTotal"
|
|
|
+ @pagination="getSpecifyDocumentList"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- 指定文件夹时显示文件夹树 -->
|
|
|
+ <div v-else-if="specifyForm.type === 'folder'" style="margin-top: 20px;">
|
|
|
+ <div style="margin-bottom: 10px; color: #606266; font-size: 14px;">
|
|
|
+ 请选择要指定的文件夹:
|
|
|
+ </div>
|
|
|
+ <FolderSelector
|
|
|
+ ref="folderSelectorRef"
|
|
|
+ :tree-data="treeData"
|
|
|
+ @change="handleFolderChange"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <template #footer>
|
|
|
+ <div class="dialog-footer">
|
|
|
+ <el-button :loading="specifyButtonLoading" type="primary" @click="submitSpecifyForm">{{ t('document.document.button.submit') }}</el-button>
|
|
|
+ <el-button @click="cancelSpecify">{{ t('document.document.button.cancel') }}</el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
<el-empty v-else :description="t('document.document.empty.description')"> </el-empty>
|
|
|
</template>
|
|
|
@@ -238,8 +368,8 @@
|
|
|
<script setup lang="ts">
|
|
|
import { ref, reactive, nextTick, getCurrentInstance, computed, watch, toRefs } from 'vue';
|
|
|
import { useI18n } from 'vue-i18n';
|
|
|
-import { listDocument, markDocument, submitDocument, confirmSubmit, filingDocument, downloadDocumentFile } from '@/api/document/document';
|
|
|
-import { DocumentQuery, DocumentVO, DocumentMarkForm, DocumentSubmitForm } from '@/api/document/document/types';
|
|
|
+import { listDocument, markDocument, submitDocument, confirmSubmit, filingDocument, downloadDocumentFile, removeTempDocument, listDocumentOnSpecify, specifyDocument } from '@/api/document/document';
|
|
|
+import { DocumentQuery, DocumentVO, DocumentMarkForm, DocumentSubmitForm, DocumentSpecifyVO, DocumentSpecifyForm } from '@/api/document/document/types';
|
|
|
import { FolderListVO } from '@/api/document/folder/types';
|
|
|
import { Select, Upload } from '@element-plus/icons-vue';
|
|
|
import { ElMessage, ElMessageBox } from 'element-plus';
|
|
|
@@ -252,6 +382,7 @@ import fileUpload from '@/components/FileUpload/index.vue';
|
|
|
import AuditLogDialog from '@/components/AuditLogDialog/index.vue';
|
|
|
import { listDocumentAuditLog, auditDocument } from '@/api/document/document';
|
|
|
import DocumentStatusTag from '@/components/DocumentStatusTag/index.vue';
|
|
|
+import FolderSelector from '@/components/FolderSelector/index.vue';
|
|
|
|
|
|
interface Props {
|
|
|
selectedFolder: FolderListVO | null;
|
|
|
@@ -261,6 +392,10 @@ interface Props {
|
|
|
|
|
|
const props = defineProps<Props>();
|
|
|
|
|
|
+const emit = defineEmits<{
|
|
|
+ refreshTree: [];
|
|
|
+}>();
|
|
|
+
|
|
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
|
const { t } = useI18n();
|
|
|
const userStore = useUserStore();
|
|
|
@@ -314,16 +449,18 @@ const submitButtonLoading = ref(false);
|
|
|
|
|
|
// 递交表单数据
|
|
|
interface SubmitForm {
|
|
|
- ossId: string;
|
|
|
+ actualDocument: string;
|
|
|
+ effectiveDate?: string;
|
|
|
}
|
|
|
|
|
|
const submitForm = ref<SubmitForm>({
|
|
|
- ossId: ''
|
|
|
+ actualDocument: '',
|
|
|
+ effectiveDate: undefined
|
|
|
});
|
|
|
|
|
|
// 递交表单验证规则
|
|
|
const submitRules = reactive({
|
|
|
- ossId: [
|
|
|
+ actualDocument: [
|
|
|
{
|
|
|
required: true,
|
|
|
message: t('document.document.submitRule.fileRequired'),
|
|
|
@@ -376,6 +513,54 @@ const auditRules = reactive({
|
|
|
]
|
|
|
});
|
|
|
|
|
|
+// 指定文档对话框
|
|
|
+const specifyDialog = reactive({
|
|
|
+ visible: false,
|
|
|
+ title: ''
|
|
|
+});
|
|
|
+
|
|
|
+// 指定表单ref
|
|
|
+const specifyFormRef = ref<FormInstance>();
|
|
|
+const specifyButtonLoading = ref(false);
|
|
|
+
|
|
|
+// 指定表单数据
|
|
|
+const specifyForm = ref({
|
|
|
+ type: 'missing',
|
|
|
+ folderId: undefined as number | undefined
|
|
|
+});
|
|
|
+
|
|
|
+// 指定表单验证规则
|
|
|
+const specifyRules = reactive({
|
|
|
+ type: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: t('document.document.specifyRule.typeRequired'),
|
|
|
+ trigger: 'change'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+});
|
|
|
+
|
|
|
+// 指定文档列表数据
|
|
|
+const specifyDocumentList = ref<DocumentSpecifyVO[]>([]);
|
|
|
+const specifyDocumentLoading = ref(false);
|
|
|
+const specifyDocumentTotal = ref(0);
|
|
|
+const specifySearchName = ref('');
|
|
|
+const specifyQueryParams = reactive({
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ projectId: props.projectId,
|
|
|
+ name: ''
|
|
|
+});
|
|
|
+
|
|
|
+// 选中的文档ID
|
|
|
+const selectedDocumentId = ref<string | number | null>(null);
|
|
|
+
|
|
|
+// 文件夹选择器引用
|
|
|
+const folderSelectorRef = ref();
|
|
|
+
|
|
|
+// 选中的文件夹ID
|
|
|
+const selectedFolderId = ref<number | string | undefined>(undefined);
|
|
|
+
|
|
|
/**
|
|
|
* 根据 specificationType 获取对应的字典
|
|
|
* @param specificationType 规格类型 (0: 中心文件, 1: 项目文件)
|
|
|
@@ -485,19 +670,20 @@ const handleAuditConfirm = async () => {
|
|
|
|
|
|
// 下载文档
|
|
|
const handleDownload = async (row: DocumentVO) => {
|
|
|
- if (!row.ossId) {
|
|
|
+ if (!row.actualDocument) {
|
|
|
ElMessage.warning(t('document.document.message.noFileToDownload'));
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- await downloadDocumentFile(row.ossId, row.fileName || row.name);
|
|
|
+ await downloadDocumentFile(row.actualDocument, row.actualDocumentName || row.name);
|
|
|
};
|
|
|
|
|
|
// 递交文档
|
|
|
const handleSubmit = (row: DocumentVO) => {
|
|
|
currentDocument.value = row;
|
|
|
submitForm.value = {
|
|
|
- ossId: ''
|
|
|
+ actualDocument: '',
|
|
|
+ effectiveDate: undefined
|
|
|
};
|
|
|
submitDialog.visible = true;
|
|
|
submitDialog.title = t('document.document.dialog.submitDocument');
|
|
|
@@ -510,7 +696,8 @@ const handleSubmit = (row: DocumentVO) => {
|
|
|
const cancelSubmit = () => {
|
|
|
submitDialog.visible = false;
|
|
|
submitForm.value = {
|
|
|
- ossId: ''
|
|
|
+ actualDocument: '',
|
|
|
+ effectiveDate: undefined
|
|
|
};
|
|
|
currentDocument.value = null;
|
|
|
};
|
|
|
@@ -523,7 +710,8 @@ const submitSubmitForm = () => {
|
|
|
try {
|
|
|
const submitData: DocumentSubmitForm = {
|
|
|
documentId: currentDocument.value.id,
|
|
|
- ossId: submitForm.value.ossId
|
|
|
+ ossId: submitForm.value.actualDocument,
|
|
|
+ effectiveDate: submitForm.value.effectiveDate
|
|
|
};
|
|
|
await submitDocument(submitData);
|
|
|
proxy?.$modal.msgSuccess(t('document.document.message.submitSuccess'));
|
|
|
@@ -573,6 +761,159 @@ const handleArchive = async (row: DocumentVO) => {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+// 删除临时文件夹中的文档
|
|
|
+const handleDeleteTemp = async (row: DocumentVO) => {
|
|
|
+ try {
|
|
|
+ await proxy?.$modal.confirm('确认要删除该临时文档吗?');
|
|
|
+ await removeTempDocument(row.id);
|
|
|
+ ElMessage.success('删除成功');
|
|
|
+ await getDocumentList();
|
|
|
+ // 触发父组件刷新树(更新临时文件夹气泡数量)
|
|
|
+ emit('refreshTree');
|
|
|
+ } catch (error) {
|
|
|
+ if (error !== 'cancel') {
|
|
|
+ console.error('删除临时文档失败:', error);
|
|
|
+ ElMessage.error('删除临时文档失败');
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+// 指定文档
|
|
|
+const handleSpecify = (row: DocumentVO) => {
|
|
|
+ currentDocument.value = row;
|
|
|
+ specifyForm.value = {
|
|
|
+ type: 'missing',
|
|
|
+ folderId: undefined
|
|
|
+ };
|
|
|
+ selectedDocumentId.value = null;
|
|
|
+ selectedFolderId.value = undefined;
|
|
|
+ specifySearchName.value = '';
|
|
|
+ specifyQueryParams.pageNum = 1;
|
|
|
+ specifyQueryParams.name = '';
|
|
|
+ specifyQueryParams.projectId = props.projectId;
|
|
|
+ specifyDialog.visible = true;
|
|
|
+ nextTick(() => {
|
|
|
+ specifyFormRef.value?.clearValidate();
|
|
|
+ // 如果选择的是指定递交缺失,则加载列表
|
|
|
+ if (specifyForm.value.type === 'missing') {
|
|
|
+ getSpecifyDocumentList();
|
|
|
+ }
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
+// 获取可指定的文档列表
|
|
|
+const getSpecifyDocumentList = async () => {
|
|
|
+ if (!props.projectId) return;
|
|
|
+
|
|
|
+ specifyDocumentLoading.value = true;
|
|
|
+ try {
|
|
|
+ const res = await listDocumentOnSpecify(specifyQueryParams);
|
|
|
+ specifyDocumentList.value = res.rows || [];
|
|
|
+ specifyDocumentTotal.value = res.total || 0;
|
|
|
+ } catch (error) {
|
|
|
+ console.error('获取可指定文档列表失败:', error);
|
|
|
+ ElMessage.error('获取可指定文档列表失败');
|
|
|
+ } finally {
|
|
|
+ specifyDocumentLoading.value = false;
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+// 搜索指定文档
|
|
|
+const handleSpecifySearch = () => {
|
|
|
+ specifyQueryParams.name = specifySearchName.value;
|
|
|
+ specifyQueryParams.pageNum = 1;
|
|
|
+ getSpecifyDocumentList();
|
|
|
+};
|
|
|
+
|
|
|
+// 重置搜索
|
|
|
+const handleSpecifyReset = () => {
|
|
|
+ specifySearchName.value = '';
|
|
|
+ specifyQueryParams.name = '';
|
|
|
+ specifyQueryParams.pageNum = 1;
|
|
|
+ getSpecifyDocumentList();
|
|
|
+};
|
|
|
+
|
|
|
+// 选择文档
|
|
|
+const handleSelectDocument = (id: string | number) => {
|
|
|
+ selectedDocumentId.value = id;
|
|
|
+};
|
|
|
+
|
|
|
+// 监听指定类型变化
|
|
|
+watch(() => specifyForm.value.type, (newType) => {
|
|
|
+ selectedDocumentId.value = null;
|
|
|
+ selectedFolderId.value = undefined;
|
|
|
+ if (newType === 'missing' && specifyDialog.visible) {
|
|
|
+ getSpecifyDocumentList();
|
|
|
+ } else if (newType === 'folder' && folderSelectorRef.value) {
|
|
|
+ folderSelectorRef.value.clearSelection();
|
|
|
+ }
|
|
|
+});
|
|
|
+
|
|
|
+// 取消指定
|
|
|
+const cancelSpecify = () => {
|
|
|
+ specifyDialog.visible = false;
|
|
|
+ specifyForm.value = {
|
|
|
+ type: 'missing',
|
|
|
+ folderId: undefined
|
|
|
+ };
|
|
|
+ selectedDocumentId.value = null;
|
|
|
+ selectedFolderId.value = undefined;
|
|
|
+ specifyDocumentList.value = [];
|
|
|
+ currentDocument.value = null;
|
|
|
+};
|
|
|
+
|
|
|
+// 文件夹选择变化处理
|
|
|
+const handleFolderChange = (folderId: number | string | undefined) => {
|
|
|
+ selectedFolderId.value = folderId;
|
|
|
+};
|
|
|
+
|
|
|
+// 提交指定表单
|
|
|
+const submitSpecifyForm = () => {
|
|
|
+ specifyFormRef.value?.validate(async (valid: boolean) => {
|
|
|
+ if (valid && currentDocument.value) {
|
|
|
+ // 如果是指定递交缺失,需要选择一个文档
|
|
|
+ if (specifyForm.value.type === 'missing' && !selectedDocumentId.value) {
|
|
|
+ ElMessage.warning('请选择一个文档');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 如果是指定文件夹,需要选择一个文件夹
|
|
|
+ if (specifyForm.value.type === 'folder' && !selectedFolderId.value) {
|
|
|
+ ElMessage.warning('请选择一个文件夹');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ specifyButtonLoading.value = true;
|
|
|
+ try {
|
|
|
+ // 构建请求数据
|
|
|
+ const specifyData: DocumentSpecifyForm = {
|
|
|
+ documentId: currentDocument.value.id
|
|
|
+ };
|
|
|
+
|
|
|
+ if (specifyForm.value.type === 'missing') {
|
|
|
+ // 指定递交缺失
|
|
|
+ specifyData.missingDocumentId = selectedDocumentId.value as number | string;
|
|
|
+ } else if (specifyForm.value.type === 'folder') {
|
|
|
+ // 指定文件夹
|
|
|
+ specifyData.folderId = selectedFolderId.value;
|
|
|
+ }
|
|
|
+
|
|
|
+ await specifyDocument(specifyData);
|
|
|
+ ElMessage.success('指定成功');
|
|
|
+ specifyDialog.visible = false;
|
|
|
+ await getDocumentList();
|
|
|
+ // 触发父组件刷新树(更新临时文件夹气泡数量)
|
|
|
+ emit('refreshTree');
|
|
|
+ } catch (error) {
|
|
|
+ console.error('指定失败:', error);
|
|
|
+ ElMessage.error('指定失败');
|
|
|
+ } finally {
|
|
|
+ specifyButtonLoading.value = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
// 标识文档
|
|
|
const handleMark = (row: DocumentVO) => {
|
|
|
currentDocument.value = row;
|