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

202 lines
5.7 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
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <div class="collect-no-tab">
  3. <CollectHeader ref="collectHeaderRef" :is-title-type="isTitleType" :selected-category="selectedCategory" :arc-id="arcId" :selections="selections" :is-recycle="isRecycle" />
  4. <!-- <el-button type="text" @click="openAnjuan">打开案卷的Drawer</el-button> -->
  5. <div class="collect-table">
  6. <el-table
  7. ref="table"
  8. v-loading="getTableDisplayFieldsLoading"
  9. class="archives-table"
  10. :data="projectData"
  11. highlight-current-row
  12. style="width: 100%;"
  13. :row-key="rowKey"
  14. :row-class-name="tableRowClassName"
  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="案卷" prop="children_num" width="55" align="center" />
  24. <el-table-column v-for="field in tableDisplayFields" :key="field.id" :label="field.fieldCnName" :align="field.displayformatType" :width="field.displayLength" show-overflow-tooltip>
  25. <template slot="header">
  26. <el-tooltip
  27. class="item"
  28. effect="dark"
  29. :content="field.fieldCnName"
  30. placement="top-start"
  31. >
  32. <span>{{ field.fieldCnName }}</span>
  33. </el-tooltip>
  34. </template>
  35. <template slot-scope="scope">
  36. {{ scope.row[field.fieldName] }}
  37. </template>
  38. </el-table-column>
  39. </el-table>
  40. <!--分页组件-->
  41. <el-pagination
  42. v-if="projectData.length !== 0"
  43. :current-page="page.page"
  44. :total="page.total"
  45. :page-size="page.size"
  46. :pager-count="5"
  47. layout="total, prev, pager, next, sizes"
  48. @size-change="handleSizeChange"
  49. @current-change="handleCurrentPage"
  50. />
  51. </div>
  52. <!-- 档案详情 -->
  53. <ArchivesInfo ref="archivesInfo" :selected-category="selectedCategory" :arc-id="arcId" />
  54. </div>
  55. </template>
  56. <script>
  57. import { collectionLibraryCrud } from '../mixins/index'
  58. import { header, form } from '@crud/crud'
  59. import CollectHeader from '../module/collectHeader.vue'
  60. import ArchivesInfo from '../module/archivesInfo/index'
  61. export default {
  62. name: 'Project',
  63. components: { CollectHeader, ArchivesInfo },
  64. mixins: [
  65. header(),
  66. form({}),
  67. collectionLibraryCrud
  68. ],
  69. props: {
  70. data: {
  71. type: String,
  72. default: ''
  73. },
  74. selectedCategory: {
  75. type: Object,
  76. default: function() {
  77. return {}
  78. }
  79. },
  80. isRecycle: {
  81. type: Boolean,
  82. default: false
  83. },
  84. smartQuery: {
  85. type: Object,
  86. default: function() {
  87. return {}
  88. }
  89. }
  90. },
  91. inject: ['parentsData'],
  92. data() {
  93. return {
  94. isTitleType: 2,
  95. categoryId: '',
  96. arcId: '',
  97. activeIndex: '1',
  98. selections: [],
  99. yearData: [],
  100. parentId: null
  101. }
  102. },
  103. watch: {
  104. selectedCategory: function(newValue, oldValue) {
  105. },
  106. tableDisplayFields(val) {
  107. // this.doLayout()
  108. }
  109. },
  110. created() {
  111. },
  112. mounted() {
  113. },
  114. methods: {
  115. getCommonData(categoryLevel, parentId, type) {
  116. this.getViewTable(categoryLevel, parentId, type)
  117. },
  118. sendYearDataToParent() {
  119. this.$emit('myYearEvent', this.yearData)
  120. },
  121. openAnjuan(data, parentId) {
  122. // this.$emit('openAnjuan', '传值')
  123. this.$emit('openAnjuan', data, parentId)
  124. },
  125. rowKey(row) {
  126. return row.id
  127. },
  128. // table选中加上选中状态
  129. tableRowClassName({ row, rowIndex }) {
  130. // console.log('添加类名', row, rowIndex)
  131. let color = ''
  132. this.selections.forEach(item => {
  133. if (item.id === row.id) {
  134. color = 'rowStyle'
  135. }
  136. })
  137. return color
  138. },
  139. // table - 全选
  140. selectAll(val) {
  141. this.selections = val
  142. },
  143. // table - 双击查看详情
  144. tableDoubleClick(row) {
  145. if (this.timer) {
  146. clearTimeout(this.timer)
  147. }
  148. this.arcId = row.id
  149. this.$nextTick(() => {
  150. this.$refs.archivesInfo.detailTitle = '项目详情'
  151. this.$refs.archivesInfo.archivesInfoVisible = true
  152. this.$refs.archivesInfo.archivesTabIndex = 0
  153. this.$refs.archivesInfo.getDetial(1, row.id)
  154. })
  155. },
  156. // table - 当前选中得row
  157. clickRowHandler(row) {
  158. this.parentsData.smartQuery = {
  159. 'retention': null,
  160. 'security_class': null,
  161. 'doc_type': null,
  162. 'medium_type': null,
  163. 'archive_year': null,
  164. 'fonds_no': null
  165. }
  166. if (this.timer) {
  167. clearTimeout(this.timer)
  168. }
  169. this.timer = setTimeout(() => {
  170. this.parentId = row.id
  171. this.openAnjuan('所属项目:' + row.project_no, this.parentId)
  172. }, 300)
  173. this.selections = this.crud.selections
  174. },
  175. // 触发单选
  176. handleCurrentChange(selection, row) {
  177. this.selections = selection
  178. },
  179. handleSizeChange(size) {
  180. this.page.size = size
  181. this.page.page = 1
  182. this.getViewTable(1)
  183. },
  184. handleCurrentPage(val) {
  185. this.page.page = val
  186. this.getViewTable(1)
  187. }
  188. }
  189. }
  190. </script>
  191. <style lang='scss' scoped>
  192. @import "~@/assets/styles/collect-reorganizi.scss";
  193. .collect-no-tab{
  194. padding-top: 36px;
  195. }
  196. [data-theme=dark] .collect-no-tab{
  197. padding-top: 0;
  198. }
  199. </style>