xuhuajiao
2 years ago
5 changed files with 768 additions and 574 deletions
-
9src/api/archivesManage/archivesList.js
-
961src/views/archivesManage/archivesList/archivesAnjuan/index.vue
-
9src/views/archivesManage/archivesList/index.vue
-
89src/views/archivesManage/archivesList/module/oneClickDelete/index.vue
-
274src/views/archivesManage/archivesList/oneClickDelete/index.vue
@ -1,481 +1,480 @@ |
|||
<template> |
|||
<div class="archives-warp"> |
|||
<!--工具栏--> |
|||
<div class="head-container head-archives clearfix"> |
|||
<div v-if="!recycleMain.isRecycle" class="archives-crud"> |
|||
<!-- 新增 --> |
|||
<el-button v-if="!isHasProject" size="mini" :disabled="isProject && selectedCategory.isType === 2" icon="el-icon-plus" @click="handleForm('add','档案', 1)">新增</el-button> |
|||
<!-- 修改 --> |
|||
<el-button size="mini" icon="el-icon-edit" :disabled="selections.length !== 1" @click="handleForm('edit','档案',null)">修改</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(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> |
|||
<div v-else class="archives-recycle"> |
|||
<el-button icon="el-icon-delete" size="mini" :disabled="selections.length === 0" @click="toDelete(selections)">彻底删除</el-button> |
|||
<el-button size="mini" class="iconfont icon-huanyuan-fanbai" :disabled="selections.length === 0" @click="handleRestore">还原</el-button> |
|||
</div> |
|||
<div class="head-search"> |
|||
<!-- 搜索 --> |
|||
<el-select v-if="!recycleMain.isRecycle" v-model="query.queryType" clearable size="small" placeholder="状态" class="filter-item" style="width: 100px" @change="stateSelect"> |
|||
<i slot="prefix" class="iconfont icon-zhuangtai-fanbai" /> |
|||
<el-option v-for="item in stateOptions" :key="item.value" :label="item.label" :value="item.value" /> |
|||
</el-select> |
|||
<el-input v-model="anjuanQuery[anjuanInputSelect]" clearable size="small" placeholder="请输入关键词" style="width: 220px;" class="input-prepend filter-item" @clear="getTableList()" @keyup.enter.native="getTableList"> |
|||
<el-select slot="prepend" v-model="anjuanInputSelect" style="width: 112px" @change="querySelect(anjuanInputSelect)"> |
|||
<el-option |
|||
v-for="item in queryOption" |
|||
:key="item.value" |
|||
:label="item.label" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-input> |
|||
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="getTableList()">搜索</el-button> |
|||
</div> |
|||
<div v-if="!recycleMain.isRecycle" class="archives-handler-btn"> |
|||
<!-- 装盒btn 多选 --> |
|||
<!-- <svg-icon icon-class="zhuanghe" /> --> |
|||
<el-button class="packing-btn iconfont icon-sr-dn-pz" type="primary" :disabled="selectedCategory.isType === 5 ? selections.length === 0 : selections.length !== 1" @click="handlePacking(selections,0)"><svg-icon icon-class="zhuanghe" class="svg-arc-style" />装盒</el-button> |
|||
<!-- 分卷装盒btn 针对案卷-单选 --> |
|||
<el-button v-if="selectedCategory.isType === 3 || selectedCategory.isType === 2" class="part-btn iconfont" type="primary" :disabled="selections.length !== 1" @click="handlePacking(selections,1)"><svg-icon icon-class="partzhuanghe" class="svg-arc-style" />分卷装盒</el-button> |
|||
<!-- <el-button class="warehousing-btn iconfont" type="primary">入库</el-button> --> |
|||
<!-- 借阅btn 多选 --> |
|||
<el-button class="lending-btn iconfont" :disabled="selections.length === 0" type="primary" @click="handleLending"><svg-icon icon-class="jieyue" class="svg-arc-style" />借阅</el-button> |
|||
<!-- 绑定标签btn 单选 --> |
|||
<el-button class="binding-btn iconfont" type="primary" :disabled="selections.length !== 1" @click="bindingTag(selections)"><svg-icon icon-class="bindbiaoqian" class="svg-arc-style" />绑定标签</el-button> |
|||
</div> |
|||
</div> |
|||
|
|||
<!--新增 / 编辑 表单组件--> |
|||
<el-dialog class="preview-dialog" :modal-append-to-body="false" :close-on-click-modal="false" :before-close="handleClose" :visible="formVisible" :title="formTitle"> |
|||
<span class="dialog-right-top" /> |
|||
<span class="dialog-left-bottom" /> |
|||
<div class="setting-dialog"> |
|||
<!-- form --> |
|||
<PreviewForm v-if="formPreviewData.length" ref="previewForm" :is-has-code="false" :is-disabled="false" :form-preview-data.sync="formPreviewData" :selected-category="selectedCategory" :parents-id="parentsId" :arc-id="arcId" :is-des-form-type="isDesFormType" @emitTableList="getTableList" /> |
|||
<div slot="footer" class="dialog-footer"> |
|||
<!-- :loading="crud.status.cu === 2" --> |
|||
<el-button type="primary" @click="handlerArchivesSubmit">保存</el-button> |
|||
</div> |
|||
</div> |
|||
</el-dialog> |
|||
|
|||
<!-- table表格渲染 --> |
|||
<!-- height="calc(100vh - 434px)" --> |
|||
<el-card class="box-card" shadow="never"> |
|||
<span class="right-top-line" /> |
|||
<span class="left-bottom-line" /> |
|||
<el-table |
|||
ref="table" |
|||
v-loading="crud.loading || getTableDisplayFieldsLoading" |
|||
class="archives-table" |
|||
:data="anjuanData" |
|||
highlight-current-row |
|||
style="width: 100%;" |
|||
:height="anjuanTableHeight" |
|||
:row-class-name="tableRowClassName" |
|||
:row-key="rowKey" |
|||
@select-all="selectAll" |
|||
@selection-change="crud.selectionChangeHandler" |
|||
@row-click="clickRowHandler" |
|||
@cell-dblclick="tableDoubleClick" |
|||
@select="handleCurrentChange" |
|||
> |
|||
<el-table-column type="selection" :reserve-selection="true" width="55" align="center" /> |
|||
<el-table-column type="index" label="序号" width="55" align="center" /> |
|||
<el-table-column :label=" selectedCategory.isType === 5 ? '文件':'卷内'" prop="children_num" 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-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> |
|||
</template> |
|||
</el-table-column> |
|||
<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> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column v-if="!recycleMain.isRecycle" label="入库" width="100" align="center" :fixed="fixedStatusBar ? false : 'right' "> |
|||
<template slot-scope="scope"> |
|||
<!-- is_storage 为空的情况下即没装盒 / 0 未入 / 1 待入 / 2 已入 / 3 待出--> |
|||
<span :class="['row-state', 'row-warehousing', (storageTxt[scope.$index] === '已入' )? 'state-active' : '' ]">{{ storageTxt[scope.$index] }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column v-if="!recycleMain.isRecycle" label="借阅" width="100" align="center" :fixed="fixedStatusBar ? false : 'right' "> |
|||
<template slot-scope="scope"> |
|||
<!-- is_borrow 4 已归还 / 为空 - 未加入待借列表 - 在库 / 2 待借阅(在待借列表/借出确认列表) - 待借 / 1待登记 - 不可借-用“—” 表示 / 3 待归还 - 已借 --> |
|||
<span :class="['row-state', 'row-lending', (borrowTxt[scope.$index] === '已借' )? 'state-active' : '' ]">{{ borrowTxt[scope.$index] }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
</el-table> |
|||
<!--分页组件--> |
|||
<el-pagination |
|||
:current-page="page.page" |
|||
:total="page.total" |
|||
:page-size="page.size" |
|||
:pager-count="5" |
|||
layout="total, prev, pager, next, sizes" |
|||
@size-change="handleSizeChange" |
|||
@current-change="handleCurrentPage" |
|||
/> |
|||
</el-card> |
|||
|
|||
<!-- 上传附件 --> |
|||
<el-dialog class="upload-dialog" :modal-append-to-body="false" :close-on-click-modal="false" :before-close="handleClose" :visible.sync="uploadFileVisible" title="上传附件"> |
|||
<span class="dialog-right-top" /> |
|||
<span class="dialog-left-bottom" /> |
|||
<div class="setting-dialog"> |
|||
<UploadFile ref="uploadFile" :category-id="categoryId" :arc-id="arcId" /> |
|||
</div> |
|||
</el-dialog> |
|||
|
|||
<!-- 档案详情 --> |
|||
<ArchivesInfo ref="archivesInfo" :category-id="categoryId" :arc-id="arcId" /> |
|||
<!-- 装盒 --> |
|||
<Packing ref="packing" /> |
|||
<!-- 绑定标签 --> |
|||
<binding-tag-dlg ref="bindingTag" :binding-id="selections[0] && selections[0].id" :binding-type="1" binding-txt="档案" @refresh="crud.refresh" /> |
|||
<!-- 还原 --> |
|||
<RestoreArchives ref="restore" :selections="selections" :category-id="categoryId" /> |
|||
<!-- 删除档案 --> |
|||
<DeltArchives ref="deltArchives" :selections="selections" :category-id="categoryId" :total-sum-all="totalSumAll" :is-delt-type="2" /> |
|||
|
|||
<!-- 借阅 --> |
|||
<el-dialog title="借阅" :visible.sync="lengingVisible" :close-on-click-modal="false" :before-close="handleClose"> |
|||
<span class="dialog-right-top" /> |
|||
<span class="dialog-left-bottom" /> |
|||
<div class="setting-dialog"> |
|||
<div class="dialog-delt"> |
|||
<p><span>确定将当前档案加入借阅列表?</span></p> |
|||
</div> |
|||
<div slot="footer" class="dialog-footer"> |
|||
<el-button type="primary" @click.native="handleLendingConfirm">确定</el-button> |
|||
</div> |
|||
</div> |
|||
</el-dialog> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { header, form } from '@crud/crud' |
|||
import { mapGetters } from 'vuex' |
|||
import { archivesCrud } from '../mixins/archives' |
|||
import { FetchIsExistBorrow, FetchAddArchivesWaitRegister } from '@/api/archivesManage/lendManage' |
|||
import PreviewForm from '@/views/components/category/PreviewForm' |
|||
import ArchivesInfo from '../module/archivesInfo/index' |
|||
import Packing from '../module/packing/index' |
|||
import BindingTagDlg from '@/views/components/BindingTagDlg' |
|||
import UploadFile from '../module/uploadFile/index' |
|||
import RestoreArchives from '../module/restoreArchives/index' |
|||
import DeltArchives from '../module/deltArchives/index' |
|||
|
|||
export default { |
|||
name: 'ArchivesAnjuan', |
|||
components: { PreviewForm, ArchivesInfo, Packing, BindingTagDlg, UploadFile, RestoreArchives, DeltArchives }, |
|||
mixins: [ |
|||
header(), |
|||
form({}), |
|||
archivesCrud |
|||
], |
|||
provide() { |
|||
return { |
|||
caseData: this |
|||
} |
|||
}, |
|||
inject: ['recycleMain'], |
|||
props: { |
|||
selectedCategory: { |
|||
type: Object, |
|||
default: function() { |
|||
return {} |
|||
} |
|||
}, |
|||
isProject: { |
|||
type: Boolean, |
|||
default: true |
|||
}, |
|||
projectSelection: { |
|||
type: Object, |
|||
default: function() { |
|||
return {} |
|||
} |
|||
}, |
|||
fixedStatusBar: { |
|||
type: Boolean, |
|||
default: true |
|||
}, |
|||
smartQuery: { |
|||
type: Object, |
|||
default: function() { |
|||
return {} |
|||
} |
|||
}, |
|||
isHasProject: { |
|||
type: Boolean, |
|||
default: true |
|||
} |
|||
}, |
|||
data() { |
|||
return { |
|||
anjuanData: [], |
|||
anjuanQuery: {}, |
|||
queryOption: [], |
|||
anjuanInputSelect: '', |
|||
stateOptions: [ // 搜索 - 状态选择 |
|||
{ value: '0', label: '全部' }, |
|||
{ value: '1', label: '未装' }, |
|||
{ value: '2', label: '未入' }, |
|||
{ value: '3', label: '待入' }, |
|||
{ value: '4', label: '在库' }, |
|||
{ value: '5', label: '待借' }, |
|||
{ value: '6', label: '已借' } |
|||
], |
|||
isAnjuan: true, // 用于判断卷内-新增/导出按钮 |
|||
lengingVisible: false // 借阅 |
|||
} |
|||
}, |
|||
computed: { |
|||
...mapGetters([ |
|||
'baseApi' |
|||
]) |
|||
}, |
|||
watch: { |
|||
selectedCategory: function(newValue, oldValue) { |
|||
this.query.queryTitle = '' |
|||
this.query.archiveNo = '' |
|||
this.query.archiveCtgNo = '' |
|||
this.query.responsibleby = '' |
|||
this.resetQuery() |
|||
}, |
|||
tableDisplayFields(val) { |
|||
this.doLayout() |
|||
}, |
|||
isProject: function(newValue, oldValue) { |
|||
}, |
|||
isHasProject: function(newValue, oldValue) { |
|||
}, |
|||
fixedStatusBar: function(newValue, oldValue) { |
|||
}, |
|||
projectSelection: function(newValue, oldValue) { |
|||
}, |
|||
smartQuery: { |
|||
handler(n, o) { |
|||
}, |
|||
deep: true |
|||
} |
|||
}, |
|||
created() { |
|||
this.resetQuery() |
|||
this.selections = [] |
|||
this.query.queryType = this.stateOptions[0].value |
|||
}, |
|||
mounted() { |
|||
}, |
|||
methods: { |
|||
// 文件/案卷重置query |
|||
resetQuery() { |
|||
if (this.selectedCategory.isType === 5) { |
|||
this.queryOption = [ |
|||
{ value: 'queryTitle', label: '题名' }, |
|||
{ value: 'archiveNo', label: '档号' }, |
|||
{ value: 'responsibleby', label: '责任者' } |
|||
] |
|||
} else { |
|||
this.queryOption = [ |
|||
{ value: 'queryTitle', label: '题名' }, |
|||
{ value: 'archiveNo', label: '档号' }, |
|||
{ value: 'archiveCtgNo', label: '实体分类号' } |
|||
] |
|||
} |
|||
this.anjuanInputSelect = this.queryOption[0].value |
|||
}, |
|||
// 档案列表获取显示列 |
|||
getTableDisplayFields(type) { |
|||
this.getTableItemCommon(type) |
|||
}, |
|||
handleSizeChange(size) { |
|||
this.page.size = size |
|||
this.page.page = 1 |
|||
this.getListCommon('anjuanData', 'anjuanTableHeight', 1) |
|||
this.$nextTick(() => { |
|||
this.selections = this.$refs.table.selection |
|||
}) |
|||
}, |
|||
// list |
|||
getTableList() { |
|||
// this.query.queryType = null |
|||
this.query.queryTitle = '' |
|||
this.query.archiveNo = '' |
|||
this.query.archiveCtgNo = '' |
|||
this.query.responsibleby = '' |
|||
switch (this.anjuanInputSelect) { |
|||
case 'queryTitle': // 题名 |
|||
this.query.queryTitle = this.anjuanQuery[this.anjuanInputSelect] |
|||
break |
|||
case 'archiveNo': // 档号 |
|||
this.query.archiveNo = this.anjuanQuery[this.anjuanInputSelect] |
|||
break |
|||
case 'archiveCtgNo': // 实体分类号 |
|||
this.query.archiveCtgNo = this.anjuanQuery[this.anjuanInputSelect] |
|||
break |
|||
case 'responsibleby': // 责任者 |
|||
this.query.responsibleby = this.anjuanQuery[this.anjuanInputSelect] |
|||
break |
|||
} |
|||
this.getListCommon('anjuanData', 'anjuanTableHeight', 1) |
|||
}, |
|||
stateSelect(val) { |
|||
this.page.page = 1 |
|||
this.query.queryType = val |
|||
this.getListCommon('anjuanData', 'anjuanTableHeight', 1) |
|||
}, |
|||
// table - 全选 |
|||
selectAll(val) { |
|||
this.selections = val |
|||
this.isAnjuan = val.length !== 1 |
|||
this.$emit('getJnInAjBtnState', this.isAnjuan) |
|||
this.$emit('getSelections', val, this.selections) |
|||
}, |
|||
// table - 双击查看详情 |
|||
tableDoubleClick(row) { |
|||
if (this.selectedCategory.isType !== 5) { |
|||
this.$refs.archivesInfo.isHasFile = false |
|||
} else { |
|||
this.$refs.archivesInfo.isHasFile = true |
|||
} |
|||
this.$refs.archivesInfo.isDetailsInfo = true |
|||
this.$refs.archivesInfo.isTidOrBorrow = true |
|||
this.arcId = row.id |
|||
this.$refs.archivesInfo.detailTitle = '档案详情' |
|||
this.$refs.archivesInfo.archivesInfoVisible = true |
|||
this.$refs.archivesInfo.archivesTabIndex = 0 |
|||
this.$refs.archivesInfo.getDetial(row.id) |
|||
}, |
|||
// table - 当前选中得row |
|||
clickRowHandler(row) { |
|||
this.$refs.table.clearSelection() |
|||
this.$refs.table.toggleRowSelection(row) |
|||
this.selections = this.crud.selections |
|||
this.isAnjuan = this.crud.selections.length !== 1 |
|||
this.$emit('getJnInAjBtnState', this.isAnjuan) |
|||
this.$emit('getSelections', row, null) |
|||
}, |
|||
// 触发单选 |
|||
handleCurrentChange(selection, row) { |
|||
this.selections = selection |
|||
// 判断案卷内的卷内-新增btn-状态 |
|||
this.isAnjuan = selection.length !== 1 |
|||
this.$emit('getJnInAjBtnState', this.isAnjuan) |
|||
this.$emit('getSelections', row, selection) |
|||
}, |
|||
// 绑定标签 |
|||
bindingTag(data) { |
|||
if (data[0].tid) { |
|||
this.$refs.bindingTag.isBinding = true |
|||
this.$refs.bindingTag.tidCode = data[0].tid |
|||
} |
|||
this.$refs.bindingTag.bindingVisible = true |
|||
}, |
|||
// 装盒 |
|||
handlePacking(data, type) { |
|||
if (this.selectedCategory.isType !== 5) { |
|||
if (data[0].children_num === 0) { |
|||
this.$message.error('当前选中的档案无相关卷内文件,不可装盒!') |
|||
return |
|||
} |
|||
} |
|||
if (data[0].case_no) { |
|||
this.$message.error('当前档案已装盒,请勿重复操作!') |
|||
return |
|||
} |
|||
this.$refs.packing.packingVisible = true |
|||
this.$refs.packing.isPackingOrPartType = type |
|||
if (type) { |
|||
this.$refs.packing.getPackingFileList() |
|||
} |
|||
this.getTotalSumAll() |
|||
}, |
|||
// 借阅 |
|||
handleLending() { |
|||
const index = this.selections.findIndex((item) => item.is_storage === 0 || item.is_storage === '' || item.is_storage === 1) |
|||
const index2 = this.selections.findIndex((item) => item.is_borrow === 3) |
|||
const index3 = this.selections.findIndex((item) => item.is_storage === 3) |
|||
if (index !== -1) { |
|||
this.$message.error('所选档案还未入库不能借阅') |
|||
return false |
|||
} |
|||
if (index3 !== -1) { |
|||
this.$message.error('待出档案不可借阅') |
|||
return false |
|||
} |
|||
if (index2 !== -1) { |
|||
this.$message.error('当前档案已借出,还未归还') |
|||
return false |
|||
} |
|||
const params = this.selections.map(item => { |
|||
return item.id |
|||
}) |
|||
FetchIsExistBorrow(params).then(data => { |
|||
if (data.length === 0) { |
|||
this.lengingVisible = true |
|||
} else if (data.length === this.selections.length) { |
|||
this.$message.error('所选档案不可借阅') |
|||
} else { |
|||
this.$message.error('部分档案不可借阅') |
|||
} |
|||
}) |
|||
}, |
|||
// 确认借阅 |
|||
handleLendingConfirm() { |
|||
const params = this.selections.map(item => { |
|||
return item.id |
|||
}) |
|||
FetchAddArchivesWaitRegister(params).then(data => { |
|||
if (data.length !== 0) { |
|||
this.$message.success('借阅成功') |
|||
this.lengingVisible = false |
|||
this.crud.refresh() |
|||
} |
|||
}) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style rel="stylesheet/scss" lang="scss" scoped> |
|||
@import "~@/assets/styles/archives-manage.scss"; |
|||
::v-deep .input-prepend{ |
|||
.el-select .el-input__inner{ |
|||
padding-left: 15px !important; |
|||
} |
|||
.el-input__inner { |
|||
padding-left: 106px !important; |
|||
} |
|||
} |
|||
::v-deep .el-table__fixed-right-patch{ |
|||
background-color:#02255f; |
|||
border-bottom: none; |
|||
} |
|||
</style> |
|||
<template> |
|||
<div class="archives-warp"> |
|||
<!--工具栏--> |
|||
<div class="head-container head-archives clearfix"> |
|||
<div v-if="!recycleMain.isRecycle" class="archives-crud"> |
|||
<!-- 新增 --> |
|||
<el-button v-if="!isHasProject" size="mini" :disabled="isProject && selectedCategory.isType === 2" icon="el-icon-plus" @click="handleForm('add','档案', 1)">新增</el-button> |
|||
<!-- 修改 --> |
|||
<el-button size="mini" icon="el-icon-edit" :disabled="selections.length !== 1" @click="handleForm('edit','档案',null)">修改</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(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> |
|||
<div v-else class="archives-recycle"> |
|||
<el-button icon="el-icon-delete" size="mini" :disabled="selections.length === 0" @click="toDelete(selections)">彻底删除</el-button> |
|||
<el-button size="mini" class="iconfont icon-huanyuan-fanbai" :disabled="selections.length === 0" @click="handleRestore">还原</el-button> |
|||
</div> |
|||
<div class="head-search"> |
|||
<!-- 搜索 --> |
|||
<el-select v-if="!recycleMain.isRecycle" v-model="query.queryType" clearable size="small" placeholder="状态" class="filter-item" style="width: 100px" @change="stateSelect"> |
|||
<i slot="prefix" class="iconfont icon-zhuangtai-fanbai" /> |
|||
<el-option v-for="item in stateOptions" :key="item.value" :label="item.label" :value="item.value" /> |
|||
</el-select> |
|||
<el-input v-model="anjuanQuery[anjuanInputSelect]" clearable size="small" placeholder="请输入关键词" style="width: 220px;" class="input-prepend filter-item" @clear="getTableList()" @keyup.enter.native="getTableList"> |
|||
<el-select slot="prepend" v-model="anjuanInputSelect" style="width: 112px" @change="querySelect(anjuanInputSelect)"> |
|||
<el-option |
|||
v-for="item in queryOption" |
|||
:key="item.value" |
|||
:label="item.label" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-input> |
|||
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="getTableList()">搜索</el-button> |
|||
</div> |
|||
<div v-if="!recycleMain.isRecycle" class="archives-handler-btn"> |
|||
<!-- 装盒btn 多选 --> |
|||
<!-- <svg-icon icon-class="zhuanghe" /> --> |
|||
<el-button class="packing-btn iconfont icon-sr-dn-pz" type="primary" :disabled="selectedCategory.isType === 5 ? selections.length === 0 : selections.length !== 1" @click="handlePacking(selections,0)"><svg-icon icon-class="zhuanghe" class="svg-arc-style" />装盒</el-button> |
|||
<!-- 分卷装盒btn 针对案卷-单选 --> |
|||
<el-button v-if="selectedCategory.isType === 3 || selectedCategory.isType === 2" class="part-btn iconfont" type="primary" :disabled="selections.length !== 1" @click="handlePacking(selections,1)"><svg-icon icon-class="partzhuanghe" class="svg-arc-style" />分卷装盒</el-button> |
|||
<!-- <el-button class="warehousing-btn iconfont" type="primary">入库</el-button> --> |
|||
<!-- 借阅btn 多选 --> |
|||
<el-button class="lending-btn iconfont" :disabled="selections.length === 0" type="primary" @click="handleLending"><svg-icon icon-class="jieyue" class="svg-arc-style" />借阅</el-button> |
|||
<!-- 绑定标签btn 单选 --> |
|||
<el-button class="binding-btn iconfont" type="primary" :disabled="selections.length !== 1" @click="bindingTag(selections)"><svg-icon icon-class="bindbiaoqian" class="svg-arc-style" />绑定标签</el-button> |
|||
</div> |
|||
</div> |
|||
|
|||
<!--新增 / 编辑 表单组件--> |
|||
<el-dialog class="preview-dialog" :modal-append-to-body="false" :close-on-click-modal="false" :before-close="handleClose" :visible="formVisible" :title="formTitle"> |
|||
<span class="dialog-right-top" /> |
|||
<span class="dialog-left-bottom" /> |
|||
<div class="setting-dialog"> |
|||
<!-- form --> |
|||
<PreviewForm v-if="formPreviewData.length" ref="previewForm" :is-has-code="false" :is-disabled="false" :form-preview-data.sync="formPreviewData" :selected-category="selectedCategory" :parents-id="parentsId" :arc-id="arcId" :is-des-form-type="isDesFormType" @emitTableList="getTableList" /> |
|||
<div slot="footer" class="dialog-footer"> |
|||
<!-- :loading="crud.status.cu === 2" --> |
|||
<el-button type="primary" @click="handlerArchivesSubmit">保存</el-button> |
|||
</div> |
|||
</div> |
|||
</el-dialog> |
|||
|
|||
<!-- table表格渲染 --> |
|||
<!-- height="calc(100vh - 434px)" --> |
|||
<el-card class="box-card" shadow="never"> |
|||
<span class="right-top-line" /> |
|||
<span class="left-bottom-line" /> |
|||
<el-table |
|||
ref="table" |
|||
v-loading="crud.loading || getTableDisplayFieldsLoading" |
|||
class="archives-table" |
|||
:data="anjuanData" |
|||
highlight-current-row |
|||
style="width: 100%;" |
|||
:height="anjuanTableHeight" |
|||
:row-class-name="tableRowClassName" |
|||
:row-key="rowKey" |
|||
@select-all="selectAll" |
|||
@selection-change="crud.selectionChangeHandler" |
|||
@row-click="clickRowHandler" |
|||
@cell-dblclick="tableDoubleClick" |
|||
@select="handleCurrentChange" |
|||
> |
|||
<el-table-column type="selection" :reserve-selection="true" width="55" align="center" /> |
|||
<el-table-column type="index" label="序号" width="55" align="center" /> |
|||
<el-table-column :label=" selectedCategory.isType === 5 ? '文件':'卷内'" prop="children_num" 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-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> |
|||
</template> |
|||
</el-table-column> |
|||
<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> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column v-if="!recycleMain.isRecycle" label="入库" width="100" align="center" :fixed="fixedStatusBar ? false : 'right' "> |
|||
<template slot-scope="scope"> |
|||
<!-- is_storage 为空的情况下即没装盒 / 0 未入 / 1 待入 / 2 已入 / 3 待出--> |
|||
<span :class="['row-state', 'row-warehousing', (storageTxt[scope.$index] === '已入' )? 'state-active' : '' ]">{{ storageTxt[scope.$index] }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column v-if="!recycleMain.isRecycle" label="借阅" width="100" align="center" :fixed="fixedStatusBar ? false : 'right' "> |
|||
<template slot-scope="scope"> |
|||
<!-- is_borrow 4 已归还 / 为空 - 未加入待借列表 - 在库 / 2 待借阅(在待借列表/借出确认列表) - 待借 / 1待登记 - 不可借-用“—” 表示 / 3 待归还 - 已借 --> |
|||
<span :class="['row-state', 'row-lending', (borrowTxt[scope.$index] === '已借' )? 'state-active' : '' ]">{{ borrowTxt[scope.$index] }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<!--分页组件--> |
|||
<el-pagination |
|||
:current-page="page.page" |
|||
:total="page.total" |
|||
:page-size="page.size" |
|||
:pager-count="5" |
|||
layout="total, prev, pager, next, sizes" |
|||
@size-change="handleSizeChange" |
|||
@current-change="handleCurrentPage" |
|||
/> |
|||
</el-card> |
|||
|
|||
<!-- 上传附件 --> |
|||
<el-dialog class="upload-dialog" :modal-append-to-body="false" :close-on-click-modal="false" :before-close="handleClose" :visible.sync="uploadFileVisible" title="上传附件"> |
|||
<span class="dialog-right-top" /> |
|||
<span class="dialog-left-bottom" /> |
|||
<div class="setting-dialog"> |
|||
<UploadFile ref="uploadFile" :category-id="categoryId" :arc-id="arcId" /> |
|||
</div> |
|||
</el-dialog> |
|||
|
|||
<!-- 档案详情 --> |
|||
<ArchivesInfo ref="archivesInfo" :category-id="categoryId" :arc-id="arcId" /> |
|||
<!-- 装盒 --> |
|||
<Packing ref="packing" /> |
|||
<!-- 绑定标签 --> |
|||
<binding-tag-dlg ref="bindingTag" :binding-id="selections[0] && selections[0].id" :binding-type="1" binding-txt="档案" @refresh="crud.refresh" /> |
|||
<!-- 还原 --> |
|||
<RestoreArchives ref="restore" :selections="selections" :category-id="categoryId" /> |
|||
<!-- 删除档案 --> |
|||
<DeltArchives ref="deltArchives" :selections="selections" :category-id="categoryId" :total-sum-all="totalSumAll" :is-delt-type="2" /> |
|||
|
|||
<!-- 借阅 --> |
|||
<el-dialog title="借阅" :visible.sync="lengingVisible" :close-on-click-modal="false" :before-close="handleClose"> |
|||
<span class="dialog-right-top" /> |
|||
<span class="dialog-left-bottom" /> |
|||
<div class="setting-dialog"> |
|||
<div class="dialog-delt"> |
|||
<p><span>确定将当前档案加入借阅列表?</span></p> |
|||
</div> |
|||
<div slot="footer" class="dialog-footer"> |
|||
<el-button type="primary" @click.native="handleLendingConfirm">确定</el-button> |
|||
</div> |
|||
</div> |
|||
</el-dialog> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { header, form } from '@crud/crud' |
|||
import { mapGetters } from 'vuex' |
|||
import { archivesCrud } from '../mixins/archives' |
|||
import { FetchIsExistBorrow, FetchAddArchivesWaitRegister } from '@/api/archivesManage/lendManage' |
|||
import PreviewForm from '@/views/components/category/PreviewForm' |
|||
import ArchivesInfo from '../module/archivesInfo/index' |
|||
import Packing from '../module/packing/index' |
|||
import BindingTagDlg from '@/views/components/BindingTagDlg' |
|||
import UploadFile from '../module/uploadFile/index' |
|||
import RestoreArchives from '../module/restoreArchives/index' |
|||
import DeltArchives from '../module/deltArchives/index' |
|||
|
|||
export default { |
|||
name: 'ArchivesAnjuan', |
|||
components: { PreviewForm, ArchivesInfo, Packing, BindingTagDlg, UploadFile, RestoreArchives, DeltArchives }, |
|||
mixins: [ |
|||
header(), |
|||
form({}), |
|||
archivesCrud |
|||
], |
|||
provide() { |
|||
return { |
|||
caseData: this |
|||
} |
|||
}, |
|||
inject: ['recycleMain'], |
|||
props: { |
|||
selectedCategory: { |
|||
type: Object, |
|||
default: function() { |
|||
return {} |
|||
} |
|||
}, |
|||
isProject: { |
|||
type: Boolean, |
|||
default: true |
|||
}, |
|||
projectSelection: { |
|||
type: Object, |
|||
default: function() { |
|||
return {} |
|||
} |
|||
}, |
|||
fixedStatusBar: { |
|||
type: Boolean, |
|||
default: true |
|||
}, |
|||
smartQuery: { |
|||
type: Object, |
|||
default: function() { |
|||
return {} |
|||
} |
|||
}, |
|||
isHasProject: { |
|||
type: Boolean, |
|||
default: true |
|||
} |
|||
}, |
|||
data() { |
|||
return { |
|||
anjuanData: [], |
|||
anjuanQuery: {}, |
|||
queryOption: [], |
|||
anjuanInputSelect: '', |
|||
stateOptions: [ // 搜索 - 状态选择 |
|||
{ value: '0', label: '全部' }, |
|||
{ value: '1', label: '未装' }, |
|||
{ value: '2', label: '未入' }, |
|||
{ value: '3', label: '待入' }, |
|||
{ value: '4', label: '在库' }, |
|||
{ value: '5', label: '待借' }, |
|||
{ value: '6', label: '已借' } |
|||
], |
|||
isAnjuan: true, // 用于判断卷内-新增/导出按钮 |
|||
lengingVisible: false // 借阅 |
|||
} |
|||
}, |
|||
computed: { |
|||
...mapGetters([ |
|||
'baseApi' |
|||
]) |
|||
}, |
|||
watch: { |
|||
selectedCategory: function(newValue, oldValue) { |
|||
this.query.queryTitle = '' |
|||
this.query.archiveNo = '' |
|||
this.query.archiveCtgNo = '' |
|||
this.query.responsibleby = '' |
|||
this.resetQuery() |
|||
}, |
|||
tableDisplayFields(val) { |
|||
this.doLayout() |
|||
}, |
|||
isProject: function(newValue, oldValue) { |
|||
}, |
|||
isHasProject: function(newValue, oldValue) { |
|||
}, |
|||
fixedStatusBar: function(newValue, oldValue) { |
|||
}, |
|||
projectSelection: function(newValue, oldValue) { |
|||
}, |
|||
smartQuery: { |
|||
handler(n, o) { |
|||
}, |
|||
deep: true |
|||
} |
|||
}, |
|||
created() { |
|||
this.resetQuery() |
|||
this.selections = [] |
|||
this.query.queryType = this.stateOptions[0].value |
|||
}, |
|||
mounted() { |
|||
}, |
|||
methods: { |
|||
// 文件/案卷重置query |
|||
resetQuery() { |
|||
if (this.selectedCategory.isType === 5) { |
|||
this.queryOption = [ |
|||
{ value: 'queryTitle', label: '题名' }, |
|||
{ value: 'archiveNo', label: '档号' }, |
|||
{ value: 'responsibleby', label: '责任者' } |
|||
] |
|||
} else { |
|||
this.queryOption = [ |
|||
{ value: 'queryTitle', label: '题名' }, |
|||
{ value: 'archiveNo', label: '档号' }, |
|||
{ value: 'archiveCtgNo', label: '实体分类号' } |
|||
] |
|||
} |
|||
this.anjuanInputSelect = this.queryOption[0].value |
|||
}, |
|||
// 档案列表获取显示列 |
|||
getTableDisplayFields(type) { |
|||
this.getTableItemCommon(type) |
|||
}, |
|||
handleSizeChange(size) { |
|||
this.page.size = size |
|||
this.page.page = 1 |
|||
this.getListCommon('anjuanData', 'anjuanTableHeight', 1) |
|||
this.$nextTick(() => { |
|||
this.selections = this.$refs.table.selection |
|||
}) |
|||
}, |
|||
// list |
|||
getTableList() { |
|||
// this.query.queryType = null |
|||
this.query.queryTitle = '' |
|||
this.query.archiveNo = '' |
|||
this.query.archiveCtgNo = '' |
|||
this.query.responsibleby = '' |
|||
switch (this.anjuanInputSelect) { |
|||
case 'queryTitle': // 题名 |
|||
this.query.queryTitle = this.anjuanQuery[this.anjuanInputSelect] |
|||
break |
|||
case 'archiveNo': // 档号 |
|||
this.query.archiveNo = this.anjuanQuery[this.anjuanInputSelect] |
|||
break |
|||
case 'archiveCtgNo': // 实体分类号 |
|||
this.query.archiveCtgNo = this.anjuanQuery[this.anjuanInputSelect] |
|||
break |
|||
case 'responsibleby': // 责任者 |
|||
this.query.responsibleby = this.anjuanQuery[this.anjuanInputSelect] |
|||
break |
|||
} |
|||
this.getListCommon('anjuanData', 'anjuanTableHeight', 1) |
|||
}, |
|||
stateSelect(val) { |
|||
this.page.page = 1 |
|||
this.query.queryType = val |
|||
this.getListCommon('anjuanData', 'anjuanTableHeight', 1) |
|||
}, |
|||
// table - 全选 |
|||
selectAll(val) { |
|||
this.selections = val |
|||
this.isAnjuan = val.length !== 1 |
|||
this.$emit('getJnInAjBtnState', this.isAnjuan) |
|||
this.$emit('getSelections', val, this.selections) |
|||
}, |
|||
// table - 双击查看详情 |
|||
tableDoubleClick(row) { |
|||
if (this.selectedCategory.isType !== 5) { |
|||
this.$refs.archivesInfo.isHasFile = false |
|||
} else { |
|||
this.$refs.archivesInfo.isHasFile = true |
|||
} |
|||
this.$refs.archivesInfo.isDetailsInfo = true |
|||
this.$refs.archivesInfo.isTidOrBorrow = true |
|||
this.arcId = row.id |
|||
this.$refs.archivesInfo.detailTitle = '档案详情' |
|||
this.$refs.archivesInfo.archivesInfoVisible = true |
|||
this.$refs.archivesInfo.archivesTabIndex = 0 |
|||
this.$refs.archivesInfo.getDetial(row.id) |
|||
}, |
|||
// table - 当前选中得row |
|||
clickRowHandler(row) { |
|||
this.$refs.table.clearSelection() |
|||
this.$refs.table.toggleRowSelection(row) |
|||
this.selections = this.crud.selections |
|||
this.isAnjuan = this.crud.selections.length !== 1 |
|||
this.$emit('getJnInAjBtnState', this.isAnjuan) |
|||
this.$emit('getSelections', row, null) |
|||
}, |
|||
// 触发单选 |
|||
handleCurrentChange(selection, row) { |
|||
this.selections = selection |
|||
// 判断案卷内的卷内-新增btn-状态 |
|||
this.isAnjuan = selection.length !== 1 |
|||
this.$emit('getJnInAjBtnState', this.isAnjuan) |
|||
this.$emit('getSelections', row, selection) |
|||
}, |
|||
// 绑定标签 |
|||
bindingTag(data) { |
|||
if (data[0].tid) { |
|||
this.$refs.bindingTag.isBinding = true |
|||
this.$refs.bindingTag.tidCode = data[0].tid |
|||
} |
|||
this.$refs.bindingTag.bindingVisible = true |
|||
}, |
|||
// 装盒 |
|||
handlePacking(data, type) { |
|||
if (this.selectedCategory.isType !== 5) { |
|||
if (data[0].children_num === 0) { |
|||
this.$message.error('当前选中的档案无相关卷内文件,不可装盒!') |
|||
return |
|||
} |
|||
} |
|||
if (data[0].case_no) { |
|||
this.$message.error('当前档案已装盒,请勿重复操作!') |
|||
return |
|||
} |
|||
this.$refs.packing.packingVisible = true |
|||
this.$refs.packing.isPackingOrPartType = type |
|||
if (type) { |
|||
this.$refs.packing.getPackingFileList() |
|||
} |
|||
this.getTotalSumAll() |
|||
}, |
|||
// 借阅 |
|||
handleLending() { |
|||
const index = this.selections.findIndex((item) => item.is_storage === 0 || item.is_storage === '' || item.is_storage === 1) |
|||
const index2 = this.selections.findIndex((item) => item.is_borrow === 3) |
|||
const index3 = this.selections.findIndex((item) => item.is_storage === 3) |
|||
if (index !== -1) { |
|||
this.$message.error('所选档案还未入库不能借阅') |
|||
return false |
|||
} |
|||
if (index3 !== -1) { |
|||
this.$message.error('待出档案不可借阅') |
|||
return false |
|||
} |
|||
if (index2 !== -1) { |
|||
this.$message.error('当前档案已借出,还未归还') |
|||
return false |
|||
} |
|||
const params = this.selections.map(item => { |
|||
return item.id |
|||
}) |
|||
FetchIsExistBorrow(params).then(data => { |
|||
if (data.length === 0) { |
|||
this.lengingVisible = true |
|||
} else if (data.length === this.selections.length) { |
|||
this.$message.error('所选档案不可借阅') |
|||
} else { |
|||
this.$message.error('部分档案不可借阅') |
|||
} |
|||
}) |
|||
}, |
|||
// 确认借阅 |
|||
handleLendingConfirm() { |
|||
const params = this.selections.map(item => { |
|||
return item.id |
|||
}) |
|||
FetchAddArchivesWaitRegister(params).then(data => { |
|||
if (data.length !== 0) { |
|||
this.$message.success('借阅成功') |
|||
this.lengingVisible = false |
|||
this.crud.refresh() |
|||
} |
|||
}) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style rel="stylesheet/scss" lang="scss" scoped> |
|||
@import "~@/assets/styles/archives-manage.scss"; |
|||
::v-deep .input-prepend{ |
|||
.el-select .el-input__inner{ |
|||
padding-left: 15px !important; |
|||
} |
|||
.el-input__inner { |
|||
padding-left: 106px !important; |
|||
} |
|||
} |
|||
::v-deep .el-table__fixed-right-patch{ |
|||
background-color:#02255f; |
|||
border-bottom: none; |
|||
} |
|||
</style> |
@ -1,89 +0,0 @@ |
|||
<template> |
|||
<!-- 一键删除 --> |
|||
<el-dialog class="oneClick" title="一键删除" :visible.sync="oneClickVisible" :close-on-click-modal="false" :before-close="handleClose"> |
|||
<span class="dialog-right-top" /> |
|||
<span class="dialog-left-bottom" /> |
|||
<div class="setting-dialog"> |
|||
{{ getCategory }} |
|||
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="small" label-width="80px"> |
|||
<el-form-item label="门类" prop="categoryId"> |
|||
<el-input v-model="form.categoryId" disabled /> |
|||
</el-form-item> |
|||
<el-form-item label="年度" prop="archiveYear"> |
|||
<el-select v-model="form.archiveYear" placeholder="请选择"> |
|||
<el-option v-for="item in roles" :key="item.name" /> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="保管期限" prop="retention"> |
|||
<el-select v-model="form.retention" placeholder="请选择"> |
|||
<el-option v-for="item in roles" :key="item.name" /> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-form> |
|||
<div slot="footer" class="dialog-footer"> |
|||
<el-button type="primary" @click.native="handleDeltConfirm">确定</el-button> |
|||
</div> |
|||
</div> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script> |
|||
// import { del, FetchCompletelyDelete } from '@/api/archivesManage/archivesList' |
|||
import { header, form } from '@crud/crud' |
|||
const defaultForm = { id: null, categoryId: null, archiveYear: null, retention: null } |
|||
export default { |
|||
name: 'OneClickDelt', |
|||
components: { }, |
|||
mixins: [ |
|||
header(), |
|||
form(defaultForm) |
|||
], |
|||
props: { |
|||
}, |
|||
inject: ['recycleMain'], |
|||
data() { |
|||
return { |
|||
getCategory: null, |
|||
roles: [], |
|||
oneClickVisible: false, |
|||
rules: { |
|||
'categoryId': [ |
|||
{ required: true, trigger: 'blur' } |
|||
], |
|||
'archiveYear': [ |
|||
{ required: true, trigger: 'change' } |
|||
], |
|||
'retention': [ |
|||
{ required: true, trigger: 'change' } |
|||
] |
|||
} |
|||
} |
|||
}, |
|||
watch: { |
|||
}, |
|||
created() { |
|||
}, |
|||
mounted() { |
|||
console.log(this.getCategory) |
|||
this.form.categoryId = this.getCategory.cnName |
|||
}, |
|||
methods: { |
|||
handleDeltConfirm() { |
|||
}, |
|||
// 删除 - 关闭 |
|||
handleClose(done) { |
|||
this.oneClickVisible = false |
|||
done() |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style rel="stylesheet/scss" lang="scss" scoped> |
|||
@import "~@/assets/styles/archives-manage.scss"; |
|||
.oneClick{ |
|||
::v-deep .el-dialog{ |
|||
width: 940px; |
|||
} |
|||
} |
|||
</style> |
@ -0,0 +1,274 @@ |
|||
<template> |
|||
<!-- 一键删除 --> |
|||
<el-dialog class="oneClick" title="一键删除" :visible.sync="oneClickVisible" :close-on-click-modal="false" :before-close="handleClose"> |
|||
<span class="dialog-right-top" /> |
|||
<span class="dialog-left-bottom" /> |
|||
<div class="setting-dialog"> |
|||
<el-form ref="form" :inline="true" :model="smartQuery" :rules="rules" size="small" label-width="80px"> |
|||
<el-form-item label="门类" prop="categoryName"> |
|||
<el-input v-model="smartQuery.categoryName" disabled /> |
|||
</el-form-item> |
|||
<el-form-item label="年度" prop="archiveYear"> |
|||
<el-select v-model="smartQuery.archiveYear" placeholder="请选择"> |
|||
<el-option v-for="item in archiveYearOptions" :key="item.id" :label="item.dicName" :value="item.dicName" /> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="保管期限" prop="retention"> |
|||
<el-select v-model="smartQuery.retention" placeholder="请选择"> |
|||
<el-option v-for="item in retentionOptions" :key="item.id" :label="item.dicName" :value="item.dicName" /> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="filterTableList('form')">加载</el-button> |
|||
</el-form> |
|||
<div> |
|||
<el-table |
|||
ref="table" |
|||
v-loading="crud.loading || getTableDisplayFieldsLoading" |
|||
class="archives-table" |
|||
:data="anjuanData" |
|||
highlight-current-row |
|||
style="width: 100%;" |
|||
height="calc(100vh - 556px)" |
|||
:row-key="rowKey" |
|||
@select-all="selectAll" |
|||
@selection-change="crud.selectionChangeHandler" |
|||
@row-click="clickRowHandler" |
|||
@select="handleCurrentChange" |
|||
> |
|||
<el-table-column type="selection" :reserve-selection="true" width="55" align="center" /> |
|||
<el-table-column type="index" label="序号" width="55" align="center" /> |
|||
<el-table-column :label=" selectedCategory.isType === 5 ? '文件':'卷内'" prop="children_num" 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-column v-if="!recycleMain.isRecycle" label="借阅" width="100" align="center" fixed="right"> |
|||
<template slot-scope="scope"> |
|||
<!-- is_borrow 4 已归还 / 为空 - 未加入待借列表 - 在库 / 2 待借阅(在待借列表/借出确认列表) - 待借 / 1待登记 - 不可借-用“—” 表示 / 3 待归还 - 已借 --> |
|||
<span :class="['row-state', 'row-lending', (borrowTxt[scope.$index] === '已借' )? 'state-active' : '' ]">{{ borrowTxt[scope.$index] }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<!--分页组件--> |
|||
<el-pagination |
|||
:current-page="page.page" |
|||
:total="page.total" |
|||
:page-size="page.size" |
|||
:pager-count="5" |
|||
layout="total, prev, pager, next, sizes" |
|||
@size-change="handleSizeChange" |
|||
@current-change="handleCurrentPage" |
|||
/> |
|||
</div> |
|||
<div slot="footer" class="dialog-footer"> |
|||
<el-button type="primary" @click.native="handleDeltConfirm">确定删除</el-button> |
|||
</div> |
|||
</div> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script> |
|||
import { FetchTransferMainLibrary } from '@/api/archivesManage/archivesList' |
|||
import { header } from '@crud/crud' |
|||
import { archivesCrud } from '../mixins/archives' |
|||
export default { |
|||
name: 'OneClickDelt', |
|||
components: { }, |
|||
mixins: [ |
|||
header(), |
|||
archivesCrud |
|||
], |
|||
props: { |
|||
selectedCategory: { |
|||
type: Object, |
|||
default: function() { |
|||
return {} |
|||
} |
|||
}, |
|||
intellClassifyTree: { |
|||
type: Array, |
|||
default: function() { |
|||
return [] |
|||
} |
|||
} |
|||
}, |
|||
inject: ['recycleMain'], |
|||
data() { |
|||
return { |
|||
anjuanData: [], |
|||
archiveYearOptions: [], |
|||
retentionOptions: [], |
|||
oneClickVisible: false, |
|||
smartQuery: { |
|||
categoryName: null, |
|||
archiveYear: null, |
|||
retention: null |
|||
}, |
|||
rules: { |
|||
'archiveYear': [ |
|||
{ required: true, trigger: 'change', message: '请选择年度' } |
|||
] |
|||
} |
|||
} |
|||
}, |
|||
watch: { |
|||
selectedCategory: function(newValue, oldValue) { |
|||
if (newValue && newValue.id) { |
|||
this.categoryId = newValue.id |
|||
this.smartQuery.categoryName = newValue.cnName |
|||
this.getTableItemCommon(1) |
|||
} |
|||
}, |
|||
intellClassifyTree: function(newValue, oldValue) { |
|||
if (newValue) { |
|||
this.archiveYearOptions = newValue[0].childMenus |
|||
newValue.filter(item => { |
|||
if (item.dicCode === 'Search_BGQX') { |
|||
this.retentionOptions = item.childMenus |
|||
} |
|||
}) |
|||
} |
|||
} |
|||
}, |
|||
created() { |
|||
}, |
|||
mounted() { |
|||
this.categoryId = this.selectedCategory.id |
|||
this.smartQuery.categoryName = this.selectedCategory.cnName |
|||
this.getTableItemCommon(1) |
|||
}, |
|||
methods: { |
|||
// list |
|||
getTableList() { |
|||
this.getListCommon('anjuanData', '', 1) |
|||
}, |
|||
// table - 当前选中得row |
|||
clickRowHandler(row) { |
|||
this.$refs.table.clearSelection() |
|||
this.$refs.table.toggleRowSelection(row) |
|||
this.selections = this.crud.selections |
|||
// this.isAnjuan = this.crud.selections.length !== 1 |
|||
// this.$emit('getJnInAjBtnState', this.isAnjuan) |
|||
// this.$emit('getSelections', row, null) |
|||
}, |
|||
// 触发单选 |
|||
handleCurrentChange(selection, row) { |
|||
this.selections = selection |
|||
// 判断案卷内的卷内-新增btn-状态 |
|||
// this.isAnjuan = selection.length !== 1 |
|||
// this.$emit('getJnInAjBtnState', this.isAnjuan) |
|||
// this.$emit('getSelections', row, selection) |
|||
}, |
|||
handleSizeChange(size) { |
|||
this.page.size = size |
|||
this.page.page = 1 |
|||
this.getListCommon('anjuanData', '', 1) |
|||
this.$nextTick(() => { |
|||
this.selections = this.$refs.table.selection |
|||
}) |
|||
}, |
|||
// table - 全选 |
|||
selectAll(val) { |
|||
this.selections = val |
|||
// this.isAnjuan = val.length !== 1 |
|||
// this.$emit('getJnInAjBtnState', this.isAnjuan) |
|||
// this.$emit('getSelections', val, this.selections) |
|||
}, |
|||
filterTableList(formName) { |
|||
this.$refs[formName].validate((valid) => { |
|||
if (valid) { |
|||
this.$refs.table.clearSelection() |
|||
this.getTableList() |
|||
} else { |
|||
console.log('error submit!!') |
|||
return false |
|||
} |
|||
}) |
|||
}, |
|||
handleDeltConfirm() { |
|||
if (this.selections.length !== 0) { |
|||
const index2 = this.selections.findIndex((item) => item.is_borrow === 3) |
|||
if (index2 !== -1) { |
|||
this.$message.error('当前所选的档案包含已借出的,不可操作一键删除') |
|||
return false |
|||
} |
|||
const arrParams = this.selections.map(item => { |
|||
const json = {} |
|||
json.archivesId = item.id |
|||
json.caseId = item.case_no |
|||
json.categoryId = this.categoryId |
|||
json.isCase = !!item.case_no |
|||
json.isStorage = !((item.is_storage === 0 || item.is_storage === '')) |
|||
return json |
|||
}) |
|||
FetchTransferMainLibrary(arrParams).then(res => { |
|||
console.log(res) |
|||
if (res.archivesNo.length !== 0) { |
|||
if (res.archivesNo.length === this.selections.length) { |
|||
this.$message({ |
|||
type: 'success', |
|||
message: '选中的档案全部一键删除成功!' |
|||
}) |
|||
} else { |
|||
this.$message({ |
|||
type: 'success', |
|||
message: '部分档案一键删除成功!' |
|||
}) |
|||
} |
|||
} else { |
|||
this.$message({ |
|||
type: 'success', |
|||
message: '档案一键删除失败!' |
|||
}) |
|||
} |
|||
this.oneClickVisible = false |
|||
this.smartQuery = { |
|||
archiveYear: null, |
|||
retention: null |
|||
} |
|||
this.anjuanData = [] |
|||
this.crud.refresh() |
|||
}) |
|||
} else { |
|||
this.$message({ |
|||
type: 'error', |
|||
message: '请先加载相关数据,再进行一键删除操作!' |
|||
}) |
|||
} |
|||
}, |
|||
// 删除 - 关闭 |
|||
handleClose(done) { |
|||
this.oneClickVisible = false |
|||
this.smartQuery = { |
|||
archiveYear: null, |
|||
retention: null |
|||
} |
|||
this.anjuanData = [] |
|||
done() |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style rel="stylesheet/scss" lang="scss" scoped> |
|||
@import "~@/assets/styles/archives-manage.scss"; |
|||
.oneClick{ |
|||
::v-deep .el-dialog{ |
|||
width: 1000px; |
|||
.el-dialog__body{ |
|||
padding: 30px 0; |
|||
} |
|||
} |
|||
} |
|||
</style> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue