Browse Source

收集库-插件/合卷/拆卷/排序

master
xuhuajiao 1 year ago
parent
commit
91fd672524
  1. 22
      src/api/collect/collect.js
  2. 1
      src/utils/upload.js
  3. 28
      src/views/collectReorganizi/collectionLibrary/anjuan/tableList.vue
  4. 9
      src/views/collectReorganizi/collectionLibrary/mixins/index.js
  5. 44
      src/views/collectReorganizi/collectionLibrary/module/bulkImport/index.vue
  6. 79
      src/views/collectReorganizi/collectionLibrary/module/collectHeader.vue
  7. 65
      src/views/collectReorganizi/collectionLibrary/module/combineFile/index.vue
  8. 5
      src/views/collectReorganizi/collectionLibrary/module/fileSeqAdjustment/index.vue
  9. 169
      src/views/collectReorganizi/collectionLibrary/module/insertFile/index.vue

22
src/api/collect/collect.js

@ -153,6 +153,24 @@ export function FetchArchivesAdjust(data) {
})
}
// 拆卷
export function FetchDisbandArchives(data) {
return request({
url: 'api/collect/disbandArchives',
method: 'post',
data
})
}
// 合卷
export function FetchMergeArchives(data) {
return request({
url: 'api/collect/mergeArchives',
method: 'post',
data
})
}
export default {
collectAdd,
collectEdit,
@ -168,5 +186,7 @@ export default {
FetchBatchUpdate,
FetchUpdateArchivesNo,
FetchDoArchivesAdjust,
FetchArchivesAdjust
FetchArchivesAdjust,
FetchDisbandArchives,
FetchMergeArchives
}

1
src/utils/upload.js

@ -17,6 +17,7 @@ export function BatchImport(api, params) {
data.append('categoryId', params.categoryId)
data.append('categoryLevel', params.categoryLevel)
data.append('replicated', params.replicated)
data.append('parentsId', params.parentsId)
const config = {
headers: {
'Authorization': getToken()

28
src/views/collectReorganizi/collectionLibrary/anjuan/tableList.vue

@ -127,11 +127,13 @@ export default {
activeIndex(newValue) {
if (newValue === 1) {
this.title = '文件'
if (this.selectedCategory.arrangeType === 3) {
this.getCommonData(3, this.parentsData.parentsProjectId)
} else {
this.getCommonData(3, null)
}
// if (this.selectedCategory.arrangeType === 3) {
// console.log('2222')
// this.getCommonData(3, this.parentsData.parentsProjectId)
// } else {
// this.getCommonData(3, null)
// }
} else {
this.title = '案卷'
if (this.selectedCategory.arrangeType === 3) {
@ -242,11 +244,12 @@ export default {
this.page.size = size
this.page.page = 1
if (this.activeIndex === 1) {
if (this.selectedCategory.arrangeType === 3) {
this.getViewTable(3, this.parentsData.parentsProjectId)
} else {
// if (this.selectedCategory.arrangeType === 3) {
// this.getViewTable(3, this.parentsData.parentsProjectId)
// } else {
// this.getViewTable(3, null)
// }
this.getViewTable(3, null)
}
} else {
if (this.selectedCategory.arrangeType === 3) {
this.getViewTable(2, this.parentsData.parentsProjectId)
@ -258,11 +261,12 @@ export default {
handleCurrentPage(val) {
this.page.page = val
if (this.activeIndex === 1) {
if (this.selectedCategory.arrangeType === 3) {
this.getViewTable(3, this.parentsData.parentsProjectId)
} else {
// if (this.selectedCategory.arrangeType === 3) {
// this.getViewTable(3, this.parentsData.parentsProjectId)
// } else {
// this.getViewTable(3, null)
// }
this.getViewTable(3, null)
}
} else {
if (this.selectedCategory.arrangeType === 3) {
this.getViewTable(2, this.parentsData.parentsProjectId)

9
src/views/collectReorganizi/collectionLibrary/mixins/index.js

@ -52,11 +52,16 @@ export const collectionLibraryCrud = {
} else if (this.isTitleType === 3) {
if (this.selectedCategory.arrangeType === 1) {
this.parentsId = null
this.$parent.getTableDisplayFieldsLoading = true
} else {
console.log('未整理理理理2')
console.log(this.activeIndex)
if (this.activeIndex === 1) {
this.parentsId = null
} else {
this.parentsId = this.parentsData.parentsProjectId
this.$parent.getTableDisplayFieldsLoading = true
}
}
this.$parent.getTableDisplayFieldsLoading = true
} else if (this.isTitleType === 4) {
// 卷内
this.$parent.$parent.getTableDisplayFieldsLoading = true

44
src/views/collectReorganizi/collectionLibrary/module/bulkImport/index.vue

@ -5,7 +5,7 @@
<div class="bulk-import-item">
<h4 class="bulk-import-title1">下载模板</h4>
<!-- <a href="" download></a> -->
<span class="template-name" @click="downloadTemplate"><i class="iconfont icon-xiazai" />{{ selectedCategory.cnName }}</span>
<span class="template-name" @click="downloadTemplate"><i class="iconfont icon-xiazai" />{{ selectedCategory.cnName+ '-' + typeName }}</span>
</div>
<div class="bulk-import-item">
<h4 class="bulk-import-title2">上传导入</h4>
@ -42,7 +42,7 @@
</el-select>
</el-form-item>
<el-form-item label="导入">
<el-button class="import-submit" type="primary" @click="onSubmitImport('form')">上传并导入</el-button>
<el-button :loading="importLoading" class="import-submit" type="primary" @click="onSubmitImport('form')">上传并导入</el-button>
</el-form-item>
</el-form>
</div>
@ -61,6 +61,7 @@ import { exportFile } from '@/utils/index'
import { mapGetters } from 'vuex'
import { FetchInitCategoryInputFieldByPid } from '@/api/system/category/category'
import { BatchImport } from '@/utils/upload'
export default {
name: 'BulkImport',
components: { },
@ -83,9 +84,10 @@ export default {
default: () => []
}
},
inject: ['parentsData'],
data() {
return {
//
importLoading: false,
bulkImportVisible: false,
rules: {},
form: {
@ -106,7 +108,19 @@ export default {
computed: {
...mapGetters([
'baseApi'
])
]),
typeName() {
if (this.collectLevel === 2) {
return '案卷'
} else if (this.collectLevel === 3) {
if (this.selectedCategory.arrangeType === 1) {
return '文件'
} else {
return '案卷卷内'
}
}
return ''
}
},
created() {
},
@ -129,7 +143,7 @@ export default {
const params = {
'categoryId': this.selectedCategory.id,
'categoryLevel': this.collectLevel,
'categoryName': this.selectedCategory.cnName
'categoryName': this.selectedCategory.cnName + '-' + this.typeName
}
console.log(params)
exportFile(this.baseApi + '/api/collect/exportTemplate?' + qs.stringify(params, { indices: false }))
@ -158,11 +172,27 @@ export default {
}
this.$refs[formName].validate((valid) => {
if (valid) {
this.importLoading = true
let parentsId
if (this.collectLevel === 2) {
if (this.selectedCategory.arrangeType === 3) {
parentsId = this.parentsData.parentsProjectId
} else {
parentsId = null
}
} else if (this.collectLevel === 3) {
if (this.selectedCategory.arrangeType === 1) {
parentsId = null
} else {
parentsId = this.parentsData.parentsAnjuanId
}
}
const params = {
'categoryId': this.selectedCategory.id,
'categoryLevel': this.collectLevel,
'file': this.excelList[0],
'replicated': this.form.replicated.join(',')
'replicated': this.form.replicated.join(','),
'parentsId': parentsId
}
console.log(params)
BatchImport(this.baseApi + '/api/collect/batchImport', params).then(res => {
@ -174,6 +204,7 @@ export default {
} else {
this.$message.error('批量导入失败')
}
this.importLoading = false
})
} else {
console.log('error submit!!')
@ -186,6 +217,7 @@ export default {
this.$refs.form.resetFields()
this.bulkImportVisible = false
this.excelList = []
this.importLoading = false
//
// done()
}

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

@ -67,7 +67,7 @@
<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 && selectedCategory.arrangeType === 2) && activeIndex === 0" index="2-3" @click="handleJnSeqAdjustment('anjuan')">案卷顺序调整</el-menu-item>
<el-menu-item v-if="(isTitleType === 3) && activeIndex === 0" 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>
@ -179,24 +179,10 @@
<!-- 案卷/文件/卷内 顺序调整 -->
<FileSeqAdjustment ref="fileSeqAdjustmentRef" :selected-category="selectedCategory" :collect-level="collectLevel" :selections="selections" @close-dialog="closeDialog" />
<!-- 拆卷 -->
<el-dialog class="tip-dialog" title="拆卷" :close-on-click-modal="false" :modal-append-to-body="false" append-to-body :visible.sync="uncoilVisible">
<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="uncoilVisible = false">取消</el-button>
<el-button type="primary" @click.native="handleUncoilConfirm">确定</el-button>
</div>
</div>
</el-dialog>
<!-- 合卷 -->
<CombineFile ref="combineFileRef" />
<CombineFile ref="combineFileRef" :selected-category="selectedCategory" :collect-level="collectLevel" :selections="selections" @close-dialog="closeDialog" />
<!-- 插件 -->
<InsertFile ref="insertFileRef" />
<InsertFile ref="insertFileRef" :selected-category="selectedCategory" :collect-level="collectLevel" :selections="selections" @close-dialog="closeDialog" />
<!-- 移动 -->
<CollectMoveFile ref="collectMoveFileRef" />
@ -286,7 +272,7 @@
import CRUD, { crud } from '@crud/crud'
import { collectionLibraryCrud } from '../mixins/index'
import { FetchInitCategoryInputFieldByPid } from '@/api/system/category/category'
import { FetchDetailsById, collectDel, FetchRemoveArchivesSingle, FetchDeleteArchivesFile, FetchUpdateArchivesNo } from '@/api/collect/collect'
import { FetchDetailsById, collectDel, FetchRemoveArchivesSingle, FetchDeleteArchivesFile, FetchUpdateArchivesNo, FetchDisbandArchives } from '@/api/collect/collect'
import { FetchArchivesClassTree } from '@/api/system/archivesClass'
import { FetchDictionaryTree } from '@/api/system/dict'
import Treeselect from '@riophae/vue-treeselect'
@ -354,7 +340,6 @@ export default {
delAllLoading: false,
deleteVisible: false,
moveVisible: false,
uncoilVisible: false,
filingVisible: false,
returnVisible: false,
downloadVisible: false,
@ -773,8 +758,6 @@ export default {
this.$refs.fileSeqAdjustmentRef.isJuannei = false
})
}
this.$refs.fileSeqAdjustmentRef.adjustmentVisible = true
this.$nextTick(() => {
this.$refs.fileSeqAdjustmentRef.getDoArchivesAdjust()
})
@ -828,10 +811,33 @@ export default {
this.$message('您还未勾选需要操作的条目,请先确认!')
return false
}
this.uncoilVisible = true
},
handleUncoilConfirm() {
this.uncoilVisible = 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
}
console.log(params)
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() {
@ -839,15 +845,32 @@ export default {
this.$message('合卷操作至少勾选2个案卷,请重试!')
return false
}
this.$refs.combineFileRef.combineFileVisible = true
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.getInsertViewTable()
}).catch(() => {
})
} else {
this.$refs.insertFileRef.getInsertViewTable()
}
} else {
if (this.selections.length !== 1) {
this.$message('插卷操作只可勾选唯一目标条目,请先确认!')
return false
} else {
this.$refs.insertFileRef.getInsertViewTable()
}
}
this.$refs.insertFileRef.insertFileVisible = true
},
//
handleCollectMoveFile() {
@ -996,11 +1019,9 @@ export default {
},
closeDialog(data) {
this.formVisible = false
// this.$parent.$parent.getTableDisplayFieldsLoading = true
setTimeout(() => {
this.handleSearch(this.collectLevel)
})
console.log('this', this)
}
}
}

65
src/views/collectReorganizi/collectionLibrary/module/combineFile/index.vue

@ -1,6 +1,6 @@
<template>
<!-- 合卷 -->
<el-dialog class="fileUpload-dialog" title="合卷" :close-on-click-modal="false" :modal-append-to-body="false" append-to-body :visible.sync="combineFileVisible">
<el-dialog class="fileUpload-dialog" title="合卷" :close-on-click-modal="false" :modal-append-to-body="false" append-to-body :visible.sync="combineFileVisible" :before-close="handleCloseDialog">
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="合并到" prop="combineNumber">
<el-select v-model="form.combineNumber" placeholder="请选择" style="width: 400px;">
@ -14,29 +14,42 @@
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="combineFileVisible = false">取消</el-button>
<el-button type="text" @click="handleCloseDialog">取消</el-button>
<el-button type="primary" @click.native="handleComfireCombineFile">确定</el-button>
</div>
</el-dialog>
</template>
<script>
import { FetchMergeArchives } from '@/api/collect/collect'
export default {
name: 'CombineFile',
components: { },
mixins: [],
props: {
selectedCategory: {
type: Object,
default: function() {
return {}
}
},
collectLevel: {
type: Number,
default: function() {
return null
}
},
selections: {
type: Array,
default: () => []
}
},
data() {
return {
combineFileVisible: false,
form: {
combineNumber: ''
},
options: [
{
value: '1',
label: '档号1'
}
],
options: [],
rules: {
combineNumber: [
{ required: true, message: '请选择', trigger: 'change' }
@ -44,13 +57,41 @@ export default {
}
}
},
created() {
},
mounted() {
},
methods: {
handleComfireCombineFile() {
const archivesIds = this.selections.map(item => item.id)
const params = {
'categoryId': this.selectedCategory.id, // id
'archivesIds': archivesIds, // id
'archivesId': this.form.combineNumber // id
}
console.log(params)
FetchMergeArchives(params).then((res) => {
if (res.code !== 500) {
this.$message.success('合卷成功')
this.$emit('close-dialog')
} else {
this.$message.success('合卷失败')
}
this.combineFileVisible = false
})
},
getTargetList() {
if (this.selections.length !== 0) {
this.combineFileVisible = true
this.options = this.selections.map(item => {
return { value: item.id, label: item.archive_no }
})
}
},
handleCloseDialog(done) {
//
this.$refs.form.resetFields()
this.combineFileVisible = false
//
// done()
}
}
}

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

@ -82,6 +82,8 @@ export default {
},
methods: {
getDoArchivesAdjust() {
this.loading = true
this.sortTableData = []
const archivesIds = this.selections.map(item => item.id)
let params
if (this.isJuannei) {
@ -98,11 +100,11 @@ export default {
}
}
FetchDoArchivesAdjust(params).then((res) => {
console.log(res)
this.categoryB = res.category.id
this.sortTableData = res.list
this.queryCnFields = res.queryCnFields
this.queryFields = res.queryFields
this.adjustmentVisible = true
}).catch(err => {
console.log(err)
})
@ -134,7 +136,6 @@ export default {
'archivesIds': archivesIds,
'sequences': sequences
}
console.log(params)
FetchArchivesAdjust(params).then((res) => {
if (res !== 500) {
this.$message({

169
src/views/collectReorganizi/collectionLibrary/module/insertFile/index.vue

@ -2,21 +2,42 @@
<!-- 插件 -->
<el-dialog class="insertFile-dialog" title="插件" :close-on-click-modal="false" :modal-append-to-body="false" append-to-body :visible.sync="insertFileVisible">
<div class="head-search">
<el-input v-model="query.blurry" clearable size="small" placeholder="输入题名搜索" prefix-icon="el-icon-search" style="width: 200px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
<rrOperation />
<el-input v-model="query.search" clearable size="small" placeholder="输入题名搜索" prefix-icon="el-icon-search" style="width: 200px; margin-right: 10px;" class="filter-item" @keyup.enter.native="toQuery" />
<el-button class="filter-item filter-search" size="mini" type="success" icon="el-icon-search" @click="toQuery">搜索</el-button>
<el-button class="filter-item filter-refresh" size="mini" type="warning" icon="el-icon-refresh-left" @click="resetQuery">重置</el-button>
</div>
<el-table :data="crud.data" style="width: 100%">
<el-table
ref="table"
:data="tableData"
highlight-current-row
style="width: 100%;"
:row-key="rowKey"
@select-all="selectAll"
@selection-change="selectionChangeHandler"
@row-click="clickRowHandler"
@select="handleCurrentChange"
>
<el-table-column type="selection" :reserve-selection="true" width="55" align="center" />
<el-table-column prop="number" label="题名" width="120" />
<el-table-column prop="operator" label="档号" width="120" />
<el-table-column prop="operationType" label="年度" width="120" />
<el-table-column prop="file" label="所属门类" width="160" />
<el-table-column prop="createDate" label="所属分类" width="200" />
<el-table-column prop="createDate" label="起始时间" width="200" />
<el-table-column prop="createDate" label="终止时间" width="200" />
<el-table-column type="index" label="序号" width="55" align="center" />
<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
class="item"
effect="dark"
:content="field.fieldCnName"
placement="top-start"
>
<span>{{ field.fieldCnName }}</span>
</el-tooltip>
</template>
<template slot-scope="scope">
{{ scope.row[field.fieldName] }}
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<el-pagination
v-if="tableData.length !== 0"
:current-page="page.page"
:total="page.total"
:page-size="page.size"
@ -26,40 +47,45 @@
@current-change="handleCurrentPage"
/>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="insertFileVisible = false">取消</el-button>
<el-button type="text" @click="handleCloseDialog">取消</el-button>
<el-button type="primary" @click.native="handleComfireInsertFile">确定</el-button>
</div>
</el-dialog>
</template>
<script>
import CRUD, { presenter, crud } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import { FetchInitCategoryViewTable, FetchInitCategoryView } from '@/api/collect/collect'
export default {
name: 'InsertFile',
components: { rrOperation },
mixins: [presenter(), crud()],
cruds() {
return CRUD({
url: 'api/category/menu',
crudMethod: { },
optShow: {
add: false,
edit: false,
del: false,
reset: true,
download: false,
group: false
props: {
selectedCategory: {
type: Object,
default: function() {
return {}
}
},
collectLevel: {
type: Number,
default: function() {
return null
}
},
selections: {
type: Array,
default: () => []
}
})
},
inject: ['parentsData'],
data() {
return {
query: {
blurry: ''
search: null
},
insertFileVisible: false,
insertSelections: [],
tableData: [],
tableDisplayFields: [],
arrySort: [],
page: {
page: 1,
size: 10,
@ -70,10 +96,86 @@ export default {
created() {
},
mounted() {
},
methods: {
rowKey(row) {
return row.id
},
toQuery() {
},
resetQuery() {
this.query.search = null
},
getInsertViewTable() {
this.tableDisplayFields = []
let parentsId
let categoryLevel
if (this.collectLevel === 2) {
// ""
parentsId = null
categoryLevel = 3
} else if (this.collectLevel === 3) {
// ""
categoryLevel = 2
if (this.selectedCategory.arrangeType === 3) {
parentsId = this.parentsData.parentsProjectId
} else {
parentsId = null
}
}
FetchInitCategoryViewTable({ categoryId: this.selectedCategory.id, categoryLevel: categoryLevel }).then((res) => {
if (res) {
this.arrySort = []
this.tableDisplayFields = res
const orderSortArry = this.tableDisplayFields.filter(item => item.displayOrder).sort((a, b) => a.displayOrder - b.displayOrder)
orderSortArry.forEach(item => {
if (item.displayOrderBy) {
this.arrySort.push(item.fieldName + ',' + item.displayOrderBy)
}
})
this.$nextTick(() => {
this.getInsertList(categoryLevel, parentsId)
})
}
})
},
getInsertList(categoryLevel, parentsId) {
const params = {
'parentId': parentsId,
'categoryId': this.selectedCategory.id,
'categoryLevel': categoryLevel,
'search': this.query.search,
'page': this.page.page - 1,
'size': this.page.size,
'sort': this.arrySort
}
FetchInitCategoryView(params).then((res) => {
if (res.code !== 500) {
this.insertFileVisible = true
this.tableData = res.list.content
this.page.total = res.list.totalElements
}
})
},
// table -
selectAll(val) {
this.insertSelections = val
},
clickRowHandler(row) {
this.$refs.table.toggleRowSelection(row)
// this.insertSelections = this.crud.selections
},
selectionChangeHandler(val) {
this.insertSelections = val
},
handleCurrentChange(selection, row) {
this.insertSelections = selection
},
handleComfireInsertFile() {
this.insertFileVisible = false
console.log('insertSelections', this.insertSelections)
// this.insertFileVisible = false
},
handleSizeChange(size) {
this.page.size = size
@ -81,6 +183,15 @@ export default {
},
handleCurrentPage(val) {
this.page.page = val
},
handleCloseDialog(done) {
//
this.query.search = null
this.tableDisplayFields = []
this.tableData = []
this.insertFileVisible = false
//
// done()
}
}
}

Loading…
Cancel
Save