Browse Source

档案管理-抽离

master
xuhuajiao 3 years ago
parent
commit
54685992a8
  1. 238
      src/utils/archives.js
  2. 231
      src/views/archivesManage/archivesList/archivesAnjuan/index.vue
  3. 224
      src/views/archivesManage/archivesList/archivesJuannei/index.vue
  4. 173
      src/views/archivesManage/archivesList/archivesProject/index.vue
  5. 19
      src/views/archivesManage/archivesList/index.vue

238
src/utils/archives.js

@ -0,0 +1,238 @@
import qs from 'qs'
import { exportFile } from '@/utils/index'
import { FetchTableDisplayFields, FetchInitArchivesView, FetchFormDisplayFields } from '@/api/archivesManage/archivesList'
export const common = {
// 组件共用属性
data() {
return {
permission: {
add: ['admin', 'archivesList:add'],
edit: ['admin', 'archivesList:edit'],
del: ['admin', 'archivesList:del'],
download: ['admin', 'archivesList:download']
},
page: {
page: 0,
size: 10,
total: 0
},
query: {
'queryType': null,
'queryTitle': null,
'recordNo': null,
'archiveCtgNo': null,
'archiveNo': null,
'responsibleby': null
},
stateOptions: [ // 搜索 - 状态选择
{ key: '1', label: '全部' },
{ key: '2', label: '未装' },
{ key: '3', label: '未入' },
{ key: '4', label: '在库' },
{ key: '5', label: '待借' },
{ key: '6', label: '已借' }
],
tableDisplayFields: [], // table-list-title字段
getTableDisplayFieldsLoading: false, // table-loading
formVisible: false,
formTitle: '新建档案',
formPreviewData: [], // 预览界面data
totalSumAll: 0, // 删除时,内部文件数据求和
arrySort: [], // 多项sort-query
selections: [], // table已选择的
categoryId: null, // 上传附件使用
parentsId: null, // 父id
arcId: null, // 档案ID
yearGroup: [], // 智能分类 - 年度
uploadFileVisible: false // 上传附件
}
},
// 组件共用方法
methods: {
// 搜索-select
querySelect(name, val) {
this[name] = val
},
// 案卷 / 卷内 / 文件 导出
doExport(type) {
this.crud.downloadLoading = true
if (type === 0 && this.selectedCategory.isType === 2) {
this.parentsId = this.projectSelection.id
} else if (type === 1 && this.selectedCategory.isType === 2) {
this.parentsId = this.anjuanSelection.id
} else {
this.parentsId = null
}
const params = {
'categoryId': this.categoryId,
'parentsId': this.parentsId
}
exportFile(this.baseApi + '/api/archives/exportArchives?' + qs.stringify(params))
this.crud.downloadLoading = false
},
// table - 表头项
getTableItemCommon(type) {
if (type === 0) {
this.categoryId = this.selectedCategory.id
} else if (type === 1) {
if (this.selectedCategory.isType === 2) {
if (this.selectedCategory.children.length !== 0) {
this.categoryId = this.selectedCategory.children[0].id
}
} else {
this.categoryId = this.selectedCategory.id
}
} else if (type === 2) {
if (this.selectedCategory.isType === 2) {
if (this.selectedCategory.children.length !== 0) {
this.categoryId = this.selectedCategory.children[0].children[0].id
}
} else if (this.selectedCategory.isType === 3) {
if (this.selectedCategory.children.length !== 0) {
this.categoryId = this.selectedCategory.children[0].id
}
} else {
this.categoryId = this.selectedCategory.id
}
}
this.getTableDisplayFieldsLoading = true
this.selections = []
FetchTableDisplayFields({ categoryId: this.categoryId }).then(data => {
if (data) {
this.arrySort = []
this.tableDisplayFields = data
this.getTableDisplayFieldsLoading = false
const orderSortArry = this.tableDisplayFields.filter(item => item.queue).sort((a, b) => a.queue - b.queue)
orderSortArry.forEach(item => {
this.arrySort.push(item.fieldName + ',' + item.displayOrderBy)
})
}
})
},
// table - list
getListCommon(name, page, type) {
if (type === 0) {
this.parentsId = null
} else if (type === 1) {
if (this.selectedCategory.isType === 3 || this.selectedCategory.isType === 5) {
this.parentsId = null
} else {
this.parentsId = this.projectSelection.id
}
} else if (type === 2) {
if (this.selectedCategory.isType !== 4) {
this.parentsId = this.anjuanSelection.id
} else {
this.parentsId = null
}
}
this.selections = []
this.page.page = isNaN(page - 1) ? 0 : page - 1
this.formVisible = false
this.getTableDisplayFieldsLoading = true
const params = {
'categoryId': this.categoryId,
'parentsId': this.parentsId,
'isdel': this.recycleMain.isdel,
'page': this.page.page,
'size': this.page.size,
'sort': this.arrySort,
'queryType': this.query.queryType,
'queryTitle': this.query.queryTitle,
'recordNo': this.query.recordNo,
'archiveCtgNo': this.query.archiveCtgNo,
'responsibleby': this.query.responsibleby,
'archiveNo': this.query.archiveNo,
'archiveYear': this.smartQuery.archiveYear,
'department': this.smartQuery.department,
'retention': this.smartQuery.retention,
'securityClass': this.smartQuery.securityClass,
'organizationMatter': this.smartQuery.organizationMatter
}
FetchInitArchivesView(params).then(data => {
this.getTableDisplayFieldsLoading = false
if (data) {
this[name] = data.list.content
this.yearGroup = data.yearGroup
this.page.total = data.list.totalElements
}
})
},
// 著录界面-form/详情-api
handleForm(type, title) {
if (type === 'add') {
this.formTitle = '新增' + title
this.arcId = null
// this.parentsId = this[name].id //案卷和卷内有 不确定
} else if (type === 'edit') {
this.arcId = this.selections[0].id
this.formTitle = '编辑' + title
}
this.formVisible = true
this.form.dictionaryConfigId = {}
this.formPreviewData = []
// 档案预编辑获取字段
const params = {
categoryId: this.categoryId,
archivesId: this.arcId
}
this.getFormInfo(params, type)
},
getFormInfo(params, type) {
FetchFormDisplayFields(params).then(data => {
this.formPreviewData = data.showFiled
this.$nextTick(() => {
if (type === 'edit') {
this.$refs.previewForm.addOrUpdateForm = data.echo
}
})
})
},
// form - submit
handlerArchivesSubmit() {
this.$refs.previewForm.submitForm('addOrUpdateForm', this.categoryId)
this.selections = []
},
// 选择删除
toDelete(data) {
this.$refs.deltArchives.deleteVisible = true
this.getTotalSumAll()
},
getTotalSumAll() {
this.totalSumAll = 0
this.selections.map((item) => { if (!isNaN(item.children_num)) this.totalSumAll += item.children_num })
if (isNaN(this.totalSumAll)) {
return 0
}
return this.totalSumAll
},
// 删除 - 关闭
handleClose(done) {
this.formVisible = false
done()
},
/* 重新渲染table组件 防止table-fixed 错位 配合watch-table数据 */
doLayout() {
this.$nextTick(() => {
this.$refs.table.doLayout()
})
},
// 上传附件
uploadFile() {
this.uploadFileVisible = true
this.arcId = this.selections[0].id
this.$nextTick(() => {
this.$refs.uploadFile.tableData = []
this.$refs.uploadFile.getFileList()
})
},
// 还原
handleRestore() {
this.$refs.restore.restoreVisible = true
}
},
// 组件挂载时的共用方法
mounted() {
}
}

