档案移交申请,审核功能
This commit is contained in:
parent
f32b1fb6b4
commit
b4194ffe6d
|
|
@ -270,7 +270,7 @@ const handleDetail = (rowData) => {
|
|||
query: {
|
||||
id: rowData.id ?? '0',
|
||||
proId: rowData.proId ?? '0',
|
||||
viewStatus: 'detail',
|
||||
viewStatus: 'audit',
|
||||
auditStatus: getStatusText2(rowData.auditStatus),
|
||||
}
|
||||
})
|
||||
|
|
|
|||
|
|
@ -0,0 +1,419 @@
|
|||
<template>
|
||||
<div class="detail-container">
|
||||
<!-- 返回按钮 -->
|
||||
<div class="back-btn">
|
||||
<el-button type="danger" plain :icon="Close" size="mini" @click="handleClose">
|
||||
返回
|
||||
</el-button>
|
||||
</div>
|
||||
|
||||
<!-- 移交内容区域 -->
|
||||
<div class="content-section">
|
||||
<div class="section-title">
|
||||
<div class="title-bar"></div>
|
||||
<span>移交内容</span>
|
||||
</div>
|
||||
<div class="content-info">
|
||||
<span class="project-name">{{ projectName }}</span>
|
||||
<span class="receiving-org">接收组织: {{ receivingOrg }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 文件详情表格 -->
|
||||
<div class="table-section">
|
||||
<!-- 移交记录视图 -->
|
||||
<el-table
|
||||
v-if="viewStatus === 'record'"
|
||||
:data="fileList"
|
||||
border
|
||||
style="width: 100%"
|
||||
class="detail-table"
|
||||
max-height="800"
|
||||
>
|
||||
<el-table-column type="index" label="序号" width="80" align="center" />
|
||||
<el-table-column prop="proName" label="项目名称" min-width="150">
|
||||
<template #default="{ row }">
|
||||
{{ row.proName || '--' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="singleProName" label="单项工程名称" min-width="150">
|
||||
<template #default="{ row }">
|
||||
{{ row.singleProName || '--' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="transferTime" label="移交时间" min-width="120">
|
||||
<template #default="{ row }">
|
||||
{{ row.transferTime || '--' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="archiveName" label="档案名称" min-width="300">
|
||||
<template #default="{ row }">
|
||||
<div class="archive-name-cell file-name-link" @click="viewFile(row)">
|
||||
{{ row.archiveName }}
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- 接收视图 -->
|
||||
<el-table
|
||||
v-if="viewStatus === 'accept'"
|
||||
:data="fileList"
|
||||
border
|
||||
style="width: 100%"
|
||||
class="detail-table"
|
||||
max-height="800"
|
||||
>
|
||||
<el-table-column type="index" label="序号" width="80" align="center" />
|
||||
<el-table-column prop="transferTime" label="移交时间" min-width="150">
|
||||
<template #default="{ row }">
|
||||
{{ row.transferTime || '--' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="archiveName" label="档案名称" min-width="300">
|
||||
<template #default="{ row }">
|
||||
<div class="archive-name-cell file-name-link" @click="viewFile(row)">
|
||||
{{ row.archiveName }}
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="接收状态" min-width="120">
|
||||
<template #default="{ row }">
|
||||
<el-tag :type="row.receiveStatus === '1' ? 'success' : 'danger'">
|
||||
{{ row.receiveStatus === '1' ? '已接收' : '未接收' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" min-width="100" v-if="viewStatus === 'accept'">
|
||||
<template #default="{ row }">
|
||||
<el-button
|
||||
v-if="row.receiveStatus === '0'"
|
||||
plain
|
||||
:icon="Check"
|
||||
type="primary"
|
||||
size="mini"
|
||||
@click="handleAccept(row)"
|
||||
>
|
||||
确认接收
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
<!-- 确认接收弹窗 -->
|
||||
<el-dialog
|
||||
v-model="confirmDialogVisible"
|
||||
:close-on-click-modal="false"
|
||||
:close-on-press-escape="false"
|
||||
:show-close="true"
|
||||
width="450px"
|
||||
>
|
||||
<template #header>
|
||||
<div class="dialog-title">操作确认</div>
|
||||
</template>
|
||||
<div class="confirm-content">
|
||||
<div class="confirm-icon">
|
||||
<el-icon><QuestionFilled /></el-icon>
|
||||
</div>
|
||||
<div class="confirm-text">
|
||||
<p class="main-message">移交接收确认?</p>
|
||||
<p class="sub-message">确定该档案已经接收完成吗?</p>
|
||||
</div>
|
||||
</div>
|
||||
<template #footer>
|
||||
<el-button class="clear-btn" @click="confirmDialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" class="search-btn" @click="confirmTransferStatus">
|
||||
确定
|
||||
</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 预览文件 -->
|
||||
<ViewFile
|
||||
v-if="isViewFlag"
|
||||
:row-data="currentRow"
|
||||
title="预览"
|
||||
@close-dialog="isViewFlag = false"
|
||||
:width="600"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, onBeforeUnmount, nextTick } from 'vue';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import {
|
||||
Close,
|
||||
Check,
|
||||
QuestionFilled
|
||||
} from '@element-plus/icons-vue';
|
||||
|
||||
// API
|
||||
import { getTransferRecordDetailApi } from '@/api/filesTransfer/record';
|
||||
import { getTransferReceiceDetailApi, transferReceiveApi } from '@/api/filesTransfer/accept';
|
||||
|
||||
// Components
|
||||
import ViewFile from '@/views/viewFile/viewFile.vue';
|
||||
|
||||
// Route & Router
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
|
||||
// ================== Refs ==================
|
||||
const id = route.query.id;
|
||||
const proId = route.query.proId;
|
||||
const viewStatus = route.query.viewStatus;
|
||||
|
||||
const projectName = ref('');
|
||||
const receivingOrg = ref('');
|
||||
const fileList = ref([]);
|
||||
const confirmDialogVisible = ref(false);
|
||||
const isViewFlag = ref(false);
|
||||
const currentRow = ref({});
|
||||
const currentForm = ref({});
|
||||
|
||||
// ================== Methods ==================
|
||||
const viewFile = (row) => {
|
||||
currentRow.value = row;
|
||||
isViewFlag.value = true;
|
||||
};
|
||||
|
||||
const handleClose = () => {
|
||||
let path = '';
|
||||
if (viewStatus === 'record') {
|
||||
path = '/archivesManagement/filesTransfer/record';
|
||||
} else {
|
||||
path = '/archivesManagement/filesTransfer/accept';
|
||||
}
|
||||
|
||||
// 模拟 tab 关闭并跳转(根据你的实际逻辑调整)
|
||||
// 如果你使用的是 keep-alive + tab,可能需要调用全局方法
|
||||
// 这里简化为直接返回
|
||||
router.push(path);
|
||||
};
|
||||
|
||||
const initData = async () => {
|
||||
fileList.value = [];
|
||||
try {
|
||||
const api =
|
||||
viewStatus === 'accept'
|
||||
? getTransferReceiceDetailApi
|
||||
: getTransferRecordDetailApi;
|
||||
|
||||
const res = await api({ id, proId });
|
||||
|
||||
projectName.value = res?.data?.proName || '/';
|
||||
receivingOrg.value = res?.data?.deptName || '/';
|
||||
|
||||
if (Array.isArray(res.data.transferFileDtos)) {
|
||||
fileList.value = res.data.transferFileDtos.map((item) => ({
|
||||
id: item.id,
|
||||
proName: item.proName,
|
||||
singleProName: item.singleProName,
|
||||
transferTime: item.transferTime,
|
||||
archiveName:
|
||||
`${item.parParentName || ''}/${item.parentName || ''}/${item.fileName}`.replace(/^\/+/, ''),
|
||||
receiveStatus: item.receiveStatus || '0',
|
||||
transferDate: item.transferDate,
|
||||
fileId: item.fileId || '',
|
||||
proId: item.proId || ''
|
||||
}));
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('加载详情失败', error);
|
||||
ElMessage.error('加载数据失败');
|
||||
}
|
||||
};
|
||||
|
||||
const handleAccept = (row) => {
|
||||
currentForm.value = row;
|
||||
confirmDialogVisible.value = true;
|
||||
};
|
||||
|
||||
const confirmTransferStatus = async () => {
|
||||
const { id: fileId, proId: rowProId } = currentForm.value;
|
||||
const transferApplyId = id;
|
||||
|
||||
try {
|
||||
const res = await transferReceiveApi({
|
||||
id: fileId,
|
||||
transferApplyId,
|
||||
proId: rowProId
|
||||
});
|
||||
|
||||
confirmDialogVisible.value = false;
|
||||
|
||||
if (res.code === 200) {
|
||||
ElMessage.success(res.msg || '确认接收成功');
|
||||
await refreshData();
|
||||
} else {
|
||||
ElMessage.error(res.msg || '确认接收失败');
|
||||
}
|
||||
} catch (error) {
|
||||
ElMessage.error('操作失败');
|
||||
console.error(error);
|
||||
}
|
||||
};
|
||||
|
||||
const refreshData = async () => {
|
||||
fileList.value = [];
|
||||
try {
|
||||
const res = await getTransferReceiceDetailApi({ id, proId });
|
||||
if (Array.isArray(res.data.transferFileDtos)) {
|
||||
fileList.value = res.data.transferFileDtos.map((item) => ({
|
||||
id: item.id,
|
||||
proName: item.proName,
|
||||
singleProName: item.singleProName,
|
||||
transferTime: item.transferTime,
|
||||
archiveName:
|
||||
`${item.parParentName || ''}/${item.parentName || ''}/${item.fileName}`.replace(/^\/+/, ''),
|
||||
receiveStatus: item.receiveStatus || '0',
|
||||
transferDate: item.transferDate,
|
||||
fileId: item.fileId || '',
|
||||
proId: item.proId || ''
|
||||
}));
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('刷新失败', error);
|
||||
}
|
||||
};
|
||||
|
||||
// ================== Lifecycle ==================
|
||||
onMounted(() => {
|
||||
document.body.style.overflow = 'hidden';
|
||||
initData();
|
||||
});
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
document.body.style.overflow = 'auto';
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.detail-container {
|
||||
padding: 20px;
|
||||
background: #fff;
|
||||
height: calc(100vh - 120px);
|
||||
overflow-y: auto;
|
||||
box-sizing: border-box;
|
||||
|
||||
&::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
background: #f5f5f5;
|
||||
}
|
||||
&::-webkit-scrollbar-track {
|
||||
background: #f5f5f5;
|
||||
border-radius: 3px;
|
||||
}
|
||||
&::-webkit-scrollbar-thumb {
|
||||
background: #c0c4cc;
|
||||
border-radius: 3px;
|
||||
transition: background 0.3s;
|
||||
}
|
||||
&::-webkit-scrollbar-thumb:hover {
|
||||
background: #909399;
|
||||
}
|
||||
}
|
||||
|
||||
.status-section {
|
||||
text-align: center;
|
||||
margin-bottom: 40px;
|
||||
.status-icon {
|
||||
margin-bottom: 15px;
|
||||
i {
|
||||
font-size: 80px;
|
||||
color: #409eff;
|
||||
}
|
||||
}
|
||||
.status-text {
|
||||
font-size: 24px;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
|
||||
.content-section {
|
||||
margin-bottom: 30px;
|
||||
.section-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 15px;
|
||||
.title-bar {
|
||||
width: 4px;
|
||||
height: 20px;
|
||||
background: #409eff;
|
||||
margin-right: 10px;
|
||||
}
|
||||
span {
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
.content-info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 30px;
|
||||
.project-name {
|
||||
font-size: 16px;
|
||||
color: #333;
|
||||
}
|
||||
.receiving-org {
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.table-section {
|
||||
margin-bottom: 30px;
|
||||
.detail-table {
|
||||
.archive-name-cell {
|
||||
white-space: normal;
|
||||
word-break: break-word;
|
||||
line-height: 1.4;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.back-btn {
|
||||
height: 50px;
|
||||
}
|
||||
|
||||
/* 确认弹框样式 */
|
||||
.confirm-content {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
padding: 20px 0;
|
||||
}
|
||||
.confirm-icon {
|
||||
font-size: 48px;
|
||||
color: #e6a23c;
|
||||
margin-right: 16px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.confirm-text {
|
||||
flex: 1;
|
||||
}
|
||||
.main-message {
|
||||
margin: 0 0 8px 0;
|
||||
font-size: 16px;
|
||||
color: #303133;
|
||||
line-height: 1.5;
|
||||
}
|
||||
.sub-message {
|
||||
margin: 0;
|
||||
font-size: 14px;
|
||||
color: #909399;
|
||||
line-height: 1.4;
|
||||
}
|
||||
.file-name-link {
|
||||
color: #409eff;
|
||||
cursor: pointer;
|
||||
}
|
||||
.file-name-link:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,180 @@
|
|||
<template>
|
||||
<el-dialog
|
||||
class="l-dialog"
|
||||
:class="lDialog"
|
||||
:title="title"
|
||||
v-model="dialogVisible"
|
||||
:show-close="true"
|
||||
:close-on-click-modal="false"
|
||||
@close="handleClose"
|
||||
append-to-body
|
||||
:width="width > 500 ? '700px' : '500px'"
|
||||
>
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
label-width="110px"
|
||||
:disabled="disabled"
|
||||
>
|
||||
<el-form-item label="文件名称" prop="fileName">
|
||||
<el-input
|
||||
v-model="form.fileName"
|
||||
clearable
|
||||
show-word-limit
|
||||
placeholder="请输入文件名称"
|
||||
maxlength="64"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<template #footer>
|
||||
<el-button class="clear-btn" @click="handleClose" :disabled="disabled">
|
||||
取消
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
class="search-btn"
|
||||
:disabled="disabled"
|
||||
@click="submitForm"
|
||||
>
|
||||
确认
|
||||
</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed, watch } from 'vue';
|
||||
import { ElMessage, ElLoading } from 'element-plus';
|
||||
import { updateTransferRecordFileApi } from '@/api/filesTransfer/record';
|
||||
|
||||
// ================== Props & Emits ==================
|
||||
const props = defineProps({
|
||||
modelValue: Boolean, // v-model:visible
|
||||
rowData: Object,
|
||||
title: {
|
||||
type: String,
|
||||
default: '维护'
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
width: {
|
||||
type: Number,
|
||||
default: 500
|
||||
}
|
||||
});
|
||||
|
||||
const emit = defineEmits(['update:modelValue', 'closeDialog', 'handleQuery']);
|
||||
|
||||
// ================== Refs ==================
|
||||
const dialogVisible = ref(false);
|
||||
const formRef = ref(null);
|
||||
const form = ref({
|
||||
id: null,
|
||||
fileName: ''
|
||||
});
|
||||
|
||||
const rules = {
|
||||
fileName: [
|
||||
{ required: true, message: '请输入文件名称', trigger: 'blur' }
|
||||
]
|
||||
};
|
||||
|
||||
const lDialog = computed(() => (props.width > 500 ? 'w700' : 'w500'));
|
||||
|
||||
// ================== Methods ==================
|
||||
const initFormData = () => {
|
||||
if (props.rowData) {
|
||||
form.value = {
|
||||
id: props.rowData.fileId || null,
|
||||
fileName: props.rowData.fileName || ''
|
||||
};
|
||||
} else {
|
||||
form.value = { id: null, fileName: '' };
|
||||
}
|
||||
};
|
||||
|
||||
const handleClose = () => {
|
||||
dialogVisible.value = false;
|
||||
emit('update:modelValue', false);
|
||||
emit('closeDialog');
|
||||
};
|
||||
|
||||
const submitForm = async () => {
|
||||
if (!formRef.value) return;
|
||||
|
||||
try {
|
||||
await formRef.value.validate();
|
||||
const loading = ElLoading.service({
|
||||
lock: true,
|
||||
text: '数据提交中,请稍候...',
|
||||
background: 'rgba(0,0,0,0.5)'
|
||||
});
|
||||
|
||||
try {
|
||||
const params = { ...form.value };
|
||||
const res = await updateTransferRecordFileApi(params);
|
||||
|
||||
loading.close();
|
||||
|
||||
if (res.data.code === 200) {
|
||||
ElMessage.success(res.data.msg);
|
||||
emit('handleQuery');
|
||||
handleClose();
|
||||
} else {
|
||||
ElMessage.error(res.data.msg);
|
||||
}
|
||||
} catch (error) {
|
||||
loading.close();
|
||||
// ElMessage.error('提交失败,请重试');
|
||||
console.error(error);
|
||||
}
|
||||
} catch (error) {
|
||||
// 表单验证未通过,无需处理
|
||||
}
|
||||
};
|
||||
|
||||
// ================== Watch & Lifecycle ==================
|
||||
watch(
|
||||
() => props.modelValue,
|
||||
(val) => {
|
||||
dialogVisible.value = val;
|
||||
if (val) {
|
||||
initFormData();
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
|
||||
// 监听 rowData 变化(可选,用于动态更新)
|
||||
watch(
|
||||
() => props.rowData,
|
||||
() => {
|
||||
if (dialogVisible.value) {
|
||||
initFormData();
|
||||
}
|
||||
}
|
||||
);
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.l-dialog .el-dialog__header .el-dialog__title {
|
||||
font-size: 16px;
|
||||
}
|
||||
.w700 .el-dialog {
|
||||
width: 700px;
|
||||
}
|
||||
.w500 .el-dialog {
|
||||
width: 500px;
|
||||
}
|
||||
.form-item {
|
||||
width: 100%;
|
||||
}
|
||||
.clear-btn {
|
||||
margin-right: 10px;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,227 @@
|
|||
<template>
|
||||
<!-- 小型弹窗,用于查看移交清单/进度 -->
|
||||
<el-dialog
|
||||
class="l-dialog"
|
||||
:class="lDialog"
|
||||
:title="title"
|
||||
v-model="dialogVisible"
|
||||
:show-close="true"
|
||||
:close-on-click-modal="false"
|
||||
@close="handleClose"
|
||||
append-to-body
|
||||
width="700px"
|
||||
>
|
||||
<el-table
|
||||
:data="tableData"
|
||||
style="width: 100%"
|
||||
border
|
||||
header-align="center"
|
||||
max-height="600"
|
||||
>
|
||||
<el-table-column type="index" label="序号" width="80" align="center" />
|
||||
|
||||
<el-table-column
|
||||
v-for="item in tableColumns"
|
||||
:key="item.prop"
|
||||
:prop="item.prop"
|
||||
:label="item.label"
|
||||
align="center"
|
||||
>
|
||||
<template #default="scope">
|
||||
<span
|
||||
v-if="item.prop === 'fileName'"
|
||||
class="file-name-link"
|
||||
@click="viewFile(scope.row)"
|
||||
style="color: #409eff; cursor: pointer"
|
||||
>
|
||||
{{ scope.row.fileName }}
|
||||
</span>
|
||||
<span v-else>
|
||||
{{ scope.row[item.prop] }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作" width="100" align="center">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
v-if="jumpType === 'list' && scope.row.transferStatus === '进行中'"
|
||||
plain
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="handleMaintenance(scope.row)"
|
||||
:disabled="!hasPermission(['record:file:update'])"
|
||||
>
|
||||
维护
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="jumpType === 'progress' && scope.row.transferStatus === '进行中'"
|
||||
plain
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="transfer(scope.row)"
|
||||
:disabled="!hasPermission(['record:file:transfer'])"
|
||||
>
|
||||
移交
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- 预览文件 -->
|
||||
<ViewFile
|
||||
v-if="isViewFlag"
|
||||
:row-data="currentRow"
|
||||
title="预览"
|
||||
@close-dialog="isViewFlag = false"
|
||||
:width="600"
|
||||
/>
|
||||
|
||||
<!-- 维护弹窗 -->
|
||||
<Maintenance
|
||||
v-if="isMaintenanceVisible"
|
||||
:row-data="maintenanceRow"
|
||||
title="维护"
|
||||
@close-dialog="isMaintenanceVisible = false"
|
||||
:width="600"
|
||||
@handle-query="handleQuery"
|
||||
/>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed, onMounted, watch } from 'vue';
|
||||
import { ElMessage, ElMessageBox, ElLoading } from 'element-plus';
|
||||
import { getTransferRecordFilesApi, updateTransferRecordFilesStatusApi } from '@/api/filesTransfer/record';
|
||||
import Maintenance from './maintenance.vue';
|
||||
import ViewFile from '@/views/viewFile/viewFile.vue';
|
||||
|
||||
// ================== Props & Emits ==================
|
||||
const props = defineProps({
|
||||
modelValue: Boolean, // v-model:visible
|
||||
title: String,
|
||||
rowData: Object,
|
||||
jumpType: {
|
||||
type: String,
|
||||
required: true,
|
||||
validator: (val) => ['list', 'progress'].includes(val)
|
||||
}
|
||||
});
|
||||
|
||||
const emit = defineEmits(['update:modelValue', 'close', 'handle-query']);
|
||||
|
||||
// ================== Refs ==================
|
||||
const dialogVisible = ref(false);
|
||||
const tableData = ref([]);
|
||||
const currentRow = ref(null);
|
||||
const isViewFlag = ref(false);
|
||||
const isMaintenanceVisible = ref(false);
|
||||
const maintenanceRow = ref(null);
|
||||
|
||||
const lDialog = computed(() => (props.title?.length > 10 ? 'w700' : 'w500'));
|
||||
|
||||
// 动态列
|
||||
const tableColumns = computed(() => {
|
||||
if (props.jumpType === 'list') {
|
||||
return [
|
||||
{ prop: 'parParentName', label: '所属分类' },
|
||||
{ prop: 'parentName', label: '所属案卷' },
|
||||
{ prop: 'fileName', label: '文件名称' }
|
||||
];
|
||||
} else {
|
||||
return [
|
||||
{ prop: 'parParentName', label: '所属分类' },
|
||||
{ prop: 'parentName', label: '所属案卷' },
|
||||
{ prop: 'fileName', label: '文件名称' },
|
||||
{ prop: 'transferStatus', label: '进度' }
|
||||
];
|
||||
}
|
||||
});
|
||||
|
||||
// ================== Methods ==================
|
||||
const initFormData = async () => {
|
||||
if (!props.rowData?.id) return;
|
||||
const res = await getTransferRecordFilesApi({ transferApplyId: props.rowData.id });
|
||||
if (Array.isArray(res.data.data)) {
|
||||
tableData.value = res.data.data.map(item => ({
|
||||
...item,
|
||||
transferStatus: (item.transferStatus ?? '0') === '0' ? '进行中' : '已完成'
|
||||
}));
|
||||
}
|
||||
};
|
||||
|
||||
const viewFile = (row) => {
|
||||
currentRow.value = row;
|
||||
isViewFlag.value = true;
|
||||
};
|
||||
|
||||
const handleMaintenance = (row) => {
|
||||
maintenanceRow.value = row;
|
||||
isMaintenanceVisible.value = true;
|
||||
};
|
||||
|
||||
const transfer = (row) => {
|
||||
ElMessageBox.confirm(`是否确认移交文件名称为 "${row.fileName}" 的数据项?`, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
const loading = ElLoading.service({ text: '正在移交,请稍候...' });
|
||||
try {
|
||||
const res = await updateTransferRecordFilesStatusApi({
|
||||
transferApplyId: props.rowData.id,
|
||||
id: row.fileId,
|
||||
transferStatus: '1'
|
||||
});
|
||||
loading.close();
|
||||
if (res.data.code === 200) {
|
||||
ElMessage.success(res.data.msg);
|
||||
await handleQuery();
|
||||
emit('handle-query');
|
||||
} else {
|
||||
ElMessage.error(res.data.msg);
|
||||
}
|
||||
} catch (error) {
|
||||
loading.close();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const handleQuery = async () => {
|
||||
await initFormData();
|
||||
};
|
||||
|
||||
const handleClose = () => {
|
||||
dialogVisible.value = false;
|
||||
emit('update:modelValue', false);
|
||||
emit('close');
|
||||
};
|
||||
|
||||
// ================== Watch & Lifecycle ==================
|
||||
watch(
|
||||
() => props.modelValue,
|
||||
(val) => {
|
||||
dialogVisible.value = val;
|
||||
if (val) {
|
||||
initFormData();
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
|
||||
onMounted(() => {
|
||||
if (props.modelValue) {
|
||||
initFormData();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.l-dialog .el-dialog__header .el-dialog__title {
|
||||
font-size: 16px;
|
||||
}
|
||||
.file-name-link {
|
||||
color: #409eff;
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -90,10 +90,10 @@
|
|||
/>
|
||||
</div>
|
||||
<div class="approval-actions">
|
||||
<el-button type="primary" @click="handleApprove" v-hasPermi="['transfer:apply:audit']">
|
||||
<el-button type="primary" @click="handleApprove">
|
||||
同意
|
||||
</el-button>
|
||||
<el-button type="danger" @click="handleReject" v-hasPermi="['transfer:apply:audit']">
|
||||
<el-button type="danger" @click="handleReject">
|
||||
驳回
|
||||
</el-button>
|
||||
</div>
|
||||
|
|
@ -247,15 +247,14 @@ const initData = async () => {
|
|||
apiInfo({ id, proId })
|
||||
])
|
||||
|
||||
projectName.value = resInfo?.data?.proName || '/'
|
||||
receivingOrg.value = resInfo?.data?.deptName || '/'
|
||||
projectName.value = resInfo?.data.data?.proName || '/'
|
||||
receivingOrg.value = resInfo?.data.data?.deptName || '/'
|
||||
|
||||
auditUserName.value = resInfo?.data?.auditUser || '--'
|
||||
auditDate.value = resInfo?.data?.auditTime || '--'
|
||||
auditOpinion.value = resInfo?.data?.auditOpinion || '--'
|
||||
auditUserName.value = resInfo?.data.data?.auditUser || '--'
|
||||
auditDate.value = resInfo?.data.data?.auditTime || '--'
|
||||
auditOpinion.value = resInfo?.data.data?.auditOpinion || '--'
|
||||
|
||||
fileList.value = []
|
||||
console.log("resFile.data",resFile.data)
|
||||
if (Array.isArray(resFile.data.data) && resFile.data.data.length > 0) {
|
||||
fileList.value = resFile.data.data.map(item => ({
|
||||
proName: item.proName,
|
||||
|
|
|
|||
|
|
@ -18,28 +18,57 @@
|
|||
@refresh-change="refreshChange"
|
||||
@on-load="onLoad"
|
||||
>
|
||||
<!-- 自定义档案状态显示 -->
|
||||
<!-- 移交进度状态文本 -->
|
||||
<template #transferStatus="{ row }">
|
||||
{{
|
||||
getStatusText(row.transferStatus)
|
||||
}}
|
||||
<span
|
||||
class="clickable-status"
|
||||
@click="handleTProgress(row)"
|
||||
>
|
||||
{{ getStatusText(row.transferStatus) }}
|
||||
</span>
|
||||
</template>
|
||||
|
||||
<!-- 接收部门名称 -->
|
||||
<template #deptId="{ row }">
|
||||
{{ row.deptName }}
|
||||
{{ row.deptName || '-' }}
|
||||
</template>
|
||||
|
||||
<!-- 移交清单操作 -->
|
||||
<template #t_list="{ row }">
|
||||
<span
|
||||
class="clickable-status"
|
||||
@click="handleTList(row)"
|
||||
>
|
||||
查看清单
|
||||
</span>
|
||||
</template>
|
||||
|
||||
</avue-crud>
|
||||
</basic-container>
|
||||
|
||||
<RecordList
|
||||
v-model="recordListVisible"
|
||||
:title="recordListTitle"
|
||||
:row-data="recordListRow"
|
||||
:jump-type="recordListJumpType"
|
||||
@handle-query="onLoad(page, query)"
|
||||
@close="recordListVisible = false"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import RecordList from '@/views/fileTransfer/components/recordList.vue'
|
||||
import {
|
||||
getTransferRecordListApi,
|
||||
getTransferRecordListApi
|
||||
} from '@/api/filesTransfer/record';
|
||||
import { getDeptSelectApi } from '@/api/select'
|
||||
import { getDeptSelectApi } from '@/api/select';
|
||||
import { mapGetters } from 'vuex';
|
||||
import website from '@/config/website';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
RecordList
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
form: {},
|
||||
|
|
@ -48,7 +77,7 @@ export default {
|
|||
page: {
|
||||
pageSize: 10,
|
||||
currentPage: 1,
|
||||
total: 0,
|
||||
total: 0
|
||||
},
|
||||
selectionList: [],
|
||||
option: {
|
||||
|
|
@ -70,13 +99,13 @@ export default {
|
|||
{
|
||||
label: '项目名称',
|
||||
prop: 'proName',
|
||||
search: true,
|
||||
search: true
|
||||
},
|
||||
|
||||
{
|
||||
label: '单项工程名称',
|
||||
prop: 'singleProName',
|
||||
search: true,
|
||||
search: true
|
||||
},
|
||||
{
|
||||
label: '移交时间',
|
||||
|
|
@ -104,17 +133,22 @@ export default {
|
|||
{
|
||||
label: '移交清单',
|
||||
prop: 't_list',
|
||||
slot: true // 启用插槽
|
||||
},
|
||||
{
|
||||
label: '移交进度',
|
||||
prop: 'transferStatus',
|
||||
slot: true,
|
||||
},
|
||||
slot: true
|
||||
}
|
||||
|
||||
],
|
||||
]
|
||||
},
|
||||
data: [],
|
||||
treeDataList: [],
|
||||
recordListVisible: false,
|
||||
recordListTitle: '',
|
||||
recordListRow: null,
|
||||
recordListJumpType: 'list'
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
|
|
@ -124,7 +158,7 @@ export default {
|
|||
addBtn: this.validData(this.permission.post_add, false),
|
||||
viewBtn: this.validData(this.permission.post_view, false),
|
||||
delBtn: this.validData(this.permission.post_delete, false),
|
||||
editBtn: this.validData(this.permission.post_edit, false),
|
||||
editBtn: this.validData(this.permission.post_edit, false)
|
||||
};
|
||||
},
|
||||
ids() {
|
||||
|
|
@ -133,7 +167,7 @@ export default {
|
|||
ids.push(ele.id);
|
||||
});
|
||||
return ids.join(',');
|
||||
},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
beforeOpen(done, type, row) {
|
||||
|
|
@ -142,11 +176,11 @@ export default {
|
|||
getStatusText(status) {
|
||||
switch (status) {
|
||||
case '0':
|
||||
return '进行中'
|
||||
return '进行中';
|
||||
case '1':
|
||||
return '已完成'
|
||||
return '已完成';
|
||||
default:
|
||||
return '未知状态'
|
||||
return '未知状态';
|
||||
}
|
||||
},
|
||||
searchReset() {
|
||||
|
|
@ -179,7 +213,7 @@ export default {
|
|||
this.$confirm('确定将选择数据删除?', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
type: 'warning'
|
||||
})
|
||||
.then(() => {
|
||||
return delTransferApplyApi(row.id);
|
||||
|
|
@ -188,7 +222,7 @@ export default {
|
|||
this.onLoad(this.page);
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '操作成功!',
|
||||
message: '操作成功!'
|
||||
});
|
||||
});
|
||||
},
|
||||
|
|
@ -207,23 +241,23 @@ export default {
|
|||
// 树数据过滤 - 支持无限层级转换
|
||||
convertToVueTree(data, level = 1) {
|
||||
if (!data || !Array.isArray(data)) {
|
||||
return []
|
||||
return [];
|
||||
}
|
||||
|
||||
return data.map(item => {
|
||||
const node = {
|
||||
id: item.deptId,
|
||||
label: item.deptName,
|
||||
}
|
||||
label: item.deptName
|
||||
};
|
||||
|
||||
if (item.children && Array.isArray(item.children) && item.children.length > 0) {
|
||||
if (level < 3) {
|
||||
const children = this.convertToVueTree(item.children, level + 1)
|
||||
if (children.length > 0) node.children = children
|
||||
const children = this.convertToVueTree(item.children, level + 1);
|
||||
if (children.length > 0) node.children = children;
|
||||
}
|
||||
}
|
||||
return node
|
||||
})
|
||||
return node;
|
||||
});
|
||||
},
|
||||
onLoad(page, params = {}) {
|
||||
this.loading = true;
|
||||
|
|
@ -241,8 +275,32 @@ export default {
|
|||
this.selectionClear();
|
||||
});
|
||||
},
|
||||
|
||||
handleTList(row) {
|
||||
this.recordListTitle = '移交清单';
|
||||
this.recordListRow = row;
|
||||
this.recordListJumpType = 'list';
|
||||
this.recordListVisible = true;
|
||||
},
|
||||
|
||||
handleTProgress(row) {
|
||||
this.recordListTitle = '移交进度';
|
||||
this.recordListRow = row;
|
||||
this.recordListJumpType = 'progress';
|
||||
this.recordListVisible = true;
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style></style>
|
||||
<style scoped>
|
||||
.clickable-status {
|
||||
color: #409eff;
|
||||
cursor: pointer;
|
||||
text-decoration: none;
|
||||
}
|
||||
.clickable-status:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
Loading…
Reference in New Issue