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

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