Browse Source

预归档库

master
xuhuajiao 3 months ago
parent
commit
e736f219de
  1. 10
      src/api/system/category/category.js
  2. 11
      src/api/system/fieldMate.js
  3. 11
      src/api/system/fileLibrary/fileLibrary.js
  4. 4
      src/assets/styles/prearchive-library.scss
  5. 4
      src/views/collectReorganizi/collectionLibrary/module/collectHeader.vue
  6. 4
      src/views/collectReorganizi/collectionLibrary/module/fileSeqAdjustment/index.vue
  7. 34
      src/views/components/category/PreviewForm.vue
  8. 18
      src/views/prearchiveLibrary/index.vue
  9. 59
      src/views/prearchiveLibrary/module/batchFile.vue
  10. 148
      src/views/prearchiveLibrary/module/moveFile.vue
  11. 85
      src/views/prearchiveLibrary/module/scope.vue
  12. 65
      src/views/prearchiveLibrary/treeList.vue

10
src/api/system/category/category.js

@ -130,4 +130,12 @@ export function FetchInitCategoryInputFieldByPid(params) {
})
}
export default { add, edit, del, FetchCategoryMenu, FetchInitCategoryField, FetchCategoryFieldManage, FetchUpardicSort, FetchInitCategoryFieldByPid, FetchInitCategoryInputFieldByPid }
export function FetchMenuByFondsId(params) {
return request({
url: 'api/category/menuByFondsId',
method: 'get',
params
})
}
export default { add, edit, del, FetchCategoryMenu, FetchInitCategoryField, FetchCategoryFieldManage, FetchUpardicSort, FetchInitCategoryFieldByPid, FetchInitCategoryInputFieldByPid, FetchMenuByFondsId }

11
src/api/system/fieldMate.js

@ -68,4 +68,13 @@ export function FetchDetailsByDocumentIdAndCategoryId(params) {
})
}
export default { add, edit, del, FetchInitFieldMateList, FetchCheckRepeat, FetchInitFieldMate, FetchMateByDocumentId, FetchDetailsByDocumentIdAndCategoryId }
// 新的 --- 根据预归档库获取对应规则
export function FetchMateByDocumentIdShow(params) {
return request({
url: 'api/fieldMate/getMateByDocumentIdShow',
method: 'get',
params
})
}
export default { add, edit, del, FetchInitFieldMateList, FetchCheckRepeat, FetchInitFieldMate, FetchMateByDocumentId, FetchDetailsByDocumentIdAndCategoryId, FetchMateByDocumentIdShow }

11
src/api/system/fileLibrary/fileLibrary.js

@ -78,4 +78,13 @@ export function FetchInitDocumentFieldByPid(params) {
})
}
export default { add, edit, del, sort, FetchDocumentMenu, FetchDocumentFieldManage, FetchInitDocumentFieldByPid }
// 获取预归档库菜单
export function FetchMenuPerpare(params) {
return request({
url: 'api/document/menu_perpare',
method: 'get',
params
})
}
export default { add, edit, del, sort, FetchDocumentMenu, FetchDocumentFieldManage, FetchInitDocumentFieldByPid, FetchMenuPerpare }

4
src/assets/styles/prearchive-library.scss

