|
@@ -566,98 +566,69 @@
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<!-- 文件列表 -->
|
|
<!-- 文件列表 -->
|
|
|
- <draggable
|
|
|
|
|
- v-model="fileListData"
|
|
|
|
|
- :options="{ animation: 200, handle: '.drag-handle' }"
|
|
|
|
|
- tag="div"
|
|
|
|
|
- class="file-list-draggable"
|
|
|
|
|
- @change="handleSortFiles"
|
|
|
|
|
|
|
+ <el-table
|
|
|
|
|
+ v-loading="fileListLoading"
|
|
|
|
|
+ :data="fileListData"
|
|
|
|
|
+ border
|
|
|
|
|
+ style="width: 100%"
|
|
|
>
|
|
>
|
|
|
- <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;
|
|
|
|
|
- cursor: move;
|
|
|
|
|
- "
|
|
|
|
|
|
|
+ <el-table-column type="index" label="序号" width="80" align="center" />
|
|
|
|
|
+ <el-table-column
|
|
|
|
|
+ prop="documentName"
|
|
|
|
|
+ label="文书名称"
|
|
|
|
|
+ min-width="200"
|
|
|
|
|
+ align="left"
|
|
|
|
|
+ />
|
|
|
|
|
+ <el-table-column
|
|
|
|
|
+ prop="documentNumber"
|
|
|
|
|
+ label="文号"
|
|
|
|
|
+ width="180"
|
|
|
|
|
+ align="center"
|
|
|
>
|
|
>
|
|
|
- <el-row :gutter="20">
|
|
|
|
|
- <el-col :span="2">
|
|
|
|
|
- <div style="text-align: center">
|
|
|
|
|
- <span
|
|
|
|
|
- class="drag-handle"
|
|
|
|
|
- style="cursor: move; color: #909399; font-size: 18px"
|
|
|
|
|
- >
|
|
|
|
|
- ☰
|
|
|
|
|
- </span>
|
|
|
|
|
- <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-button
|
|
|
|
|
- type="text"
|
|
|
|
|
- size="small"
|
|
|
|
|
- style="margin-right: 5px"
|
|
|
|
|
- @click="handleEditFile(row)"
|
|
|
|
|
- >
|
|
|
|
|
- 修改
|
|
|
|
|
- </el-button>
|
|
|
|
|
- <el-button
|
|
|
|
|
- type="text"
|
|
|
|
|
- size="small"
|
|
|
|
|
- @click="handleDeleteDetailFile(row)"
|
|
|
|
|
- >
|
|
|
|
|
- 删除
|
|
|
|
|
- </el-button>
|
|
|
|
|
- </el-col>
|
|
|
|
|
- </el-row>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div
|
|
|
|
|
- v-if="fileListData.length === 0"
|
|
|
|
|
- style="text-align: center; padding: 40px 0; color: #909399"
|
|
|
|
|
|
|
+ <template slot-scope="{ row }">
|
|
|
|
|
+ {{ row.documentNumber || row.documentNo || '-' }}
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column
|
|
|
|
|
+ prop="auditedUnitName"
|
|
|
|
|
+ label="监审单位"
|
|
|
|
|
+ min-width="180"
|
|
|
|
|
+ align="left"
|
|
|
|
|
+ />
|
|
|
|
|
+ <el-table-column
|
|
|
|
|
+ prop="fileSource"
|
|
|
|
|
+ label="文件来源"
|
|
|
|
|
+ width="160"
|
|
|
|
|
+ align="center"
|
|
|
|
|
+ />
|
|
|
|
|
+ <el-table-column
|
|
|
|
|
+ prop="pageCount"
|
|
|
|
|
+ label="页数"
|
|
|
|
|
+ width="100"
|
|
|
|
|
+ align="center"
|
|
|
>
|
|
>
|
|
|
- 暂无数据
|
|
|
|
|
- </div>
|
|
|
|
|
- </draggable>
|
|
|
|
|
|
|
+ <template slot-scope="{ row }">
|
|
|
|
|
+ {{ row.pageCount || 0 }}
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column label="操作" width="220" align="center" fixed="right">
|
|
|
|
|
+ <template slot-scope="{ row }">
|
|
|
|
|
+ <el-button type="text" size="small" @click="handlePreviewFile(row)">
|
|
|
|
|
+ 预览
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ <el-button type="text" size="small" @click="handleEditFile(row)">
|
|
|
|
|
+ 修改
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="text"
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ @click="handleDeleteDetailFile(row)"
|
|
|
|
|
+ >
|
|
|
|
|
+ 删除
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ </el-table>
|
|
|
|
|
|
|
|
<div slot="footer" style="text-align: right; margin-top: 20px">
|
|
<div slot="footer" style="text-align: right; margin-top: 20px">
|
|
|
<el-button @click="fileListDialogVisible = false">关闭</el-button>
|
|
<el-button @click="fileListDialogVisible = false">关闭</el-button>
|
|
@@ -762,7 +733,7 @@
|
|
|
<script>
|
|
<script>
|
|
|
import CostAuditDialog from '@/components/costAudit/CostAuditDialog.vue'
|
|
import CostAuditDialog from '@/components/costAudit/CostAuditDialog.vue'
|
|
|
import UploadComponent from '@/components/costAudit/UploadComponent.vue'
|
|
import UploadComponent from '@/components/costAudit/UploadComponent.vue'
|
|
|
- import draggable from 'vuedraggable'
|
|
|
|
|
|
|
+ import { Base64 } from 'js-base64'
|
|
|
import {
|
|
import {
|
|
|
addDataInductionList,
|
|
addDataInductionList,
|
|
|
saveDataInductionWithDetails,
|
|
saveDataInductionWithDetails,
|
|
@@ -780,7 +751,6 @@
|
|
|
components: {
|
|
components: {
|
|
|
CostAuditDialog,
|
|
CostAuditDialog,
|
|
|
UploadComponent,
|
|
UploadComponent,
|
|
|
- draggable,
|
|
|
|
|
},
|
|
},
|
|
|
filters: {
|
|
filters: {
|
|
|
formatDate(value) {
|
|
formatDate(value) {
|
|
@@ -1137,6 +1107,22 @@
|
|
|
: []
|
|
: []
|
|
|
this.newFileDialogVisible = true
|
|
this.newFileDialogVisible = true
|
|
|
},
|
|
},
|
|
|
|
|
+ handlePreviewFile(row) {
|
|
|
|
|
+ const rawUrl = row.attachmentUrl || row.url || row.fileUrl
|
|
|
|
|
+ if (!rawUrl) {
|
|
|
|
|
+ this.$message.warning('暂无文件!')
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ // 拼接完整地址
|
|
|
|
|
+ const absoluteUrl = rawUrl.startsWith('http')
|
|
|
|
|
+ ? rawUrl
|
|
|
|
|
+ : (window.context?.form || '') + rawUrl
|
|
|
|
|
+ // kkFileView 预览地址
|
|
|
|
|
+ const baseHost =
|
|
|
|
|
+ typeof host !== 'undefined' && host ? host : window.location.origin
|
|
|
|
|
+ const encodedUrl = encodeURIComponent(Base64.encode(absoluteUrl))
|
|
|
|
|
+ window.open(`${baseHost}:8012/onlinePreview?url=${encodedUrl}`)
|
|
|
|
|
+ },
|
|
|
async handleDeleteDetailFile(row) {
|
|
async handleDeleteDetailFile(row) {
|
|
|
this.$confirm('确定要删除此文件吗?', '提示', {
|
|
this.$confirm('确定要删除此文件吗?', '提示', {
|
|
|
confirmButtonText: '确定',
|
|
confirmButtonText: '确定',
|
|
@@ -1154,8 +1140,8 @@
|
|
|
)
|
|
)
|
|
|
if (index > -1) {
|
|
if (index > -1) {
|
|
|
this.fileListData.splice(index, 1)
|
|
this.fileListData.splice(index, 1)
|
|
|
- // 删除后重新排序
|
|
|
|
|
- await this.handleSortFiles()
|
|
|
|
|
|
|
+ // 删除后刷新列表
|
|
|
|
|
+ this.loadFileList(this.currentEditingMaterial.id)
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
this.$message.error(response.message || '删除失败')
|
|
this.$message.error(response.message || '删除失败')
|
|
@@ -1170,31 +1156,6 @@
|
|
|
handleUploadNewFileSuccess(response, file) {
|
|
handleUploadNewFileSuccess(response, file) {
|
|
|
// 此方法已经被 handleNewFileSaveFiles 指代
|
|
// 此方法已经被 handleNewFileSaveFiles 指代
|
|
|
},
|
|
},
|
|
|
- async handleSortFiles() {
|
|
|
|
|
- try {
|
|
|
|
|
- if (!this.fileListData || this.fileListData.length === 0) {
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
- // 一次性保存所有文件的orderNum
|
|
|
|
|
- const savePromises = this.fileListData.map((row, index) => {
|
|
|
|
|
- const params = {
|
|
|
|
|
- id: row.id,
|
|
|
|
|
- orderNum: index + 1,
|
|
|
|
|
- masterId: this.currentEditingMaterial.id,
|
|
|
|
|
- taskId: this.taskId,
|
|
|
|
|
- }
|
|
|
|
|
- return saveDetailInfo(params)
|
|
|
|
|
- })
|
|
|
|
|
- await Promise.all(savePromises)
|
|
|
|
|
- // 排序成功,不显示提示信息
|
|
|
|
|
- // 不需要重新加载,应为fileListData已经是排序后的结果
|
|
|
|
|
- } catch (error) {
|
|
|
|
|
- console.error('排序失败:', error)
|
|
|
|
|
- this.$message.error('排序失败,请重试')
|
|
|
|
|
- // 失败时重新加载文件列表
|
|
|
|
|
- this.loadFileList(this.currentEditingMaterial.id)
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
openAddFileDialog() {
|
|
openAddFileDialog() {
|
|
|
this.addFileForm = {
|
|
this.addFileForm = {
|
|
|
documentName: '',
|
|
documentName: '',
|