231
src/views/archivesManage/archivesList/archivesAnjuan/index.vue

@ -4,13 +4,13 @@
<div class="head-container head-archives clearfix">
<div v-if="!recycleMain.isRecycle" class="archives-crud">
<!-- 新增 -->
<el-button size="mini" :disabled="isProject && selectedCategory.isType === 2" icon="el-icon-plus" @click="handleForm('add')">新增</el-button>
<el-button size="mini" :disabled="isProject && selectedCategory.isType === 2" icon="el-icon-plus" @click="handleForm('add','档案')">新增</el-button>
<!-- 修改 -->
<el-button size="mini" icon="el-icon-edit" :disabled="selections.length !== 1" @click="handleForm('edit')">修改</el-button>
<el-button size="mini" icon="el-icon-edit" :disabled="selections.length !== 1" @click="handleForm('edit','档案')">修改</el-button>
<!-- 删除btn 多选 -->
<el-button v-permission="permission.del" icon="el-icon-delete" size="mini" :loading="crud.delAllLoading" :disabled="selections.length === 0" @click="toDelete(selections)">删除</el-button>
<!-- 导出btn :disabled="!crud.data.length" -->
<el-button v-permission="permission.download" :disabled="isProject && selectedCategory.isType === 2" :loading="crud.downloadLoading" size="mini" icon="el-icon-download" @click="doExport">导出</el-button>
<el-button v-permission="permission.download" :disabled="isProject && selectedCategory.isType === 2" :loading="crud.downloadLoading" size="mini" icon="el-icon-download" @click="doExport(0)">导出</el-button>
<!-- 上传附件btn 针对卷内/文件 单选 -->
<el-button v-if="selectedCategory.isType===5" :disabled="selections.length !== 1" size="mini" icon="el-icon-download" @click="uploadFile">上传附件</el-button>
</div>
@ -26,7 +26,7 @@
<el-option v-for="item in stateOptions" :key="item.key" :label="item.label" :value="item.key" />
</el-select>
<el-input v-model="anjuanQuery[anjuanInputSelect]" clearable size="small" placeholder="请输入关键词" style="width: 200px;" class="input-prepend filter-item" @clear="getTableList()" @keyup.enter.native="getTableList">
<el-select slot="prepend" v-model="anjuanInputSelect" style="width: 80px" @change="querySelect">
<el-select slot="prepend" v-model="anjuanInputSelect" style="width: 80px" @change="querySelect(anjuanInputSelect)">
<el-option
v-for="item in queryOption"
:key="item.value"
@ -101,29 +101,29 @@
{{ scope.row[field.fieldName] }}
</template>
</el-table-column>
<el-table-column v-if="!recycleMain.isRecycle" label="装盒" width="100" align="center" :fixed="fixedStatusBar?false:'right'">
<el-table-column v-if="!recycleMain.isRecycle" label="装盒" width="100" align="center" :fixed="fixedStatusBar ? false : 'right' ">
<!-- state-active 已装/已入/已借/已绑 -->
<template slot-scope="scope">
<!-- 未装 / 已装 -->
<span :class="['row-state', 'row-packing', scope.row.case_no?'state-active':'']">{{ scope.row.case_no ? '已装': '未装' }}</span>
<span :class="['row-state', 'row-packing', scope.row.case_no ? 'state-active' : '' ]">{{ scope.row.case_no ? '已装': '未装' }}</span>
</template>
</el-table-column>
<el-table-column v-if="!recycleMain.isRecycle" label="入库" width="100" align="center" :fixed="fixedStatusBar?false:'right'">
<el-table-column v-if="!recycleMain.isRecycle" label="入库" width="100" align="center" :fixed="fixedStatusBar ? false : 'right' ">
<template slot-scope="">
<!-- 未入 / 已入 -->
<span class="row-state row-warehousing">未入</span>
</template>
</el-table-column>
<el-table-column v-if="!recycleMain.isRecycle" label="借阅" width="100" align="center" :fixed="fixedStatusBar?false:'right'">
<el-table-column v-if="!recycleMain.isRecycle" label="借阅" width="100" align="center" :fixed="fixedStatusBar ? false : 'right' ">
<template slot-scope="">
<!-- 待借 / 不可借- 表示 / 已借 -->
<span class="row-state row-lending"></span>
</template>
</el-table-column>
<el-table-column v-if="!recycleMain.isRecycle" label="标签" width="100" align="center" :fixed="fixedStatusBar?false:'right'">
<el-table-column v-if="!recycleMain.isRecycle" label="标签" width="100" align="center" :fixed="fixedStatusBar ? false : 'right' ">
<template slot-scope="scope">
<!-- 未绑 / 已绑 -->
<span :class="['row-state', 'row-binding', scope.row.tid?'state-active':'']">{{ scope.row.tid ? '已绑': '未绑' }}</span>
<span :class="['row-state', 'row-binding', scope.row.tid ? 'state-active' : '' ]">{{ scope.row.tid ? '已绑': '未绑' }}</span>
</template>
</el-table-column>
</el-table>
@ -176,11 +176,9 @@
</template>
<script>
import qs from 'qs'
import { FetchTableDisplayFields, FetchInitArchivesView, FetchFormDisplayFields } from '@/api/archivesManage/archivesList'
import { header, form } from '@crud/crud'
import { mapGetters } from 'vuex'
import { exportFile } from '@/utils/index'
import { common } from '@/utils/archives'
import PreviewForm from '@/views/components/category/PreviewForm'
import ArchivesInfo from '../module/archivesInfo/index'
import Packing from '../module/packing/index'
@ -194,7 +192,8 @@ export default {
components: { PreviewForm, ArchivesInfo, Packing, BindingTagDlg, UploadFile, RestoreArchives, DeltArchives },
mixins: [
header(),
form({})
form({}),
common
],
provide() {
return {
@ -232,54 +231,14 @@ export default {
},
data() {
return {
permission: {
add: ['admin', 'archivesList:add'],
edit: ['admin', 'archivesList:edit'],
del: ['admin', 'archivesList:del'],
download: ['admin', 'archivesList:download']
},
page: {
page: 0,
size: 10,
total: 0
},
anjuanData: [],
formVisible: false,
formTitle: '新建档案',
tableDisplayFields: [], // table-list-title
getTableDisplayFieldsLoading: false, // table-loading
formPreviewData: [], // data
anjuanQuery: {},
query: {
'queryType': null,
'queryTitle': null,
'recordNo': null,
'archiveCtgNo': null,
'archiveNo': null,
'responsibleby': null
},
stateOptions: [ // -
{ key: '1', label: '全部' },
{ key: '2', label: '未装' },
{ key: '3', label: '未入' },
{ key: '4', label: '在库' },
{ key: '5', label: '待借' },
{ key: '6', label: '已借' }
],
queryOption: [
{ value: 'queryTitle', label: '题名' },
{ value: 'archiveNo', label: '档号' }
],
anjuanInputSelect: '',
totalSumAll: 0, //
arrySort: [], // sort-query
selections: [], // table
categoryId: null, // 使
parentsId: null, // id
arcId: null, // ID
yearGroup: [], // -
isAnjuan: true, // -/
uploadFileVisible: false, //
lengingVisible: false //
}
},
@ -309,7 +268,8 @@ export default {
created() {
// select -
this.anjuanInputSelect = this.queryOption[0].value
if (this.selectedCategory === 5) {
this.selections = []
if (this.selectedCategory.isType === 5) {
this.queryOption.push({ value: 'responsibleby', label: '责任者' })
} else {
this.queryOption.push({ value: 'archiveCtgNo', label: '实体分类号' })
@ -318,50 +278,12 @@ export default {
mounted() {
},
methods: {
doExport(fileName = '未知文件') {
this.crud.downloadLoading = true
if (this.selectedCategory.isType !== 3 || this.selectedCategory.isType !== 5) {
this.parentsId = this.projectSelection.id
} else {
this.parentsId = null
}
const params = {
'categoryId': this.categoryId,
'parentsId': this.parentsId
}
exportFile(this.baseApi + '/api/archives/exportArchives?' + qs.stringify(params))
this.crud.downloadLoading = false
},
// -select
querySelect(val) {
this.anjuanInputSelect = val
},
//
getTableDisplayFields() {
this.getTableDisplayFieldsLoading = true
this.selections = []
if (this.selectedCategory.isType === 2) {
if (this.selectedCategory.children.length !== 0) {
this.categoryId = this.selectedCategory.children[0].id
}
} else {
this.categoryId = this.selectedCategory.id
}
FetchTableDisplayFields({ categoryId: this.categoryId }).then(data => {
if (data) {
this.arrySort = []
this.tableDisplayFields = data
this.getTableDisplayFieldsLoading = false
const orderSortArry = this.tableDisplayFields.filter(item => item.queue).sort((a, b) => a.queue - b.queue)
orderSortArry.forEach(item => {
this.arrySort.push(item.fieldName + ',' + item.displayOrderBy)
})
}
})
getTableDisplayFields(type) {
this.getTableItemCommon(type)
},
// list
getTableList(page) {
this.selections = []
switch (this.anjuanInputSelect) {
case 'queryTitle': //
this.query.queryTitle = this.anjuanQuery[this.anjuanInputSelect]
@ -372,82 +294,13 @@ export default {
this.query.queryTitle = ''
break
case 'archiveCtgNo': //
this.query.archiveCtgNo = this.juanneiQuery[this.juanneiInputSelect]
this.query.archiveCtgNo = this.anjuanQuery[this.juanneiInputSelect]
break
case 'responsibleby': //
this.query.responsibleby = this.juanneiQuery[this.juanneiInputSelect]
this.query.responsibleby = this.anjuanQuery[this.juanneiInputSelect]
break
}
this.page.page = isNaN(page - 1) ? 0 : page - 1
this.formVisible = false
this.getTableDisplayFieldsLoading = true
if (this.selectedCategory.isType === 3 || this.selectedCategory.isType === 5) {
this.parentsId = null
} else {
this.parentsId = this.projectSelection.id
}
const params = {
'categoryId': this.categoryId,
'parentsId': this.parentsId,
'isdel': this.recycleMain.isdel,
'page': this.page.page,
'size': this.page.size,
'sort': this.arrySort,
'queryType': this.query.queryType,
'queryTitle': this.query.queryTitle,
'recordNo': this.query.recordNo,
'archiveCtgNo': this.query.archiveCtgNo,
'responsibleby': this.query.responsibleby,
'archiveNo': this.query.archiveNo,
'archiveYear': this.smartQuery.archiveYear,
'department': this.smartQuery.department,
'retention': this.smartQuery.retention,
'securityClass': this.smartQuery.securityClass,
'organizationMatter': this.smartQuery.organizationMatter
}
FetchInitArchivesView(params).then(data => {
this.getTableDisplayFieldsLoading = false
if (data) {
this.anjuanData = data.list.content
this.yearGroup = data.yearGroup
this.page.total = data.list.totalElements
}
})
},
// -form/-api
handleForm(type) {
if (type === 'add') {
this.formTitle = '新增档案'
this.arcId = null
this.parentsId = this.projectSelection.id
} else if (type === 'edit') {
this.arcId = this.selections[0].id
this.formTitle = '编辑档案'
}
this.formVisible = true
this.form.dictionaryConfigId = {}
this.formPreviewData = []
//
const params = {
categoryId: this.categoryId,
archivesId: this.arcId
}
this.getFormInfo(params, type)
},
getFormInfo(params, type) {
FetchFormDisplayFields(params).then(data => {
this.formPreviewData = data.showFiled
this.$nextTick(() => {
if (type === 'edit') {
this.$refs.previewForm.addOrUpdateForm = data.echo
}
})
})
},
// form - submit
handlerArchivesSubmit() {
this.$refs.previewForm.submitForm('addOrUpdateForm', this.categoryId)
this.selections = []
this.getListCommon('anjuanData', page, 1)
},
// table -
selectAll(val) {
@ -485,43 +338,6 @@ export default {
this.$emit('getJnInAjBtnState', this.isAnjuan)
this.$emit('getSelections', row, selection)
},
//
toDelete(data) {
this.$refs.deltArchives.deleteVisible = true
this.getTotalSumAll()
},
getTotalSumAll() {
this.totalSumAll = 0
this.selections.map((item) => { if (!isNaN(item.children_num)) this.totalSumAll += item.children_num })
if (isNaN(this.totalSumAll)) {
return 0
}
return this.totalSumAll
},
// -
handleClose(done) {
this.formVisible = false
done()
},
/* 重新渲染table组件 防止table-fixed 错位 配合watch-table数据 */
doLayout() {
this.$nextTick(() => {
this.$refs.table.doLayout()
})
},
//
uploadFile() {
this.uploadFileVisible = true
this.arcId = this.selections[0].id
this.$nextTick(() => {
this.$refs.uploadFile.tableData = []
this.$refs.uploadFile.getFileList()
})
},
//
handleRestore() {
this.$refs.restore.restoreVisible = true
},
//
bindingTag(data) {
if (data[0].tid) {
@ -555,11 +371,4 @@ export default {
<style rel="stylesheet/scss" lang="scss" scoped>
@import "~@/assets/styles/archives-manage.scss";
::v-deep .el-table th.el-table__cell > .cell {
white-space: pre;
// white-space: pre-wrap;
}
.iconfont::before{
margin-right: 6px;
}
</style>

224
src/views/archivesManage/archivesList/archivesJuannei/index.vue

@ -4,13 +4,13 @@
<div class="head-container head-archives clearfix">
<div v-if="!recycleMain.isRecycle" class="archives-crud">
<!-- 新增 -->
<el-button v-if="selectedCategory.isType !== 4" size="mini" :disabled="isAnjuan" icon="el-icon-plus" @click="handleForm('add')">新增</el-button>
<el-button v-if="selectedCategory.isType !== 4" size="mini" :disabled="isAnjuan" icon="el-icon-plus" @click="handleForm('add','档案')">新增</el-button>
<!-- 修改 -->
<el-button size="mini" icon="el-icon-edit" :disabled="selections.length !== 1" @click="handleForm('edit')">修改</el-button>
<el-button size="mini" icon="el-icon-edit" :disabled="selections.length !== 1" @click="handleForm('edit','档案')">修改</el-button>
<!-- 删除btn 多选 -->
<el-button v-permission="permission.del" icon="el-icon-delete" size="mini" :loading="crud.delAllLoading" :disabled="selections.length === 0" @click="toDelete(selections)">删除</el-button>
<!-- 导出btn :disabled="!crud.data.length" -->
<el-button v-permission="permission.download" :disabled="isAnjuan && selectedCategory.isType !== 4" :loading="crud.downloadLoading" size="mini" icon="el-icon-download" @click="doExport">导出</el-button>
<el-button v-permission="permission.download" :disabled="isAnjuan && selectedCategory.isType !== 4" :loading="crud.downloadLoading" size="mini" icon="el-icon-download" @click="doExport(1)">导出</el-button>
<!-- 上传附件btn 针对卷内/文件 单选 -->
<el-button :disabled="selections.length !== 1" size="mini" icon="el-icon-download" @click="uploadFile">上传附件</el-button>
</div>
@ -22,7 +22,7 @@
<div class="head-search">
<!-- @keyup.enter.native="crud.toQuery" -->
<el-input v-model="juanneiQuery[juanneiInputSelect]" clearable size="small" placeholder="请输入关键词" style="width: 200px;" class="input-prepend filter-item" @clear="getTableList()" @keyup.enter.native="getTableList">
<el-select slot="prepend" v-model="juanneiInputSelect" style="width: 80px" @change="querySelect">
<el-select slot="prepend" v-model="juanneiInputSelect" style="width: 80px" @change="querySelect(juanneiInputSelect)">
<el-option
v-for="item in queryOption"
:key="item.value"
@ -84,14 +84,14 @@
{{ scope.row[field.fieldName] }}
</template>
</el-table-column>
<el-table-column v-if="!recycleMain.isRecycle" label="装盒" width="100" align="center" :fixed="fixedStatusBar?false:'right'">
<el-table-column v-if="!recycleMain.isRecycle" label="装盒" width="100" align="center" :fixed="fixedStatusBar ? false : 'right' ">
<!-- state-active 已装/已入/已借/已绑 -->
<template slot-scope="scope">
<!-- 未装 / 已装 -->
<span :class="['row-state', 'row-packing', scope.row.case_no?'state-active':'']">{{ scope.row.case_no ? '已装': '未装' }}</span>
<span :class="['row-state', 'row-packing', scope.row.case_no ? 'state-active' : '' ]">{{ scope.row.case_no ? '已装': '未装' }}</span>
</template>
</el-table-column>
<el-table-column v-if="!recycleMain.isRecycle" label="入库" width="100" align="center" :fixed="fixedStatusBar?false:'right'">
<el-table-column v-if="!recycleMain.isRecycle" label="入库" width="100" align="center" :fixed="fixedStatusBar ? false : 'right' ">
<template slot-scope="">
<!-- 未入 / 已入 -->
<span class="row-state row-warehousing">未入</span>
@ -129,11 +129,9 @@
</template>
<script>
import qs from 'qs'
import { FetchTableDisplayFields, FetchInitArchivesView, FetchFormDisplayFields } from '@/api/archivesManage/archivesList'
import { header, form } from '@crud/crud'
import { mapGetters } from 'vuex'
import { exportFile } from '@/utils/index'
import { common } from '@/utils/archives'
import PreviewForm from '@/views/components/category/PreviewForm'
import ArchivesInfo from '../module/archivesInfo/index'
import UploadFile from '../module/uploadFile/index'
@ -145,7 +143,8 @@ export default {
components: { PreviewForm, ArchivesInfo, UploadFile, RestoreArchives, DeltArchives },
mixins: [
header(),
form({})
form({}),
common
],
inject: ['recycleMain'],
props: {
@ -178,54 +177,14 @@ export default {
},
data() {
return {
permission: {
add: ['admin', 'archivesList:add'],
edit: ['admin', 'archivesList:edit'],
del: ['admin', 'archivesList:del'],
download: ['admin', 'archivesList:download']
},
page: {
page: 0,
size: 10,
total: 0
},
junneiData: [],
formVisible: false,
formTitle: '新建档案',
tableDisplayFields: [], // table-list-title
getTableDisplayFieldsLoading: false, // table-loading
formPreviewData: [], // data
juanneiQuery: {},
query: {
'queryType': null,
'queryTitle': null,
'recordNo': null,
'archiveCtgNo': null,
'archiveNo': null,
'responsibleby': null
},
stateOptions: [ // -
{ key: '1', label: '全部' },
{ key: '2', label: '未装' },
{ key: '3', label: '未入' },
{ key: '4', label: '在库' },
{ key: '5', label: '待借' },
{ key: '6', label: '已借' }
],
queryOption: [
{ value: 'queryTitle', label: '题名' },
{ value: 'archiveNo', label: '档号' },
{ value: 'responsibleby', label: '责任者' }
],
juanneiInputSelect: '',
totalSumAll: 0, //
arrySort: [], // sort-query
selections: [], // table
categoryId: null,
parentsId: null, // id
arcId: null, // ID
yearGroup: [], // -
uploadFileVisible: false //
juanneiInputSelect: ''
}
},
computed: {
@ -235,7 +194,6 @@ export default {
},
watch: {
selectedCategory: function(newValue, oldValue) {
this.setCategory = newValue
},
tableDisplayFields(val) {
this.doLayout()
@ -258,57 +216,14 @@ export default {
this.selections = []
},
mounted() {
// this.getTableDisplayFields()
},
methods: {
doExport(fileName = '未知文件') {
this.crud.downloadLoading = true
if (this.selectedCategory.isType !== 4) {
this.parentsId = this.anjuanSelection.id
} else {
this.parentsId = null
}
const params = {
'categoryId': this.categoryId,
'parentsId': this.parentsId
}
exportFile(this.baseApi + '/api/archives/exportArchives?' + qs.stringify(params))
this.crud.downloadLoading = false
},
// -select
querySelect(val) {
this.juanneiInputSelect = val
},
//
getTableDisplayFields() {
this.getTableDisplayFieldsLoading = true
this.selections = []
if (this.selectedCategory.isType === 2) {
if (this.selectedCategory.children.length !== 0) {
this.categoryId = this.selectedCategory.children[0].children[0].id
}
} else if (this.selectedCategory.isType === 3) {
if (this.selectedCategory.children.length !== 0) {
this.categoryId = this.selectedCategory.children[0].id
}
} else {
this.categoryId = this.selectedCategory.id
}
FetchTableDisplayFields({ categoryId: this.categoryId }).then(data => {
if (data) {
this.arrySort = []
this.tableDisplayFields = data
this.getTableDisplayFieldsLoading = false
const orderSortArry = this.tableDisplayFields.filter(item => item.queue).sort((a, b) => a.queue - b.queue)
orderSortArry.forEach(item => {
this.arrySort.push(item.fieldName + ',' + item.displayOrderBy)
})
}
})
getTableDisplayFields(type) {
this.getTableItemCommon(type)
},
// list
getTableList(page) {
this.selections = []
switch (this.juanneiInputSelect) {
case 'queryTitle': //
this.query.queryTitle = this.juanneiQuery[this.juanneiInputSelect]
@ -320,76 +235,7 @@ export default {
this.query.responsibleby = this.juanneiQuery[this.juanneiInputSelect]
break
}
this.page.page = isNaN(page - 1) ? 0 : page - 1
this.formVisible = false
this.getTableDisplayFieldsLoading = true
if (this.selectedCategory.isType !== 4) {
this.parentsId = this.anjuanSelection.id
} else {
this.parentsId = null
}
const params = {
'categoryId': this.categoryId,
'parentsId': this.parentsId,
'isdel': this.recycleMain.isdel,
'page': this.page.page,
'size': this.page.size,
'sort': this.arrySort,
'queryType': this.query.queryType,
'queryTitle': this.query.queryTitle,
'recordNo': this.query.recordNo,
'archiveCtgNo': this.query.archiveCtgNo,
'responsibleby': this.query.responsibleby,
'archiveNo': this.query.archiveNo,
'archiveYear': this.smartQuery.archiveYear,
'department': this.smartQuery.department,
'retention': this.smartQuery.retention,
'securityClass': this.smartQuery.securityClass,
'organizationMatter': this.smartQuery.organizationMatter
}
FetchInitArchivesView(params).then(data => {
this.getTableDisplayFieldsLoading = false
if (data) {
this.junneiData = data.list.content
this.yearGroup = data.yearGroup
this.page.total = data.list.totalElements
}
})
},
// -form/-api
handleForm(type) {
if (type === 'add') {
this.formTitle = '新增档案'
this.arcId = null
this.parentsId = this.anjuanSelection.id
} else if (type === 'edit') {
this.arcId = this.selections[0].id
this.formTitle = '编辑档案'
}
this.formVisible = true
this.form.dictionaryConfigId = {}
this.formPreviewData = []
//
const params = {
categoryId: this.categoryId,
archivesId: this.arcId
}
this.getFormInfo(params, type)
},
getFormInfo(params, type) {
FetchFormDisplayFields(params).then(data => {
this.formPreviewData = data.showFiled
this.$nextTick(() => {
if (type === 'edit') {
this.$refs.previewForm.addOrUpdateForm = data.echo
}
})
})
},
// form - submit
handlerArchivesSubmit() {
this.$refs.previewForm.submitForm('addOrUpdateForm', this.categoryId)
this.selections = []
this.getListCommon('junneiData', page, 2)
},
// table -
selectAll(val) {
@ -398,10 +244,10 @@ export default {
// table -
tableDoubleClick(row) {
this.$refs.archivesInfo.isHasFile = true
this.arcId = row.id
this.$refs.archivesInfo.detailTitle = '档案详情'
this.$refs.archivesInfo.archivesInfoVisible = true
this.$refs.archivesInfo.archivesTabIndex = 0
this.arcId = row.id
this.$refs.archivesInfo.getDetial(row.id)
},
// table - row
@ -413,39 +259,6 @@ export default {
//
handleCurrentChange(selection, row) {
this.selections = selection
},
//
toDelete(data) {
this.$refs.deltArchives.deleteVisible = true
this.totalSumAll = 0
this.selections.map((item) => { if (!isNaN(item.children_num)) this.totalSumAll += item.children_num })
if (isNaN(this.totalSumAll)) {
return 0
}
},
// -
handleClose(done) {
this.formVisible = false
done()
},
/* 重新渲染table组件 防止table-fixed 错位 配合watch-table数据 */
doLayout() {
this.$nextTick(() => {
this.$refs.table.doLayout()
})
},
//
uploadFile() {
this.uploadFileVisible = true
this.arcId = this.selections[0].id
this.$nextTick(() => {
this.$refs.uploadFile.tableData = []
this.$refs.uploadFile.getFileList()
})
},
//
handleRestore() {
this.$refs.restore.restoreVisible = true
}
}
}
@ -453,11 +266,4 @@ export default {
<style rel="stylesheet/scss" lang="scss" scoped>
@import "~@/assets/styles/archives-manage.scss";
::v-deep .el-table th.el-table__cell > .cell {
white-space: pre;
// white-space: pre-wrap; //
}
.iconfont::before{
margin-right: 6px;
}
</style>

173
src/views/archivesManage/archivesList/archivesProject/index.vue

@ -4,9 +4,9 @@
<div class="head-container head-archives clearfix">
<div v-if="!recycleMain.isRecycle" class="archives-crud">
<!-- 新增 -->
<el-button size="mini" icon="el-icon-plus" @click="handleForm('add')">新增</el-button>
<el-button size="mini" icon="el-icon-plus" @click="handleForm('add','项目')">新增</el-button>
<!-- 修改 -->
<el-button size="mini" icon="el-icon-edit" :disabled="selections .length !== 1" @click="handleForm('edit')">修改</el-button>
<el-button size="mini" icon="el-icon-edit" :disabled="selections .length !== 1" @click="handleForm('edit','项目')">修改</el-button>
<!-- 删除btn 多选 -->
<el-button icon="el-icon-delete" size="mini" :loading="crud.delAllLoading" :disabled="selections.length === 0" @click="toDelete(selections)">删除</el-button>
</div>
@ -18,7 +18,7 @@
<div class="head-search">
<!-- @keyup.enter.native="crud.toQuery" -->
<el-input v-model="projectQuery[projectInputSelect]" clearable size="small" placeholder="请输入关键词" style="width: 200px;" class="input-prepend filter-item" @clear="getTableList()" @keyup.enter.native="getTableList">
<el-select slot="prepend" v-model="projectInputSelect" style="width: 80px" @change="querySelect">
<el-select slot="prepend" v-model="projectInputSelect" style="width: 80px" @change="querySelect(projectInputSelect)">
<el-option
v-for="item in queryOption"
:key="item.value"
@ -104,8 +104,8 @@
</template>
<script>
import { FetchTableDisplayFields, FetchInitArchivesView, FetchFormDisplayFields } from '@/api/archivesManage/archivesList'
import { header, form } from '@crud/crud'
import { common } from '@/utils/archives'
import PreviewForm from '@/views/components/category/PreviewForm'
import ArchivesInfo from '../module/archivesInfo/index'
import RestoreArchives from '../module/restoreArchives/index'
@ -116,7 +116,8 @@ export default {
components: { PreviewForm, ArchivesInfo, RestoreArchives, DeltArchives },
mixins: [
header(),
form({})
form({}),
common
],
inject: ['recycleMain'],
props: {
@ -135,52 +136,14 @@ export default {
},
data() {
return {
permission: {
add: ['admin', 'archivesList:add'],
edit: ['admin', 'archivesList:edit'],
del: ['admin', 'archivesList:del'],
download: ['admin', 'archivesList:download']
},
page: {
page: 0,
size: 10,
total: 0
},
projectData: [],
formVisible: false,
formTitle: '新建项目', // form - title
tableDisplayFields: [], // table-list-title
getTableDisplayFieldsLoading: false, // table-loading
formPreviewData: [], // data
projectQuery: {},
query: {
'queryType': null,
'queryTitle': null,
'recordNo': null,
'archiveCtgNo': null,
'archiveNo': null
},
stateOptions: [ // -
{ key: '1', label: '全部' },
{ key: '2', label: '未装' },
{ key: '3', label: '未入' },
{ key: '4', label: '在库' },
{ key: '5', label: '待借' },
{ key: '6', label: '已借' }
],
queryOption: [
{ value: 'queryTitle', label: '题名' },
{ value: 'recordNo', label: '项目代号' }
],
projectInputSelect: '',
arrySort: [], // sort - query
parentsId: null, // id
arcId: null, // ID\
categoryId: null, // 使
isProject: true, // -/
selections: [], // table
totalSumAll: 0, // - num
yearGroup: [] // -
isProject: true // -/
}
},
watch: {
@ -201,32 +164,14 @@ export default {
this.selections = []
},
mounted() {
this.getTableDisplayFields()
},
methods: {
// -select
querySelect(val) {
this.projectInputSelect = val
},
// -
getTableDisplayFields() {
this.selections = []
this.categoryId = this.selectedCategory.id
FetchTableDisplayFields({ categoryId: this.categoryId }).then(data => {
if (data) {
this.arrySort = []
this.tableDisplayFields = data
this.getTableDisplayFieldsLoading = false
const orderSortArry = this.tableDisplayFields.filter(item => item.queue).sort((a, b) => a.queue - b.queue)
orderSortArry.forEach(item => {
this.arrySort.push(item.fieldName + ',' + item.displayOrderBy)
})
}
})
getTableDisplayFields(type) {
this.getTableItemCommon(type)
},
// table - list
getTableList(page) {
this.selections = []
switch (this.projectInputSelect) {
case 'queryTitle': //
this.query.queryTitle = this.projectQuery[this.projectInputSelect]
@ -235,70 +180,7 @@ export default {
this.query.recordNo = this.projectQuery[this.projectInputSelect]
break
}
this.page.page = isNaN(page - 1) ? 0 : page - 1
this.formVisible = false
this.getTableDisplayFieldsLoading = true
this.parentsId = null
const params = {
'categoryId': this.categoryId,
'parentsId': this.parentsId,
'isdel': this.recycleMain.isdel,
'page': this.page.page,
'size': this.page.size,
'sort': this.arrySort,
'queryType': this.query.queryType,
'queryTitle': this.query.queryTitle,
'recordNo': this.query.recordNo,
'archiveCtgNo': this.query.archiveCtgNo,
'archiveNo': this.query.archiveNo,
'archiveYear': this.smartQuery.archiveYear,
'department': this.smartQuery.department,
'retention': this.smartQuery.retention,
'securityClass': this.smartQuery.securityClass,
'organizationMatter': this.smartQuery.organizationMatter
}
FetchInitArchivesView(params).then(data => {
this.getTableDisplayFieldsLoading = false
if (data) {
this.projectData = data.list.content
this.yearGroup = data.yearGroup
this.page.total = data.list.totalElements
}
})
},
// -form/-api
handleForm(type) {
if (type === 'add') {
this.arcId = null
this.formTitle = '新建项目'
} else if (type === 'edit') {
this.arcId = this.selections[0].id
this.formTitle = '编辑项目'
}
this.formVisible = true
this.form.dictionaryConfigId = {}
this.formPreviewData = []
//
const params = {
categoryId: this.categoryId,
archivesId: this.arcId
}
this.getFormInfo(params, type)
},
getFormInfo(params, type) {
FetchFormDisplayFields(params).then(data => {
this.formPreviewData = data.showFiled
this.$nextTick(() => {
if (type === 'edit') {
this.$refs.previewForm.addOrUpdateForm = data.echo
}
})
})
},
// form - submit
handlerArchivesSubmit() {
this.$refs.previewForm.submitForm('addOrUpdateForm', this.selectedCategory.id)
this.selections = []
this.getListCommon('projectData', page, 0)
},
// table -
selectAll(val) {
@ -308,11 +190,11 @@ export default {
},
// table -
tableDoubleClick(row) {
this.$refs.archivesInfo.detailTitle = '项目详情'
this.$refs.archivesInfo.isHasFile = false
this.arcId = row.id
this.$refs.archivesInfo.detailTitle = '项目详情'
this.$refs.archivesInfo.archivesInfoVisible = true
this.$refs.archivesInfo.archivesTabIndex = 0
this.arcId = row.id
this.$refs.archivesInfo.getDetial(row.id)
},
// table - row
@ -331,30 +213,6 @@ export default {
this.isProject = selection.length !== 1
this.$emit('getAjInProjectBtnState', this.isProject)
this.$emit('getProjectSelections', row, selection)
},
//
toDelete(data) {
this.$refs.deltArchives.deleteVisible = true
this.totalSumAll = 0
this.selections.map((item) => { if (!isNaN(item.children_num)) this.totalSumAll += item.children_num })
if (isNaN(this.totalSumAll)) {
return 0
}
},
// -
handleClose(done) {
this.formVisible = false
done()
},
//
handleRestore() {
this.$refs.restore.restoreVisible = true
},
/* 重新渲染table组件 防止table-fixed 错位 配合watch-table数据 */
doLayout() {
this.$nextTick(() => {
this.$refs.table.doLayout()
})
}
}
}
@ -362,11 +220,4 @@ export default {
<style rel="stylesheet/scss" lang="scss" scoped>
@import "~@/assets/styles/archives-manage.scss";
::v-deep .el-table th.el-table__cell > .cell {
white-space: pre;
// white-space: pre-wrap; //
}
.iconfont::before{
margin-right: 6px;
}
</style>

19
src/views/archivesManage/archivesList/index.vue

@ -382,9 +382,10 @@ export default {
this.$nextTick(() => {
this.$refs.anjuan.anjuanData = []
this.$refs.file.junneiData = []
this.$refs.project.getTableDisplayFields(0)
if (this.selectedCategory.children.length !== 0) {
this.$refs.anjuan.getTableDisplayFields()
this.$refs.file.getTableDisplayFields()
this.$refs.anjuan.getTableDisplayFields(1)
this.$refs.file.getTableDisplayFields(2)
}
setTimeout(() => {
this.$refs.project.getTableList()
@ -397,9 +398,9 @@ export default {
this.$nextTick(() => {
this.$refs.anjuan.anjuanData = []
this.$refs.file.junneiData = []
this.$refs.anjuan.getTableDisplayFields()
this.$refs.anjuan.getTableDisplayFields(1)
if (this.selectedCategory.children.length !== 0) {
this.$refs.file.getTableDisplayFields()
this.$refs.file.getTableDisplayFields(2)
}
setTimeout(() => {
this.$refs.anjuan.getTableList()
@ -411,7 +412,7 @@ export default {
} else if (this.selectedCategory.isType === 4) {
this.$nextTick(() => {
this.$refs.file.junneiData = []
this.$refs.file.getTableDisplayFields()
this.$refs.file.getTableDisplayFields(2)
setTimeout(() => {
this.$refs.file.getTableList()
}, 200)
@ -422,7 +423,7 @@ export default {
} else if (this.selectedCategory.isType === 5) {
this.$nextTick(() => {
this.$refs.anjuan.anjuanData = []
this.$refs.anjuan.getTableDisplayFields()
this.$refs.anjuan.getTableDisplayFields(1)
setTimeout(() => {
this.$refs.anjuan.getTableList()
}, 200)
@ -443,4 +444,10 @@ export default {
overflow-y: scroll;
overflow-x: hidden;
}
::v-deep .el-table th.el-table__cell > .cell {
white-space: pre;
}
.iconfont::before{
margin-right: 6px;
}
</style>
Loading…
Cancel
Save