This commit is contained in:
liang.chao 2025-12-02 16:44:16 +08:00
parent f895483925
commit 4f2d4d8a6a
6 changed files with 409 additions and 1 deletions

View File

@ -70,6 +70,28 @@ export function updateFileManageRightApi(data) {
}
})
}
// 加入整改
export function addRectification(data) {
return request({
url: '/blade-system/fileManage/addRectification',
method: 'post',
data:data,
})
}
export function selectRectificationListApi(data) {
return request({
url: '/blade-system/fileManage/selectRectificationList',
method: 'post',
data:data,
})
}
export function updateRectificationApi(data) {
return request({
url: '/blade-system/fileManage/selectRectificationList',
method: 'post',
data:data,
})
}
// 删除档案目录
export function delFileManageApi(data) {

View File

@ -116,4 +116,11 @@ export default [
title: '移交详情'
}
},
{
path: '/fileManager/rectificationList',
name: 'RectificationList',
component: () => import('@/views/fileManager/components/rectificationList.vue'),
meta: { title: '整改清单' }
}
];

View File

@ -0,0 +1,125 @@
<template>
<el-dialog
v-model="dialogVisible"
:title="title"
:show-close="true"
:close-on-click-modal="false"
@close="handleClose"
:append-to-body="true"
width="600px"
>
<div>
<el-form :model="form" :rules="rules" ref="ruleFormRef" label-width="110px">
<el-form-item label="档案文件">
<el-input
type="textarea"
class="form-item"
:value="belongName"
:disabled="true"
></el-input>
</el-form-item>
<el-form-item label="整改描述" prop="description">
<el-input
type="textarea"
class="form-item"
v-model="form.description"
clearable
show-word-limit
placeholder="请输入整改描述"
maxlength="64"
></el-input>
</el-form-item>
</el-form>
</div>
<template #footer>
<span class="dialog-footer">
<el-button @click="handleClose">取消</el-button>
<el-button type="primary" @click="submitForm">确认</el-button>
</span>
</template>
</el-dialog>
</template>
<script setup>
import { ref, reactive, onMounted } from 'vue'
import { ElMessage, ElLoading } from 'element-plus'
import { addRectification} from '@/api/archivesManagement/fileManager/fileManager.js'
const props = defineProps({
title: { type: String, default: '编辑档案' },
rowData: { type: Object, required: true },
projectId: { type: String, required: true }
})
const emit = defineEmits(['closeDialog', 'handleQuery'])
const dialogVisible = ref(true)
const form = reactive({
id: null,
description: '',
proId: null
})
const belongName = ref('')
const ruleFormRef = ref()
const rules = reactive({
description: [{ required: true, message: '整改描述不能为空', trigger: 'blur' }]
})
// 使 props
const initFormData = () => {
belongName.value = props.rowData.belongName || ''
form.fileId = props.rowData.fileId
form.description = props.rowData.description || ''
form.proId = props.projectId
}
const handleClose = () => {
dialogVisible.value = false
emit('closeDialog')
}
const submitForm = async () => {
try {
await ruleFormRef.value.validate()
} catch {
return
}
const loading = ElLoading.service({
lock: true,
text: '保存中...',
background: 'rgba(0,0,0,0.5)'
})
try {
const res = await addRectification({
fileId: form.fileId,
description: form.description.trim(),
proId: form.proId })
if (res.data.code === 200) {
ElMessage.success('加入成功')
emit('handleQuery')
handleClose()
} else {
ElMessage.error(res.data.msg || '修改失败')
}
} finally {
loading.close()
}
}
onMounted(() => {
initFormData()
})
</script>
<style scoped>
.form-item {
width: 100%;
}
</style>

View File

