10 changed files with 283 additions and 866 deletions
-
1src/utils/upload.js
-
145src/views/archivesManage/archivesList/archivesAnjuan/index.vue
-
477src/views/archivesManage/archivesList/archivesDetail.vue
-
141src/views/archivesManage/archivesList/archivesJuannei/index.vue
-
138src/views/archivesManage/archivesList/archivesProject/index.vue
-
6src/views/archivesManage/archivesList/index.vue
-
41src/views/archivesManage/archivesList/module/archivesInfo/index.vue
-
110src/views/archivesManage/archivesList/module/deltArchives/index.vue
-
86src/views/archivesManage/archivesList/module/restoreArchives/index.vue
-
4src/views/archivesManage/caseManage/caseList/index.vue
@ -1,477 +0,0 @@ |
|||||
<template> |
|
||||
<div> |
|
||||
<!--工具栏--> |
|
||||
<div class="head-container head-archives"> |
|
||||
<crudOperation :permission="permission"> |
|
||||
<template v-slot:left> |
|
||||
<!-- 新增 --> |
|
||||
<el-button v-if="selectedCategory.isType !== 4" v-permission="permission.add" :disabled="selectedCategory.isType === 3 && isJuannei" size="mini" icon="el-icon-plus" @click="crud.toAdd">新增</el-button> |
|
||||
</template> |
|
||||
<template v-slot:right> |
|
||||
<!-- 删除btn 多选 --> |
|
||||
<el-button v-permission="permission.del" icon="el-icon-delete" size="mini" :loading="crud.delAllLoading" :disabled="crud.selections.length === 0" @click="toDelete(crud.selections)">删除</el-button> |
|
||||
<!-- 导出btn :disabled="!crud.data.length" --> |
|
||||
<el-button v-if="selectedCategory.isType !== 1 && selectedCategory.isType !== 2" v-permission="permission.download" :loading="crud.downloadLoading" size="mini" icon="el-icon-download" @click="doExport">导出</el-button> |
|
||||
<!-- 上传附件btn 针对卷内/文件 单选 --> |
|
||||
<el-button v-if="selectedCategory.isType === 4 || selectedCategory.isType === 5" :disabled="crud.selections.length !== 1" size="mini" icon="el-icon-download" @click="uploadFile">上传附件</el-button> |
|
||||
|
|
||||
<div class="head-search"> |
|
||||
<!-- 搜索 --> |
|
||||
<el-select v-if="selectedCategory.isType === 3 || selectedCategory.isType === 5" v-model="query.enabled" clearable size="small" placeholder="状态" class="filter-item" style="width: 100px" @change="crud.toQuery"> |
|
||||
<i slot="prefix" class="iconfont icon-zhuangtai-fanbai" /> |
|
||||
<el-option v-for="item in stateOptions" :key="item.key" :label="item.label" :value="item.key" /> |
|
||||
</el-select> |
|
||||
<el-input v-model="query[inputSelect]" clearable size="small" placeholder="请输入关键词" style="width: 200px;" class="input-prepend filter-item" @keyup.enter.native="crud.toQuery"> |
|
||||
<el-select slot="prepend" v-model="inputSelect" style="width: 80px" @change="querySelect"> |
|
||||
<el-option |
|
||||
v-for="item in queryOption" |
|
||||
:key="item.value" |
|
||||
:label="item.label" |
|
||||
:value="item.value" |
|
||||
/> |
|
||||
</el-select> |
|
||||
</el-input> |
|
||||
<rrOperation /> |
|
||||
</div> |
|
||||
</template> |
|
||||
<template v-slot:rightButtonGroup> |
|
||||
<div v-if="selectedCategory.isType === 5 || !isJuannei" class="archives-handler-btn"> |
|
||||
<!-- 装盒btn 多选 --> |
|
||||
<el-button class="packing-btn iconfont icon-weibiaoti-2" type="primary" :disabled="crud.selections.length === 0" @click="handlePacking(crud.selections)">装盒</el-button> |
|
||||
<!-- 分卷装盒btn 针对案卷-单选 --> |
|
||||
<el-button v-if="selectedCategory.isType === 3" class="part-btn iconfont icon-weibiaoti-2" type="primary" :disabled="crud.selections.length !== 1" @click="handlePacking(crud.selections)">分卷装盒</el-button> |
|
||||
<!-- <el-button class="warehousing-btn iconfont icon-weibiaoti-2" type="primary">入库</el-button> --> |
|
||||
<!-- 借阅btn 多选 --> |
|
||||
<el-button class="lending-btn iconfont icon-weibiaoti-2" :disabled="crud.selections.length === 0" type="primary" @click="lengingVisible=true">借阅</el-button> |
|
||||
<!-- 绑定标签btn 单选 --> |
|
||||
<el-button class="binding-btn iconfont icon-weibiaoti-2" type="primary" :disabled="crud.selections.length !== 1" @click="handleBinding(crud.selections)">绑定标签</el-button> |
|
||||
</div> |
|
||||
</template> |
|
||||
</crudOperation> |
|
||||
</div> |
|
||||
|
|
||||
<!--新增 / 编辑 表单组件--> |
|
||||
<el-dialog class="preview-dialog" :modal-append-to-body="false" :close-on-click-modal="false" :before-close="crud.cancelCU" :visible="crud.status.cu > 0" :title="crud.status.title"> |
|
||||
<span class="dialog-right-top" /> |
|
||||
<span class="dialog-left-bottom" /> |
|
||||
<div class="setting-dialog"> |
|
||||
<!-- form --> |
|
||||
<PreviewForm v-if="formPreviewData.length && archivesTabIndex == 0" ref="previewForm" :is-disabled="false" :form-preview-data.sync="formPreviewData" :selected-category="selectedCategory" :arc-id="arcId" /> |
|
||||
<div slot="footer" class="dialog-footer"> |
|
||||
<el-button :loading="crud.status.cu === 2" type="primary" @click="handlerArchivesSubmit">保存</el-button> |
|
||||
</div> |
|
||||
</div> |
|
||||
</el-dialog> |
|
||||
|
|
||||
<!-- 上传附件 --> |
|
||||
<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 :is-upload-detail="true" /> |
|
||||
<div slot="footer" class="dialog-footer"> |
|
||||
<el-button :loading="crud.status.cu === 2" type="primary" @click="uploadFileSave">保存</el-button> |
|
||||
</div> |
|
||||
</div> |
|
||||
</el-dialog> |
|
||||
|
|
||||
<!-- 删除档案 --> |
|
||||
<el-dialog title="删除档案" :visible.sync="deleteVisible" :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> |
|
||||
<p v-if="selectedCategory.isType == 2">数据来源:项目 1条数据 案卷 4条数据</p> |
|
||||
<p v-if="selectedCategory.isType == 3">数据来源:案卷 1条数据 卷内 2条数据</p> |
|
||||
<p v-if="selectedCategory.isType == 4">数据来源:卷内 1条数据</p> |
|
||||
<p v-if="selectedCategory.isType == 5">数据来源:卷内 1条数据</p> |
|
||||
<p class="delt-tip"><span>提示:如果删除当前档案,此档案内所附带的文件会一并删除</span></p> |
|
||||
</div> |
|
||||
<div slot="footer" class="dialog-footer"> |
|
||||
<el-button type="primary" @click.native="handleDeltConfirm">确定</el-button> |
|
||||
</div> |
|
||||
</div> |
|
||||
</el-dialog> |
|
||||
|
|
||||
<!-- table表格渲染 --> |
|
||||
<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="crud.data" highlight-current-row style="width: 100%; " height="calc(100vh - 350px)" @selection-change="crud.selectionChangeHandler" @row-click="clickRowHandler" @cell-dblclick="tableDoubleClick"> |
|
||||
<el-table-column type="selection" width="55" align="center" /> |
|
||||
<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-scope="scope"> |
|
||||
{{ scope.row[field.fieldName] }} |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column v-if="selectedCategory.isType !== 1 && selectedCategory.isType !== 2" label="装盒" width="100" align="center" :fixed="fixedStatusBar?false:'right'"> |
|
||||
<!-- state-active 已装/已入/已借/已绑 --> |
|
||||
<template slot-scope="scope"> |
|
||||
<!-- 未装 / 已装 --> |
|
||||
<span class="row-state row-packing state-active">{{ scope.row.case_no ? '已装': '未装' }}</span> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column v-if="selectedCategory.isType !== 1 && selectedCategory.isType !== 2" 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="selectedCategory.isType === 3 || selectedCategory.isType === 5" 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="selectedCategory.isType === 3 || selectedCategory.isType === 5" label="标签" width="100" align="center" :fixed="fixedStatusBar?false:'right'"> |
|
||||
<template slot-scope="scope"> |
|
||||
<!-- 未绑 / 已绑 --> |
|
||||
<span class="row-state row-binding">{{ scope.row.tid ? '已绑': '未绑' }}</span> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
<!--分页组件--> |
|
||||
<pagination /> |
|
||||
</el-card> |
|
||||
|
|
||||
<!-- 档案详情 --> |
|
||||
<ArchivesInfo ref="archivesInfo" /> |
|
||||
<!-- 装盒 --> |
|
||||
<Packing ref="packing" /> |
|
||||
<!-- 绑定标签 --> |
|
||||
<Binding ref="bind" :is-binding="isBinding" /> |
|
||||
<!-- 借阅 --> |
|
||||
<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="lengingVisible=false">确定</el-button> |
|
||||
</div> |
|
||||
</div> |
|
||||
</el-dialog> |
|
||||
</div> |
|
||||
</template> |
|
||||
|
|
||||
<script> |
|
||||
import qs from 'qs' |
|
||||
import { add, edit, del, getTableDisplayFields, getFormDisplayFields } from '@/api/archivesManage/archivesList' |
|
||||
import CRUD, { presenter, header, form } from '@crud/crud' |
|
||||
import { exportFile } from '@/utils/index' |
|
||||
import { initData } from '@/api/data' |
|
||||
import crudOperation from '@crud/CRUD.operation' |
|
||||
import rrOperation from '@crud/RR.operation' |
|
||||
import pagination from '@crud/Pagination' |
|
||||
import PreviewForm from '@/views/components/category/PreviewForm' |
|
||||
import UploadFile from './module/uploadFile/index' |
|
||||
import ArchivesInfo from './module/archivesInfo/index' |
|
||||
import Packing from './module/packing/index' |
|
||||
|
|
||||
export default { |
|
||||
name: 'ArchivesDetail', |
|
||||
components: { crudOperation, rrOperation, pagination, PreviewForm, UploadFile, ArchivesInfo, Packing }, |
|
||||
mixins: [ |
|
||||
presenter(), |
|
||||
header(), |
|
||||
form({}) |
|
||||
], |
|
||||
props: { |
|
||||
selectedCategory: { |
|
||||
type: Object, |
|
||||
default: function() { |
|
||||
return {} |
|
||||
} |
|
||||
}, |
|
||||
isJuannei: { |
|
||||
type: Boolean, |
|
||||
default: false |
|
||||
} |
|
||||
}, |
|
||||
cruds() { |
|
||||
return [ |
|
||||
CRUD({ |
|
||||
title: '档案', |
|
||||
url: 'api/archives/initArchivesView', |
|
||||
query: { isdel: false }, |
|
||||
crudMethod: { add, edit, del }, |
|
||||
optShow: { |
|
||||
add: false, |
|
||||
edit: true, |
|
||||
del: false, |
|
||||
reset: false, |
|
||||
download: false, |
|
||||
group: false |
|
||||
}, |
|
||||
queryOnPresenterCreated: false, |
|
||||
sort: [] |
|
||||
}) |
|
||||
] |
|
||||
}, |
|
||||
data() { |
|
||||
return { |
|
||||
stateOptions: [ // 搜索 - 状态选择 |
|
||||
{ key: '1', label: '全部' }, |
|
||||
{ key: '2', label: '未装' }, |
|
||||
{ key: '3', label: '未入' }, |
|
||||
{ key: '4', label: '在库' }, |
|
||||
{ key: '5', label: '待借' }, |
|
||||
{ key: '6', label: '已借' } |
|
||||
], |
|
||||
queryOption: [ |
|
||||
{ value: 'maintitle', label: '题名' }, |
|
||||
{ value: 'archive_no', label: '档号' }, |
|
||||
{ value: 'archive_year', label: '年度' } |
|
||||
], |
|
||||
inputSelect: '', |
|
||||
permission: { |
|
||||
add: ['admin', 'archivesList:add'], |
|
||||
edit: ['admin', 'archivesList:edit'], |
|
||||
del: ['admin', 'archivesList:del'], |
|
||||
download: ['admin', 'archivesList:download'] |
|
||||
}, |
|
||||
fixedStatusBar: false, // table-右侧fixed |
|
||||
deleteVisible: false, // 删除dialog |
|
||||
deleteData: {}, // 删除选中data |
|
||||
tableDisplayFields: [], // table-list-title字段 |
|
||||
getTableDisplayFieldsLoading: false, // table-loading |
|
||||
formPreviewData: [], // 预览界面data |
|
||||
isEditOrAdd: '', // 判断crud-add/edit-btn |
|
||||
selectedData: null, // table已选择的 |
|
||||
archivesTabIndex: 0, // 新增 |
|
||||
arcId: null, // 档案ID |
|
||||
arrySort: [], // 多项sort-query |
|
||||
uploadFileVisible: false, // 上传附件 |
|
||||
archivesInfoVisible: false, // 档案详情 |
|
||||
lengingVisible: false, // 借阅 |
|
||||
isBinding: false, // 判断是否已绑定标签 |
|
||||
parent_id: null |
|
||||
} |
|
||||
}, |
|
||||
watch: { |
|
||||
selectedCategory: function(newValue, oldValue) { |
|
||||
// 案卷 卷内 文件 |
|
||||
if (newValue.isType === 3 || newValue.isType === 4 || newValue.isType === 5) { |
|
||||
this.crud.query.categoryId = newValue.id |
|
||||
this.crud.refresh() |
|
||||
} |
|
||||
}, |
|
||||
isJuannei: function(newValue, oldValue) { |
|
||||
|
|
||||
}, |
|
||||
tableDisplayFields(val) { |
|
||||
this.doLayout() |
|
||||
} |
|
||||
}, |
|
||||
created() { |
|
||||
// 初始化带select的输入框的 - 搜索 |
|
||||
this.inputSelect = this.queryOption[0].value |
|
||||
}, |
|
||||
mounted() { |
|
||||
}, |
|
||||
methods: { |
|
||||
doExport(fileName = '未知文件') { |
|
||||
this.crud.downloadLoading = true |
|
||||
if (this.selectedCategory.pid !== '0') { |
|
||||
this.parent_id = this.selectedCategory.pid |
|
||||
} else { |
|
||||
this.parent_id = null |
|
||||
} |
|
||||
const params = { |
|
||||
'categoryId': this.selectedCategory.id, |
|
||||
'parentsId': this.parent_id |
|
||||
} |
|
||||
exportFile('api/archives/exportArchives?' + qs.stringify(params)) |
|
||||
// this.crud.downloadLoading = false |
|
||||
}, |
|
||||
// 搜索-select |
|
||||
querySelect(val) { |
|
||||
this.inputSelect = val |
|
||||
}, |
|
||||
[CRUD.HOOK.beforeRefresh]() { |
|
||||
// 判断是否有门类父级id |
|
||||
if (this.selectedCategory.pid !== '0') { |
|
||||
this.crud.query.parentsId = this.selectedCategory.pid |
|
||||
} else { |
|
||||
this.crud.query.parentsId = null |
|
||||
} |
|
||||
this.getTableDisplayFieldsLoading = true |
|
||||
// 档案列表获取显示列 |
|
||||
getTableDisplayFields({ categoryId: this.selectedCategory.id }).then(data => { |
|
||||
this.tableDisplayFields = data |
|
||||
this.getTableDisplayFieldsLoading = false |
|
||||
this.tableDisplayFields.map(item => { |
|
||||
if (item.queue) { |
|
||||
this.arrySort.push(item.fieldName + ', ' + (item.displayOrder === 1 ? 'asc' : 'desc')) |
|
||||
} |
|
||||
}) |
|
||||
this.crud.sort = this.arrySort |
|
||||
new Promise((resolve, reject) => { |
|
||||
this.crud.loading = true |
|
||||
// 请求数据 |
|
||||
initData(this.crud.url, this.crud.getQueryParams()).then(data => { |
|
||||
const table = this.crud.getTable() |
|
||||
if (table && table.lazy) { // 懒加载子节点数据,清掉已加载的数据 |
|
||||
table.store.states.treeData = {} |
|
||||
table.store.states.lazyTreeNodeMap = {} |
|
||||
} |
|
||||
if (data) { |
|
||||
this.crud.page.total = data.totalElements !== null ? data.totalElements : data.length |
|
||||
this.crud.data = data.content ? data.content : data |
|
||||
this.crud.resetDataStatus() |
|
||||
resolve(data) |
|
||||
// time 毫秒后显示表格 |
|
||||
setTimeout(() => { |
|
||||
this.crud.loading = false |
|
||||
}, this.crud.time) |
|
||||
} |
|
||||
}).catch(err => { |
|
||||
this.crud.loading = false |
|
||||
reject(err) |
|
||||
}) |
|
||||
}) |
|
||||
}) |
|
||||
return false |
|
||||
}, |
|
||||
[CRUD.HOOK.beforeToCU](crud, form, btn) { |
|
||||
this.isEditOrAdd = btn |
|
||||
this.selectedData = crud.selections |
|
||||
this.archivesTabIndex = 0 |
|
||||
if (this.isEditOrAdd === 'add') { |
|
||||
this.arcId = null |
|
||||
} else if (this.isEditOrAdd === 'edit') { |
|
||||
this.arcId = this.selectedData[0].id |
|
||||
} |
|
||||
this.form.dictionaryConfigId = {} |
|
||||
this.formPreviewData = [] |
|
||||
// 档案预编辑获取字段 |
|
||||
const params = { |
|
||||
categoryId: this.selectedCategory.id, |
|
||||
archivesId: this.arcId |
|
||||
} |
|
||||
this.getFormInfo(params) |
|
||||
}, |
|
||||
// 著录界面-form/详情-api |
|
||||
getFormInfo(params) { |
|
||||
getFormDisplayFields(params).then(data => { |
|
||||
// this.formPreviewData = data.showFiled.filter((fields) => { return fields.isInput }) |
|
||||
this.formPreviewData = data.showFiled |
|
||||
this.form.categoryId = this.selectedCategory.id |
|
||||
this.$nextTick(() => { |
|
||||
if (this.isEditOrAdd === 'edit') { |
|
||||
this.$refs.previewForm.addOrUpdateForm = data.echo |
|
||||
} |
|
||||
}) |
|
||||
}) |
|
||||
}, |
|
||||
// form - submit |
|
||||
handlerArchivesSubmit() { |
|
||||
this.$refs.previewForm.submitForm('addOrUpdateForm') |
|
||||
}, |
|
||||
// table - 双击查看详情 |
|
||||
tableDoubleClick(row) { |
|
||||
this.$refs.archivesInfo.archivesInfoVisible = true |
|
||||
const params = { |
|
||||
categoryId: this.selectedCategory.id, |
|
||||
archivesId: row.id |
|
||||
} |
|
||||
this.getFormInfo(params) |
|
||||
}, |
|
||||
// table - 当前选中得row |
|
||||
clickRowHandler(row) { |
|
||||
this.$refs.table.toggleRowSelection(row) |
|
||||
}, |
|
||||
// 选择删除 |
|
||||
toDelete(data) { |
|
||||
this.deleteData = data |
|
||||
this.deleteVisible = true |
|
||||
}, |
|
||||
// 确认删除 |
|
||||
handleDeltConfirm() { |
|
||||
this.deleteVisible = false |
|
||||
this.crud.delAllLoading = true |
|
||||
// this.crud.doDelete(this.deleteData) |
|
||||
const ids = [] |
|
||||
this.deleteData.forEach(val => { |
|
||||
ids.push(val.id) |
|
||||
}) |
|
||||
const params = { |
|
||||
'ids': ids, |
|
||||
'categoryId': this.selectedCategory.id |
|
||||
} |
|
||||
// 删除fetch |
|
||||
del(params).then(res => { |
|
||||
this.crud.delAllLoading = false |
|
||||
this.$notify({ |
|
||||
title: '删除成功', |
|
||||
type: 'success', |
|
||||
duration: 2500 |
|
||||
}) |
|
||||
this.crud.refresh() |
|
||||
}) |
|
||||
}, |
|
||||
// 删除 - 关闭 |
|
||||
handleClose(done) { |
|
||||
this.deleteData = {} |
|
||||
done() |
|
||||
}, |
|
||||
/* 重新渲染table组件 防止table-fixed 错位 配合watch-table数据 */ |
|
||||
doLayout() { |
|
||||
this.$nextTick(() => { |
|
||||
this.$refs.table.doLayout() |
|
||||
}) |
|
||||
}, |
|
||||
// 上传附件 |
|
||||
uploadFile() { |
|
||||
this.uploadFileVisible = true |
|
||||
}, |
|
||||
uploadFileSave() { |
|
||||
this.uploadFileVisible = false |
|
||||
}, |
|
||||
// 绑定 |
|
||||
handleBinding(data) { |
|
||||
this.$refs.bind.bindingVisible = true |
|
||||
if (data.tid == null) { |
|
||||
this.isBinding = false |
|
||||
this.$refs.bind.bindingTitle = '绑定标签' |
|
||||
} else { |
|
||||
this.isBinding = true |
|
||||
this.$refs.bind.bindingTitle = '重新绑定' |
|
||||
} |
|
||||
}, |
|
||||
// 装盒 |
|
||||
handlePacking(data) { |
|
||||
this.$refs.packing.packingVisible = true |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
</script> |
|
||||
|
|
||||
<style rel="stylesheet/scss" lang="scss" scoped> |
|
||||
@import "~@/assets/styles/archives-manage.scss"; |
|
||||
.preview-dialog { |
|
||||
::v-deep .el-dialog { |
|
||||
.el-dialog__body{ |
|
||||
padding: 0; |
|
||||
} |
|
||||
.preview-content { |
|
||||
width: auto !important; |
|
||||
margin-right: 6px; |
|
||||
overflow: hidden; |
|
||||
overflow-y: auto; |
|
||||
.el-textarea__inner { |
|
||||
border: 1px solid #339cff; |
|
||||
background-color: transparent; |
|
||||
} |
|
||||
} |
|
||||
.dialog-footer{ |
|
||||
margin: 0 auto; |
|
||||
padding: 15px 0 20px 0; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
</style> |
|
@ -0,0 +1,110 @@ |
|||||
|
<template> |
||||
|
<div class="archives-warp"> |
||||
|
|
||||
|
<!-- 删除档案 --> |
||||
|
<el-dialog title="删除档案" :visible.sync="deleteVisible" :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> |
||||
|
<p v-if="recycleMain.selectedCategory.isType !== 5">数据来源:案卷 {{ selections.length }} 条数据 卷内 {{ totalSumAll }} 条数据</p> |
||||
|
<p v-else>数据来源:文件 {{ selections.length }} 条数据 附件 {{ totalSumAll }} 条数据</p> |
||||
|
<p class="delt-tip"><span>提示:如果删除当前档案,此档案内所附带的文件会一并删除</span></p> |
||||
|
</div> |
||||
|
<div slot="footer" class="dialog-footer"> |
||||
|
<el-button type="primary" @click.native="handleDeltConfirm">确定</el-button> |
||||
|
</div> |
||||
|
</div> |
||||
|
</el-dialog> |
||||
|
|
||||
|
</div></template> |
||||
|
|
||||
|
<script> |
||||
|
import { del, FetchCompletelyDelete } from '@/api/archivesManage/archivesList' |
||||
|
import { header, form } from '@crud/crud' |
||||
|
|
||||
|
export default { |
||||
|
name: 'DeltArchives', |
||||
|
mixins: [ |
||||
|
header(), |
||||
|
form({}) |
||||
|
], |
||||
|
props: { |
||||
|
selections: { |
||||
|
type: Array, |
||||
|
default: function() { |
||||
|
return [] |
||||
|
} |
||||
|
}, |
||||
|
categoryId: { |
||||
|
type: String, |
||||
|
default: function() { |
||||
|
return '' |
||||
|
} |
||||
|
}, |
||||
|
totalSumAll: { |
||||
|
type: Number, |
||||
|
default: function() { |
||||
|
return 0 |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
inject: ['recycleMain'], |
||||
|
data() { |
||||
|
return { |
||||
|
deleteVisible: false // 删除dialog |
||||
|
} |
||||
|
}, |
||||
|
watch: { |
||||
|
selections: function(newValue, oldValue) { |
||||
|
}, |
||||
|
categoryId: function(newValue, oldValue) { |
||||
|
}, |
||||
|
totalSumAll: function(newValue, oldValue) { |
||||
|
} |
||||
|
}, |
||||
|
created() { |
||||
|
}, |
||||
|
mounted() { |
||||
|
}, |
||||
|
methods: { |
||||
|
// 确认删除 |
||||
|
handleDeltConfirm() { |
||||
|
this.deleteVisible = false |
||||
|
this.crud.delAllLoading = true |
||||
|
const ids = [] |
||||
|
this.selections.forEach(val => { |
||||
|
ids.push(val.id) |
||||
|
}) |
||||
|
const params = { |
||||
|
'ids': ids, |
||||
|
'categoryId': this.categoryId |
||||
|
} |
||||
|
// 删除fetch |
||||
|
if (!this.recycleMain.isRecycle) { |
||||
|
del(params).then(res => { |
||||
|
this.crud.delAllLoading = false |
||||
|
this.$message.success('删除成功!') |
||||
|
this.crud.refresh() |
||||
|
}) |
||||
|
} else { |
||||
|
FetchCompletelyDelete(params).then(res => { |
||||
|
this.crud.delAllLoading = false |
||||
|
this.$message.success('删除成功!') |
||||
|
this.crud.refresh() |
||||
|
}) |
||||
|
} |
||||
|
}, |
||||
|
// 删除 - 关闭 |
||||
|
handleClose(done) { |
||||
|
this.deleteVisible = false |
||||
|
done() |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style rel="stylesheet/scss" lang="scss" scoped> |
||||
|
@import "~@/assets/styles/archives-manage.scss"; |
||||
|
</style> |
@ -0,0 +1,86 @@ |
|||||
|
<template> |
||||
|
<!-- 回收站-还原 --> |
||||
|
<el-dialog title="确认还原" :visible.sync="restoreVisible" :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="handleRestoreConfirm">确定</el-button> |
||||
|
</div> |
||||
|
</div> |
||||
|
</el-dialog> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { header, form } from '@crud/crud' |
||||
|
import { FetchReduction } from '@/api/archivesManage/archivesList' |
||||
|
export default { |
||||
|
name: 'RestoreArchives', |
||||
|
mixins: [ |
||||
|
header(), |
||||
|
form({}) |
||||
|
], |
||||
|
props: { |
||||
|
selections: { |
||||
|
type: Array, |
||||
|
default: function() { |
||||
|
return [] |
||||
|
} |
||||
|
}, |
||||
|
categoryId: { |
||||
|
type: String, |
||||
|
default: function() { |
||||
|
return '' |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
restoreVisible: false |
||||
|
} |
||||
|
}, |
||||
|
watch: { |
||||
|
selections: function(newValue, oldValue) { |
||||
|
}, |
||||
|
categoryId: function(newValue, oldValue) { |
||||
|
} |
||||
|
}, |
||||
|
mounted() { |
||||
|
}, |
||||
|
methods: { |
||||
|
// 关闭 |
||||
|
handleClose(done) { |
||||
|
this.restoreVisible = false |
||||
|
done() |
||||
|
}, |
||||
|
handleRestoreConfirm() { |
||||
|
const ids = [] |
||||
|
this.selections.forEach(val => { |
||||
|
ids.push(val.id) |
||||
|
}) |
||||
|
const params = { |
||||
|
'ids': ids, |
||||
|
'categoryId': this.categoryId |
||||
|
} |
||||
|
FetchReduction(params).then(data => { |
||||
|
if (data === 0) { |
||||
|
this.$message.error('还原失败!') |
||||
|
} else if (this.selections.length === data) { |
||||
|
this.$message.success('还原成功!') |
||||
|
} else if (this.selections.length > data) { |
||||
|
this.$message.success('部分档案还原成功!') |
||||
|
} |
||||
|
this.restoreVisible = false |
||||
|
this.crud.refresh() |
||||
|
}) |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style rel="stylesheet/scss" lang="scss" scoped> |
||||
|
@import "~@/assets/styles/archives-manage.scss"; |
||||
|
</style> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue