Browse Source

收集库追加条目

master
xuhuajiao 2 weeks ago
parent
commit
ab2f626dfe
  1. 66
      src/views/collectReorganizi/collectionLibrary/module/collectHeader.vue
  2. 6
      src/views/components/category/PreviewForm.vue

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

@ -70,11 +70,12 @@
<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 v-if="isTitleType !== 6" index="1-6" @click="handleForm('copy',0)">追加条目</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 index="1-7" @click="fileUpload(1)">文件上传</el-menu-item>
</el-menu-item-group>
</el-submenu>
<el-submenu v-if="isTitleType !== 6" index="2">
@ -141,7 +142,7 @@
<!--新增 / 编辑 表单组件-->
<!-- v-el-drag-dialog -->
<!-- :class="isAiAutoCategory ? 'preview-dialog ai-preview-dialog' :'preview-dialog'" -->
<el-dialog :class="formPreviewData.length && formIsAddOrEdit === 'add' ? 'preview-dialog ai-preview-dialog' :'preview-dialog'" :modal-append-to-body="false" :close-on-click-modal="false" append-to-body :before-close="handleClose" :visible="formVisible" :title="formTitle">
<el-dialog :class="formPreviewData.length && (formIsAddOrEdit === 'add' || formIsAddOrEdit === 'copy') ? 'preview-dialog ai-preview-dialog' :'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">
@ -167,7 +168,7 @@
/>
<!-- 嵌入版原文上传组件 -->
<EmbedUpload
v-if="formPreviewData.length && formIsAddOrEdit === 'add'"
v-if="formPreviewData.length && (formIsAddOrEdit === 'add' || formIsAddOrEdit === 'copy' )"
ref="embedUploadRef"
:selected-category="selectedCategory"
:arc-id="arcId"
@ -395,7 +396,7 @@
import CRUD, { crud } from '@crud/crud'
import { collectionLibraryCrud } from '../mixins/index'
import { FetchInitCategoryInputFieldByPid, FetchCategoryMenu } from '@/api/system/category/category'
import { FetchDetailsById, collectDel, FetchRemoveArchivesSingle, FetchDeleteArchivesFile, FetchUpdateArchivesNo, FetchDisbandArchives, FetchReturnReDocument, FetchCompleteDelArchives, FetchRestoreArchives, FetchMaxItemNoByParentId } from '@/api/collect/collect'
import { FetchDetailsById, collectDel, FetchRemoveArchivesSingle, FetchDeleteArchivesFile, FetchUpdateArchivesNo, FetchDisbandArchives, FetchReturnReDocument, FetchCompleteDelArchives, FetchRestoreArchives, FetchMaxItemNoByParentId, FetchMaxItemNoByArchivesNo } from '@/api/collect/collect'
import { FetchInitAssistEnter, FetchDoHandleEnterAnalysis, FetchInitAssistEnterTemp } from '@/api/ai/ai'
import { FetchArchivesClassTree } from '@/api/system/archivesClass'
import Treeselect from '@riophae/vue-treeselect'
@ -754,6 +755,17 @@ export default {
}
this.arcId = this.selections[0].id
this.formTitle = '编辑' + this.collectTitle
} else if (type === 'copy') {
this.quickPaper = false
if (this.selections.length === 0) {
this.$message({ message: '您还未勾选需要操作的条目,请先确认!', offset: 8 })
return false
} else if (this.selections.length > 1) {
this.$message({ message: '追加复制操作只可勾选唯一目标条目,请先确认!', offset: 8 })
return false
}
this.arcId = this.selections[0].id
this.formTitle = '追加复制' + this.collectTitle
}
// this.form.dictionaryConfigId = {}
// this.formPreviewData = []
@ -793,6 +805,52 @@ export default {
})
})
})
} else if (type === 'copy') {
const params = {
'categoryId': this.selectedCategory.id,
'categoryLevel': this.collectLevel,
'id': this.arcId
}
FetchDetailsById(params).then(data => {
const showFiledAll = data.showFiled
this.$nextTick(() => {
this.formPreviewData = showFiledAll
this.isDesFormType = 'arcives'
this.$nextTick(() => {
this.$refs.previewForm.archivesType = 'add'
this.$refs.previewForm.addOrUpdateForm = data.echo
if (data.echo.fonds_name === '' || data.echo.fonds_name === null) {
this.$set(this.$refs.previewForm.addOrUpdateForm, 'fonds_name', this.selectedCategory.fondName)
}
console.log('data.echo', data.echo)
const archivesNo = data.echo.archive_no
if (archivesNo) {
let categoryId
if (this.isDesFormType !== 'mergeFile' && this.isDesFormType !== 'arcives' && this.isDesFormType !== 'manageArcives') {
categoryId = this.selectedCategory.pid
} else {
categoryId = this.selectedCategory.id
}
this.$refs.previewForm.FetchNoFormatField(categoryId).then(() => {
FetchMaxItemNoByArchivesNo({ archivesNo, categoryId, categoryLevel: this.collectLevel }).then(res => {
if (res) {
const newItemNo = (parseInt(res) + 1).toString()
const field = this.formPreviewData.find(item => item.fieldName === 'item_no')
if (field && field.isFilling) {
const fillingDigit = field.fillingDigit
this.$set(this.$refs.previewForm.addOrUpdateForm, 'item_no', newItemNo.padStart(fillingDigit, '0'))
} else {
this.$set(this.$refs.previewForm.addOrUpdateForm, 'item_no', newItemNo)
}
this.$refs.previewForm.handleAuto()
}
})
})
}
})
})
})
} else {
const params = {
'categoryId': this.selectedCategory.id,

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

@ -1577,7 +1577,7 @@ export default {
// }
// }
// })
if (this.archivesType === 'add') {
if (this.archivesType === 'add' || this.archivesType === 'copy') {
this.addOrUpdateForm.fonds_affiliation = this.selectedCategory.fondsId
}
const originalArchiveNo = this.addOrUpdateForm.archive_no
@ -1673,7 +1673,7 @@ export default {
'categoryLevel': 2,
'jsonString': JSON.stringify(this.addOrUpdateForm)
}
} else if (this.selectedCategory.arrangeType === 3 && this.activeIndex === 1 && this.archivesType === 'add') {
} else if (this.selectedCategory.arrangeType === 3 && this.activeIndex === 1 && (this.archivesType === 'add' || this.archivesType === 'copy')) {
// parentsId === null
const fileIds = []
console.log('this.uploadedFileData', this.uploadedFileData)
@ -1721,7 +1721,7 @@ export default {
}
}
console.log(params)
if (this.archivesType === 'add') {
if (this.archivesType === 'add' || this.archivesType === 'copy') {
collectAdd(params).then(res => {
console.log('res', res)
if (res.code !== 500) {

Loading…
Cancel
Save