|
|
@@ -45,29 +45,37 @@
|
|
|
width="120"
|
|
|
align="center"
|
|
|
/>
|
|
|
- <el-table-column label="操作" width="150" align="center" fixed="right">
|
|
|
+ <el-table-column label="操作" width="200" align="center" fixed="right">
|
|
|
<template slot-scope="{ row }">
|
|
|
<el-button
|
|
|
- v-if="row.canGenerate === '1'"
|
|
|
+ v-if="row.canGenerate === '1' && row.documentType === 1"
|
|
|
type="text"
|
|
|
size="small"
|
|
|
@click="handleGenerate(row)"
|
|
|
>
|
|
|
- 生成
|
|
|
+ 编辑生成
|
|
|
</el-button>
|
|
|
<el-button
|
|
|
- v-if="row.canEdit === '1'"
|
|
|
+ v-if="row.documentType === 0"
|
|
|
type="text"
|
|
|
size="small"
|
|
|
- @click="handleEdit(row)"
|
|
|
+ @click="handleViewFiles(row)"
|
|
|
>
|
|
|
- 编辑
|
|
|
+ 查看
|
|
|
</el-button>
|
|
|
<el-button
|
|
|
- v-if="row.documentType === 0"
|
|
|
+ v-if="row.documentType === 2"
|
|
|
type="text"
|
|
|
size="small"
|
|
|
- @click="handleViewFiles(row)"
|
|
|
+ @click="handleViewCatalog(row)"
|
|
|
+ >
|
|
|
+ 编辑生成
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ v-if="[1, 3].includes(row.documentType) && row.attachmentUrl"
|
|
|
+ type="text"
|
|
|
+ size="small"
|
|
|
+ @click="handlePreviewFile(row)"
|
|
|
>
|
|
|
查看
|
|
|
</el-button>
|
|
|
@@ -76,12 +84,13 @@
|
|
|
</el-table>
|
|
|
|
|
|
<!-- 文件列表弹窗(只读模式) -->
|
|
|
- <el-dialog
|
|
|
+ <CostAuditDialog
|
|
|
:visible.sync="fileListDialogVisible"
|
|
|
title="文件列表"
|
|
|
+ :show-confirm-btn="false"
|
|
|
+ :show-footer="false"
|
|
|
width="80%"
|
|
|
- :close-on-click-modal="false"
|
|
|
- @close="fileListDialogVisible = false"
|
|
|
+ @cancel="fileListDialogVisible = false"
|
|
|
>
|
|
|
<!-- 资料信息展示 -->
|
|
|
<div
|
|
|
@@ -116,84 +125,161 @@
|
|
|
</el-row>
|
|
|
</div>
|
|
|
|
|
|
- <!-- 文件列表(只读模式,无操作按钮和拖拽功能) -->
|
|
|
- <div
|
|
|
- v-for="(row, index) in fileListData"
|
|
|
- :key="row.id"
|
|
|
- class="file-list-item"
|
|
|
- style="
|
|
|
- padding: 15px;
|
|
|
- border: 1px solid #dcdfe6;
|
|
|
- margin-bottom: 10px;
|
|
|
- border-radius: 4px;
|
|
|
- background-color: #fff;
|
|
|
- "
|
|
|
+ <!-- 文件列表(只读模式,使用表格展示) -->
|
|
|
+ <el-table
|
|
|
+ v-loading="fileListLoading"
|
|
|
+ :data="fileListData"
|
|
|
+ border
|
|
|
+ style="width: 100%"
|
|
|
>
|
|
|
- <el-row :gutter="20">
|
|
|
- <el-col :span="2">
|
|
|
- <div style="text-align: center">
|
|
|
- <div style="font-size: 12px; margin-top: 5px">
|
|
|
- {{ index + 1 }}
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </el-col>
|
|
|
- <el-col :span="6">
|
|
|
- <div style="font-size: 14px; font-weight: 500">
|
|
|
- {{ row.documentName }}
|
|
|
- </div>
|
|
|
- <div style="font-size: 12px; color: #909399; margin-top: 5px">
|
|
|
- 文书名称
|
|
|
- </div>
|
|
|
- </el-col>
|
|
|
- <el-col :span="4">
|
|
|
- <div style="font-size: 14px">{{ row.documentNumber }}</div>
|
|
|
- <div style="font-size: 12px; color: #909399; margin-top: 5px">
|
|
|
- 文号
|
|
|
- </div>
|
|
|
- </el-col>
|
|
|
- <el-col :span="5">
|
|
|
- <div style="font-size: 14px">{{ row.auditedUnitName }}</div>
|
|
|
- <div style="font-size: 12px; color: #909399; margin-top: 5px">
|
|
|
- 被监审单位
|
|
|
- </div>
|
|
|
- </el-col>
|
|
|
- <el-col :span="3">
|
|
|
- <div style="font-size: 14px">{{ row.fileSource }}</div>
|
|
|
- <div style="font-size: 12px; color: #909399; margin-top: 5px">
|
|
|
- 文件来源
|
|
|
- </div>
|
|
|
- </el-col>
|
|
|
- <el-col :span="2">
|
|
|
- <div style="font-size: 14px">{{ row.pageCount || 0 }}</div>
|
|
|
- <div style="font-size: 12px; color: #909399; margin-top: 5px">
|
|
|
- 页数
|
|
|
- </div>
|
|
|
- </el-col>
|
|
|
- <el-col :span="2" style="text-align: right">
|
|
|
- <!-- 只读模式,无操作按钮 -->
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
+ <el-table-column type="index" label="序号" width="60" align="center" />
|
|
|
+ <el-table-column
|
|
|
+ prop="documentName"
|
|
|
+ label="文书名称"
|
|
|
+ min-width="200"
|
|
|
+ align="left"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ prop="documentNumber"
|
|
|
+ label="文号"
|
|
|
+ width="200"
|
|
|
+ align="center"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ prop="auditedUnitName"
|
|
|
+ label="被监审单位"
|
|
|
+ min-width="150"
|
|
|
+ align="left"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ prop="fileSource"
|
|
|
+ label="文件来源"
|
|
|
+ width="150"
|
|
|
+ align="center"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ prop="pageCount"
|
|
|
+ label="页数"
|
|
|
+ width="100"
|
|
|
+ align="center"
|
|
|
+ >
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ {{ row.pageCount || 0 }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ <div slot="footer" style="text-align: right; margin-top: 20px">
|
|
|
+ <el-button @click="fileListDialogVisible = false">关闭</el-button>
|
|
|
</div>
|
|
|
- <div
|
|
|
- v-if="fileListData.length === 0"
|
|
|
- style="text-align: center; padding: 40px 0; color: #909399"
|
|
|
+ </CostAuditDialog>
|
|
|
+
|
|
|
+ <!-- 卷内目录弹窗 -->
|
|
|
+ <CostAuditDialog
|
|
|
+ :visible.sync="catalogDialogVisible"
|
|
|
+ title="卷内目录"
|
|
|
+ :show-confirm-btn="false"
|
|
|
+ :show-footer="true"
|
|
|
+ width="80%"
|
|
|
+ @cancel="handleCancelCatalog"
|
|
|
+ >
|
|
|
+ <!-- 目录表格(只读) -->
|
|
|
+ <el-table
|
|
|
+ v-loading="catalogLoading"
|
|
|
+ :data="catalogData"
|
|
|
+ border
|
|
|
+ style="width: 100%"
|
|
|
>
|
|
|
- 暂无数据
|
|
|
+ <el-table-column type="index" label="序号" width="100" align="center" />
|
|
|
+ <el-table-column
|
|
|
+ prop="materialName"
|
|
|
+ label="资料名称"
|
|
|
+ min-width="300"
|
|
|
+ align="left"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ prop="pageRange"
|
|
|
+ label="开始页码-结束页码"
|
|
|
+ width="200"
|
|
|
+ align="center"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ prop="remark"
|
|
|
+ label="备注"
|
|
|
+ min-width="200"
|
|
|
+ align="left"
|
|
|
+ />
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ <div slot="footer" style="text-align: right">
|
|
|
+ <el-button @click="handleCancelCatalog">关闭</el-button>
|
|
|
+ <el-button type="primary" @click="handleGenerateCatalog">
|
|
|
+ 生成
|
|
|
+ </el-button>
|
|
|
</div>
|
|
|
+ </CostAuditDialog>
|
|
|
|
|
|
+ <!-- 生成文书弹窗 -->
|
|
|
+ <CostAuditDialog
|
|
|
+ :visible.sync="generateDialogVisible"
|
|
|
+ :title="generateDialogTitle"
|
|
|
+ :show-confirm-btn="false"
|
|
|
+ :show-footer="true"
|
|
|
+ width="50%"
|
|
|
+ @cancel="handleCancelGenerate"
|
|
|
+ >
|
|
|
+ <el-form
|
|
|
+ ref="generateForm"
|
|
|
+ :model="generateForm"
|
|
|
+ :rules="generateRules"
|
|
|
+ label-width="120px"
|
|
|
+ >
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="报关期限" prop="retentionPeriod">
|
|
|
+ <el-input-number
|
|
|
+ v-model="generateForm.retentionPeriod"
|
|
|
+ :min="1"
|
|
|
+ :controls="false"
|
|
|
+ placeholder="请输入保管期限"
|
|
|
+ style="width: 100%"
|
|
|
+ ></el-input-number>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="卷宗号" prop="archiveNo">
|
|
|
+ <el-input
|
|
|
+ v-model="generateForm.archiveNo"
|
|
|
+ placeholder="请输入卷宗号"
|
|
|
+ clearable
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
<div slot="footer" style="text-align: right">
|
|
|
- <el-button @click="fileListDialogVisible = false">关闭</el-button>
|
|
|
+ <el-button @click="handleCancelGenerate">取消</el-button>
|
|
|
+ <el-button type="primary" @click="handleConfirmGenerate">
|
|
|
+ 确定
|
|
|
+ </el-button>
|
|
|
</div>
|
|
|
- </el-dialog>
|
|
|
+ </CostAuditDialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import { getArchiveProofreadList } from '@/api/audit/dataProofread'
|
|
|
+ import {
|
|
|
+ getArchiveProofreadList,
|
|
|
+ saveArchiveDocument,
|
|
|
+ } from '@/api/audit/dataProofread'
|
|
|
import { getDetailListByMasterList } from '@/api/audit/dataInduction'
|
|
|
+ import CostAuditDialog from '@/components/costAudit/CostAuditDialog.vue'
|
|
|
|
|
|
export default {
|
|
|
name: 'ArchiveProofread',
|
|
|
+ components: {
|
|
|
+ CostAuditDialog,
|
|
|
+ },
|
|
|
props: {
|
|
|
taskId: {
|
|
|
type: String,
|
|
|
@@ -209,6 +295,25 @@
|
|
|
fileListData: [],
|
|
|
fileListLoading: false,
|
|
|
currentViewingMaterial: null,
|
|
|
+ // 卷内目录弹窗相关
|
|
|
+ catalogDialogVisible: false,
|
|
|
+ catalogData: [],
|
|
|
+ catalogLoading: false,
|
|
|
+ currentCatalogRow: null,
|
|
|
+ // 生成文书弹窗相关
|
|
|
+ generateDialogVisible: false,
|
|
|
+ generateDialogTitle: '生成文书',
|
|
|
+ generateForm: {
|
|
|
+ id: '',
|
|
|
+ taskId: '',
|
|
|
+ documentType: null,
|
|
|
+ retentionPeriod: null,
|
|
|
+ archiveNo: '',
|
|
|
+ },
|
|
|
+ generateRules: {
|
|
|
+ // 根据需要添加验证规则
|
|
|
+ },
|
|
|
+ currentGenerateRow: null,
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
|
@@ -247,7 +352,26 @@
|
|
|
},
|
|
|
handleGenerate(row) {
|
|
|
// 处理生成操作
|
|
|
- this.$emit('generate', row)
|
|
|
+ this.currentGenerateRow = row
|
|
|
+
|
|
|
+ // 根据 documentType 设置弹窗标题
|
|
|
+ const titleMap = {
|
|
|
+ 1: '生成案卷封面',
|
|
|
+ 2: '生成卷内目录',
|
|
|
+ 3: '生成案卷封底',
|
|
|
+ }
|
|
|
+ this.generateDialogTitle = titleMap[row.documentType] || '生成文书'
|
|
|
+
|
|
|
+ // 重置表单数据
|
|
|
+ this.generateForm = {
|
|
|
+ id: row.id || '',
|
|
|
+ taskId: this.taskId,
|
|
|
+ documentType: row.documentType,
|
|
|
+ retentionPeriod: row.retentionPeriod || null,
|
|
|
+ archiveNo: row.archiveNo || '',
|
|
|
+ }
|
|
|
+
|
|
|
+ this.generateDialogVisible = true
|
|
|
},
|
|
|
handleEdit(row) {
|
|
|
// 处理编辑操作
|
|
|
@@ -257,23 +381,127 @@
|
|
|
// 处理查看文件列表操作
|
|
|
this.currentViewingMaterial = row
|
|
|
this.fileListDialogVisible = true
|
|
|
- this.loadFileList(row.id)
|
|
|
+ // 兼容不同的ID字段名称
|
|
|
+ const masterId = row.relatedId
|
|
|
+ if (!masterId) {
|
|
|
+ this.$message.warning('无法获取资料ID')
|
|
|
+ console.warn('资料数据缺少ID字段:', row)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.loadFileList(masterId)
|
|
|
+ },
|
|
|
+ handlePreviewFile(row) {
|
|
|
+ // 预览文件(documentType = 1 或 3)
|
|
|
+ if (!row.attachmentUrl) {
|
|
|
+ this.$message.warning('文件地址为空')
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ // 在新窗口打开文件预览
|
|
|
+ window.open(row.attachmentUrl, '_blank')
|
|
|
+ },
|
|
|
+ handleViewCatalog(row) {
|
|
|
+ // 查看卷内目录(documentType = 2)
|
|
|
+ this.currentCatalogRow = row
|
|
|
+ this.catalogDialogVisible = true
|
|
|
+ this.loadCatalogData()
|
|
|
+ },
|
|
|
+ async loadCatalogData() {
|
|
|
+ try {
|
|
|
+ this.catalogLoading = true
|
|
|
+ console.log('开始加载卷内目录数据')
|
|
|
+ const response = await getArchiveProofreadList({
|
|
|
+ taskId: this.taskId,
|
|
|
+ })
|
|
|
+ console.log('卷内目录响应:', response)
|
|
|
+
|
|
|
+ if (response && response.value) {
|
|
|
+ this.catalogData = Array.isArray(response.value)
|
|
|
+ ? response.value
|
|
|
+ : response.value.list || []
|
|
|
+ console.log('卷内目录数据:', this.catalogData)
|
|
|
+ } else {
|
|
|
+ this.catalogData = []
|
|
|
+ console.warn('卷内目录响应数据为空')
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ console.error('加载卷内目录失败:', error)
|
|
|
+ this.catalogData = []
|
|
|
+ this.$message.error(
|
|
|
+ '数据加载失败: ' + (error.message || '请检查网络连接')
|
|
|
+ )
|
|
|
+ } finally {
|
|
|
+ this.catalogLoading = false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ handleCancelCatalog() {
|
|
|
+ // 关闭卷内目录弹窗
|
|
|
+ this.catalogDialogVisible = false
|
|
|
+ this.currentCatalogRow = null
|
|
|
+ this.catalogData = []
|
|
|
+ },
|
|
|
+ async handleGenerateCatalog() {
|
|
|
+ // 生成卷内目录,调用 documentType=2 的保存接口
|
|
|
+ try {
|
|
|
+ this.catalogLoading = true
|
|
|
+
|
|
|
+ const submitData = {
|
|
|
+ taskId: this.taskId,
|
|
|
+ documentType: 2, // 卷内目录
|
|
|
+ }
|
|
|
+
|
|
|
+ // 如果当前行有ID,说明是编辑
|
|
|
+ if (this.currentCatalogRow && this.currentCatalogRow.id) {
|
|
|
+ submitData.id = this.currentCatalogRow.id
|
|
|
+ }
|
|
|
+
|
|
|
+ console.log('生成卷内目录数据:', submitData)
|
|
|
+
|
|
|
+ // 调用保存文书的API接口
|
|
|
+ const response = await saveArchiveDocument(submitData)
|
|
|
+ if (response && response.success !== false) {
|
|
|
+ this.$message.success(response.message || '生成成功')
|
|
|
+ this.catalogDialogVisible = false
|
|
|
+ this.loadProofreadData() // 重新加载列表
|
|
|
+ } else {
|
|
|
+ this.$message.error(response.message || '生成失败')
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ console.error('生成卷内目录失败:', error)
|
|
|
+ this.$message.error(
|
|
|
+ '生成失败:' + (error.message || '请检查网络连接')
|
|
|
+ )
|
|
|
+ } finally {
|
|
|
+ this.catalogLoading = false
|
|
|
+ }
|
|
|
},
|
|
|
async loadFileList(masterId) {
|
|
|
+ if (!masterId) {
|
|
|
+ console.error('加载文件列表失败: masterId 为空')
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
try {
|
|
|
this.fileListLoading = true
|
|
|
+ console.log('开始加载文件列表, masterId:', masterId)
|
|
|
const response = await getDetailListByMasterList(masterId)
|
|
|
+ console.log('文件列表响应:', response)
|
|
|
+
|
|
|
if (response && response.value) {
|
|
|
this.fileListData = Array.isArray(response.value)
|
|
|
? response.value
|
|
|
: response.value.list || []
|
|
|
+ console.log('文件列表数据:', this.fileListData)
|
|
|
} else {
|
|
|
this.fileListData = []
|
|
|
+ console.warn('文件列表响应数据为空')
|
|
|
}
|
|
|
} catch (error) {
|
|
|
console.error('加载文件列表失败:', error)
|
|
|
this.fileListData = []
|
|
|
- this.$message.error('文件列表加载失败')
|
|
|
+ this.$message.error(
|
|
|
+ '文件列表加载失败: ' + (error.message || '请检查网络连接')
|
|
|
+ )
|
|
|
} finally {
|
|
|
this.fileListLoading = false
|
|
|
}
|
|
|
@@ -286,21 +514,56 @@
|
|
|
// 处理下一步操作
|
|
|
this.$emit('next-step')
|
|
|
},
|
|
|
+ handleCancelGenerate() {
|
|
|
+ // 取消生成
|
|
|
+ this.generateDialogVisible = false
|
|
|
+ this.currentGenerateRow = null
|
|
|
+ this.$nextTick(() => {
|
|
|
+ if (this.$refs.generateForm) {
|
|
|
+ this.$refs.generateForm.resetFields()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ async handleConfirmGenerate() {
|
|
|
+ // 确认生成
|
|
|
+ this.$refs.generateForm.validate(async (valid) => {
|
|
|
+ if (!valid) return false
|
|
|
+
|
|
|
+ try {
|
|
|
+ // 准备提交数据
|
|
|
+ const submitData = {
|
|
|
+ taskId: this.generateForm.taskId,
|
|
|
+ documentType: this.generateForm.documentType,
|
|
|
+ retentionPeriod: this.generateForm.retentionPeriod,
|
|
|
+ archiveNo: this.generateForm.archiveNo,
|
|
|
+ }
|
|
|
+
|
|
|
+ // 如果有ID,说明是编辑
|
|
|
+ if (this.generateForm.id) {
|
|
|
+ submitData.id = this.generateForm.id
|
|
|
+ }
|
|
|
+
|
|
|
+ console.log('生成文书数据:', submitData)
|
|
|
+
|
|
|
+ // 调用生成文书的API接口
|
|
|
+ const response = await saveArchiveDocument(submitData)
|
|
|
+ if (response && response.success !== false) {
|
|
|
+ this.$message.success(response.message || '生成成功')
|
|
|
+ this.generateDialogVisible = false
|
|
|
+ this.loadProofreadData() // 重新加载列表
|
|
|
+ } else {
|
|
|
+ this.$message.error(response.message || '生成失败')
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ console.error('生成文书失败:', error)
|
|
|
+ this.$message.error(
|
|
|
+ '生成失败:' + (error.message || '请检查网络连接')
|
|
|
+ )
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
},
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
-<style scoped lang="scss">
|
|
|
- .file-list-item {
|
|
|
- pointer-events: none; // 只读模式,禁用所有交互
|
|
|
- }
|
|
|
-
|
|
|
- .file-list-item ::v-deep .el-input__inner,
|
|
|
- .file-list-item ::v-deep .el-textarea__inner,
|
|
|
- .file-list-item ::v-deep .el-select .el-input__inner {
|
|
|
- background-color: #f5f7fa;
|
|
|
- border-color: #e4e7ed;
|
|
|
- color: #909399;
|
|
|
- cursor: not-allowed;
|
|
|
- }
|
|
|
-</style>
|
|
|
+<style scoped lang="scss"></style>
|