@ -0,0 +1,205 @@
<template>
<div class="rectification-list">
<el-card>
<template #header>
<div class="card-header">
<span>整改清单</span>
<el-button size="small" @click="goBack">返回</el-button>
</div>
</template>
<!-- 表格已移除详情按钮 -->
<avue-crud
:data="tableData"
:page="page"
:table-loading="loading"
:option="option"
addBtn: false
@on-load="onLoad"
@refresh-change="onLoad"
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
@row-click="handleEdit"
/>
</el-card>
<!-- 编辑弹窗 -->
<el-dialog
v-model="dialogVisible"
title="编辑整改内容"
width="500px"
@close="closeDialog"
>
<avue-form
ref="formRef"
:option="editOption"
v-model="formData"
:rules="rules"
/>
<template #footer>
<el-button @click="closeDialog">取消</el-button>
<el-button type="primary" @click="submitEdit" :loading="submitLoading">保存</el-button>
</template>
</el-dialog>
</div>
</template>
<script setup>
import { ref, reactive, onMounted } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { ElMessage } from 'element-plus'
import { selectRectificationListApi, updateRectificationApi } from '@/api/archivesManagement/fileManager/fileManager.js'
const route = useRoute()
const router = useRouter()
//
const projectId = route.query.projectId
const loading = ref(false)
const tableData = ref([])
const page = reactive({
currentPage: 1,
pageSize: 10,
total: 0
})
// #menu
const option = reactive({
height: 'auto',
index: true,
border: true,
addBtn: false,
editBtn: false,
delBtn: false,
viewBtn: false,
menu: false, // 👈
column: [
{ label: '项目名称', },
{ label: '单项工程名称', prop: 'singleProName' },
{ label: '档案名称', prop: 'contentName'},
{ label: '整改内容', prop: 'description', sortable: true }
]
})
//
const onLoad = async (pageParam = page) => {
if (!projectId) {
ElMessage.error('缺少必要参数')
return
}
loading.value = true
try {
const res = await selectRectificationListApi({
proId: projectId,
pageNum: pageParam.currentPage,
pageSize: pageParam.pageSize
})
if (res.data.code === 200) {
tableData.value = res.data.rows || []
page.total = res.data.total || 0
} else {
ElMessage.error(res.data.msg || '加载失败')
}
} catch (error) {
ElMessage.error('网络错误')
console.error(error)
} finally {
loading.value = false
}
}
//
const handleCurrentChange = (val) => {
page.currentPage = val
onLoad()
}
const handleSizeChange = (val) => {
page.pageSize = val
onLoad()
}
//
const goBack = () => {
router.go(-1)
}
// ================== ==================
const dialogVisible = ref(false)
const formData = ref({})
const submitLoading = ref(false)
const formRef = ref()
//
const editOption = reactive({
labelWidth: 100,
column: [
{
label: '档案名称',
prop: 'contentName',
disabled: true, // 👈
placeholder: '档案名称'
},
{
label: '整改内容',
prop: 'description',
type: 'textarea',
rows: 4,
placeholder: '请输入整改内容'
}
]
})
const rules = {
description: [{ required: true, message: '请输入整改内容', trigger: 'blur' }]
}
//
const handleEdit = (row) => {
formData.value = {
id: row.id,
contentName: row.contentName,
description: row.description
}
dialogVisible.value = true
}
//
const closeDialog = () => {
dialogVisible.value = false
formData.value = {}
}
//
const submitEdit = async () => {
await formRef.value.validate()
submitLoading.value = true
try {
const res = await updateRectificationApi(formData.value)
if (res.data.code === 200) {
ElMessage.success('保存成功')
closeDialog()
onLoad() //
} else {
ElMessage.error(res.data.msg || '保存失败')
}
} catch (error) {
ElMessage.error('网络错误')
} finally {
submitLoading.value = false
}
}
//
onMounted(() => {
onLoad()
})
</script>
<style scoped>
.card-header {
display: flex;
justify-content: space-between;
align-items: center;
}
</style>

View File

