阅行客电子档案
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

1178 lines
48 KiB

<template>
<div>
<div class="collect-header">
<h4 :class="classType">{{ collectTitle }} </h4>
<div class="collect-filter">
<treeselect
v-if="selectedCategory.arrangeType === 3 && isTitleType !== 4 && isTitleType !== 6 && activeIndex !== 1"
v-model="query.project_class"
:options="projectOptions"
style="width: 180px;"
flat
:multiple="false"
:normalizer="normalizerProject"
placeholder="请选择"
@input="handleSearch(collectLevel)"
@select="handleSearch(collectLevel)"
/>
<treeselect
v-if="isTitleType !== 6"
v-model="query.archive_ctg_no"
:options="classifyOptions"
style="width: 180px;"
flat
:multiple="false"
:normalizer="normalizer"
placeholder="请选择档案分类"
@input="handleSearch(collectLevel)"
@select="handleSearch(collectLevel)"
/>
</div>
<div v-if="isTitleType !== 6" class="head-search">
<!-- 搜索 -->
<el-input v-model="query.search" clearable size="small" :placeholder="placeholderType" prefix-icon="el-icon-search" style="width: 200px;" class="filter-item" @keyup.enter.native="handleSearch(collectLevel)" @clear="handleSearch(collectLevel)" />
<el-button class="filter-item filter-search" size="mini" type="success" icon="el-icon-search" @click="handleSearch(collectLevel)">搜索</el-button>
<el-button class="filter-item filter-refresh" size="mini" type="warning" icon="el-icon-refresh-left" @click="resetQuery">重置</el-button>
</div>
<div v-if="!isRecycle" class="collect-menu">
<el-menu
:default-active="activeMenuIndex"
mode="horizontal"
@select="handleSelect"
>
<el-submenu index="1">
<template slot="title">
<i class="iconfont icon-changgui" />
<span>常规</span>
</template>
<el-menu-item-group class="collect-submenu-group">
<el-menu-item v-if="isTitleType !== 6" index="1-1" @click="handleForm('add',0)">新增</el-menu-item>
<el-menu-item v-if="isTitleType !== 6" index="1-2" @click="handleForm('edit',0)">编辑</el-menu-item>
<el-menu-item v-if="isTitleType !== 4" index="1-3" @click="toDelete">删除</el-menu-item>
<el-menu-item v-if="isTitleType === 4" index="1-4" @click="toMove">移出</el-menu-item>
</el-menu-item-group>
<el-menu-item-group v-if="(isTitleType === 3 && selectedCategory.arrangeType === 1) || isTitleType === 4 || isTitleType === 6 || (isTitleType === 3 && activeIndex === 1)" class="collect-submenu-group submenu-tree">
<template slot="title">原文上传</template>
<el-menu-item index="1-5" @click="fileUpload(0)">普通上传</el-menu-item>
<el-menu-item index="1-6" @click="fileUpload(1)">大文件上传</el-menu-item>
</el-menu-item-group>
</el-submenu>
<el-submenu v-if="isTitleType !== 6" index="2">
<template slot="title">
<i class="iconfont icon-zhengli" />
<span>整理</span>
</template>
<el-menu-item-group class="collect-submenu-group">
<el-menu-item v-if="isTitleType !== 2" index="2-1" @click="handleBlukImport">批量导入</el-menu-item>
<!-- 项目 / 案卷 / 卷内 / 文件-->
<el-menu-item v-if="activeIndex !== 1 || (isTitleType === 3 && selectedCategory.arrangeType === 1 && activeIndex === 1)" index="2-2" @click="handleBlukEditing">批量修改</el-menu-item>
<el-menu-item v-if="isTitleType === 3 && activeIndex === 0 && selectedCategory.arrangeType !== 1" index="2-3" @click="handleJnSeqAdjustment('anjuan')">案卷顺序调整</el-menu-item>
<el-menu-item v-if="isTitleType === 3 && activeIndex === 0 && selectedCategory.arrangeType !== 1 " index="2-12" @click="handleJnSeqAdjustment('juannei')">卷内顺序调整</el-menu-item>
<el-menu-item v-if="isTitleType === 3 && selectedCategory.arrangeType === 1" index="2-3" @click="handleJnSeqAdjustment('file')">文件顺序调整</el-menu-item>
<el-menu-item v-if="isTitleType !== 2 && !(isTitleType === 3 && (selectedCategory.arrangeType === 1|| selectedCategory.arrangeType === 2) && activeIndex === 1) && isTitleType !== 4" index="2-4" @click="handleFileNumberUpdate(0)">档号更新</el-menu-item>
<!-- 案卷 -->
<el-menu-item v-if="isTitleType === 3 && activeIndex === 0 && selectedCategory.arrangeType !== 1 " index="2-5" @click="handleFileNumberUpdate(1)">卷内档号更新</el-menu-item>
<el-menu-item v-if="isTitleType === 3 && activeIndex === 0 && selectedCategory.arrangeType !== 1" index="2-6" @click="handleUncoil">拆卷</el-menu-item>
<el-menu-item v-if="isTitleType === 3 && activeIndex === 0 && selectedCategory.arrangeType !== 1" index="2-7" @click="handleCombineFile">合卷</el-menu-item>
<el-menu-item v-if="isTitleType === 3 && selectedCategory.arrangeType !== 1" index="2-8" @click="handleInsertFile">插件</el-menu-item>
<!-- 案卷 / 卷内 / 文件 -->
<el-menu-item v-if="isTitleType !== 2" index="2-9" @click="handleCollectMoveFile">移动</el-menu-item>
<!-- 案卷 -->
<el-menu-item v-if="isTitleType === 3 && activeIndex === 0" index="2-10" @click="handleFiling">归档</el-menu-item>
<!-- 文件 -->
<el-menu-item v-if="(isTitleType === 3 && selectedCategory.arrangeType === 1) || (isTitleType === 3 && activeIndex === 1)" index="2-11" @click="handleReturn">退回预归档库</el-menu-item>
</el-menu-item-group>
<el-menu-item-group v-if="isTitleType === 3 && activeIndex === 1 && selectedCategory.arrangeType !== 1" class="collect-submenu-group submenu-tree">
<template slot="title">组卷</template>
<el-menu-item index="2-12" @click="handleQuickPaper">快速组卷</el-menu-item>
<el-menu-item index="2-13" @click="handlePaper">手工组卷</el-menu-item>
</el-menu-item-group>
</el-submenu>
<el-submenu index="3">
<template slot="title">
<i class="iconfont icon-gengduo" />
<span>更多</span>
</template>
<el-menu-item-group class="collect-submenu-group">
<el-menu-item v-if="isTitleType !== 6" index="3-1" @click="handleExport">导出</el-menu-item>
<el-menu-item v-if="!(isTitleType === 3 && (selectedCategory.arrangeType === 3 || selectedCategory.arrangeType === 2) && activeIndex === 1) && (isTitleType !== 2 && isTitleType !== 6)" index="3-2" @click="handlePrint">打印</el-menu-item>
<el-menu-item v-if="!(isTitleType === 3 && (selectedCategory.arrangeType === 3 || selectedCategory.arrangeType === 2) && activeIndex === 1) && (isTitleType !== 2 && isTitleType !== 6) && isTitleType !== 4" index="3-3" @click="handleFourTest">四性检测</el-menu-item>
<el-menu-item v-if="isTitleType === 6" index="3-4" @click="handleOriginalDownload">下载</el-menu-item>
</el-menu-item-group>
<el-menu-item-group v-if="!(isTitleType === 3 && (selectedCategory.arrangeType === 3 || selectedCategory.arrangeType === 2) && activeIndex === 1) && (isTitleType !== 2 && isTitleType !== 4 && isTitleType !== 6)" class="collect-submenu-group submenu-tree">
<template slot="title">电子文件目录</template>
<el-menu-item index="3-5" @click="handleCatalogDownload">目录下载</el-menu-item>
<el-menu-item index="3-6" @click="fileUpload(2)">目录上传</el-menu-item>
</el-menu-item-group>
</el-submenu>
</el-menu>
</div>
<div v-if="isRecycle && (isTitleType === 2 || (isTitleType === 3 && selectedCategory.arrangeType !== 3))" class="collect-menu">
<el-button class="filter-item" size="mini" type="success" @click="toRecover"><i class="iconfont icon-huifu" />恢复</el-button>
<el-button class="filter-item" size="mini" type="success" @click="toCompletelyDelete"><i class="iconfont icon-shanchu" />彻底删除</el-button>
</div>
<!--新增 / 编辑 表单组件-->
<el-dialog class="preview-dialog" :modal-append-to-body="false" :close-on-click-modal="false" append-to-body :before-close="handleClose" :visible="formVisible" :title="formTitle">
<span class="dialog-right-top" />
<span class="dialog-left-bottom" />
<div class="setting-dialog">
<!-- form @emitTableList="getTableList" -->
<PreviewForm
v-if="formPreviewData.length"
ref="previewForm"
:is-has-code="true"
:is-disabled="false"
:form-preview-data.sync="formPreviewData"
:selected-category="selectedCategory"
:arc-id="arcId"
:is-des-form-type="isDesFormType"
:is-title-type="isTitleType"
:collect-level="collectLevel"
@close-dialog="closeDialog"
/>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="handlerArchivesSubmit">保存</el-button>
</div>
</div>
</el-dialog>
<!--删除对话框组件-->
<el-dialog class="tip-dialog" title="提示" :close-on-click-modal="false" :modal-append-to-body="false" append-to-body :visible.sync="deleteVisible">
<div class="setting-dialog">
<div class="tip-content">
<p class="tipMsg">此删除将把会所选条目与其子集放入回收站</p>
<span>你是否还要继续?</span>
</div>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="deleteVisible = false">取消</el-button>
<el-button type="primary" @click.native="handleDelConfirm">确定</el-button>
</div>
</div>
</el-dialog>
<!--卷内移出 组件-->
<el-dialog class="tip-dialog" title="提示" :close-on-click-modal="false" :modal-append-to-body="false" append-to-body :visible.sync="moveVisible">
<div class="setting-dialog">
<div class="tip-content">
<p class="tipMsg">此移出将把会所选条目返还到未整理列表</p>
<span>你是否还要继续?</span>
</div>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="moveVisible = false">取消</el-button>
<el-button type="primary" @click.native="handleMoveConfirm">确定</el-button>
</div>
</div>
</el-dialog>
<!-- 原文上传 -->
<UploadOriginal ref="uploadOriginalRef" :selected-category="selectedCategory" :arc-id="arcId" @close-dialog="closeDialog" />
<!-- 大文件上传 -->
<BigUpload ref="uploadBigRef" :selected-category="selectedCategory" :arc-id="arcId" @close-dialog="closeDialog" />
<!-- 批量导入 -->
<BlukImport ref="blukImportRef" :selected-category="selectedCategory" :collect-level="collectLevel" :selections="selections" @close-dialog="closeDialog" />
<!-- 批量修改 -->
<BlukEditing ref="blukEditingRef" :selected-category="selectedCategory" :collect-level="collectLevel" :selections="selections" @close-dialog="closeDialog" />
<!-- 档案调整 -->
<!-- <FileNumberAdjustment ref="fileNumberAdjustmentRef" :selected-category="selectedCategory" :collect-level="collectLevel" /> -->
<!-- 案卷/文件/卷内 顺序调整 -->
<FileSeqAdjustment ref="fileSeqAdjustmentRef" :selected-category="selectedCategory" :collect-level="collectLevel" :selections="selections" @close-dialog="closeDialog" />
<!-- 合卷 -->
<CombineFile ref="combineFileRef" :selected-category="selectedCategory" :collect-level="collectLevel" :selections="selections" @close-dialog="closeDialog" />
<!-- 插件 -->
<InsertFile ref="insertFileRef" :selected-category="selectedCategory" :collect-level="collectLevel" :selections="selections" @close-dialog="closeDialog" />
<!-- 移动 -->
<CollectMoveFile ref="collectMoveFileRef" :selected-category="selectedCategory" :collect-level="collectLevel" :selections="selections" @close-dialog="closeDialog" />
<!-- 打印 -->
<Print ref="printRef" :selected-category="selectedCategory" :collect-level="collectLevel" :selections="selections" @close-dialog="closeDialog" />
<!-- 四性检测 -->
<FourTest ref="fourTestRef" :selected-category="selectedCategory" :collect-level="collectLevel" @close-dialog="closeDialog" />
<!-- 快速组卷 -->
<QuickPaper ref="quickPaperRef" :selected-category="selectedCategory" :arc-id="arcId" :collect-level="collectLevel" @close-dialog="closeDialog" />
<!-- 归档 -->
<ArchivesFilling ref="archivesFillingRef" :selected-category="selectedCategory" :collect-level="collectLevel" :selections="selections" @close-dialog="closeDialog" />
</div>
<div style="display: flex; justify-content: space-between; height: 30px; line-height: 30px; padding: 0 20px; ">
<span v-if="(isTitleType !== 2 && selectedCategory.arrangeType === 3 ) || ((isTitleType === 4 || isTitleType === 6) && selectedCategory.arrangeType === 2) || (isTitleType === 6 && selectedCategory.arrangeType === 1)" style="font-size: 12px;">{{ test }}</span>
<div v-if="isTitleType !== 2 && !isRecycle && isTitleType !== 6 && !(isTitleType === 3 && activeIndex === 1 && selectedCategory.arrangeType !== 1 )" class="mangement-fixed-top">
<el-checkbox v-model="parentsData.fixedStatusBar" @change="statusBarChecked">隐藏状态栏</el-checkbox>
</div>
</div>
</div>
</template>
<script>
import CRUD, { crud } from '@crud/crud'
import { collectionLibraryCrud } from '../mixins/index'
import { FetchInitCategoryInputFieldByPid } from '@/api/system/category/category'
// FetchBecomeDocumentConfirm
import { FetchDetailsById, collectDel, FetchRemoveArchivesSingle, FetchDeleteArchivesFile, FetchUpdateArchivesNo, FetchDisbandArchives, FetchReturnReDocument, FetchCompleteDelArchives, FetchRestoreArchives } from '@/api/collect/collect'
import { FetchArchivesClassTree } from '@/api/system/archivesClass'
import { FetchDictionaryTree } from '@/api/system/dict'
import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import PreviewForm from '@/views/components/category/PreviewForm'
import UploadOriginal from './uploadOriginal/index'
import BigUpload from './uploadOriginal/bigUpload'
import BlukImport from './bulkImport/index'
import BlukEditing from './blukEditing/index'
import FileSeqAdjustment from './fileSeqAdjustment/index'
import CombineFile from './combineFile/index'
import InsertFile from './insertFile/index'
import CollectMoveFile from './collectMoveFile/index'
import Print from './print/index'
import FourTest from './fourTest/index'
import QuickPaper from './quickPaper/index'
import ArchivesFilling from './archivesFilling/index'
import qs from 'qs'
import { downloadFile, exportFile } from '@/utils/index'
import { mapGetters } from 'vuex'
export default {
name: 'CollectHeader',
components: { Treeselect, PreviewForm, UploadOriginal, BigUpload, BlukImport, BlukEditing, FileSeqAdjustment, CombineFile, InsertFile, CollectMoveFile, Print, FourTest, QuickPaper, ArchivesFilling },
mixins: [collectionLibraryCrud, crud()],
props: {
selectedCategory: {
type: Object,
default: function() {
return {}
}
},
isTitleType: {
type: Number,
default: 2
},
selections: {
type: Array,
default: () => []
},
activeIndex: {
type: Number,
default: 0
},
isTabFile: {
type: Boolean,
default: false
},
isRecycle: {
type: Boolean,
default: false
},
test: {
type: String,
default: ''
}
},
inject: ['parentsData'],
data() {
return {
activeMenuIndex: '1',
formVisible: false,
formTitle: '项目',
formPreviewData: [], // 预览界面data
projectOptions: [],
classifyOptions: [],
delAllLoading: false,
deleteVisible: false,
moveVisible: false,
recoverVisible: false,
completelyDeleteVisible: false,
isDesFormType: 'arcives', // 区分是门类得还是档案得
arcId: null,
quickPaper: false,
quickPaperArcId: []
}
},
computed: {
...mapGetters([
'baseApi'
]),
collectTitle() {
if (this.isTitleType === 2) {
return '项目'
} else if (this.isTitleType === 3) {
if (this.selectedCategory.arrangeType === 1) {
return '文件'
} else {
if (this.activeIndex === 1) {
if (this.quickPaper) {
return '案卷'
} else {
return '文件'
}
} else {
return '案卷'
}
}
} else if (this.isTitleType === 4) {
return '卷内'
} else if (this.isTitleType === 6) {
return '原文'
}
return ''
},
collectLevel() {
if (this.isTitleType === 2) {
return 1
} else if (this.isTitleType === 3) {
if (this.selectedCategory.arrangeType === 1) {
return 3
} else {
if (this.activeIndex === 1) {
if (this.quickPaper) {
return 2
} else {
return 3
}
} else {
return 2
}
}
} else if (this.isTitleType === 4) {
return 3
} else if (this.isTitleType === 6) {
return 4
}
return null
},
classType() {
if (this.isTitleType === 2) {
return ''
} else if (this.isTitleType === 3) {
if (this.selectedCategory.arrangeType === 1) {
return 'is-juannei'
} else {
if (this.activeIndex === 1) {
return 'is-juannei'
} else {
return 'is-anjuan'
}
}
} else if (this.isTitleType === 4) {
return 'is-juannei'
} else if (this.isTitleType === 6) {
return 'is-file'
}
return ''
},
placeholderType() {
if (this.isTitleType === 2) {
return '输入项目名称或编号'
} else if (this.isTitleType === 3 || this.isTitleType === 4) {
return '输入题名或档号'
}
return '输入项目名称或编号'
}
},
watch: {
selectedCategory: function(newValue, oldValue) {
if (newValue && newValue.id) {
this.getInitArchivesClass()
this.getDictsList()
}
},
isTitleType: function(newValue, oldValue) {
console.log('isTitleType', newValue)
},
activeIndex: function(newValue, oldValue) {
console.log('activeIndex', newValue)
if (newValue === 1) {
this.parentsData.isTabFile = true
} else {
this.parentsData.isTabFile = false
}
}
},
created() {
},
mounted() {
this.getInitArchivesClass()
this.getDictsList()
},
methods: {
resetQuery() {
this.query = {
'search': null,
'project_class': null,
'archive_ctg_no': null
}
this.handleSearch(this.collectLevel)
},
// 筛选 - 档案分类
getInitArchivesClass() {
this.classifyOptions = []
this.query = {
'search': null,
'project_class': null,
'archive_ctg_no': null
}
const params = {
'categoryId': this.selectedCategory.id
}
FetchArchivesClassTree(params).then((res) => {
this.classifyOptions = JSON.parse(JSON.stringify(res))
}).catch(err => {
console.log(err)
})
},
normalizer(node) {
if (node.childArchivesClass === null) {
delete node.childArchivesClass
}
return {
id: node.code,
label: node.name,
children: node.childArchivesClass
}
},
// 项目级别 - 阶段分类
getDictsList() {
this.projectOptions = []
FetchDictionaryTree().then((res) => {
const filterCodes = ['project_class']
let filteredItems = JSON.parse(JSON.stringify(res)).filter(item => filterCodes.includes(item.dictionaryCode))
filteredItems = this.addLevelToDictionaryList(filteredItems, 1)
if (this.selectedCategory.arrangeType === 3 && this.isTitleType === 3) {
this.projectOptions = filteredItems
} else {
this.projectOptions = this.filterData(filteredItems, filteredItems[0].id)
}
}).catch(err => {
console.log(err)
})
},
// 显示第一级和第二级
filterData(data, targetId) {
return data.filter(item => {
if (item.id === targetId || item.dictionaryParents === targetId) {
if (item.childDictionarys && item.childDictionarys.length > 0) {
item.childDictionarys = this.filterData(item.childDictionarys, targetId)
}
return true
}
return false
})
},
// 给筛选出来的数据加level 方便后面是否可点击
addLevelToDictionaryList(dictionaryList, level) {
dictionaryList.forEach(dictionary => {
dictionary.level = level
if (dictionary.childDictionarys) {
dictionary.childDictionarys = this.addLevelToDictionaryList(dictionary.childDictionarys, level + 1)
}
})
return dictionaryList
},
normalizerProject(node) {
if ((node.childDictionarys && !node.childDictionarys.length) || node.childDictionarys === null) {
delete node.childDictionarys
}
return {
id: node.dictionaryName,
label: node.dictionaryName,
children: node.childDictionarys,
isDisabled: this.isTitleType === 3 ? node.level !== 3 : node.level === 1
}
},
handleSelect(key, keyPath) {
console.log(key, keyPath)
},
// 著录界面-form/详情-api
handleForm(type, isPaper) {
if (type === 'add') {
if (this.parentsData.parentsAnjuanRow && this.parentsData.parentsAnjuanRow.collect_formal === 2) {
this.$message('当前档案处于归档流程中,不可操作新增,请先确认!')
return false
}
this.arcId = null
if (isPaper) {
this.quickPaper = true
this.formTitle = '新增案卷'
} else {
this.formTitle = '新增' + this.collectTitle
this.quickPaper = false
}
} else if (type === 'edit') {
this.quickPaper = false
if (this.selections.length === 0) {
this.$message('您还未勾选需要操作的条目,请先确认!')
return false
} else if (this.selections.length > 1) {
this.$message('编辑操作只可勾选唯一目标条目,请先确认!')
return false
} else if (this.selections[0].collect_formal === 2) {
this.$message('当前所选的档案处于归档流程中,不可操作编辑,请先确认!')
return false
}
this.arcId = this.selections[0].id
this.formTitle = '编辑' + this.collectTitle
}
// this.form.dictionaryConfigId = {}
// this.formPreviewData = []
// 档案预编辑获取字段
this.formVisible = true
this.$nextTick(() => {
this.getFormInfo(type)
})
},
getFormInfo(type) {
if (type === 'edit') {
const params = {
'categoryId': this.selectedCategory.id,
'categoryLevel': this.collectLevel,
'id': this.arcId
}
FetchDetailsById(params).then(data => {
// const showFiledAll = data.showFiled.filter(item => item.isSequence).sort((a, b) => a.isSequence - b.isSequence)
const showFiledAll = data.showFiled
this.$nextTick(() => {
this.formPreviewData = showFiledAll
this.isDesFormType = 'arcives'
this.$nextTick(() => {
this.$refs.previewForm.archivesType = 'edit'
this.$refs.previewForm.addOrUpdateForm = data.echo
this.$refs.previewForm.FetchNoFormatField(this.selectedCategory.id)
})
})
})
} else {
const params = {
'categoryId': this.selectedCategory.id,
'categoryLevel': this.collectLevel
}
FetchInitCategoryInputFieldByPid(params).then(data => {
this.formPreviewData = data
this.isDesFormType = 'arcives'
this.$nextTick(() => {
this.$refs.previewForm.archivesType = 'add'
console.log('active', this.activeIndex)
this.$refs.previewForm.activeIndex = this.activeIndex
this.$refs.previewForm.FetchNoFormatField(this.selectedCategory.id)
})
})
}
},
// form - submit
handlerArchivesSubmit() {
this.$refs.previewForm.submitForm('addOrUpdateForm', this.selectedCategory.id, this.quickPaperArcId)
},
// 关闭
handleClose(done) {
this.formVisible = false
done()
},
// 删除
toDelete() {
if (this.selections.length === 0) {
this.$message('您还未勾选需要操作的条目,请先确认!')
return false
}
const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
if (isHasFillFormal) {
this.$message('您所选的条目有正在归档流程中,不可操作删除,请先确认!')
return false
}
if (this.collectLevel === 4) {
if (this.parentsData.parentsAnjuanRow && this.parentsData.parentsAnjuanRow.collect_formal === 2) {
this.$message('当前档案处于归档流程中,不可操作删除,请先确认!')
return false
}
}
this.deleteVisible = true
},
// 卷内 - 移除
toMove() {
if (this.selections.length === 0) {
this.$message('您还未勾选需要操作的条目,请先确认!')
return false
}
const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
if (isHasFillFormal) {
this.$message('您所选的条目有正在归档流程中,不可操作删除,请先确认!')
return false
}
this.moveVisible = true
},
// 删除 - 确认
handleDelConfirm() {
this.delAllLoading = true
if (this.collectLevel === 4) {
const params = this.selections.map((item) => {
const json = {}
json.archivesId = item.archive_id
json.categoryId = this.selectedCategory.id
json.documentFileId = item.document_file_id
json.documentId = item.document_id
json.id = item.id
return json
})
FetchDeleteArchivesFile(params).then((res) => {
if (res === 'SUCCESS') {
this.crud.notify('删除成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.delAllLoading = false
this.deleteVisible = false
this.handleSearch(this.collectLevel)
} else {
this.crud.notify('删除所选电子原文失败', CRUD.NOTIFICATION_TYPE.ERROR)
}
}).catch(err => {
this.delAllLoading = false
console.log(err)
})
} else {
const archivesIds = []
this.selections.forEach(val => {
archivesIds.push(val.id)
})
const params = {
'categoryId': this.selectedCategory.id,
'categoryLevel': this.collectLevel,
'archivesIds': archivesIds
}
collectDel(params).then((res) => {
if (res.includes('成功')) {
this.crud.notify('删除成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.delAllLoading = false
this.deleteVisible = false
this.handleSearch(this.collectLevel)
} else {
this.crud.notify('删除所选档案失败', CRUD.NOTIFICATION_TYPE.ERROR)
}
}).catch(err => {
this.delAllLoading = false
console.log(err)
})
}
},
// 卷内 - 移出 确认
handleMoveConfirm() {
const archivesIds = []
this.selections.forEach(val => {
archivesIds.push(val.id)
})
const params = {
'categoryId': this.selectedCategory.id,
'categoryLevel': this.collectLevel,
'archivesIds': archivesIds,
'parentsId': this.parentsData.parentsAnjuanId
}
FetchRemoveArchivesSingle(params).then((res) => {
if (res === true) {
this.crud.notify('移出成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.handleSearch(this.collectLevel)
} else {
this.crud.notify('移出失败', CRUD.NOTIFICATION_TYPE.ERROR)
}
this.moveVisible = false
}).catch(err => {
console.log(err)
})
},
// 原文上传
fileUpload(uploadType) {
if (uploadType !== 2) {
if (this.isTitleType !== 6) {
if (this.selections.length === 0) {
this.$message('您还未勾选需要操作的条目,请先确认!')
return false
}
if (this.selections.length > 1) {
this.$message('上传操作只可勾选唯一目标条目,请先确认!')
return false
}
const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
if (isHasFillFormal) {
this.$message('您所选的条目有正在归档流程中,不可操作原文上传,请先确认!')
return false
}
this.arcId = this.selections[0].id
} else {
if (this.parentsData.parentsAnjuanRow && this.parentsData.parentsAnjuanRow.collect_formal === 2) {
this.$message('当前档案处于归档流程中,不可操作原文上传,请先确认!')
return false
}
if (this.selectedCategory.arrangeType === 1) {
this.arcId = this.parentsData.parentsAnjuanId
} else {
if (this.parentsData.isTabFile) {
this.arcId = this.parentsData.parentsAnjuanId
} else {
this.arcId = this.parentsData.parentsJuanneiId
}
}
}
}
if (uploadType === 0) {
this.$refs.uploadOriginalRef.uploadTitle = '普通上传'
this.$refs.uploadOriginalRef.uploadVisible = true
} else if (uploadType === 1) {
this.$refs.uploadBigRef.uploadBigVisible = true
} else if (uploadType === 2) {
this.$refs.uploadOriginalRef.uploadTitle = '原文目录上传'
this.$refs.uploadOriginalRef.uploadVisible = true
}
if (this.$refs.uploadOriginalRef.uploadVisible) {
this.$refs.uploadOriginalRef.uploadType = uploadType
this.$refs.uploadOriginalRef.fileList = []
}
},
// 批量导入
handleBlukImport() {
if (this.parentsData.parentsAnjuanRow && this.parentsData.parentsAnjuanRow.collect_formal === 2) {
this.$message('当前档案处于归档流程中,不可操作批量导入,请先确认!')
return false
}
this.$refs.blukImportRef.bulkImportVisible = true
},
// 批量修改
handleBlukEditing() {
if (this.selections.length === 0) {
this.$message('您还未勾选需要操作的条目,请先确认!')
return false
}
const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
if (isHasFillFormal) {
this.$message('您所选的条目有正在归档流程中,不可操作批量修改,请先确认!')
return false
}
this.$nextTick(() => {
this.$refs.blukEditingRef.bulkEditingVisible = true
})
},
// 案卷/文件/卷内顺序调整
handleJnSeqAdjustment(type) {
if (type === 'juannei') {
if (this.selections.length === 0) {
this.$message('您还未勾选需要操作的条目,请先确认!')
return false
}
if (this.selections.length > 1) {
this.$message('卷内顺序调整操作只可勾选唯一目标条目,请先确认!')
return false
}
const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
if (isHasFillFormal) {
this.$message('您所选的条目有正在归档流程中,不可操作卷内顺序调整,请先确认!')
return false
}
this.$nextTick(() => {
this.$refs.fileSeqAdjustmentRef.titleAdjustment = '卷内顺序调整'
this.$refs.fileSeqAdjustmentRef.isJuannei = true
})
} else {
if (this.selections.length < 2) {
this.$message('请选择多个' + (type === 'file' ? '文件' : '案卷') + '后进行操作!')
return false
}
const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
if (isHasFillFormal) {
this.$message('您所选的条目有正在归档流程中,不可操作案卷/文件顺序调整,请先确认!')
return false
}
this.$nextTick(() => {
if (type === 'anjuan') {
this.$refs.fileSeqAdjustmentRef.titleAdjustment = '案卷顺序调整'
} else {
this.$refs.fileSeqAdjustmentRef.titleAdjustment = '文件顺序调整'
}
this.$refs.fileSeqAdjustmentRef.isJuannei = false
})
}
this.$nextTick(() => {
this.$refs.fileSeqAdjustmentRef.getDoArchivesAdjust()
})
},
// 档号更新
handleFileNumberUpdate(type) {
if (this.selections.length === 0) {
this.$message('您还未勾选需要操作的条目,请先确认!')
return false
}
const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
if (isHasFillFormal) {
this.$message('您所选的条目有正在归档流程中,不可操作档号更新,请先确认!')
return false
}
this.$confirm('此操作将会自动重新生成档号' + '<span>你是否还要继续?</span>', '提示', {
confirmButtonText: '继续',
cancelButtonText: '取消',
type: 'warning',
dangerouslyUseHTMLString: true
}).then(() => {
// updateType 更新类别 1.档号更新 2.卷内档号更新
let updateType
if (type === 0) {
updateType = 1
} else {
updateType = 2
}
const archivesIds = []
this.selections.forEach(val => {
archivesIds.push(val.id)
})
const params = {
'categoryId': this.selectedCategory.id,
'categoryLevel': this.collectLevel,
'archivesIds': archivesIds,
'updateType': updateType
}
FetchUpdateArchivesNo(params).then((res) => {
if (res.code !== 500) {
this.crud.notify('档号更新成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.handleSearch(this.collectLevel)
} else {
this.crud.notify(res.message, CRUD.NOTIFICATION_TYPE.ERROR)
}
}).catch(err => {
console.log(err)
})
}).catch(() => {
})
},
// 拆卷
handleUncoil() {
if (this.selections.length === 0) {
this.$message('您还未勾选需要操作的条目,请先确认!')
return false
}
const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
if (isHasFillFormal) {
this.$message('您所选的条目有正在归档流程中,不可操作拆卷,请先确认!')
return false
}
this.$confirm('拆卷之后,对应的案卷数据将会自动删除' + '<span>你是否还要继续?</span>', '提示', {
confirmButtonText: '继续',
cancelButtonText: '取消',
type: 'warning',
dangerouslyUseHTMLString: true
}).then(() => {
const archivesIds = []
this.selections.forEach(val => {
archivesIds.push(val.id)
})
const params = {
'categoryId': this.selectedCategory.id,
'archivesIds': archivesIds
}
FetchDisbandArchives(params).then((res) => {
if (res.code !== 500) {
this.crud.notify('拆卷成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.handleSearch(this.collectLevel)
} else {
this.crud.notify('拆卷失败', CRUD.NOTIFICATION_TYPE.ERROR)
}
}).catch(err => {
console.log(err)
})
}).catch(() => {
})
},
// 合卷
handleCombineFile() {
if (this.selections.length < 2) {
this.$message('合卷操作至少勾选2个案卷,请重试!')
return false
}
const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
if (isHasFillFormal) {
this.$message('您所选的条目有正在归档流程中,不可操作合卷,请先确认!')
return false
}
this.$refs.combineFileRef.getTargetList()
},
// 插件
handleInsertFile() {
if (this.collectLevel === 3) {
if (this.selections.length === 0) {
this.$confirm('您未勾选条目,否则直接选择所有条目' + '<span>你是否还要继续?</span>', '提示', {
confirmButtonText: '继续',
cancelButtonText: '取消',
type: 'warning',
dangerouslyUseHTMLString: true
}).then(() => {
this.$refs.insertFileRef.fileNoSelectionData = this.parentsData.$refs.anjuanEle.$refs.ajContent.$refs.tableList.anjuanData
this.$refs.insertFileRef.getInsertViewTable()
}).catch(() => {
})
} else {
this.$refs.insertFileRef.getInsertViewTable()
}
} else {
const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
if (this.selections.length !== 1) {
this.$message('插卷操作只可勾选唯一目标条目,请先确认!')
return false
} else if (isHasFillFormal) {
this.$message('您所选的条目有正在归档流程中,不可操作插件,请先确认!')
return false
} else {
this.$refs.insertFileRef.getInsertViewTable()
}
}
},
// 移动
handleCollectMoveFile() {
if (this.selections.length === 0) {
this.$message('您还未勾选需要操作的条目,请先确认!')
return false
}
const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
if (isHasFillFormal) {
this.$message('您所选的条目有正在归档流程中,不可操作移动,请先确认!')
return false
}
this.$refs.collectMoveFileRef.collectMoveFileVisible = true
},
// 归档
handleFiling() {
if (this.selections.length === 0) {
this.$message('您还未勾选需要操作的条目,请先确认!')
return false
}
const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
if (isHasFillFormal) {
this.$message('您所选的条目有正在归档流程中,勿重复操作,请先确认!!')
return false
}
this.$refs.archivesFillingRef.archivesFillingVisible = true
},
// 退回预归档库
handleReturn() {
if (this.selections.length === 0) {
this.$message('您还未勾选需要操作的条目,请先确认!')
return false
}
const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
if (isHasFillFormal) {
this.$message('您所选的条目有正在归档流程中,不可操作退回预归档库,请先确认!!')
return false
}
this.$confirm('此操作将把会所选条目退回到预归档库' + '<span>你是否还要继续?</span>', '提示', {
confirmButtonText: '继续',
cancelButtonText: '取消',
type: 'warning',
dangerouslyUseHTMLString: true
}).then(() => {
const archivesIds = this.selections.map(item => item.id)
const params = {
'categoryId': this.selectedCategory.id,
'archivesIds': archivesIds
}
FetchReturnReDocument(params).then((res) => {
if (res.code !== 500) {
if (res === 0) {
this.crud.notify('当前数据中不包含预归档数据,无法返回', CRUD.NOTIFICATION_TYPE.INFO)
} else {
this.crud.notify('已成功返回' + res + '条来自预归档的数据', CRUD.NOTIFICATION_TYPE.SUCCESS)
}
this.handleSearch(this.collectLevel)
} else {
this.crud.notify(res.message, CRUD.NOTIFICATION_TYPE.ERROR)
}
}).catch(err => {
console.log(err)
})
}).catch(() => {
})
},
// 导出
handleExport() {
if (this.selections.length === 0) {
this.$message('您还未勾选需要操作的条目,请先确认!')
return false
}
this.$confirm('此操作将导出所选数据' + '<span>你是否还要继续?</span>', '提示', {
confirmButtonText: '继续',
cancelButtonText: '取消',
type: 'warning',
dangerouslyUseHTMLString: true
}).then(() => {
const archivesIds = []
this.selections.forEach(val => {
archivesIds.push(val.id)
})
const params = {
'categoryId': this.selectedCategory.id,
'categoryLevel': this.collectLevel,
'archivesIds': archivesIds
}
exportFile(this.baseApi + '/api/collect/exportDate?' + qs.stringify(params, { indices: false }))
}).catch(() => {
})
},
// 打印
handlePrint() {
if (this.selections.length === 0) {
this.$refs.printRef.form.printRange = '当页条目'
let currentTableData = []
if (this.collectLevel === 2) {
currentTableData = this.parentsData.$refs.anjuanEle.$refs.ajContent.$refs.tableList.anjuanData
} else if (this.collectLevel === 3) {
if (this.isTitleType === 3) {
currentTableData = this.parentsData.$refs.anjuanEle.$refs.ajContent.$refs.tableList.anjuanData
} else {
currentTableData = this.parentsData.$refs.juanneiEle.junneiData
}
}
this.$refs.printRef.currentTable = JSON.parse(JSON.stringify(currentTableData))
} else {
this.$refs.printRef.form.printRange = '勾选条目'
}
this.$refs.printRef.printVisible = true
},
// 四性检测
handleFourTest() {
if (this.selections.length === 0) {
this.$message('您还未勾选需要操作的条目,请先确认!')
return false
}
const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
if (isHasFillFormal) {
this.$message('您所选的条目有正在归档流程中,不可操作四性检测,请先确认!')
return false
}
this.$refs.fourTestRef.fourTestVisible = true
this.$refs.fourTestRef.tableData = this.selections
},
// 目录下载
handleCatalogDownload() {
if (this.selections.length === 0) {
this.$message('您还未勾选需要操作的条目,请先确认!')
return false
}
this.$confirm('此操作将下载所选条目目录' + '<span>你是否还要继续?</span>', '提示', {
confirmButtonText: '继续',
cancelButtonText: '取消',
type: 'warning',
dangerouslyUseHTMLString: true
}).then(() => {
const archivesIds = []
this.selections.forEach(val => {
archivesIds.push(val.id)
})
const params = {
'categoryId': this.selectedCategory.id,
'categoryLevel': this.collectLevel,
'archivesIds': archivesIds
}
exportFile(this.baseApi + '/api/collect/catalogDownload?' + qs.stringify(params, { indices: false }))
}).catch(() => {
})
},
// 快速组卷
handleQuickPaper() {
this.$refs.quickPaperRef.quickVisible = true
},
// 手工组卷
handlePaper() {
if (this.selections.length === 0) {
this.$message('您还未勾选需要操作的条目,请先确认!')
return false
}
this.quickPaperArcId = this.selections.map(item => item.id)
this.handleForm('add', 1)
},
// 原文内的附件下载
handleOriginalDownload() {
if (this.selections.length > 1 || this.selections.length === 0) {
this.$message('下载操作只可勾选唯一目标条目,请先确认!')
return false
}
const url = this.baseApi + '/downloadFile' + this.selections[0].file_path
fetch(url).then(res => res.blob()).then(blob => {
downloadFile(blob, this.selections[0].file_name.split('.')[0], this.selections[0].file_type)
}).catch(() => {
this.$message.error('下载文件失败!')
})
},
// 回收站 - 恢复
toRecover() {
if (this.selections.length === 0) {
this.$message('您还未勾选需要操作的条目,请先确认!')
return false
}
this.$confirm('此恢复将会把所选条目及其子集一并恢复' + '<span>你是否还要继续?</span>', '提示', {
confirmButtonText: '继续',
cancelButtonText: '取消',
type: 'warning',
dangerouslyUseHTMLString: true
}).then(() => {
const archivesIds = []
this.selections.forEach(val => {
archivesIds.push(val.id)
})
const params = {
'categoryId': this.selectedCategory.id,
'categoryLevel': this.collectLevel,
'archivesIds': archivesIds
}
FetchRestoreArchives(params).then((res) => {
if (res.code !== 500) {
console.log(res)
this.crud.notify(res, CRUD.NOTIFICATION_TYPE.SUCCESS)
this.handleSearch(this.collectLevel)
} else {
this.crud.notify('回复所选档案失败', CRUD.NOTIFICATION_TYPE.ERROR)
}
}).catch(err => {
console.log(err)
})
}).catch(() => {
})
},
// 回收站 - 彻底删除
toCompletelyDelete() {
if (this.selections.length === 0) {
this.$message('您还未勾选需要操作的条目,请先确认!')
return false
}
this.$confirm('此删除将把会所选条目与其子集彻底删除' + '<span>你是否还要继续?</span>', '提示', {
confirmButtonText: '继续',
cancelButtonText: '取消',
type: 'warning',
dangerouslyUseHTMLString: true
}).then(() => {
const archivesIds = []
this.selections.forEach(val => {
archivesIds.push(val.id)
})
const params = {
'categoryId': this.selectedCategory.id,
'categoryLevel': this.collectLevel,
'archivesIds': archivesIds
}
FetchCompleteDelArchives(params).then((res) => {
if (res.code !== 500) {
this.crud.notify(res, CRUD.NOTIFICATION_TYPE.SUCCESS)
this.handleSearch(this.collectLevel)
} else {
this.crud.notify('删除所选档案失败', CRUD.NOTIFICATION_TYPE.ERROR)
}
}).catch(err => {
console.log(err)
})
}).catch(() => {
})
},
closeDialog(data) {
this.formVisible = false
setTimeout(() => {
this.handleSearch(this.collectLevel)
})
}
}
}
</script>
<style lang='scss' scoped>
</style>