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

270 lines
8.2 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <div>
  3. <CollectHeader ref="collectHeaderRef" :is-title-type="isTitleType" :selected-category="selectedCategory" :arc-id="arcId" :selections="selections" :active-index="activeIndex" :is-recycle="isRecycle" />
  4. <div class="collect-table">
  5. <el-table
  6. ref="table"
  7. v-loading="getTableDisplayFieldsLoading"
  8. class="archives-table"
  9. :data="anjuanData"
  10. highlight-current-row
  11. style="width: 100%;"
  12. height="calc(100vh - 418px)"
  13. :row-class-name="tableRowClassName"
  14. :row-key="rowKey"
  15. @select-all="selectAll"
  16. @selection-change="crud.selectionChangeHandler"
  17. @row-click="clickRowHandler"
  18. @cell-dblclick="tableDoubleClick"
  19. @select="handleCurrentChange"
  20. >
  21. <el-table-column type="selection" :reserve-selection="true" width="55" align="center" />
  22. <el-table-column type="index" label="序号" width="55" align="center" />
  23. <el-table-column :label="selectedCategory.arrangeType === 1 || (selectedCategory.arrangeType !==1 && activeIndex===1) ? '原文':'卷内'" prop="child" width="55" align="center">
  24. <template slot-scope="scope">
  25. {{ scope.row.child === '' ? 0 : scope.row.child }}
  26. </template>
  27. </el-table-column>
  28. <el-table-column v-for="field in tableDisplayFields" :key="field.id" :label="field.fieldCnName" :align="field.displayformatType" :width="field.displayLength" show-overflow-tooltip>
  29. <template slot="header">
  30. <el-tooltip
  31. class="item"
  32. effect="dark"
  33. :content="field.fieldCnName"
  34. placement="top-start"
  35. >
  36. <span>{{ field.fieldCnName }}</span>
  37. </el-tooltip>
  38. </template>
  39. <template slot-scope="scope">
  40. {{ scope.row[field.fieldName] }}
  41. </template>
  42. </el-table-column>
  43. </el-table>
  44. <!--分页组件-->
  45. <el-pagination
  46. v-if="anjuanData.length !== 0"
  47. :current-page="page.page"
  48. :total="page.total"
  49. :page-size="page.size"
  50. :pager-count="5"
  51. layout="total, prev, pager, next, sizes"
  52. @size-change="handleSizeChange"
  53. @current-change="handleCurrentPage"
  54. />
  55. </div>
  56. <!-- 档案详情 -->
  57. <ArchivesInfo ref="archivesInfo" :selected-category="selectedCategory" :arc-id="arcId" :is-title-type="isTitleType" />
  58. </div>
  59. </template>
  60. <script>
  61. import { header, form } from '@crud/crud'
  62. import { collectionLibraryCrud } from '../mixins/index'
  63. import ArchivesInfo from '../module/archivesInfo/index'
  64. import CollectHeader from '../module/collectHeader.vue'
  65. export default {
  66. name: 'Sorted',
  67. components: { ArchivesInfo, CollectHeader },
  68. mixins: [
  69. header(),
  70. form({}),
  71. collectionLibraryCrud
  72. ],
  73. props: {
  74. isTitleType: {
  75. type: Number,
  76. default: 3
  77. },
  78. selectedCategory: {
  79. type: Object,
  80. default: function() {
  81. return {}
  82. }
  83. },
  84. activeIndex: {
  85. type: Number,
  86. default: 0
  87. },
  88. isRecycle: {
  89. type: Boolean,
  90. default: false
  91. },
  92. smartQuery: {
  93. type: Object,
  94. default: function() {
  95. return {}
  96. }
  97. }
  98. },
  99. inject: ['parentsData'],
  100. data() {
  101. return {
  102. categoryId: '',
  103. arcId: '',
  104. title: '',
  105. selections: [],
  106. yearData: [],
  107. parentId: null
  108. }
  109. },
  110. watch: {
  111. selectedCategory: function(newValue, oldValue) {
  112. this.selections = []
  113. this.$refs.table.clearSelection()
  114. if (newValue.arrangeType !== 1) {
  115. this.title = '案卷'
  116. } else {
  117. this.title = '文件'
  118. }
  119. },
  120. tableDisplayFields(val) {
  121. this.doLayout()
  122. },
  123. activeIndex(newValue) {
  124. if (newValue === 1) {
  125. this.title = '文件'
  126. this.getCommonData(3, null)
  127. } else {
  128. this.title = '案卷'
  129. if (this.selectedCategory.arrangeType === 3) {
  130. this.getCommonData(2, this.parentsData.parentsProjectId)
  131. } else {
  132. this.getCommonData(2, null)
  133. }
  134. }
  135. this.selections = []
  136. this.$refs.table.clearSelection()
  137. }
  138. },
  139. created() {
  140. },
  141. mounted() {
  142. },
  143. methods: {
  144. getCommonData(categoryLevel, parentId, type) {
  145. this.getViewTable(categoryLevel, parentId, type)
  146. },
  147. rowKey(row) {
  148. return row.id
  149. },
  150. sendYearDataToParent() {
  151. this.$parent.$parent.$emit('myYearEvent', this.yearData)
  152. },
  153. openJuannei(data, parentId) {
  154. // this.$emit('openJuannei', '这是来自案卷的通知')
  155. if (this.selectedCategory.arrangeType === 3) {
  156. this.$parent.$parent.$parent.$emit('openJuannei', data, parentId)
  157. } else {
  158. this.$parent.$parent.$emit('openJuannei', data, parentId)
  159. }
  160. },
  161. // table选中加上选中状态
  162. tableRowClassName({ row, rowIndex }) {
  163. let color = ''
  164. this.selections.forEach(item => {
  165. if (item.id === row.id) {
  166. color = 'rowStyle'
  167. }
  168. })
  169. return color
  170. },
  171. // table - 全选
  172. selectAll(val) {
  173. this.selections = val
  174. },
  175. // table - 双击查看详情
  176. tableDoubleClick(row) {
  177. if (this.timer) {
  178. clearTimeout(this.timer)
  179. }
  180. this.arcId = row.id
  181. this.$nextTick(() => {
  182. if (this.selectedCategory.arrangeType !== 1) {
  183. this.$refs.archivesInfo.isHasFile = false
  184. if (this.activeIndex === 1) {
  185. this.$refs.archivesInfo.detailTitle = '文件详情'
  186. this.$refs.archivesInfo.isHasFile = true
  187. this.$refs.archivesInfo.getDetial(3, row.id)
  188. } else {
  189. this.$refs.archivesInfo.detailTitle = '案卷详情'
  190. this.$refs.archivesInfo.getDetial(2, row.id)
  191. }
  192. } else {
  193. this.$refs.archivesInfo.isHasFile = true
  194. this.$refs.archivesInfo.detailTitle = '文件详情'
  195. this.$refs.archivesInfo.getDetial(3, row.id)
  196. }
  197. this.$refs.archivesInfo.isFourTest = true
  198. this.$refs.archivesInfo.archivesInfoVisible = true
  199. this.$refs.archivesInfo.archivesTabIndex = 0
  200. })
  201. },
  202. // table - 当前选中得row
  203. clickRowHandler(row) {
  204. this.parentsData.smartQuery = {
  205. 'retention': null,
  206. 'security_class': null,
  207. 'doc_type': null,
  208. 'medium_type': null,
  209. 'archive_year': null,
  210. 'fonds_no': null
  211. }
  212. if (this.timer) {
  213. clearTimeout(this.timer)
  214. }
  215. if (this.selectedCategory.arrangeType === 1) {
  216. if (this.activeIndex === 0) {
  217. this.title = '文件'
  218. }
  219. } else {
  220. if (this.activeIndex === 0) {
  221. this.title = '案卷'
  222. }
  223. }
  224. this.timer = setTimeout(() => {
  225. this.parentId = row.id
  226. this.openJuannei('所属' + this.title + ':' + row.archive_no, this.parentId)
  227. }, 300)
  228. this.selections = this.crud.selections
  229. },
  230. // 触发单选
  231. handleCurrentChange(selection, row) {
  232. this.selections = selection
  233. },
  234. handleSizeChange(size) {
  235. this.page.size = size
  236. this.page.page = 1
  237. if (this.activeIndex === 1) {
  238. this.getViewTable(3, null)
  239. } else {
  240. if (this.selectedCategory.arrangeType === 3) {
  241. this.getViewTable(2, this.parentsData.parentsProjectId)
  242. } else if (this.selectedCategory.arrangeType === 1) {
  243. this.getViewTable(3, null)
  244. } else {
  245. this.getViewTable(2, null)
  246. }
  247. }
  248. },
  249. handleCurrentPage(val) {
  250. this.page.page = val
  251. if (this.activeIndex === 1) {
  252. this.getViewTable(3, null)
  253. } else {
  254. if (this.selectedCategory.arrangeType === 3) {
  255. this.getViewTable(2, this.parentsData.parentsProjectId)
  256. } else if (this.selectedCategory.arrangeType === 1) {
  257. this.getViewTable(3, null)
  258. } else {
  259. this.getViewTable(2, null)
  260. }
  261. }
  262. }
  263. }
  264. }
  265. </script>
  266. <style lang='scss' scoped>
  267. @import "~@/assets/styles/collect-reorganizi.scss";
  268. </style>