阅行客电子档案
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.

181 lines
5.4 KiB

1 year ago
2 weeks ago
1 year ago
2 weeks ago
1 year ago
2 weeks ago
1 year ago
2 weeks ago
1 year ago
1 year ago
2 weeks ago
2 weeks ago
2 weeks ago
2 weeks ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
  1. <template>
  2. <div class="app-container row-container">
  3. <div class="connection-header collect-header" style="padding: 0; border-top: none; height: auto; margin-bottom: 20px;">
  4. <div class="head-search" style="margin-bottom: 0;">
  5. <el-select
  6. v-model="fondsIds"
  7. multiple
  8. collapse-tags
  9. placeholder="请选择所属全宗"
  10. style="width: 320px;"
  11. >
  12. <el-option
  13. v-for="item in fondsOptions"
  14. :key="item.id"
  15. :label="item.fondsName"
  16. :value="item.id"
  17. />
  18. </el-select>
  19. <el-select
  20. v-model="years"
  21. multiple
  22. collapse-tags
  23. placeholder="请选择年份"
  24. style="width: 150px;"
  25. >
  26. <el-option
  27. v-for="item in yearsOptions"
  28. :key="item.id"
  29. :label="item.name"
  30. :value="item.id"
  31. />
  32. </el-select>
  33. <el-button class="filter-item filter-search" size="mini" type="success" icon="el-icon-search" @click="getTotalStatistics">查询</el-button>
  34. <el-button class="filter-item filter-refresh" size="mini" type="warning" icon="el-icon-refresh-left" @click="resetQuery">重置</el-button>
  35. </div>
  36. <el-button size="mini" @click="doExport()">
  37. <i class="iconfont icon-daochu" />
  38. 导出
  39. </el-button>
  40. </div>
  41. <el-table v-loading="loading" class="archives-table" :data="allData" :summary-method="getSummaries" show-summary style="width: 100%;">
  42. <el-table-column type="index" label="序号" width="60" align="center" />
  43. <el-table-column prop="categoryName" label="档案门类(国标分类)" align="center" />
  44. <el-table-column prop="archivesCount" label="案卷数(卷)" align="center" />
  45. <el-table-column prop="singleCount" label="卷内件数(件)" align="center" />
  46. <el-table-column prop="fileCount" label="电子原文数量(份)" align="center" />
  47. <el-table-column prop="fileSize" label="电子档案存储容量(GB)" align="center" />
  48. </el-table>
  49. </div>
  50. </template>
  51. <script>
  52. import { FetchFondsAll } from '@/api/system/fonds'
  53. import { FetchTotalStatistics, FetchArchivedAllYear } from '@/api/statistics/statistics'
  54. import qs from 'qs'
  55. import { exportFile } from '@/utils/index'
  56. import { mapGetters } from 'vuex'
  57. export default {
  58. name: 'DataStatistics',
  59. data() {
  60. return {
  61. allData: [],
  62. fondsOptions: [],
  63. fondsIds: [],
  64. yearsOptions: [],
  65. years: [],
  66. loading: false
  67. }
  68. },
  69. computed: {
  70. ...mapGetters([
  71. 'baseApi'
  72. ])
  73. },
  74. mounted() {
  75. this.getFondsDatas()
  76. this.getArchivedAllYearDatas()
  77. this.getTotalStatistics()
  78. },
  79. methods: {
  80. getSummaries(param) {
  81. const { columns, data } = param
  82. const sums = []
  83. columns.forEach((column, index) => {
  84. if (index === 1) {
  85. sums[index] = '合计(全库总量)'
  86. return
  87. }
  88. const values = data.map(item => Number(item[column.property]))
  89. if (!values.every(value => isNaN(value))) {
  90. if (column.property === 'fileSize') {
  91. sums[index] = values.reduce((prev, curr) => {
  92. return prev + curr
  93. }, 0).toFixed(3)
  94. } else {
  95. sums[index] = values.reduce((prev, curr) => {
  96. return prev + curr
  97. }, 0)
  98. }
  99. } else {
  100. sums[index] = '-'
  101. }
  102. })
  103. return sums
  104. },
  105. resetQuery() {
  106. this.fondsIds = []
  107. this.years = []
  108. this.getTotalStatistics()
  109. },
  110. getFondsDatas() {
  111. FetchFondsAll().then(res => {
  112. this.fondsOptions = res
  113. // 默认全选所有档案库
  114. // this.fondsIds = res.map(item => item.id)
  115. // this.checkAndQuery()
  116. })
  117. },
  118. getArchivedAllYearDatas() {
  119. FetchArchivedAllYear().then(res => {
  120. this.yearsOptions = res.map(item => ({
  121. id: item,
  122. name: item
  123. }))
  124. // 默认全选所有年份
  125. // this.years = res.map(item => item)
  126. // this.checkAndQuery()
  127. })
  128. },
  129. checkAndQuery() {
  130. // 当两个数据都加载完成后才执行查询
  131. if (this.fondsOptions.length > 0 && this.yearsOptions.length > 0) {
  132. this.getTotalStatistics()
  133. }
  134. },
  135. getTotalStatistics() {
  136. this.loading = true
  137. FetchTotalStatistics({
  138. fondsIds: this.fondsIds,
  139. years: this.years
  140. }).then(res => {
  141. this.allData = res
  142. this.loading = false
  143. })
  144. },
  145. doExport() {
  146. this.$confirm('此操作将导出当前统计数据' + '<span>你是否还要继续?</span>', '提示', {
  147. confirmButtonText: '继续',
  148. cancelButtonText: '取消',
  149. type: 'warning',
  150. dangerouslyUseHTMLString: true
  151. }).then(() => {
  152. exportFile(this.baseApi + '/api/control/exportBusinessFlow?' + qs.stringify({}, { indices: false }))
  153. }).catch(() => {
  154. console.log('取消')
  155. })
  156. }
  157. }
  158. }
  159. </script>
  160. <style lang="scss" scoped>
  161. .app-container {
  162. height: calc(100vh - 140px);
  163. .head-search{
  164. .el-select,
  165. .el-button{
  166. margin-right: 10px;
  167. }
  168. }
  169. ::v-deep .el-table__footer{
  170. font-size: 14px;
  171. }
  172. ::v-deep .el-table__empty-block{
  173. border-bottom: 1px solid #e4e7ed;
  174. }
  175. }
  176. </style>