Browse Source

档案统计导出

master
xuhuajiao 2 weeks ago
parent
commit
ccacbf4793
  1. 26
      src/utils/index.js
  2. 40
      src/views/archivesStatistics/borrowingStatistics/index.vue
  3. 40
      src/views/archivesStatistics/dataStatistics/index.vue
  4. 46
      src/views/archivesStatistics/roomCollectionStatistics/index.vue
  5. 62
      src/views/archivesStatistics/usageCountStatistics/index.vue
  6. 80
      src/views/archivesStatistics/utilizeRegistrationStatistics/index.vue

26
src/utils/index.js

@ -1,6 +1,7 @@
/**
* Created by PanJiaChen on 16/11/18.
*/
import { getToken } from '@/utils/auth'
/**
* Parse the time to string
@ -474,3 +475,28 @@ export function saveByteArray(fileName, byte) {
link.download = fileName
link.click()
}
export function exportFileToken(url, fileName) {
const link = document.createElement('a')
link.style.display = 'none'
const xhr = new XMLHttpRequest()
xhr.open('GET', url, true)
xhr.setRequestHeader('Authorization', getToken())
xhr.responseType = 'blob'
xhr.onload = function() {
if (xhr.status === 200) {
const blob = new Blob([xhr.response], { type: xhr.getResponseHeader('Content-Type') })
const url = window.URL.createObjectURL(blob)
link.href = url
link.setAttribute('download', fileName || 'export.xlsx')
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
window.URL.revokeObjectURL(url)
}
}
xhr.send()
}

40
src/views/archivesStatistics/borrowingStatistics/index.vue

@ -33,14 +33,18 @@
<el-button class="filter-item filter-search" size="mini" type="success" icon="el-icon-search" @click="getBorrowdStatistics">查询</el-button>
<el-button class="filter-item filter-refresh" size="mini" type="warning" icon="el-icon-refresh-left" @click="resetQuery">重置</el-button>
</div>
<el-button size="mini" @click="doExport()">
<el-button :loading="exportLoading" size="mini" @click="doExport()">
<i class="iconfont icon-daochu" />
导出
</el-button>
</div>
<el-table v-loading="loading" class="archives-table" :data="allData" :summary-method="getSummaries" show-summary style="width: 100%;">
<el-table-column type="index" label="序号" width="60" align="center" />
<!-- :summary-method="getSummaries" show-summary -->
<el-table v-loading="loading" class="archives-table" :data="allData" style="width: 100%;" :row-class-name="tableRowClassName">
<el-table-column label="序号" width="60" align="center">
<template slot-scope="scope">
{{ scope.$index === allData.length - 1 && scope.row.year === '全年累计总量' ? '-' : scope.$index + 1 }}
</template>
</el-table-column>
<el-table-column prop="year" label="统计年度" align="center" />
<!-- <el-table-column prop="borrowPersonCount" label="实体借阅量(卷/件)" align="center" /> -->
<el-table-column prop="borrowElectronicCount" label="电子借阅量(份/件)" align="center" />
@ -54,7 +58,7 @@
import { FetchFondsAll } from '@/api/system/fonds'
import { FetchBorrowdStatistics, FetchArchivedAllYear } from '@/api/statistics/statistics'
import qs from 'qs'
import { exportFile } from '@/utils/index'
import { exportFileToken, getCurrentTime } from '@/utils/index'
import { mapGetters } from 'vuex'
export default {
@ -66,7 +70,8 @@ export default {
fondsIds: [],
yearsOptions: [],
years: [],
loading: false
loading: false,
exportLoading: false
}
},
computed: {
@ -78,6 +83,12 @@ export default {
this.getBorrowdStatistics()
},
methods: {
tableRowClassName({ row, rowIndex }) {
if (rowIndex === this.allData.length - 1 && row.year === '全年累计总量') {
return 'summary-row'
}
return ''
},
getSummaries(param) {
const { columns, data } = param
const sums = []
@ -126,15 +137,23 @@ export default {
})
},
doExport() {
this.exportLoading = true
this.$confirm('此操作将导出当前统计数据' + '<span>你是否还要继续?</span>', '提示', {
confirmButtonText: '继续',
cancelButtonText: '取消',
type: 'warning',
dangerouslyUseHTMLString: true
}).then(() => {
exportFile(this.baseApi + '/api/control/exportBusinessFlow?' + qs.stringify({}, { indices: false }))
const params = {
fondsIds: this.fondsIds,
years: this.years
}
exportFileToken(this.baseApi + '/api/control/exportBorrowdStatistics?' + qs.stringify(params, { indices: false }), '借阅统计' + getCurrentTime() + '.xlsx').then(() => {
this.exportLoading = false
})
}).catch(() => {
console.log('取消')
this.exportLoading = false
})
}
}
@ -156,5 +175,12 @@ export default {
::v-deep .el-table__empty-block{
border-bottom: 1px solid #e4e7ed;
}
::v-deep .summary-row {
background-color: #f5f7fa !important;
td{
border-top: 1px solid #dfe6ec !important;
border-bottom: 1px solid #dfe6ec !important;
}
}
}
</style>

40
src/views/archivesStatistics/dataStatistics/index.vue

@ -33,14 +33,18 @@
<el-button class="filter-item filter-search" size="mini" type="success" icon="el-icon-search" @click="getTotalStatistics">查询</el-button>
<el-button class="filter-item filter-refresh" size="mini" type="warning" icon="el-icon-refresh-left" @click="resetQuery">重置</el-button>
</div>
<el-button size="mini" @click="doExport()">
<el-button :loading="exportLoading" size="mini" @click="doExport()">
<i class="iconfont icon-daochu" />
导出
</el-button>
</div>
<el-table v-loading="loading" class="archives-table" :data="allData" :summary-method="getSummaries" show-summary style="width: 100%;">
<el-table-column type="index" label="序号" width="60" align="center" />
<!-- :summary-method="getSummaries" show-summary -->
<el-table v-loading="loading" class="archives-table" :data="allData" style="width: 100%;" :row-class-name="tableRowClassName">
<el-table-column label="序号" width="60" align="center">
<template slot-scope="scope">
{{ scope.$index === allData.length - 1 && scope.row.categoryName === '合计(全库总量)' ? '-' : scope.$index + 1 }}
</template>
</el-table-column>
<el-table-column prop="categoryName" label="档案门类(国标分类)" align="center" />
<el-table-column prop="archivesCount" label="案卷数(卷)" align="center" />
<el-table-column prop="singleCount" label="卷内件数(件)" align="center" />
@ -55,7 +59,7 @@
import { FetchFondsAll } from '@/api/system/fonds'
import { FetchTotalStatistics, FetchArchivedAllYear } from '@/api/statistics/statistics'
import qs from 'qs'
import { exportFile } from '@/utils/index'
import { exportFileToken, getCurrentTime } from '@/utils/index'
import { mapGetters } from 'vuex'
export default {
@ -67,7 +71,8 @@ export default {
fondsIds: [],
yearsOptions: [],
years: [],
loading: false
loading: false,
exportLoading: false
}
},
computed: {
@ -81,6 +86,12 @@ export default {
this.getTotalStatistics()
},
methods: {
tableRowClassName({ row, rowIndex }) {
if (rowIndex === this.allData.length - 1 && row.categoryName === '合计(全库总量)') {
return 'summary-row'
}
return ''
},
getSummaries(param) {
const { columns, data } = param
const sums = []
@ -147,15 +158,23 @@ export default {
})
},
doExport() {
this.exportLoading = true
this.$confirm('此操作将导出当前统计数据' + '<span>你是否还要继续?</span>', '提示', {
confirmButtonText: '继续',
cancelButtonText: '取消',
type: 'warning',
dangerouslyUseHTMLString: true
}).then(() => {
exportFile(this.baseApi + '/api/control/exportBusinessFlow?' + qs.stringify({}, { indices: false }))
const params = {
fondsIds: this.fondsIds,
years: this.years
}
exportFileToken(this.baseApi + '/api/control/exportTotalStatistics?' + qs.stringify(params, { indices: false }), '总量统计' + getCurrentTime() + '.xlsx').then(() => {
this.exportLoading = false
})
}).catch(() => {
console.log('取消')
this.exportLoading = false
})
}
}
@ -177,5 +196,12 @@ export default {
::v-deep .el-table__empty-block{
border-bottom: 1px solid #e4e7ed;
}
::v-deep .summary-row {
background-color: #f5f7fa !important;
td{
border-top: 1px solid #dfe6ec !important;
border-bottom: 1px solid #dfe6ec !important;
}
}
}
</style>

46
src/views/archivesStatistics/roomCollectionStatistics/index.vue

@ -33,16 +33,24 @@
<el-button class="filter-item filter-search" size="mini" type="success" icon="el-icon-search" @click="getRoomCollectionStatistics">查询</el-button>
<el-button class="filter-item filter-refresh" size="mini" type="warning" icon="el-icon-refresh-left" @click="resetQuery">重置</el-button>
</div>
<el-button size="mini" @click="doExport()">
<el-button :loading="exportLoading" size="mini" @click="doExport()">
<i class="iconfont icon-daochu" />
导出
</el-button>
</div>
<el-table v-loading="loading" class="archives-table" :data="displayData" :summary-method="getSummaries" show-summary style="width: 100%;">
<el-table-column type="index" label="序号" width="60" align="center" />
<!-- :summary-method="getSummaries" show-summary -->
<el-table v-loading="loading" class="archives-table" :data="displayData" style="width: 100%;" :row-class-name="tableRowClassName">
<el-table-column label="序号" width="60" align="center">
<template slot-scope="scope">
{{ scope.$index === displayData.length - 1 && scope.row.categoryName === '该年度全类型合计' ? '-' : scope.$index + 1 }}
</template>
</el-table-column>
<el-table-column prop="categoryName" label="档案门类" align="center" />
<el-table-column prop="year" label="统计年度" align="center" />
<el-table-column prop="year" label="统计年度" align="center">
<template slot-scope="scope">
{{ scope.$index === displayData.length - 1 && scope.row.categoryName === '该年度全类型合计' ? '-' : scope.row.year }}
</template>
</el-table-column>
<el-table-column prop="permanentCount" label="永久保管(Y)数量" align="center" />
<el-table-column prop="thirtyYearCount" label="定期30年(D30)数量" align="center" />
<el-table-column prop="tenYearCount" label="定期10年(D10)数量" align="center" />
@ -55,7 +63,7 @@
import { FetchFondsAll } from '@/api/system/fonds'
import { FetchRoomCollectionStatistics, FetchArchivedAllYear } from '@/api/statistics/statistics'
import qs from 'qs'
import { exportFile } from '@/utils/index'
import { exportFileToken, getCurrentTime } from '@/utils/index'
import { mapGetters } from 'vuex'
export default {
@ -67,7 +75,8 @@ export default {
fondsIds: [],
yearsOptions: [],
years: [],
loading: false
loading: false,
exportLoading: false
}
},
computed: {
@ -98,6 +107,12 @@ export default {
this.getRoomCollectionStatistics()
},
methods: {
tableRowClassName({ row, rowIndex }) {
if (rowIndex === this.displayData.length - 1 && row.categoryName === '该年度全类型合计') {
return 'summary-row'
}
return ''
},
getSummaries(param) {
const { columns, data } = param
const sums = []
@ -160,15 +175,23 @@ export default {
})
},
doExport() {
this.exportLoading = true
this.$confirm('此操作将导出当前统计数据' + '<span>你是否还要继续?</span>', '提示', {
confirmButtonText: '继续',
cancelButtonText: '取消',
type: 'warning',
dangerouslyUseHTMLString: true
}).then(() => {
exportFile(this.baseApi + '/api/control/exportBusinessFlow?' + qs.stringify({}, { indices: false }))
const params = {
fondsIds: this.fondsIds,
years: this.years
}
exportFileToken(this.baseApi + '/api/control/exportRoomCollectionStatistics?' + qs.stringify(params, { indices: false }), '室藏统计' + getCurrentTime() + '.xlsx').then(() => {
this.exportLoading = false
})
}).catch(() => {
console.log('取消')
this.exportLoading = false
})
}
}
@ -190,5 +213,12 @@ export default {
::v-deep .el-table__empty-block{
border-bottom: 1px solid #e4e7ed;
}
::v-deep .summary-row {
background-color: #f5f7fa !important;
td{
border-top: 1px solid #dfe6ec !important;
border-bottom: 1px solid #dfe6ec !important;
}
}
}
</style>

62
src/views/archivesStatistics/usageCountStatistics/index.vue

@ -34,15 +34,19 @@
<el-button class="filter-item filter-search" size="mini" type="success" icon="el-icon-search" @click="getBorrowdCountStatisticsList">查询</el-button>
<el-button class="filter-item filter-refresh" size="mini" type="warning" icon="el-icon-refresh-left" @click="resetQuery">重置</el-button>
</div>
<el-button size="mini" @click="doExport()">
<el-button :loading="exportLoading" size="mini" @click="doExport()">
<i class="iconfont icon-daochu" />
导出
</el-button>
</div>
<div class="table-container">
<el-table v-loading="loading" class="archives-table" height="calc(100vh - 280px)" :data="allData" style="width: 100%;">
<el-table-column type="index" label="序号" width="60" align="center" />
<el-table v-loading="loading" class="archives-table" height="calc(100vh - 280px)" :data="displayData" style="width: 100%;" :row-class-name="tableRowClassName">
<el-table-column label="序号" width="60" align="center">
<template slot-scope="scope">
{{ scope.row.isSummary ? '-' : scope.$index + 1 }}
</template>
</el-table-column>
<el-table-column prop="archiveNo" label="档号" align="center" width="200" show-overflow-tooltip />
<el-table-column prop="maintitle" label="档案名称" align="center" />
<el-table-column prop="categoryName" label="档案门类" align="center" width="180" show-overflow-tooltip />
@ -74,7 +78,7 @@
import { FetchFondsAll } from '@/api/system/fonds'
import { FetchBorrowdCountStatisticsList, FetchArchivedAllYear } from '@/api/statistics/statistics'
import qs from 'qs'
import { exportFile } from '@/utils/index'
import { exportFileToken, getCurrentTime } from '@/utils/index'
import { mapGetters } from 'vuex'
export default {
@ -92,13 +96,34 @@ export default {
page: 0,
size: 10,
total: 0
}
},
totalStatistics: null,
exportLoading: false
}
},
computed: {
...mapGetters([
'baseApi'
])
]),
displayData() {
const data = [...this.allData]
if (this.totalStatistics) {
data.push({
archiveNo: '-',
maintitle: '全库合计',
categoryName: '-',
archiveYear: '-',
retention: '-',
entityBorrowCount: this.totalStatistics.totalEntityBorrowCount,
electronicBorrowCount: this.totalStatistics.totalElectronicBorrowCount,
viewCount: this.totalStatistics.totalViewCount,
downloadCount: this.totalStatistics.totalDownloadCount,
printCount: this.totalStatistics.totalPrintCount,
isSummary: true
})
}
return data
}
},
mounted() {
this.getFondsDatas()
@ -138,6 +163,7 @@ export default {
console.log(res)
this.allData = res.records
this.page.total = res.total
this.totalStatistics = res.totalStatistics
this.loading = false
})
},
@ -151,16 +177,31 @@ export default {
this.page.size = 10
this.getBorrowdCountStatisticsList()
},
tableRowClassName({ row }) {
if (row.isSummary) {
return 'summary-row'
}
return ''
},
doExport() {
this.exportLoading = true
this.$confirm('此操作将导出当前统计数据' + '<span>你是否还要继续?</span>', '提示', {
confirmButtonText: '继续',
cancelButtonText: '取消',
type: 'warning',
dangerouslyUseHTMLString: true
}).then(() => {
exportFile(this.baseApi + '/api/control/exportBusinessFlow?' + qs.stringify({}, { indices: false }))
const params = {
fondsIds: this.fondsIds,
years: this.years,
search: this.search
}
exportFileToken(this.baseApi + '/api/control/exportBorrowdCountStatisticsList?' + qs.stringify(params, { indices: false }), '利用次数统计' + getCurrentTime() + '.xlsx').then(() => {
this.exportLoading = false
})
}).catch(() => {
console.log('取消')
this.exportLoading = false
})
}
}
@ -179,6 +220,13 @@ export default {
::v-deep .el-table__footer{
font-size: 14px;
}
::v-deep .summary-row {
background-color: #f5f7fa !important;
td{
border-top: 1px solid #dfe6ec !important;
border-bottom: 1px solid #dfe6ec !important;
}
}
// ::v-deep .el-table__body{
// border-bottom: 1px solid #e4e7ed;
// }

80
src/views/archivesStatistics/utilizeRegistrationStatistics/index.vue

@ -53,7 +53,7 @@
<el-button class="filter-item filter-search" size="mini" type="success" icon="el-icon-search" @click="getBorrowdRegisterStatisticsList">查询</el-button>
<el-button class="filter-item filter-refresh" size="mini" type="warning" icon="el-icon-refresh-left" @click="resetQuery">重置</el-button>
</div>
<el-button size="mini" @click="doExport()">
<el-button :loading="exportLoading" size="mini" @click="doExport()">
<i class="iconfont icon-daochu" />
导出
</el-button>
@ -61,15 +61,23 @@
<div class="table-container">
<!-- :summary-method="getSummaries" show-summary border -->
<el-table v-loading="loading" class="archives-table" :data="allData" height="calc(100vh - 280px)" style="width: 100%;">
<el-table-column type="index" label="序号" width="60" align="center" />
<el-table v-loading="loading" class="archives-table" :data="displayData" height="calc(100vh - 280px)" style="width: 100%;" :row-class-name="tableRowClassName">
<el-table-column label="序号" width="60" align="center">
<template slot-scope="scope">
{{ scope.row.isSummary ? '-' : scope.$index + 1 }}
</template>
</el-table-column>
<el-table-column prop="applicantName" label="借阅人" align="center" />
<el-table-column prop="deptName" label="所属部门" align="center" />
<el-table-column prop="viewCount" label="累计查看次数" align="center" />
<el-table-column prop="downloadCount" label="累计下载次数" align="center" />
<el-table-column prop="borrowCount" label="累计借阅人次" align="center" />
<el-table-column prop="firstUseTime" label="首次利用时间" align="center" />
<el-table-column prop="lastUseTime" label="末次利用时间" align="center" />
<el-table-column prop="borrowCount" label="借阅次数" align="center" />
<el-table-column prop="archivesCount" label="借阅档案次数" align="center" />
<el-table-column prop="entityBorrowCount" label="实体借阅次数" align="center" />
<el-table-column prop="electronicBorrowCount" label="电子借阅次数" align="center" />
<el-table-column prop="viewCount" label="查看次数" align="center" />
<el-table-column prop="downloadCount" label="下载次数" align="center" />
<el-table-column prop="printCount" label="打印次数" align="center" />
<el-table-column prop="firstUseTime" label="首次利用时间" align="center" width="180" />
<el-table-column prop="lastUseTime" label="末次利用时间" align="center" width="180" />
</el-table>
<el-pagination
v-if="allData.length !== 0"
@ -93,7 +101,7 @@ import { FetchBorrowdRegisterStatisticsList } from '@/api/statistics/statistics'
import { FetchInitDeptsAllByFondsId } from '@/api/system/dept'
import DateRangePicker from '@/components/DateRangePicker'
import qs from 'qs'
import { exportFile } from '@/utils/index'
import { exportFileToken, getCurrentTime } from '@/utils/index'
import { mapGetters } from 'vuex'
export default {
@ -121,13 +129,35 @@ export default {
inputSelect: '',
query: {},
deptOptions: [],
deptId: ''
deptId: '',
totalStatistics: null,
exportLoading: false
}
},
computed: {
...mapGetters([
'baseApi'
])
]),
displayData() {
const data = [...this.allData]
if (this.totalStatistics) {
data.push({
applicantName: '全人员合计',
deptName: '-',
borrowCount: this.totalStatistics.totalBorrowCount,
archivesCount: this.totalStatistics.totalArchivesCount,
entityBorrowCount: this.totalStatistics.totalEntityBorrowCount,
electronicBorrowCount: this.totalStatistics.totalElectronicBorrowCount,
printCount: this.totalStatistics.totalPrintCount,
viewCount: this.totalStatistics.totalViewCount,
downloadCount: this.totalStatistics.totalDownloadCount,
firstUseTime: '-',
lastUseTime: '-',
isSummary: true
})
}
return data
}
},
created() {
this.inputSelect = this.options[0].value
@ -211,9 +241,16 @@ export default {
}).then(res => {
this.allData = res.records
this.page.total = res.total
this.totalStatistics = res.totalStatistics
this.loading = false
})
},
tableRowClassName({ row }) {
if (row.isSummary) {
return 'summary-row'
}
return ''
},
handleSizeChange(size) {
this.page.size = size
this.page.page = 0
@ -225,15 +262,27 @@ export default {
this.getBorrowdRegisterStatisticsList()
},
doExport() {
this.exportLoading = true
this.$confirm('此操作将导出当前统计数据' + '<span>你是否还要继续?</span>', '提示', {
confirmButtonText: '继续',
cancelButtonText: '取消',
type: 'warning',
dangerouslyUseHTMLString: true
}).then(() => {
exportFile(this.baseApi + '/api/control/exportBusinessFlow?' + qs.stringify({}, { indices: false }))
const params = {
fondsIds: this.fondsIds,
startTime: this.blurryTime ? this.blurryTime[0] : null,
endTime: this.blurryTime ? this.blurryTime[1] : null,
search: this.query.search || null,
borrowReason: this.query.borrowReason || null,
deptId: this.deptId || null
}
exportFileToken(this.baseApi + '/api/control/exportBorrowdRegisterStatisticsList?' + qs.stringify(params, { indices: false }), '利用登记统计' + getCurrentTime() + '.xlsx').then(() => {
this.exportLoading = false
})
}).catch(() => {
console.log('取消')
this.exportLoading = false
})
}
}
@ -252,6 +301,13 @@ export default {
::v-deep .el-table__footer{
font-size: 14px;
}
::v-deep .summary-row {
background-color: #f5f7fa !important;
td{
border-top: 1px solid #dfe6ec !important;
border-bottom: 1px solid #dfe6ec !important;
}
}
// ::v-deep .el-table__body,
// ::v-deep .el-table__body-wrapper{
// border-bottom: 1px solid #e4e7ed;

Loading…
Cancel
Save