阅行客电子档案
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

291 lines
11 KiB

<template>
<el-drawer
class="management-drawer"
:with-header="false"
:visible.sync="juanneiDrawer"
:modal="false"
:wrapper-closable="false"
:show-close="false"
direction="rtl"
:size="selectedCategory.arrangeType === 2 ? '90%' :'80%'"
>
<CollectHeader ref="collectHeaderRef" :is-title-type="isTitleType" :selected-category="selectedCategory" :selections="selections" :test="test" :is-recycle="isRecycle" />
<div class="collect-table">
<el-table
ref="table"
v-loading="crud.loading || getTableDisplayFieldsLoading"
class="archives-table"
:data="junneiData"
highlight-current-row
style="width: 100%;"
height="calc(100vh - 364px)"
: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" width="55" :reserve-selection="true" align="center" />
<el-table-column type="index" label="序号" width="55" align="center" />
<el-table-column label="原文" prop="child" width="55" align="center">
<template slot-scope="scope">
{{ scope.row.child === '' ? 0 : scope.row.child }}
</template>
</el-table-column>
<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="!isRecycle" label="标签" width="88" align="center" :fixed="parentsData.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="!isRecycle" label="装盒" width="88" align="center" :fixed="parentsData.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="!isRecycle" label="入库" width="88" align="center" :fixed="parentsData.fixedStatusBar ? false : 'right' ">
<template slot-scope="scope">
<!-- <span class="row-state row-warehousing state-active">已入</span> -->
<span :class="['row-state', 'row-warehousing', scope.row.folder_location ? 'state-active' : '' ]">{{ scope.row.folder_location ? '已入': '未入' }}</span>
<!-- 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="!isRecycle" label="借阅" width="88" align="center" :fixed="parentsData.fixedStatusBar ? false : 'right' ">
<template slot-scope="scope">
<span :class="['row-state', 'row-lending', scope.row.is_borrow ? 'state-active' : '' ]">{{ scope.row.is_borrow ? '已借': '未借' }}</span>
<!-- <span class="row-state row-lending state-active">已借</span> -->
<!-- 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-column v-if="!isRecycle " label="开放" width="88" align="center" :fixed="parentsData.fixedStatusBar ? false : 'right' ">
<template slot-scope="scope">
<span :class="['row-state', 'row-open', scope.row.open_state ? 'state-active' : '' ]">{{ scope.row.open_state ? '已开放': '未开放' }}</span>
</template>
</el-table-column>
<el-table-column v-if="!isRecycle" label="实体" width="88" align="center" :fixed="parentsData.fixedStatusBar ? false : 'right' ">
<template slot-scope="scope">
<span :class="['row-state', 'row-physical', scope.row.is_entity === 1 ? 'state-active' : '' ]">{{ scope.row.is_entity === 1 ? '有': '无' }}</span>
</template>
</el-table-column>
<el-table-column v-if="!isRecycle" label="审批锁定" width="88" align="center" :fixed="parentsData.fixedStatusBar ? false : 'right' ">
<template slot-scope="scope">
<span :class="['row-state', 'row-warehousing', scope.row.process_status !== 1 ? 'state-active' : '' ]">{{ processedStatusText(scope.row.process_status) }}</span>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<el-pagination
v-if="junneiData.length !== 0"
: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>
<!-- 档案详情 -->
<ArchivesInfo ref="archivesInfo" :selected-category="selectedCategory" :arc-id="arcId" :is-title-type="isTitleType" :is-collect="false" />
<span class="closed-btn" @click="closeDrawer" />
</el-drawer>
</template>
<script>
import { manageLibraryCrud } from '../mixins/index'
import { header, form } from '@crud/crud'
import CollectHeader from '../module/collectHeader'
import ArchivesInfo from '../module/archivesInfo/index'
export default {
name: 'Juannei',
components: { CollectHeader, ArchivesInfo },
mixins: [
header(),
form({}),
manageLibraryCrud
],
props: {
selectedCategory: {
type: Object,
default: function() {
return {}
}
},
isRecycle: {
type: Boolean,
default: false
},
smartQuery: {
type: Object,
default: function() {
return {}
}
}
},
inject: ['parentsData'],
data() {
return {
isTitleType: 4,
juanneiDrawer: false,
categoryId: '',
arcId: '',
test: '',
selections: [],
parentId: null
}
},
computed: {
processedStatusText() {
return function(status) {
let text = ''
if (status === 1) {
text = '空闲'
} else if (status === 2) {
text = '退回'
} else if (status === 3) {
text = '开放'
} else if (status === 4) {
text = '销毁'
} else if (status === 5) {
text = '利用'
} else if (status === 6) {
text = '内部移交'
} else if (status === 7) {
text = '外部移交'
}
return text
}
}
},
watch: {
selectedCategory: function(newValue, oldValue) {
},
tableDisplayFields(val) {
this.doLayout()
}
},
created() {
},
mounted() {
},
methods: {
getCommonData(categoryLevel, parentId, type) {
this.getViewTable(categoryLevel, parentId, type)
},
openFile(data, parentId) {
// this.$emit('openFile', '这是来自卷内的通知')
this.$emit('openFile', data, parentId)
},
closeDrawer() {
this.juanneiDrawer = false
this.$parent.parentsAnjuanId = null
},
rowKey(row) {
return row.id
},
// table选中加上选中状态
tableRowClassName({ row, rowIndex }) {
// console.log('添加类名', row, rowIndex)
let color = ''
this.selections.forEach(item => {
if (item.id === row.id) {
color = 'rowStyle'
}
})
return color
},
// table - 全选
selectAll(val) {
this.selections = val
},
// table - 双击查看详情
tableDoubleClick(row) {
if (this.timer) {
clearTimeout(this.timer)
}
console.log('tableDoubleClick', row)
this.arcId = row.id
this.$nextTick(() => {
this.$refs.archivesInfo.isHasFile = true
this.$refs.archivesInfo.detailTitle = '卷内详情'
this.$refs.archivesInfo.archivesInfoVisible = true
this.$refs.archivesInfo.archivesTabIndex = 0
this.$refs.archivesInfo.getDetial(3, row.id)
})
},
// table - 当前选中得row
clickRowHandler(row) {
this.parentsData.smartQuery = {
'retention': null,
'security_class': null,
'doc_type': null,
'medium_type': null,
'archive_year': null,
'fonds_no': null
}
if (this.timer) {
clearTimeout(this.timer)
}
this.timer = setTimeout(() => {
this.parentId = row.id
this.openFile('所属卷内:' + row.archive_no, this.parentId)
}, 300)
this.selections = this.crud.selections
},
// 触发单选
handleCurrentChange(selection, row) {
console.log('触发单选', row)
this.selections = selection
},
handleSizeChange(size) {
this.page.size = size
this.page.page = 1
this.getViewTable(3, this.parentsData.parentsAnjuanId)
},
handleCurrentPage(val) {
this.page.page = val
this.getViewTable(3, this.parentsData.parentsAnjuanId)
}
}
}
</script>
<style lang='scss' scoped>
@mixin management-fixed-style{
[data-theme="dark"] & {
background-color: #031435 !important;
-webkit-box-shadow: -5px 5px 10px 1px rgba(15,164,222,.16);
box-shadow: -5px 5px 10px 1px rgba(15,164,222,.16);
}
[data-theme="light"] & {
background-color: #fff;
}
}
.el-table {
::v-deep .el-table__fixed-right {
@include management-fixed-style;
}
}
</style>