|
|
@ -1,4 +1,5 @@ |
|
|
|
<template> |
|
|
|
<div> |
|
|
|
<el-dialog class="detail-dialog" title="详情" :close-on-click-modal="false" :modal-append-to-body="false" append-to-body :visible.sync="archivesInfoVisible" :before-close="handleClose"> |
|
|
|
<!-- <span class="dialog-right-top" /> |
|
|
|
<span class="dialog-left-bottom" /> --> |
|
|
@ -54,7 +55,7 @@ |
|
|
|
<template slot-scope="scope"> |
|
|
|
<div> |
|
|
|
<span v-if="scope.row.read_type==='传阅中'" class="row-state end-state">{{ scope.row.read_type }}</span> |
|
|
|
<span v-if="scope.row.read_type==='空闲中'" class="row-state defalut-state">{{ scope.row.read_type }}</span> |
|
|
|
<span v-if="scope.row.read_type==='空闲中' || scope.row.read_type==='未传阅'" class="row-state defalut-state">{{ scope.row.read_type }}</span> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
@ -87,6 +88,12 @@ |
|
|
|
><i class="iconfont icon-shanchu" /></el-button> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column v-if="!isMidoRecord" prop="update_time" label="传阅操作" min-width="80" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<!-- 传阅 - 选择用户 --> |
|
|
|
<el-button v-if="scope.row.read_type!=='传阅中'" :loading="lendBtnLoading[scope.row.id]" style="padding: 4px 2px 4px 6px !important; color: #0348f3 !important; background-color: #dcedfd !important; border: 1px solid #9bd1ff !important;" @click="handleLendFile(scope.row)"><i class="iconfont icon-liuchengfaqi" /></el-button> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -167,12 +174,62 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
</el-dialog> |
|
|
|
<!-- @open="onDialogOpen" --> |
|
|
|
<el-dialog class="miod-depts-dialog" :append-to-body="true" :visible="deptsVisible" :before-close="handleBorrowClose" :close-on-click-modal="false" title="领导及部门"> |
|
|
|
<span class="dialog-right-top" /> |
|
|
|
<span class="dialog-left-bottom" /> |
|
|
|
<div class="setting-dialog"> |
|
|
|
<el-table ref="deptsMiodTable" :data="deptsMiodTable" highlight-current-row row-key="id" height="400" style="width: 100%;" @row-click="clickRowHandlerDepts" @selection-change="selectionChangeHandlerDepts"> |
|
|
|
<el-table-column type="selection" width="55" /> |
|
|
|
<el-table-column prop="borrowName" label="借阅者名称" /> |
|
|
|
<el-table-column prop="borrowType" label="借阅者类型"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<div> |
|
|
|
<span v-if="scope.row.borrowType === 1">部门</span> |
|
|
|
<span v-if="scope.row.borrowType === 2">个人</span> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="borrowNo" label="借阅证绑定"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<div> |
|
|
|
<span v-if="scope.row.borrowNo && (scope.row.borrowNo !== null || scope.row.borrowNo !== '')" class="row-state end-state">已绑定</span> |
|
|
|
<span v-else class="row-state cancel-state">未绑定</span> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="create_time" label="创建日期" width="200px"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<div>{{ scope.row.create_time | parseTime }}</div> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
<!--分页组件--> |
|
|
|
<el-pagination |
|
|
|
v-if="deptsMiodTable.length !== 0" |
|
|
|
:current-page="pageDepts.page" |
|
|
|
:total="pageDepts.total" |
|
|
|
:page-size="pageDepts.size" |
|
|
|
:pager-count="5" |
|
|
|
layout="total, prev, pager, next, sizes" |
|
|
|
@size-change="handleDeptsSizeChange" |
|
|
|
@current-change="handleDeptsCurrentPage" |
|
|
|
/> |
|
|
|
</div> |
|
|
|
<div slot="footer" class="dialog-footer"> |
|
|
|
<el-button type="text" @click="handleBorrowClose">取消</el-button> |
|
|
|
<el-button type="primary" @click.native="handleComfireDepts">确定</el-button> |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
// import { crud } from '@crud/crud' |
|
|
|
import { FetchArchivesDetails, FetchInitDocumentDetailsList, FetchAddDocumentDetails, FetchDeleteDocumentDetails, FetchInitDistributorByDocumentId, FetchInitOperate, FetchReadGW, FetchBingdingLabel, FetchUnbindTag, FetchArchivesDetailsBorrowLog } from '@/api/system/documentArchives' |
|
|
|
import { FetchArchivesDetails, FetchInitDocumentDetailsList, FetchAddDocumentDetails, FetchDeleteDocumentDetails, FetchInitDistributorByDocumentId, FetchInitOperate, FetchReadGW, FetchBingdingLabel, FetchUnbindTag, FetchArchivesDetailsBorrowLog, FetchLend } from '@/api/system/documentArchives' |
|
|
|
import { FetchInitBorrowerList } from '@/api/system/borrower' |
|
|
|
import { mapGetters } from 'vuex' |
|
|
|
|
|
|
|
export default { |
|
|
@ -254,7 +311,17 @@ export default { |
|
|
|
}, |
|
|
|
bindLoading: {}, |
|
|
|
unbindBtnLoading: {}, |
|
|
|
deleteBtnLoading: {} |
|
|
|
deleteBtnLoading: {}, |
|
|
|
lendBtnLoading: {}, |
|
|
|
deptsVisible: false, |
|
|
|
deptsMiodTable: [], |
|
|
|
pageDepts: { |
|
|
|
page: 0, |
|
|
|
size: 10, |
|
|
|
total: 0 |
|
|
|
}, |
|
|
|
singleSelectedDept: null, |
|
|
|
currentLendData: null |
|
|
|
} |
|
|
|
}, |
|
|
|
computed: { |
|
|
@ -641,6 +708,92 @@ export default { |
|
|
|
this.$set(this.deleteBtnLoading, datas.id, false) |
|
|
|
}) |
|
|
|
}, |
|
|
|
handleLendFile(data) { |
|
|
|
console.log('data', data) |
|
|
|
this.currentLendData = data |
|
|
|
this.deptsVisible = true |
|
|
|
this.FetchDeptsList() |
|
|
|
}, |
|
|
|
// 获取部门/人员列表 |
|
|
|
FetchDeptsList() { |
|
|
|
this.singleSelectedDept = null |
|
|
|
this.deptsMiodTable = [] |
|
|
|
// this.btnLoading = true |
|
|
|
FetchInitBorrowerList(this.filterParams) |
|
|
|
.then(res => { |
|
|
|
this.deptsMiodTable = res.content || [] |
|
|
|
this.pageDepts.total = res.totalElements || 0 |
|
|
|
}) |
|
|
|
.catch(error => { |
|
|
|
this.$message.error('获取数据失败,请稍后重试') |
|
|
|
console.error('获取部门/人员列表失败', error) |
|
|
|
}) |
|
|
|
.finally(() => { |
|
|
|
// this.btnLoading = false |
|
|
|
}) |
|
|
|
}, |
|
|
|
handleComfireDepts() { |
|
|
|
// if (this.miodDeptsSelections.length === 0) { |
|
|
|
// this.$message.warning('请选择部门/人员') |
|
|
|
// return |
|
|
|
// } |
|
|
|
// this.miodDeptsTags = [...this.miodDeptsSelections] |
|
|
|
if (this.singleSelectedDept !== null) { |
|
|
|
const param = { |
|
|
|
'borrowDocumentTid': this.currentLendData.reg_no, |
|
|
|
'borrowerNo': this.singleSelectedDept.borrowNo |
|
|
|
} |
|
|
|
console.log('param', param) |
|
|
|
FetchLend(param).then((res) => { |
|
|
|
console.log('resLend', res) |
|
|
|
if (res.code !== -1) { |
|
|
|
this.$message({ message: res.msg, type: 'success', offset: 8 }) |
|
|
|
this.getInitDocumentDetailsList() |
|
|
|
} else { |
|
|
|
this.$message({ message: res.msg, type: 'error', offset: 8 }) |
|
|
|
} |
|
|
|
this.deptsVisible = false |
|
|
|
this.$set(this.lendBtnLoading, this.currentLendData.id, false) |
|
|
|
}).catch(error => { |
|
|
|
console.error(error) |
|
|
|
this.$set(this.lendBtnLoading, this.currentLendData.id, false) |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.$message({ message: '请选择借阅者', type: 'error', offset: 8 }) |
|
|
|
} |
|
|
|
}, |
|
|
|
clickRowHandlerDepts(row, event, column) { |
|
|
|
this.$refs.deptsMiodTable.toggleRowSelection(row, true) // 选中当前行 |
|
|
|
this.singleSelectedDept = row // 保存选中行数据 |
|
|
|
}, |
|
|
|
selectionChangeHandlerDepts(selection) { |
|
|
|
if (selection.length > 1) { |
|
|
|
// 如果选择了多个,只保留最后一个选中的 |
|
|
|
const latestRow = selection[selection.length - 1] |
|
|
|
this.$refs.deptsMiodTable.clearSelection() |
|
|
|
this.$refs.deptsMiodTable.toggleRowSelection(latestRow, true) |
|
|
|
this.singleSelectedDept = latestRow |
|
|
|
} else if (selection.length === 1) { |
|
|
|
// 如果选择了一个,保存选中项 |
|
|
|
this.singleSelectedDept = selection[0] |
|
|
|
} else { |
|
|
|
// 如果没有选择,清空选中状态 |
|
|
|
this.singleSelectedDept = null |
|
|
|
} |
|
|
|
}, |
|
|
|
handleDeptsSizeChange(size) { |
|
|
|
this.pageDepts.size = size |
|
|
|
this.pageDepts.page = 0 |
|
|
|
this.FetchDeptsList() |
|
|
|
}, |
|
|
|
handleDeptsCurrentPage(pageVal) { |
|
|
|
this.pageDepts.page = pageVal - 1 |
|
|
|
this.FetchDeptsList() |
|
|
|
}, |
|
|
|
handleBorrowClose(done) { |
|
|
|
this.deptsVisible = false |
|
|
|
done() |
|
|
|
}, |
|
|
|
handleClose(done) { |
|
|
|
this.archivesInfoVisible = false |
|
|
|
done() |
|
|
|