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

294 lines
9.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
  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" :test="test" />
  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-column v-if="!isRecycle && !(isTitleType === 3 && activeIndex === 1 && selectedCategory.arrangeType !== 1 )" label="归档审批" width="88" align="center" :fixed="parentsData.fixedStatusBar ? false : 'right' ">
  44. <template slot-scope="scope">
  45. <span :class="['row-state', 'row-warehousing', scope.row.collect_formal===2 ? 'state-active' : '' ]">{{ scope.row.collect_formal===2 ? '锁定': '-' }}</span>
  46. </template>
  47. </el-table-column>
  48. </el-table>
  49. <!--分页组件-->
  50. <el-pagination
  51. v-if="anjuanData.length !== 0"
  52. :current-page="page.page"
  53. :total="page.total"
  54. :page-size="page.size"
  55. :pager-count="5"
  56. layout="total, prev, pager, next, sizes"
  57. @size-change="handleSizeChange"
  58. @current-change="handleCurrentPage"
  59. />
  60. </div>
  61. <!-- 档案详情 -->
  62. <ArchivesInfo ref="archivesInfo" :selected-category="selectedCategory" :arc-id="arcId" :is-title-type="isTitleType" :is-collect="true" />
  63. </div>
  64. </template>
  65. <script>
  66. import { header, form } from '@crud/crud'
  67. import { collectionLibraryCrud } from '../mixins/index'
  68. import ArchivesInfo from '../module/archivesInfo/index'
  69. import collectHeader from '../module/collectHeader'
  70. export default {
  71. name: 'Sorted',
  72. components: { ArchivesInfo, collectHeader },
  73. mixins: [
  74. header(),
  75. form({}),
  76. collectionLibraryCrud
  77. ],
  78. props: {
  79. isTitleType: {
  80. type: Number,
  81. default: 3
  82. },
  83. selectedCategory: {
  84. type: Object,
  85. default: function() {
  86. return {}
  87. }
  88. },
  89. activeIndex: {
  90. type: Number,
  91. default: 0
  92. },
  93. isRecycle: {
  94. type: Boolean,
  95. default: false
  96. },
  97. smartQuery: {
  98. type: Object,
  99. default: function() {
  100. return {}
  101. }
  102. },
  103. test: {
  104. type: String,
  105. default: ''
  106. }
  107. },
  108. inject: ['parentsData'],
  109. data() {
  110. return {
  111. categoryId: '',
  112. arcId: '',
  113. title: '',
  114. selections: [],
  115. yearData: [],
  116. parentId: null
  117. }
  118. },
  119. watch: {
  120. selectedCategory: function(newValue, oldValue) {
  121. this.selections = []
  122. this.$refs.table.clearSelection()
  123. if (newValue.arrangeType !== 1) {
  124. this.title = '案卷'
  125. } else {
  126. this.title = '文件'
  127. }
  128. },
  129. tableDisplayFields(val) {
  130. this.doLayout()
  131. },
  132. activeIndex(newValue) {
  133. if (newValue === 1) {
  134. this.title = '文件'
  135. this.getCommonData(3, null)
  136. } else {
  137. this.title = '案卷'
  138. if (this.selectedCategory.arrangeType === 3) {
  139. this.getCommonData(2, this.parentsData.parentsProjectId)
  140. } else {
  141. this.getCommonData(2, null)
  142. }
  143. }
  144. this.selections = []
  145. this.$refs.table.clearSelection()
  146. }
  147. },
  148. created() {
  149. },
  150. mounted() {
  151. },
  152. methods: {
  153. getCommonData(categoryLevel, parentId, type) {
  154. this.getViewTable(categoryLevel, parentId, type)
  155. },
  156. rowKey(row) {
  157. return row.id
  158. },
  159. sendYearDataToParent() {
  160. this.$parent.$parent.$emit('myYearEvent', this.yearData)
  161. },
  162. openJuannei(data, parentId, parentRow) {
  163. // this.$emit('openJuannei', '这是来自案卷的通知')
  164. if (this.selectedCategory.arrangeType === 3) {
  165. this.$parent.$parent.$parent.$emit('openJuannei', data, parentId, parentRow)
  166. } else {
  167. this.$parent.$parent.$emit('openJuannei', data, parentId, parentRow)
  168. }
  169. },
  170. // table选中加上选中状态
  171. tableRowClassName({ row, rowIndex }) {
  172. let color = ''
  173. this.selections.forEach(item => {
  174. if (item.id === row.id) {
  175. color = 'rowStyle'
  176. }
  177. })
  178. return color
  179. },
  180. // table - 全选
  181. selectAll(val) {
  182. this.selections = val
  183. },
  184. // table - 双击查看详情
  185. tableDoubleClick(row) {
  186. if (this.timer) {
  187. clearTimeout(this.timer)
  188. }
  189. this.arcId = row.id
  190. this.$nextTick(() => {
  191. if (this.selectedCategory.arrangeType !== 1) {
  192. this.$refs.archivesInfo.isHasFile = false
  193. if (this.activeIndex === 1) {
  194. this.$refs.archivesInfo.detailTitle = '文件详情'
  195. this.$refs.archivesInfo.isHasFile = true
  196. this.$refs.archivesInfo.getDetial(3, row.id)
  197. } else {
  198. this.$refs.archivesInfo.detailTitle = '案卷详情'
  199. this.$refs.archivesInfo.getDetial(2, row.id)
  200. }
  201. } else {
  202. this.$refs.archivesInfo.isHasFile = true
  203. this.$refs.archivesInfo.detailTitle = '文件详情'
  204. this.$refs.archivesInfo.getDetial(3, row.id)
  205. }
  206. this.$refs.archivesInfo.isFourTest = true
  207. this.$refs.archivesInfo.archivesInfoVisible = true
  208. this.$refs.archivesInfo.archivesTabIndex = 0
  209. })
  210. },
  211. // table - 当前选中得row
  212. clickRowHandler(row) {
  213. this.parentsData.smartQuery = {
  214. 'retention': null,
  215. 'security_class': null,
  216. 'doc_type': null,
  217. 'medium_type': null,
  218. 'archive_year': null,
  219. 'fonds_no': null
  220. }
  221. if (this.timer) {
  222. clearTimeout(this.timer)
  223. }
  224. if (this.selectedCategory.arrangeType === 1) {
  225. if (this.activeIndex === 0) {
  226. this.title = '文件'
  227. }
  228. } else {
  229. if (this.activeIndex === 0) {
  230. this.title = '案卷'
  231. }
  232. }
  233. this.timer = setTimeout(() => {
  234. this.parentId = row.id
  235. this.openJuannei('所属' + this.title + ':' + row.archive_no, this.parentId, row)
  236. }, 300)
  237. // this.selections = this.crud.selections
  238. },
  239. // 触发单选
  240. handleCurrentChange(selection, row) {
  241. this.selections = selection
  242. },
  243. handleSizeChange(size) {
  244. this.page.size = size
  245. this.page.page = 1
  246. if (this.activeIndex === 1) {
  247. this.getViewTable(3, null)
  248. } else {
  249. if (this.selectedCategory.arrangeType === 3) {
  250. this.getViewTable(2, this.parentsData.parentsProjectId)
  251. } else if (this.selectedCategory.arrangeType === 1) {
  252. this.getViewTable(3, null)
  253. } else {
  254. this.getViewTable(2, null)
  255. }
  256. }
  257. },
  258. handleCurrentPage(val) {
  259. this.page.page = val
  260. if (this.activeIndex === 1) {
  261. this.getViewTable(3, null)
  262. } else {
  263. if (this.selectedCategory.arrangeType === 3) {
  264. this.getViewTable(2, this.parentsData.parentsProjectId)
  265. } else if (this.selectedCategory.arrangeType === 1) {
  266. this.getViewTable(3, null)
  267. } else {
  268. this.getViewTable(2, null)
  269. }
  270. }
  271. }
  272. }
  273. }
  274. </script>
  275. <style lang='scss' scoped>
  276. @import "~@/assets/styles/collect-reorganizi.scss";
  277. @mixin management-fixed-style{
  278. [data-theme="dark"] & {
  279. background-color: #031435 !important;
  280. -webkit-box-shadow: -5px 5px 10px 1px rgba(15,164,222,.16);
  281. box-shadow: -5px 5px 10px 1px rgba(15,164,222,.16);
  282. }
  283. [data-theme="light"] & {
  284. background-color: #fff;
  285. }
  286. }
  287. .el-table {
  288. ::v-deep .el-table__fixed-right {
  289. @include management-fixed-style;
  290. }
  291. }
  292. </style>