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

245 lines
9.4 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
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year 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
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. import { FetchInitCategoryViewTable } from '@/api/collect/collect'
  2. import { FetchInitContorlView } from '@/api/archivesManage/library'
  3. import { crud } from '@crud/crud'
  4. export const manageLibraryCrud = {
  5. mixins: [crud()],
  6. // 组件共用属性
  7. data() {
  8. return {
  9. getTableDisplayFieldsLoading: false,
  10. tableDisplayFields: [],
  11. projectData: [],
  12. anjuanData: [],
  13. junneiData: [],
  14. fileData: [],
  15. arrySort: [],
  16. page: {
  17. page: 1,
  18. size: 10,
  19. total: 0
  20. },
  21. timer: null,
  22. query: {
  23. search: null,
  24. project_class: null,
  25. archive_ctg_no: null
  26. },
  27. classifyTree: [],
  28. classifyLoading: false,
  29. parentsId: null
  30. }
  31. },
  32. // 组件挂载时的共用方法
  33. mounted() {
  34. },
  35. // 组件共用方法
  36. methods: {
  37. // 缓存用户对于固定栏操作习惯
  38. statusBarChecked(val) {
  39. this.fixedStatusBar = val
  40. localStorage.setItem('statusBarFixedType', val)
  41. },
  42. handleSearch(categoryLevel) {
  43. console.log('selectStatus', this.selectStatus)
  44. this.parentsData.$refs.classifyTree.setCurrentKey(null)
  45. this.smartQuery = {
  46. 'retention': null,
  47. 'security_class': null,
  48. 'doc_type': null,
  49. 'medium_type': null,
  50. 'archive_year': null,
  51. 'fonds_no': null
  52. }
  53. // 2 项目 3 案卷 /文件 4 卷内 6 文件
  54. if (this.isTitleType === 2) {
  55. this.parentsId = null
  56. this.$parent.getTableDisplayFieldsLoading = true
  57. } else if (this.isTitleType === 3) {
  58. if (this.selectedCategory.arrangeType === 1) {
  59. this.parentsId = null
  60. } else {
  61. if (this.activeIndex === 1) {
  62. this.parentsId = null
  63. } else {
  64. this.parentsId = this.parentsData.parentsProjectId
  65. }
  66. }
  67. this.$parent.getTableDisplayFieldsLoading = true
  68. } else if (this.isTitleType === 4) {
  69. // 卷内
  70. this.$parent.$parent.getTableDisplayFieldsLoading = true
  71. this.parentsId = this.parentsData.parentsAnjuanId
  72. } else if (this.isTitleType === 6) {
  73. // 原文
  74. if (this.selectedCategory.arrangeType === 1) {
  75. this.parentsId = this.parentsData.parentsAnjuanId
  76. this.$parent.getTableDisplayFieldsLoading = true
  77. } else {
  78. this.$parent.$parent.getTableDisplayFieldsLoading = true
  79. if (this.parentsData.isTabFile) {
  80. this.parentsId = this.parentsData.parentsAnjuanId
  81. } else {
  82. this.parentsId = this.parentsData.parentsJuanneiId
  83. }
  84. }
  85. }
  86. setTimeout(() => {
  87. this.getViewTable(categoryLevel, this.parentsId, 'search')
  88. }, 200)
  89. },
  90. getViewTable(categoryLevel, parentsId, type) {
  91. this.getTableDisplayFieldsLoading = true
  92. this.tableDisplayFields = []
  93. FetchInitCategoryViewTable({ categoryId: this.selectedCategory.id, categoryLevel: categoryLevel }).then((res) => {
  94. if (res) {
  95. this.arrySort = []
  96. this.tableDisplayFields = res
  97. const orderSortArry = this.tableDisplayFields.filter(item => item.queue).sort((a, b) => a.queue - b.queue)
  98. orderSortArry.forEach(item => {
  99. if (item.displayOrderBy) {
  100. this.arrySort.push(item.fieldName + ',' + item.displayOrderBy)
  101. }
  102. })
  103. this.$nextTick(() => {
  104. this.getViewTableList(categoryLevel, parentsId, type)
  105. })
  106. }
  107. })
  108. },
  109. getViewTableList(categoryLevel, parentsId, type) {
  110. console.log(this.smartQuery.fonds_no)
  111. const params = {
  112. 'parentId': parentsId,
  113. 'categoryId': this.selectedCategory.id,
  114. 'categoryLevel': categoryLevel,
  115. 'ignore': false,
  116. 'isdel': this.parentsData.isdel,
  117. 'checkTypes': this.selectStatus && this.selectStatus.length !== 0 ? this.selectStatus.join(',') : null,
  118. 'search': this.query.search,
  119. 'retention': this.smartQuery.retention,
  120. 'security_class': this.smartQuery.security_class,
  121. 'medium_type': this.smartQuery.medium_type,
  122. 'doc_type': this.smartQuery.doc_type,
  123. 'archive_year': this.smartQuery.archive_year,
  124. 'fonds_no': this.smartQuery.fonds_no,
  125. 'project_class': this.query.project_class,
  126. 'archive_ctg_no': this.query.archive_ctg_no,
  127. 'page': this.page.page - 1,
  128. 'size': this.page.size,
  129. 'sort': this.arrySort
  130. }
  131. FetchInitContorlView(params).then((res) => {
  132. console.log('resssss', res)
  133. if (res.code !== 500) {
  134. this.parentsData.listCategory = res.category
  135. if (categoryLevel === 1) {
  136. // 项目
  137. const projectObj = this.parentsData.$refs.projectEle
  138. this.projectData = res.list.content
  139. this.page.total = res.list.totalElements
  140. this.yearData = res.yearGroup
  141. if (this.yearData && type !== 'quickFilter') {
  142. this.$emit('myYearEvent', this.yearData)
  143. }
  144. if (type === 'search') {
  145. projectObj.projectData = res.list.content
  146. projectObj.page.total = res.list.totalElements
  147. projectObj.getTableDisplayFieldsLoading = false
  148. }
  149. } else if (categoryLevel === 2) {
  150. // 案卷
  151. const anjuanObj = this.parentsData.$refs.anjuanEle.$refs.ajContent.$refs.tableList
  152. this.anjuanData = res.list.content
  153. this.page.total = res.list.totalElements
  154. this.yearData = res.yearGroup
  155. if (this.yearData && type !== 'quickFilter') {
  156. this.$parent.$parent.$emit('myYearEvent', this.yearData)
  157. }
  158. // 搜索/新增/编辑 非 案卷是主页的时候
  159. if (type === 'search') {
  160. anjuanObj.anjuanData = res.list.content
  161. anjuanObj.page.total = res.list.totalElements
  162. anjuanObj.getTableDisplayFieldsLoading = false
  163. }
  164. } else if (categoryLevel === 3) {
  165. if (this.isTitleType === 3) {
  166. // 案卷下的未整理 / 文件为主页时
  167. const wjObj = this.parentsData.$refs.anjuanEle.$refs.ajContent.$refs.tableList
  168. this.anjuanData = res.list.content
  169. this.page.total = res.list.totalElements
  170. this.yearData = res.yearGroup
  171. if (this.yearData && type !== 'quickFilter') {
  172. this.$parent.$parent.$emit('myYearEvent', this.yearData)
  173. }
  174. if (type === 'search') {
  175. wjObj.anjuanData = res.list.content
  176. wjObj.page.total = res.list.totalElements
  177. wjObj.getTableDisplayFieldsLoading = false
  178. }
  179. } else {
  180. // 卷内
  181. this.junneiData = res.list.content
  182. this.page.total = res.list.totalElements
  183. if (type === 'search') {
  184. this.parentsData.$refs.juanneiEle.junneiData = res.list.content
  185. this.parentsData.$refs.juanneiEle.page.total = res.list.totalElements
  186. this.parentsData.$refs.juanneiEle.getTableDisplayFieldsLoading = false
  187. }
  188. }
  189. } else {
  190. // 原文
  191. this.fileData = res.list.content
  192. this.page.total = res.list.totalElements
  193. if (type === 'search') {
  194. this.parentsData.$refs.fileEle.fileData = res.list.content
  195. this.parentsData.$refs.fileEle.page.total = res.list.totalElements
  196. this.parentsData.$refs.fileEle.getTableDisplayFieldsLoading = false
  197. }
  198. }
  199. }
  200. this.getTableDisplayFieldsLoading = false
  201. this.crud.selections = []
  202. if (categoryLevel === 3) {
  203. // 按件
  204. if (this.isTitleType === 3) {
  205. const wjObj = this.parentsData.$refs.anjuanEle.$refs.ajContent.$refs.tableList
  206. wjObj.selections = []
  207. wjObj.$refs.table.clearSelection() // 清空选中
  208. wjObj.$refs.table.setCurrentRow(-1) // 清除高亮
  209. } else {
  210. const juanneiObj = this.parentsData.$refs.juanneiEle
  211. juanneiObj.selections = []
  212. juanneiObj.$refs.table.clearSelection()
  213. juanneiObj.$refs.table.setCurrentRow(-1)
  214. }
  215. } else if (categoryLevel === 2) {
  216. // 按卷
  217. const anjuanObj = this.parentsData.$refs.anjuanEle.$refs.ajContent.$refs.tableList
  218. anjuanObj.selections = []
  219. anjuanObj.$refs.table.clearSelection()
  220. anjuanObj.$refs.table.setCurrentRow(-1)
  221. } else if (categoryLevel === 1) {
  222. // 项目
  223. const projectObj = this.parentsData.$refs.projectEle
  224. projectObj.selections = []
  225. projectObj.$refs.table.clearSelection()
  226. projectObj.$refs.table.setCurrentRow(-1)
  227. } else {
  228. const fileObj = this.parentsData.$refs.fileEle
  229. fileObj.selections = []
  230. fileObj.$refs.table.clearSelection()
  231. fileObj.$refs.table.setCurrentRow(-1)
  232. }
  233. })
  234. },
  235. /* 重新渲染table组件 防止table-fixed 错位 配合watch-table数据 */
  236. doLayout() {
  237. this.$nextTick(() => {
  238. this.$refs.table.doLayout()
  239. })
  240. }
  241. }
  242. }