@ -19,6 +19,16 @@
@click="handleAdd" :disabled="addBtnIsShow" v-if="fileStatus === '0'">
新增
</el-button>
<!-- 整改清单按钮跳转页面 -->
<el-button
plain
size="small"
type="warning"
icon="List"
@click="goToRectificationList"
>
整改清单
</el-button>
</template>
<template #fileName="{ row }">
@ -43,6 +53,14 @@
@click="handleUpdate(row)"
v-hasPermi="['file:manage:update']"
>修改</el-button>
<el-button
v-if="row.isRectification === '0'"
:size="size"
type="primary"
link
icon="Plus"
@click="handleRect(row)"
>加入整改</el-button>
<el-button
:size="size"
type="danger"
@ -57,6 +75,9 @@
<!-- 新增/编辑 -->
<AddTableData v-if="isflag" :isAdd="isAdd" :rowData="row" @handleQuery="handleQuery" :title="title"
@closeDialog="closeDialog" @showColose="showColose" :dataForm="row" :width="600" :projectId="projectId" />
<!-- 整改 -->
<RectTableData v-if="isflagRect" :isRect="isRect" :rowData="row" @handleQuery="handleQuery" :title="title"
@closeDialog="closeDialog" @showColose="showColose" :dataForm="row" :width="600" :projectId="projectId" />
<!-- 预览文件 -->
<ViewFile v-if="isViewflag" :rowData="row" :title="title" :isAdd="isAdd" @closeDialog="closeDialog"
@ -66,6 +87,8 @@
</template>
<script setup>
import { useRouter } from 'vue-router'
const router = useRouter()
import { ref, reactive, watch, nextTick } from 'vue'
import { ElLoading, ElMessage, ElMessageBox } from 'element-plus';
import { Plus, View, Edit, Delete } from '@element-plus/icons-vue'
@ -75,6 +98,7 @@ import {
getFileManageApi,
} from '@/api/archivesManagement/fileManager/fileManager.js'
import AddTableData from './addTableData.vue'
import RectTableData from './rectTableData.vue'
import ViewFile from '@/views/viewFile/viewFile.vue'
const props = defineProps({
@ -92,11 +116,27 @@ const props = defineProps({
}
})
const goToRectificationList = () => {
if (!props.projectId) {
ElMessage.warning('项目异常,请联系管理员')
return
}
// projectId
router.push({
name: 'RectificationList', //
query: {
projectId: props.projectId
}
})
}
//
const title = ref("")
const isflag = ref(false)
const isflagRect = ref(false)
const isViewflag = ref(false)
const isAdd = ref('')
const isRect = ref('')
const row = ref({})
const loading = ref(false)
const addBtnIsShow = ref(true)
@ -168,6 +208,7 @@ const option = reactive({
//
const closeDialog = () => {
isflag.value = false
isflagRect.value = false
isViewflag.value = false
}
@ -203,6 +244,14 @@ const handleUpdate = (rowData) => {
row.value.detailStatus = false
isflag.value = true
}
const handleRect = (rowData) => {
title.value = "加入整改清单"
isRect.value = 'rect'
row.value = rowData
row.value.belongName = props.selectedNode.parentName + '/' + props.selectedNode.label + '/' + row.value.fileName
row.value.detailStatus = false
isflagRect.value = true
}
//
const viewFile = (rowData) => {

View File

@ -6,7 +6,7 @@
<el-button type="warning" plain icon="Bottom" size="small" @click="handleFileExtract"
v-if="fileStatus === '0' && !integrityStatus">档案同步</el-button>
<el-button type="success" plain icon="Finished" size="small" @click="moveListConfirm"
v-if="fileStatus === '0' && !integrityStatus">移交清单确认</el-button>
v-if="fileStatus === '0' && !integrityStatus">发起归档</el-button>
<el-button type="success" plain icon="Finished" size="small" @click="handleIntegrityStatus"
v-if="fileStatus === '0' && integrityStatus">完整性确认</el-button>
<el-button type="danger" plain icon="Close" size="small" @click="handleClose">返回</el-button>