@ -4,7 +4,7 @@
.move-form{
::v-deep .el-dialog{
width: 828px;
width: 1000px;
}
.move-main{
display: flex;
@ -19,7 +19,7 @@
}
.move-right{
width:550px;
width:705px;
overflow: hidden;
h4{
position: relative;

4
src/views/collectReorganizi/collectionLibrary/module/collectHeader.vue

@ -300,7 +300,7 @@
:data="repeatData"
row-key="id"
>
<el-table-column label="所属门类" prop="createBy" />
<el-table-column label="所属门类" prop="categoryName" />
<el-table-column v-if="repeatResponseData.delcount === 0" label="所属位置" prop="collectFormal">
<template slot-scope="scope">
<div v-if="scope.row.collectFormal === 1">收集库</div>
@ -313,7 +313,7 @@
<div v-if="scope.row.isDeleteMan">回收站</div>
</template>
</el-table-column>
<el-table-column label="题名" prop="maintitle" />
<el-table-column label="题名" prop="maintitle" show-overflow-tooltip min-width="130" />
<el-table-column label="创建人" prop="createBy" />
<el-table-column label="创建时间" prop="createTime" align="center" width="160">
<template slot-scope="scope">

4
src/views/collectReorganizi/collectionLibrary/module/fileSeqAdjustment/index.vue

@ -143,15 +143,17 @@ export default {
this.btnLoading = true
const archivesIds = []
const sequences = []
this.sortTableData.map((value, index) => {
archivesIds.push(value.id)
sequences.push(index + 1)
sequences.push(this.form.number + index)
})
const params = {
'categoryId': this.categoryB,
'archivesIds': archivesIds,
'sequences': sequences
}
console.log('params', params)
FetchArchivesAdjust(params).then((res) => {
if (res !== 500) {
this.$message({ message: '保存成功', type: 'success', offset: 8 })

34
src/views/components/category/PreviewForm.vue

@ -4,7 +4,23 @@
<el-form ref="addOrUpdateForm" :model="addOrUpdateForm" :rules="rules" :validate-on-rule-change="false" label-width="125px">
<el-row :gutter="4" style="padding:0 20px">
<draggable v-bind="{draggable:'.drag-item',animation:500}" :disabled="!isDraggable" @update="datadragEnd">
<el-col v-for="(item,index) in formPreviewData" v-show="item.fieldName !== 'barcode' && item.fieldName !== 'is_entity'" :key="index" :class="['drag-item',item.fieldName === 'barcode'? 'barcode-input': (item.fieldName === 'fonds_no' && (isDesFormType === 'arcives' || isDesFormType === 'manageArcives') ? ((collectLevel ===1 || (isTitleType===3 && selectedCategory.arrangeType !== 1) || (isTitleType===4 && selectedCategory.arrangeType !== 2)) ? 'disabled-fonds-xm' : 'disabled-fonds') : '')]" :span="item.isLine || item.fieldName === 'barcode' ? 24 : 12">
<el-col
v-for="(item,index) in formPreviewData"
v-show="item.fieldName !== 'barcode' && item.fieldName !== 'is_entity'"
:key="index"
:class="[
'drag-item',
item.fieldName === 'barcode' ?
'barcode-input' :
(item.fieldName === 'fonds_no' && (isDesFormType === 'arcives' || isDesFormType === 'manageArcives')?
((collectLevel === 1 || (isTitleType === 3 && selectedCategory.arrangeType!== 1) || (isTitleType === 4 && selectedCategory.arrangeType!== 2))?
'disabled-fonds-xm' : 'disabled-fonds') :
(item.fieldName === 'fonds_no' && (isDesFormType === 'prearchiveLibrary' || isDesFormType === 'mergeFile')?
'disabled-fonds' : '')
)
]"
:span="item.isLine || item.fieldName === 'barcode' ? 24 : 12"
>
<el-form-item :label="item.fieldCnName" :prop="item.fieldName">
<!-- select :load-options="loadOptions"-->
<treeselect
@ -17,7 +33,7 @@
:flat="false"
:multiple="false"
:style="{ width: item.editLength+'px'}"
:disabled="isDisabled|| (item.fieldName === 'fonds_no' && (isDesFormType === 'arcives' || isDesFormType === 'manageArcives')) "
:disabled="isDisabled|| (item.fieldName === 'fonds_no' && isDesFormType !== 'category') "
:validate-event="!isDisabled"
no-options-text="无数据"
@select="selectTree"
@ -34,7 +50,7 @@
:rows="item.isInputClass === 'textarea' ? 3 : ''"
:class="{'input-popover':(item.isInputClass === 'popover')}"
:style="{ width: item.editLength+'px'}"
:disabled="isDisabled || (item.fieldName === 'archival_category_code') || (item.fieldName === 'fonds_no'&& (isDesFormType === 'arcives' || isDesFormType === 'manageArcives')) "
:disabled="isDisabled || (item.fieldName === 'archival_category_code') || (item.fieldName === 'fonds_no' && isDesFormType !== 'category') "
:validate-event="!isDisabled"
@mousewheel.native.prevent
@DOMMouseScroll.native.prevent
@ -719,7 +735,7 @@ export default {
// popover -
handleCurrentFieldName(item) {
this.currentFieldName = item.fieldName
if (item.fieldName === 'fonds_no' && (this.isDesFormType === 'arcives' || this.isDesFormType === 'manageArcives')) {
if (item.fieldName === 'fonds_no' && this.isDesFormType !== 'category') {
return false
}
this.getAllSubset(item)
@ -784,7 +800,7 @@ export default {
if (item.fieldName === 'is_entity') {
this.$set(this.addOrUpdateForm, item.fieldName, 1)
}
if (item.fieldName === 'fonds_no' && (this.isDesFormType === 'arcives' || this.isDesFormType === 'manageArcives')) {
if (item.fieldName === 'fonds_no' && this.isDesFormType !== 'category') {
this.$set(this.addOrUpdateForm, item.fieldName, this.selectedCategory.fondsNo)
}
const rule = {
@ -1000,8 +1016,10 @@ export default {
'documentId': categoryId,
'delMan': null,
'jsonString': JSON.stringify(this.addOrUpdateForm),
'fileJsonString': this.fileJsonString
'fileJsonString': this.fileJsonString,
'fondsAffiliation': this.selectedDocument.fondsId
}
console.log('params', params)
prearchEdit(params).then(res => {
if (res) {
this.$message({ message: res.message, type: 'success', offset: 8 })
@ -1014,7 +1032,7 @@ export default {
} else if (this.isDesFormType === 'mergeFile') {
//
const params = {
'fondsAffiliation': this.user.fonds.id.toString(),
'fondsAffiliation': this.selectedCategory.fondsId,
'archivesId': null,
'archivesIds': this.mergeFileArcIds,
'documentId': categoryId,
@ -1022,6 +1040,8 @@ export default {
'archivesNo': this.addOrUpdateForm.archive_no,
'jsonString': JSON.stringify(this.addOrUpdateForm)
}
console.log('合并成件this.selectedCategory', this.selectedCategory)
console.log('params', params)
FetchMergeToFile(params).then(res => {
if (res.code !== 500) {
this.$message({ message: res, type: 'success', offset: 8 })

18
src/views/prearchiveLibrary/index.vue

@ -89,6 +89,7 @@
:normalizer="normalizer"
flat
:multiple="false"
:default-expand-level="6"
placeholder="请选择档案门类"
@select="handleSelectCategory"
/>
@ -133,7 +134,7 @@
<script>
import CRUD, { presenter, header } from '@crud/crud'
import { preLibraryCrud } from './mixins/index'
import { FetchCategoryMenu, FetchInitCategoryInputFieldByPid } from '@/api/system/category/category'
import { FetchMenuByFondsId, FetchInitCategoryInputFieldByPid } from '@/api/system/category/category'
import PrearchiveCrud from '@/api/prearchiveLibrary/prearchiveLibrary'
import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
@ -218,6 +219,7 @@ export default {
methods: {
[CRUD.HOOK.beforeRefresh]() {
this.crud.query.documentId = this.selectedDocument.id
this.crud.query.fondsAffiliation = this.selectedDocument.fondsId
this.crud.query.sort = this.arrySort
},
formLoadingShow(loadingType) {
@ -292,7 +294,12 @@ export default {
})
},
handleFormMerge() {
console.log('this.selectedDocumentmMerge', this.selectedDocument)
this.selectedCategory = this.selectedCategoryMerge
this.selectedCategory.fondsId = this.selectedDocument.fondsId
this.selectedCategory.fondsNo = this.selectedDocument.fondsNo
console.log('this.selectedCategory', this.selectedCategory)
// let categoryLevel
// if (this.selectedCategoryMerge.arrangeType === 1) {
// categoryLevel = 3
@ -398,8 +405,12 @@ export default {
this.$refs.moveForm.moveArc = this.crud.selections
},
getCategoryDataTree() {
FetchCategoryMenu().then(res => {
const params = {
'fondsId': this.selectedDocument.fondsId
}
FetchMenuByFondsId(params).then(res => {
this.categoryTree = this.filterData(res)
console.log('this.categoryTree222', this.categoryTree)
})
},
handleSelectCategory(val) {
@ -430,4 +441,7 @@ export default {
</script>
<style lang='scss' scoped>
.preview-dialog .el-dialog .preview-content {
height: calc(100vh - 290px) !important;
}
</style>

59
src/views/prearchiveLibrary/module/batchFile.vue

@ -111,9 +111,9 @@
<script>
import { preLibraryCrud } from '../mixins/index'
import { FetchInitFieldMate, FetchMateByDocumentId, FetchDetailsByDocumentIdAndCategoryId } from '@/api/system/fieldMate'
import { FetchInitFieldMate, FetchMateByDocumentIdShow, FetchDetailsByDocumentIdAndCategoryId } from '@/api/system/fieldMate'
import { FetchInitDocumentFieldByPid } from '@/api/system/fileLibrary/fileLibrary'
import { FetchCategoryMenu, FetchInitCategoryFieldByPid } from '@/api/system/category/category'
import { FetchMenuByFondsId, FetchInitCategoryFieldByPid } from '@/api/system/category/category'
import { FetchArchivesScopeByCategoryId } from '@/api/system/archivesScope'
import { FetchCheckRepeat } from '@/api/system/fieldMate'
import { FetchBatchToFile } from '@/api/prearchiveLibrary/prearchiveLibrary'
@ -197,9 +197,10 @@ export default {
//
getMateByDocumentId() {
const params = {
'documentId': this.selectedDocument.id
'documentId': this.selectedDocument.id,
'fondsId': this.selectedDocument.fondsId
}
FetchMateByDocumentId(params).then(res => {
FetchMateByDocumentIdShow(params).then(res => {
this.rulesOptions = res.map(item => {
const json = {}
json.label = item.ruleName
@ -211,13 +212,31 @@ export default {
getInitDetail(id) {
FetchInitFieldMate({ 'id': id }).then((res) => {
this.selectedCategoryName = res.categoryName
this.batchCategory = res.fieldMateDetails[0].pid.categoryId
this.form.categoryId = res.fieldMateDetails[0].pid.categoryId.pid
this.getArchivesScopeByCategoryId()
const targetNode = this.findNodeWithId(this.categoryTree, this.form.categoryId)
this.batchCategory = targetNode
console.log(targetNode)
console.log('batchCategory', this.batchCategory)
}).catch(err => {
console.log(err)
})
},
findNodeWithId(tree, targetId) {
for (const node of tree) {
if (node.id === targetId) {
return node
}
if (node.children && node.children.length > 0) {
const result = this.findNodeWithId(node.children, targetId)
if (result) {
return result
}
}
}
return null
},
selectRules(val) {
this.getInitDetail(val)
this.selectStatus = []
@ -228,8 +247,12 @@ export default {
},
//
getCategoryDataTree() {
FetchCategoryMenu().then(res => {
const params = {
'fondsId': this.selectedDocument.fondsId
}
FetchMenuByFondsId(params).then(res => {
this.categoryTree = this.filterData(res)
console.log('this.categoryTree', this.categoryTree)
})
},
// pid
@ -252,6 +275,7 @@ export default {
//
this.rightLoading = true
FetchInitCategoryFieldByPid({ categoryId: categoryId, categoryLevel: 3, isType: 2 }).then((res) => {
console.log('this.allCorrField')
this.allCorrField = res.sort((a, b) => {
if (a.isInput !== b.isInput) {
return a.isInput ? -1 : 1
@ -262,15 +286,19 @@ export default {
res.forEach((item, index) => {
this.selectStatus.push({ mode: true, fiedType: 1, value: '', field: item, isInput: item.isInput })
})
console.log('his.selectStatus', this.selectStatus)
if (this.form.scope) {
const indexClass = res.findIndex(item => item.fieldName === 'archive_ctg_no')
console.log('indexClass', indexClass)
const indexRetention = res.findIndex(item => item.fieldName === 'retention')
console.log('indexRetention', indexRetention)
if (indexClass !== -1 && this.scopeSelection[0].archivesClass !== null) {
this.selectStatus.splice(indexClass, 1, { mode: false, fiedType: 2, value: this.scopeSelection[0].archivesClass.name, field: this.allCorrField[indexClass], isInput: this.allCorrField[indexClass].isInput })
}
if (indexRetention !== -1 && this.scopeSelection[0].retention !== '') {
this.selectStatus.splice(indexRetention, 1, { mode: false, fiedType: 2, value: this.scopeSelection[0].retention, field: this.allCorrField[indexRetention], isInput: this.allCorrField[indexRetention].isInput })
}
console.log('his.selectStatus222', this.selectStatus)
}
this.rightLoading = false
@ -289,16 +317,19 @@ export default {
res.forEach((item, index) => {
this.selectStatus.push({ mode: false, fiedType: item.categoryFieldId && item.categoryFieldId.isDefaultValue === '' ? 1 : 2, value: item.categoryFieldId && item.categoryFieldId.isDefaultValue === '' ? (item.documentFieldId && item.documentFieldId.fieldCnName) : item.categoryFieldId && item.categoryFieldId.isDefaultValue, field: item.documentFieldId, isInput: item.documentFieldId && item.documentFieldId.isInput })
})
console.log('this.selectStatus444444444', this.selectStatus)
if (this.form.scope) {
const indexClass = res.findIndex(item => item.categoryFieldId.fieldName === 'archive_ctg_no')
console.log('indexClass', indexClass)
const indexRetention = res.findIndex(item => item.categoryFieldId.fieldName === 'retention')
console.log('indexRetention', indexRetention)
if (indexClass !== -1 && this.scopeSelection[0].archivesClass !== null) {
this.selectStatus.splice(indexClass, 1, { mode: false, fiedType: 2, value: this.scopeSelection[0].archivesClass.name, field: this.allFieldData[indexClass].documentFieldId, isInput: this.allFieldData[indexClass].documentFieldId.isInput })
}
if (indexRetention !== -1 && this.scopeSelection[0].retention !== '') {
this.selectStatus.splice(indexRetention, 1, { mode: false, fiedType: 2, value: this.scopeSelection[0].retention, field: this.allFieldData[indexRetention].documentFieldId, isInput: this.allFieldData[indexRetention].documentFieldId.isInput })
}
console.log('his.selectStatus555555', this.selectStatus)
}
this.fieldLoading = false
@ -345,6 +376,7 @@ export default {
//
selectScope() {
this.$refs.scopeModule.scopeVisible = true
this.$refs.scopeModule.opened(this.selectedDocument)
this.$nextTick(() => {
if (this.form.categoryId) {
this.$refs.scopeModule.$refs.tree2.setCurrentKey(this.form.categoryId)
@ -477,10 +509,12 @@ export default {
}
const indices = getIndicesByMode(false)
console.log(indices)
console.log('allCorrField', this.allCorrField)
const filteredFields = indices.map(index => this.selectStatus[index])
const categoryCorrField = indices.map(index => this.allCorrField[index])
console.log('filteredFields', filteredFields)
console.log('categoryCorrField', categoryCorrField)
console.log('this.allFieldData', this.allFieldData)
let dtos
if (!this.isCorrField) {
@ -512,9 +546,15 @@ export default {
})
} else {
dtos = this.allFieldData.map((item, index) => {
if (this.selectStatus[index].fiedType === 2) {
console.log('this.selectStatus[index].field.fieldName', this.selectStatus[index])
console.log('this.selectStatus[index].field.fieldName', this.selectStatus[index].field.fieldName)
}
return {
'categoryValue': item.categoryFieldId.fieldName,
'documentValue': this.selectStatus[index].fiedType === 2 ? item.categoryFieldId.isDefaultValue : this.selectStatus[index].field.fieldName,
// 'documentValue': this.selectStatus[index].fiedType === 2 ? item.categoryFieldId.isDefaultValue : this.selectStatus[index].field.fieldName,
'documentValue': this.selectStatus[index].fiedType === 2 && this.selectStatus[index].value !== '' ? this.selectStatus[index].value : item.categoryFieldId.isDefaultValue,
'getType': this.selectStatus[index].fiedType,
'isRequired': item.categoryFieldId.isRequired
}
@ -524,7 +564,8 @@ export default {
return item.id
})
const params = {
'fondsAffiliation': this.user.fonds.id.toString(),
'archival_category_code': this.batchCategory.code,
'fondsAffiliation': this.selectedDocument.fondsId,
'archivesIds': archivesIds,
'documentId': this.selectedDocument.id,
'categoryId': this.form.categoryId,

148
src/views/prearchiveLibrary/module/moveFile.vue

@ -8,8 +8,7 @@
<div class="move-left">
<el-tree
ref="treeMove"
v-loading="crud.loading"
:data="crud.data"
:data="categoryTree"
node-key="id"
default-expand-all
:props="defaultProps"
@ -20,7 +19,7 @@
<div class="move-right">
<div style="padding: 10px;">
<el-input v-model="query.search" placeholder="输入题名或档号搜索" style="width: 200px;" />
<el-button class="filter-item filter-search" size="mini" type="success" icon="el-icon-search" @click="getViewTableList">搜索</el-button>
<el-button class="filter-item filter-search" size="mini" type="success" icon="el-icon-search" @click="getViewTableList('search')">搜索</el-button>
</div>
<div class="raido-main">
<!-- @select="handleSelect"
@ -39,6 +38,16 @@
@row-click="clickRowHandler"
>
<el-table-column type="selection" align="center" width="55" />
<el-table-column label="序号" width="55" align="center" show-overflow-tooltip>
<template slot-scope="scope">
<span>{{ (page.page === 1 ? 0 : (page.page === 0 ? 0 : page.page - 1)) * page.size + scope.$index + 1 }}</span>
</template>
</el-table-column>
<el-table-column :label="selectedCategoryMove.arrangeType === 1 ? '原文':'卷内'" prop="child" width="55" align="center">
<template slot-scope="scope">
{{ scope.row.child === '' ? 0 : scope.row.child }}
</template>
</el-table-column>
<el-table-column v-for="field in tableDisplayFields" :key="field.id" :label="field.fieldCnName" :align="field.displayformatType" :width="field.displayLength" show-overflow-tooltip>
<template slot="header">
<el-tooltip
@ -78,23 +87,15 @@
<script>
import { preLibraryCrud } from '../mixins/index'
import CRUD, { presenter, header, crud } from '@crud/crud'
import { FetchMove } from '@/api/prearchiveLibrary/prearchiveLibrary'
import { FetchMenuByFondsId } from '@/api/system/category/category'
import { FetchInitCategoryViewTable, FetchInitCategoryView } from '@/api/collect/collect'
import { FetchInitSearchFonds } from '@/api/archiveUtilize/archiveUtilize'
// import { FetchInitSearchFonds } from '@/api/archiveUtilize/archiveUtilize'
import Vue from 'vue'
export default {
name: 'MoveFile',
components: { },
cruds() {
return [
CRUD({
title: '移动', url: 'api/category/menu',
crudMethod: {}, sort: []
})
]
},
mixins: [presenter(), header(), crud(), preLibraryCrud],
mixins: [preLibraryCrud],
props: {
selectedDocument: {
type: Object,
@ -105,6 +106,7 @@ export default {
},
data() {
return {
categoryTree: [],
archivesBtnLoading: false,
selectedCategoryMove: {},
query: {
@ -135,35 +137,38 @@ export default {
getRowKey(row) {
return row.id
},
[CRUD.HOOK.afterRefresh]() {
this.crud.data = this.filterData(this.crud.data)
},
opened() {
this.refresh()
},
refresh() {
if (this.$refs.treeMove) {
let currentKey
if (this.crud.data[0].isType === 1) {
console.log(currentKey)
currentKey = this.findNode(this.crud.data[0].children, (node) => {
return node.isType !== 1
const params = {
'fondsId': this.selectedDocument.fondsId
}
FetchMenuByFondsId(params).then(res => {
this.categoryTree = this.filterData(res)
if (this.$refs.treeMove) {
let currentKey
console.log('this.categoryTree[0]', this.categoryTree[0])
if (this.categoryTree[0].isType === 1) {
currentKey = this.findNode(this.categoryTree[0].children, (node) => {
return node.isType !== 1
})
} else {
currentKey = this.categoryTree[0]
}
this.$nextTick(() => {
this.$refs.treeMove.setCurrentKey(currentKey.id)
const selectedKey = this.$refs.treeMove.getCurrentNode()
// if (this.$refs.treeMove.getNode(selectedKey) && this.$refs.treeMove.getNode(selectedKey).parent) {
// this.expandParents(this.$refs.treeMove.getNode(selectedKey).parent)
// }
//
this.handleMoveNodeClick(selectedKey)
})
} else {
currentKey = this.crud.data[0]
}
//
this.$refs.treeMove.setCurrentKey(currentKey.id)
this.$nextTick(() => {
//
const selectedKey = this.$refs.treeMove.getCurrentNode()
if (this.$refs.treeMove.getNode(selectedKey) && this.$refs.treeMove.getNode(selectedKey).parent) {
this.expandParents(this.$refs.treeMove.getNode(selectedKey).parent)
}
//
this.handleMoveNodeClick(selectedKey)
})
}
})
},
//
handleMoveNodeClick(val) {
@ -174,6 +179,7 @@ export default {
}
this.page.page = 1
this.page.size = 10
this.query.search = null
this.getViewTable()
}
},
@ -197,30 +203,55 @@ export default {
}
})
},
getViewTableList() {
getViewTableList(type) {
if (type === 'search') {
this.page.page = 1
}
this.tableData = []
this.loading = true
FetchInitSearchFonds().then(res => {
const allFondsIds = res.map(item => item.fondsId)
const params = {
'categoryId': this.selectedCategoryMove.id,
'categoryLevel': 3,
'ignore': true,
'isdel': false,
'collectFormal': 1,
'search': this.query.search,
'fonds_no': allFondsIds.join(','),
'page': this.page.page - 1,
'size': this.page.size
console.log('selectedCategoryMove', this.selectedCategoryMove)
// FetchInitSearchFonds().then(res => {
// const allFondsIds = res.map(item => item.fondsId)
// const params = {
// 'categoryId': this.selectedCategoryMove.id,
// 'categoryLevel': 3,
// 'ignore': true,
// 'isdel': false,
// 'collectFormal': 1,
// 'search': this.query.search,
// 'fonds_no': allFondsIds.join(','),
// 'page': this.page.page - 1,
// 'size': this.page.size
// }
// FetchInitCategoryView(params).then((res) => {
// console.log(res)
// if (res.code !== 500) {
// this.tableData = res.list.content
// this.page.total = res.list.totalElements
// }
// this.loading = false
// })
// })
const params = {
'categoryId': this.selectedCategoryMove.id,
'categoryLevel': 3,
'ignore': true,
'isdel': false,
'collectFormal': 1,
'search': this.query.search,
'fonds_no': this.selectedDocument.fondsId,
'page': this.page.page - 1,
'size': this.page.size,
'sort': this.arrySort
}
FetchInitCategoryView(params).then((res) => {
console.log(res)
if (res.code !== 500) {
this.tableData = res.list.content
this.page.total = res.list.totalElements
}
FetchInitCategoryView(params).then((res) => {
console.log(res)
if (res.code !== 500) {
this.tableData = res.list.content
this.page.total = res.list.totalElements
}
this.loading = false
})
this.loading = false
})
},
getFonds() {
@ -284,7 +315,6 @@ export default {
<style lang="scss" scoped>
@import "~@/assets/styles/prearchive-library.scss";
.el-pagination{
padding-right: 5px;
margin: 25px 0 !important;

85
src/views/prearchiveLibrary/module/scope.vue

@ -7,11 +7,11 @@
<div class="move-main">
<div class="move-left">
<!--门类树状结构-->
<!-- v-loading="loadingTree" -->
<div class="tree-scroll">
<el-tree
ref="tree2"
v-loading="crud.loading"
:data="crud.data"
:data="categoryTree"
node-key="id"
default-expand-all
:props="defaultProps"
@ -64,26 +64,28 @@
<script>
import { preLibraryCrud } from '../mixins/index'
import { FetchMenuByFondsId } from '@/api/system/category/category'
import { FetchInitArchivesScope, FetchSonArchivesScope } from '@/api/system/archivesScope'
import CRUD, { presenter, header, crud } from '@crud/crud'
import Vue from 'vue'
// import Vue from 'vue'
export default {
name: 'ScopeModule',
components: { },
cruds() {
return [
CRUD({
title: '归档范围', url: 'api/category/menu',
crudMethod: {}, sort: []
})
]
},
mixins: [presenter(), header(), crud(), preLibraryCrud],
// cruds() {
// return [
// CRUD({
// title: '', url: 'api/category/menuByFondsId',
// crudMethod: {}, sort: []
// })
// ]
// },
mixins: [preLibraryCrud],
data() {
return {
scopeVisible: false,
selectedCategory: null,
loading: false,
loadingTree: false,
categoryTree: [],
tableData: [],
selections: [],
defaultProps: { children: 'children', label: 'cnName' }
@ -98,30 +100,37 @@ export default {
getRowKey(row) {
return row.id
},
[CRUD.HOOK.afterRefresh]() {
this.crud.data = this.filterData(this.crud.data)
this.$nextTick(() => {
if (this.$refs.tree2) {
let currentKey
if (this.crud.data[0].isType === 1) {
currentKey = this.findNode(this.crud.data[0].children, (node) => {
return node.isType !== 1
opened(selectedDocument) {
console.log('selectedDocument444', selectedDocument)
const params = {
'fondsId': selectedDocument.fondsId
}
FetchMenuByFondsId(params).then(res => {
this.categoryTree = this.filterData(res)
this.$nextTick(() => {
if (this.$refs.tree2) {
let currentKey
if (this.categoryTree[0].isType === 1) {
currentKey = this.findNode(this.categoryTree[0].children, (node) => {
return node.isType !== 1
})
} else {
currentKey = this.categoryTree[0]
}
this.$nextTick(() => {
//
this.$refs.tree2.setCurrentKey(currentKey.id)
//
const selectedKey = this.$refs.tree2.getCurrentNode()
if (this.$refs.tree2.getNode(selectedKey) && this.$refs.tree2.getNode(selectedKey).parent) {
this.expandParents(this.$refs.tree2.getNode(selectedKey).parent)
}
//
this.handleNodeClick2(selectedKey)
})
} else {
currentKey = this.crud.data[0]
}
//
this.$refs.tree2.setCurrentKey(currentKey.id)
this.$nextTick(() => {
//
const selectedKey = this.$refs.tree2.getCurrentNode()
if (this.$refs.tree2.getNode(selectedKey) && this.$refs.tree2.getNode(selectedKey).parent) {
this.expandParents(this.$refs.tree2.getNode(selectedKey).parent)
}
//
this.handleNodeClick2(selectedKey)
})
}
})
})
},
//
@ -130,9 +139,9 @@ export default {
console.log('handleNodeClick233', val.isType)
if (val) {
this.selectedCategory = val
if (val.pid !== '0') {
Vue.set(this.selectedCategory, 'parentName', this.$refs.tree2.getNode(val.pid).data.cnName)
}
// if (val.pid !== '0') {
// Vue.set(this.selectedCategory, 'parentName', this.$refs.tree2.getNode(val.pid).data.cnName)
// }
this.loading = true
this.getInitArchivesScope(this.selectedCategory)
}

65
src/views/prearchiveLibrary/treeList.vue

@ -5,13 +5,13 @@
<span class="left-bottom-line" />
<!--门类树状结构-->
<div class="tree-scroll">
<el-tree ref="tree" v-loading="crud.loading" :data="crud.data" :props="defaultProps" node-key="id" :expand-on-click-node="false" highlight-current @node-click="handleNodeClick">
<el-tree ref="tree" v-loading="crud.loading" :data="crud.data" :props="defaultProps" node-key="keyId" :expand-on-click-node="false" highlight-current default-expand-all @node-click="handleNodeClick">
<span slot-scope="{ node, data }" class="custom-tree-node">
<span v-if="data.isType === 1 " class="iconFolder">
{{ data.cnName }}
{{ data.label }}
</span>
<span v-if="data.isType === 2" class="iconFile">
{{ data.cnName }}
{{ data.label }}
</span>
</span>
</el-tree>
@ -22,6 +22,7 @@
<script>
import CRUD, { presenter, header } from '@crud/crud'
import { preLibraryCrud } from './mixins/index'
import { mapGetters } from 'vuex'
export default {
name: 'PrearchiveTree',
@ -29,7 +30,7 @@ export default {
cruds() {
return [
CRUD({
title: '预归档库', url: 'api/document/menu',
title: '预归档库', url: 'api/document/menu_perpare',
crudMethod: { },
optShow: {
add: false,
@ -58,39 +59,55 @@ export default {
}
},
computed: {
...mapGetters([
'user'
])
},
created() {
},
methods: {
[CRUD.HOOK.beforeToAdd](crud, form, btn) {
[CRUD.HOOK.beforeRefresh](crud) {
this.crud.query.page = null
this.crud.query.size = null
this.crud.query.fondsId = this.user.fonds.id
const ids = this.user.roles.map(item => { return item.id })
this.crud.query.roleIds = ids.join(',')
},
[CRUD.HOOK.afterRefresh]() {
this.crud.data = this.filterData(this.crud.data)
this.$nextTick(() => {
let currentKey
if (this.crud.data[0].isType === 1) {
currentKey = this.findNode(this.crud.data[0].children, (node) => {
return node.isType !== 1
this.crud.data = this.crud.data.map((item, index) => {
const newItem = {
...item.fonds,
keyId: item.fonds.fonds_id,
isType: 1,
label: item.fonds.fonds_name,
children: item.document.map((doc, childIndex) => {
// id
const uniqueChildId = `${item.fonds.fonds_id}_${doc.id}_${childIndex}`
return {
...doc,
keyId: uniqueChildId,
fondsId: item.fonds.fonds_id,
fondsNo: item.fonds.fonds_no,
label: doc.cnName
}
})
} else {
currentKey = this.crud.data[0]
}
//
this.$refs.tree.setCurrentKey(currentKey.id)
this.$nextTick(() => {
//
const selectedKey = this.$refs.tree.getCurrentNode()
if (this.$refs.tree.getNode(selectedKey) && this.$refs.tree.getNode(selectedKey).parent) {
this.expandParents(this.$refs.tree.getNode(selectedKey).parent)
return newItem
})
this.$nextTick(() => {
if (this.crud.data.length > 0 && this.crud.data[0].children && this.crud.data[0].children.length > 0) {
const targetNode = this.crud.data[0].children[0]
const node = this.$refs.tree.getNode(targetNode.keyId)
if (node) {
this.$refs.tree.setCurrentKey(targetNode.keyId)
this.handleNodeClick(node.data)
}
//
this.handleNodeClick(selectedKey)
})
}
})
},
//
handleNodeClick(val) {
console.log('val', val)
if (val) {
this.$emit('nodeClick', val)
}

Loading…
Cancel
Save