档案目录管理

This commit is contained in:
bb_pan 2025-09-09 18:51:52 +08:00
parent ee61dc7088
commit 83f84b8888
2 changed files with 313 additions and 253 deletions

View File

@ -0,0 +1,55 @@
import request from '@/utils/request'
// 获取档案目录树
export function getArchivalCatalogueTreeApi(params) {
return request({
url: '/smartArchives/archive/getArchivalCatalogueTree',
method: 'get',
params,
})
}
// 新增档案目录
export function addArchiveApi(data) {
return request({
url: '/smartArchives/archive',
method: 'post',
data,
})
}
// 修改档案目录
export function putArchiveApi(data) {
return request({
url: '/smartArchives/archive',
method: 'put',
data,
})
}
// 删除档案目录
export function delArchiveApi(data) {
return request({
url: '/smartArchives/archive',
method: 'delete',
data,
})
}
// 编辑-详情
export function getArchivalCatalogueByIdApi(params) {
return request({
url: '/smartArchives/archive/getArchivalCatalogueById',
method: 'get',
params
})
}
// 列表
export function getArchivalCatalogueListApi(params) {
return request({
url: '/smartArchives/archive/getArchivalCatalogue',
method: 'get',
params
})
}

View File

@ -14,7 +14,7 @@
"
>
<el-input
v-model="typeName"
v-model="contentName"
placeholder="请输入类型名称"
clearable
maxlength="50"
@ -64,7 +64,7 @@
v-if="isMousemoveId === data.id"
>
<el-button
v-if="data.level < 4"
v-if="data.level < 3"
type="text"
size="mini"
icon="el-icon-plus"
@ -103,10 +103,11 @@
:inline="true"
v-show="showSearch"
label-width="68px"
@submit.native.prevent
>
<el-form-item label="" prop="keyword">
<el-form-item label="" prop="contentName">
<el-input
v-model="queryParams.keyword"
v-model="queryParams.contentName"
placeholder="请输入类型名称"
clearable
style="width: 240px"
@ -176,36 +177,36 @@
<el-table-column
label="文件名称"
align="center"
key="fileName"
prop="fileName"
key="contentName"
prop="contentName"
show-overflow-tooltip
/>
<el-table-column
label="案卷期限"
align="center"
key="filePeriod"
prop="filePeriod"
key="term"
prop="term"
show-overflow-tooltip
/>
<el-table-column
label="档案标识代码"
align="center"
key="fileCode"
prop="fileCode"
key="markCode"
prop="markCode"
show-overflow-tooltip
/>
<el-table-column
label="所属专业"
align="center"
key="filePro"
prop="filePro"
key="major"
prop="major"
show-overflow-tooltip
/>
<el-table-column
label="文件分类标记"
align="center"
key="fileCategory"
prop="fileCategory"
key="classifyMark"
prop="classifyMark"
show-overflow-tooltip
/>
@ -296,25 +297,31 @@
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="分类名称" prop="typeName">
<el-form-item label="分类名称" prop="contentName">
<el-input
style="width: 100%"
v-model="addFormParams.typeName"
v-model="addFormParams.contentName"
placeholder="请输入"
clearable
/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="分类号" prop="classNumber">
<el-input
<el-form-item label="分类号" prop="sort">
<el-input-number
style="width: 100%"
v-model="addFormParams.classNumber"
v-model="addFormParams.sort"
placeholder="请输入"
clearable
:min="0"
:precision="0"
controls-position="right"
/>
</el-form-item>
</el-col>
</el-row>
<el-row style="text-align: right">
<el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button
size="small"
type="primary"
@ -322,12 +329,8 @@
@click="onSubmit"
> </el-button
>
<el-button size="small" @click="onCancel"
> </el-button
>
</el-form-item>
</el-row>
</el-form>
<el-button size="small" @click="onCancel"> </el-button>
</span>
</el-dialog>
<el-dialog
@ -336,70 +339,72 @@
width="50%"
:close-on-click-modal="false"
v-loading="loading"
:title="title"
>
<el-form
label-width="120px"
:model="addFormDetails"
:rules="addFormParamsRules"
:rules="addFormDetailsRules"
ref="formDetails"
:disabled="isView"
>
<el-form-item label="所属案卷" prop="caseFileName">
<el-form-item label="所属案卷" prop="parentName">
<el-input
v-model="addFormDetails.caseFileName"
v-model="addFormDetails.parentName"
placeholder="请输入所属案卷"
disabled
/>
</el-form-item>
<el-form-item label="文件题名" prop="fileName">
<el-form-item label="文件题名" prop="contentName">
<el-input
v-model="addFormDetails.fileName"
v-model="addFormDetails.contentName"
placeholder="请输入文件题名"
maxlength="100"
/>
</el-form-item>
<el-form-item label="保管期限" prop="filePeriod">
<el-form-item label="保管期限" prop="term">
<el-input
v-model="addFormDetails.filePeriod"
v-model="addFormDetails.term"
placeholder="请输入保管期限"
maxlength="100"
/>
</el-form-item>
<el-form-item label="归档责任单位" prop="archiveUnit">
<el-form-item label="归档责任单位" prop="unitName">
<el-input
v-model="addFormDetails.archiveUnit"
v-model="addFormDetails.unitName"
placeholder="请输入归档责任单位"
maxlength="100"
/>
</el-form-item>
<el-form-item label="所属专业" prop="filePro">
<el-form-item label="所属专业" prop="major">
<el-input
v-model="addFormDetails.filePro"
v-model="addFormDetails.major"
placeholder="请输入所属专业"
maxlength="100"
/>
</el-form-item>
<el-form-item label="档案标识代码" prop="fileCode">
<el-form-item label="档案标识代码" prop="markCode">
<el-select
v-model="addFormDetails.fileCode"
v-model="addFormDetails.markCode"
placeholder="请选择档案标识代码"
style="width: 100%"
>
<el-option
v-for="item in fileCodeList"
v-for="item in markCodeList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="文件分类标记" prop="fileCategory">
<el-form-item label="文件分类标记" prop="classifyMark">
<el-select
v-model="addFormDetails.fileCategory"
v-model="addFormDetails.classifyMark"
placeholder="请选择文件分类标记"
style="width: 100%"
>
<el-option
v-for="item in fileCategoryList"
v-for="item in classifyMarkList"
:key="item.value"
:label="item.label"
:value="item.value"
@ -407,6 +412,19 @@
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button
v-if="!isView"
size="small"
type="primary"
style="color: #fff"
@click="submitForm"
> </el-button
>
<el-button size="small" @click="dialogVisible = false">{{
isView ? '关 闭' : '取 消'
}}</el-button>
</span>
</el-dialog>
</div>
</template>
@ -414,102 +432,90 @@
<script>
import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import {
getArchivalCatalogueTreeApi,
addArchiveApi,
putArchiveApi,
delArchiveApi,
getArchivalCatalogueByIdApi,
getArchivalCatalogueListApi,
} from '@/api/archivesManagement'
export default {
name: 'Type',
name: 'ArchCatalogue',
components: { Treeselect },
data() {
return {
//
loading: false,
isSubmit: false,
//
showSearch: true,
//
typeName: undefined,
contentName: undefined,
//
treeOptions: [
{
id: 0,
label: '全部',
children: [
{
id: 1,
label: '一级分类',
children: [
{
id: 11,
label: '二级分类',
children: [
{
id: 111,
label: '三级分类',
level: 3,
children: [
{
id: 1111,
label: '四级分类',
level: 4,
},
],
},
],
level: 2,
},
],
level: 1,
},
],
level: 0,
},
],
treeOptions: [],
//
typeList: [
{
id: 1,
fileName: '文件名称1',
filePeriod: '2020-2025',
fileType: 'pdf',
fileCode: 'A123456',
filePro: '土建',
fileCategory: '合同类',
},
],
typeList: [],
total: 0,
levelTemp: undefined,
idTemp: undefined,
parentId: undefined,
defaultProps: {
children: 'children',
label: 'label',
label: 'contentName',
},
//
queryParams: {
pageNum: 1,
pageSize: 10,
typeName: undefined,
level: 0,
parentId: null,
contentName: null,
},
//
isAdd: true,
isView: false,
addFormDetails: {
caseFileId: '', //
caseFileName: '', //
fileName: '', //
filePeriod: '', //
archiveUnit: '', //
filePro: '', //
fileCode: '', //
fileCategory: '', //
parentId: '', // id
parentName: '', //
level: 4,
contentName: '', //
term: '', //
unitName: '', //
major: '', //
markCode: '', //
classifyMark: '', //
},
addFormDetailsRules: {
contentName: [
{
required: true,
message: '请输入文件题名',
trigger: 'blur',
},
fileCodeList: [
{ label: '普通文件', value: 1 },
{ label: '照片', value: 2 },
],
fileCategoryList: [
{ label: '合同类', value: 1 },
{ label: '归档类', value: 2 },
term: [
{
required: true,
message: '请输入保管期限',
trigger: 'blur',
},
],
unitName: [
{
required: true,
message: '请选择归档责任单位',
trigger: 'change',
},
],
major: [
{
required: true,
message: '请输入所属专业',
trigger: 'change',
},
],
},
markCodeList: [],
classifyMarkList: [],
title: '', //
dialogVisible: false,
/* 新增弹框等数据源定义 */
@ -518,9 +524,8 @@ export default {
addTitle: '', //
addFormParams: {
label: '',
typeName: '',
classNumber: '',
keeperUserId: '',
contentName: '',
sort: '',
},
addFormParamsRules: {
nodeId: [
@ -530,14 +535,14 @@ export default {
trigger: 'change',
},
],
typeName: [
contentName: [
{
required: true,
message: '名称不能为空',
trigger: 'blur',
},
],
classNumber: [
sort: [
{
required: true,
message: '分类号不能为空',
@ -552,106 +557,83 @@ export default {
},
watch: {
//
typeName(val) {
contentName(val) {
this.$refs.tree.filter(val)
},
},
created() {
// this.getTreeData()
// this.getKeeperData()
// this.getRepairerData()
// this.getList()
this.getTreeData()
},
methods: {
selectNode(value) {
console.log('选中节点--', value)
this.levelTemp = value.level
this.idTemp = value.id
this.parentId = value.parentId || null
selectNode(data) {
console.log('🚀 ~ selectNode ~ data:', data)
this.addFormParams.level = data.level + 1
this.addFormParams.parentId = data.id
},
normalizer(node) {
console.log('🚀 ~ normalizer ~ node:', node)
if (node.children && !node.children.length) {
delete node.children
}
return {
id: node.id,
label: node.label,
label: node.contentName,
children: node.children,
}
},
/** 查询新增页面-上级类型下拉树结构 */
getTreeData() {
getMaTypeList().then((response) => {
getArchivalCatalogueTreeApi().then((response) => {
this.treeOptions = response.data
console.log(this.treeOptions)
if (this.treeOptions.length > 0) {
if (
this.treeOptions[0].children &&
this.treeOptions[0].children.length > 0
) {
const firstNode = this.treeOptions[0].children[0]
this.queryParams.typeId = firstNode.id
this.queryParams.level = 1
this.queryParams.houseId = firstNode.houseId
this.getList()
} else {
this.queryParams.typeId = this.treeOptions[0].id
this.queryParams.level = 0
this.queryParams.houseId = this.treeOptions[0].id
this.getList()
}
}
console.log(
'🚀 ~ getTreeData ~ this.treeOptions:',
this.treeOptions,
)
})
},
/** 查询列表 */
getList() {
this.loading = true
getListByMaType(this.queryParams).then((response) => {
if (
response.code === 200 &&
response.data &&
response.data.rows
) {
this.typeList = response.data.rows
this.total = response.data.total
}
console.log('🚀 ~ getList ~ this.queryParams:', this.queryParams)
getArchivalCatalogueListApi(this.queryParams)
.then((res) => {
this.loading = false
if (!res.rows) return
this.typeList = res.rows || []
this.total = res.total || 0
})
.catch(() => {
this.loading = false
})
},
// -
filterNode(value, data) {
if (!value) return true
return data.label.indexOf(value) !== -1
return data.contentName.indexOf(value) !== -1
},
// -
async handleNodeClick(data, node) {
console.log('🚀 ~ handleNodeClick ~ data:', data)
this.nodeId = data.id
this.nodeName = data.label
if (data.level == 0) {
this.queryParams.typeId = data.id
this.queryParams.level = data.level
this.queryParams.houseId = data.id
} else {
this.queryParams.typeId = data.id
this.queryParams.level = data.level
this.queryParams.houseId = data.houseId
this.nodeId = data.level == 3 ? data.id : null
this.nodeName = data.level == 3 ? data.contentName : null
this.queryParams.parentId = data.level == 3 ? data.id : null
if (data.level == 3) {
this.getList()
}
},
/** 搜索按钮操作 */
handleQuery() {
// this.queryParams.pageNum = 1;
this.queryParams.pageNum = 1
this.queryParams.pageSize = 10
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm('queryForm')
this.queryParams.typeId = undefined
this.queryParams.pageNum = 1
this.queryParams.pageSize = 10
this.queryParams.level = 0
// this.$refs.tree.setCurrentKey(null)
// this.handleQuery()
this.getList()
},
//
handleView(row) {
@ -662,7 +644,7 @@ export default {
this.title = '查看卷内文件'
setTimeout(() => {
this.$refs.formDetails.resetFields()
this.addFormDetails = { ...row }
this.getInfo(row.id)
}, 300)
},
/** 新增按钮操作 */
@ -673,41 +655,69 @@ export default {
this.title = '新增卷内文件'
setTimeout(() => {
this.$refs.formDetails.resetFields()
this.addFormDetails.caseFileId = this.nodeId
this.addFormDetails.caseFileName = this.nodeName
console.log(
'🚀 ~ caseFileName:',
this.addFormDetails.caseFileName,
)
this.addFormDetails.parentId = this.nodeId
this.addFormDetails.parentName = this.nodeName
console.log('🚀 ~ parentName:', this.addFormDetails.parentName)
}, 300)
},
/** 修改按钮操作 */
handleUpdate(row) {
console.log('🚀 ~ handleUpdate ~ row:', row)
this.isAdd = false
this.isView = false
this.dialogVisible = true
this.title = '修改卷内文件'
setTimeout(() => {
this.$refs.formDetails.resetFields()
this.addFormDetails = { ...row }
this.getInfo(row.id)
}, 300)
},
/** 删除按钮操作 */
handleDelete(row) {
const typeId = row.typeId
this.$modal
.confirm('是否确认删除数据项?')
.then(function () {})
.then(() => {
.then(async () => {
try {
this.isLoading = true
await delArchiveApi({ id: row.id })
this.$modal.msgSuccess('删除成功')
} catch (error) {
console.log('🚀 ~ handleDelete ~ error:', error)
} finally {
this.isLoading = false
this.getList()
}
})
.catch(() => {})
},
/** 提交按钮 */
submitForm() {
console.log('提交---')
this.$refs['form'].validate((valid) => {
this.$refs['formDetails'].validate(async (valid) => {
if (!valid) return
try {
if (this.isSubmit) return
this.isSubmit = true
this.isLoading = true
const params = { ...this.addFormDetails }
console.log('🚀 ~ submitForm ~ params:', params)
if (this.isAdd) {
await addArchiveApi(params)
} else {
await putArchiveApi(params)
}
this.$message({
message: '添加成功',
type: 'success',
})
} catch (error) {
console.log('🚀 ~ submitForm ~ error:', error)
} finally {
this.isLoading = false
this.isSubmit = false
this.dialogVisible = false
this.getList()
}
})
},
/** 导出按钮作 */
@ -733,13 +743,22 @@ export default {
`导出_${currentTime}.xlsx`,
)
},
async getInfo(id) {
try {
const { data } = await getArchivalCatalogueByIdApi({ id })
this.addFormParams = { ...data }
this.addFormParams.label = data.parentName
this.addFormDetails = { ...data }
} catch (error) {
console.log('🚀 ~ getInfo ~ error:', error)
}
},
handleAddNewNode() {
this.isNew = true
this.addFormParams = {
label: '',
typeName: '',
classNumber: '',
keeperUserId: '',
contentName: '',
sort: '',
nodeId: null,
}
this.addTitle = '新增分类'
@ -747,38 +766,35 @@ export default {
},
/* 树节点增加 */
appendTreeNode(data) {
this.isNew = false
this.levelTemp = data.level
this.idTemp = data.id
console.log('dataAdd', data)
Object.assign(this.addFormParams, data)
this.addFormParams.typeName = ''
this.isNew = false
this.addFormParams.sort = null
this.addFormParams.contentName = ''
this.addFormParams.nodeId = data.id
this.addFormParams.level = data.level + 1
this.addFormParams.parentId = data.id
this.addFormParams.label = data.contentName || ''
console.log(
'🚀 ~ appendTreeNode ~ this.addFormParams:',
this.addFormParams,
)
this.addTitle = '新增分类'
this.addTitleVisible = true
},
/* 树节点修改 */
editTreeNode(data) {
this.isNew = false
console.log('🚀 ~ editTreeNode ~ data:', data)
this.levelTemp = data.level
console.log('🚀 ~ editTreeNode ~ this.levelTemp:', this.levelTemp)
this.idTemp = data.id
this.parentId = data.parentId
console.log('data', data)
Object.assign(this.addFormParams, data)
this.addTitle = '修改分类'
this.addFormParams.typeName = data.label
this.addTitleVisible = true
this.getInfo(data.id)
},
/* 树节点删除 */
removeTreeNode(data) {
// this.$message.success('--')
console.log(data, '删除时的数据源--')
const typeId = data.id
console.log('🚀 ~ removeTreeNode ~ data:', data)
this.$modal
.confirm('是否确认删除数据项?')
.then(function () {
// return delMaType(typeId)
return delArchiveApi({ id: data.id })
})
.then(() => {
this.$modal.msgSuccess('删除成功')
@ -788,51 +804,40 @@ export default {
},
/* 确定 */
onSubmit() {
const { id, typeName, classNumber, keeperUserId } =
this.addFormParams
console.log('level', this.levelTemp)
console.log('idTemp', this.idTemp)
const addParams = {
parentId: this.levelTemp == 0 ? 0 : this.idTemp,
typeName,
level: this.levelTemp,
houseId: this.levelTemp == 0 ? id : null,
classNumber,
}
console.log(
'🚀 ~ onSubmit ~ this.addFormParams:',
this.addFormParams,
)
const editParams = {
houseId: id,
typeName,
level: this.levelTemp,
parentId: this.parentId,
typeId: id,
classNumber,
keeperUserId,
const params = {
id: this.addFormParams.id || '',
parentId: this.addFormParams.parentId,
contentName: this.addFormParams.contentName,
sort: this.addFormParams.sort,
level: this.addFormParams.level,
}
this.$refs['addFormParamsRef'].validate(async (valid) => {
if (valid) {
if (this.addTitle === '新增') {
const res = await addMaType(addParams)
if (res.code === 200) {
try {
if (this.isSubmit) return
this.isSubmit = true
this.isLoading = true
if (this.addTitle === '新增分类') {
await addArchiveApi(params)
this.$message.success('新增成功!')
this.addTitleVisible = false
this.getList()
this.getTreeData()
}
} else {
let res = null
if (this.levelTemp == 0) {
res = await updatePartType(editParams)
} else {
res = await updateMaType(editParams)
}
if (res.code === 200) {
await putArchiveApi(params)
this.$message.success('修改成功!')
this.addTitleVisible = false
this.getList()
this.getTreeData()
}
} catch (error) {
console.log('🚀 ~ onSubmit ~ error:', error)
} finally {
this.isLoading = false
this.isSubmit = false
this.addTitleVisible = false
this.getTreeData()
// this.getList()
}
}
})