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

333 lines
11 KiB

3 years ago
10 months ago
10 months ago
10 months ago
2 months ago
2 months ago
10 months ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
10 months ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
2 years ago
10 months ago
10 months ago
10 hours ago
10 months ago
10 months ago
10 months ago
10 months ago
3 years ago
3 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. @row-dblclick="tableDoubleClick"
  19. @select="handleCurrentChange"
  20. @mousedown.native="onMouseDown"
  21. @mouseup.native="onMouseUp"
  22. >
  23. <el-table-column type="selection" :reserve-selection="true" width="55" align="center" />
  24. <el-table-column label="序号" width="55" align="center" show-overflow-tooltip>
  25. <template slot-scope="scope">
  26. <span>{{ page.page * page.size + scope.$index + 1 }}</span>
  27. </template>
  28. </el-table-column>
  29. <!-- <el-table-column type="index" label="序号" width="55" align="center" /> -->
  30. <el-table-column :label="selectedCategory.arrangeType === 1 || (selectedCategory.arrangeType !==1 && activeIndex===1) ? '原文':'卷内'" prop="child" width="55" align="center">
  31. <template slot-scope="scope">
  32. {{ scope.row.child === '' ? 0 : scope.row.child }}
  33. </template>
  34. </el-table-column>
  35. <el-table-column v-for="field in tableDisplayFields" :key="field.id" :label="field.fieldCnName" :align="field.displayformatType" :width="field.displayLength" show-overflow-tooltip>
  36. <template slot="header">
  37. <el-tooltip
  38. class="item"
  39. effect="dark"
  40. :content="field.fieldCnName"
  41. placement="top-start"
  42. >
  43. <span>{{ field.fieldCnName }}</span>
  44. </el-tooltip>
  45. </template>
  46. <template slot-scope="scope">
  47. {{ scope.row[field.fieldName] }}
  48. </template>
  49. </el-table-column>
  50. <!-- <el-table-column v-if="!isRecycle" label="装盒" width="88" align="center" :fixed="parentsData.fixedStatusBar ? false : 'right' ">
  51. <template slot-scope="scope">
  52. <span :class="['row-state', 'row-packing', scope.row.case_no ? 'state-active' : '' ]">{{ scope.row.case_no ? '已装': '未装' }}</span>
  53. </template>
  54. </el-table-column> -->
  55. <el-table-column v-if="!isRecycle && !(isTitleType === 3 && activeIndex === 1 && selectedCategory.arrangeType !== 1 )" label="审批锁定" width="88" align="center" :fixed="parentsData.fixedStatusBar ? false : 'right' ">
  56. <template slot-scope="scope">
  57. <span :class="['row-state', 'row-warehousing', scope.row.collect_formal===2 ? 'state-active' : '' ]">{{ scope.row.collect_formal===2 ? '归档': '空闲' }}</span>
  58. </template>
  59. </el-table-column>
  60. </el-table>
  61. <!--分页组件-->
  62. <el-pagination
  63. v-if="anjuanData.length !== 0"
  64. :current-page="currentPage"
  65. :total="page.total"
  66. :page-size="page.size"
  67. :pager-count="5"
  68. layout="total, prev, pager, next, sizes"
  69. @size-change="handleSizeChange"
  70. @current-change="handleCurrentPage"
  71. />
  72. </div>
  73. <!-- 档案详情 -->
  74. <ArchivesInfo ref="archivesInfo" :selected-category="selectedCategory" :arc-id="arcId" :is-title-type="isTitleType" :is-collect="true" />
  75. </div>
  76. </template>
  77. <script>
  78. import { header, form } from '@crud/crud'
  79. import { collectionLibraryCrud } from '../mixins/index'
  80. import ArchivesInfo from '../module/archivesInfo/index'
  81. import collectHeader from '../module/collectHeader'
  82. export default {
  83. name: 'Sorted',
  84. components: { ArchivesInfo, collectHeader },
  85. mixins: [
  86. header(),
  87. form({}),
  88. collectionLibraryCrud
  89. ],
  90. props: {
  91. isTitleType: {
  92. type: Number,
  93. default: 3
  94. },
  95. selectedCategory: {
  96. type: Object,
  97. default: function() {
  98. return {}
  99. }
  100. },
  101. activeIndex: {
  102. type: Number,
  103. default: 0
  104. },
  105. isRecycle: {
  106. type: Boolean,
  107. default: false
  108. },
  109. smartQuery: {
  110. type: Object,
  111. default: function() {
  112. return {}
  113. }
  114. },
  115. test: {
  116. type: String,
  117. default: ''
  118. }
  119. },
  120. inject: ['parentsData'],
  121. data() {
  122. return {
  123. categoryId: '',
  124. arcId: '',
  125. title: '',
  126. selections: [],
  127. yearData: [],
  128. parentId: null,
  129. currentPage: 1,
  130. mousedownTime: 0,
  131. mousedownX: 0,
  132. mousedownY: 0
  133. }
  134. },
  135. watch: {
  136. selectedCategory: function(newValue, oldValue) {
  137. this.selections = []
  138. this.$refs.table.clearSelection()
  139. if (newValue.arrangeType !== 1) {
  140. this.title = '案卷'
  141. } else {
  142. this.title = '文件'
  143. }
  144. },
  145. tableDisplayFields(val) {
  146. this.doLayout()
  147. },
  148. activeIndex(newValue) {
  149. if (newValue === 1) {
  150. this.title = '文件'
  151. this.getCommonData(3, null)
  152. } else {
  153. this.title = '案卷'
  154. if (this.selectedCategory.arrangeType === 3) {
  155. this.getCommonData(2, this.parentsData.parentsProjectId)
  156. } else {
  157. this.getCommonData(2, null)
  158. }
  159. }
  160. this.selections = []
  161. this.$refs.table.clearSelection()
  162. }
  163. },
  164. created() {
  165. },
  166. mounted() {
  167. },
  168. methods: {
  169. getCommonData(categoryLevel, parentId, type) {
  170. this.getViewTable(categoryLevel, parentId, type)
  171. },
  172. rowKey(row) {
  173. return row.id
  174. },
  175. sendYearDataToParent() {
  176. this.$parent.$parent.$emit('myYearEvent', this.yearData)
  177. },
  178. openJuannei(data, parentId, parentRow) {
  179. // this.$emit('openJuannei', '这是来自案卷的通知')
  180. if (this.selectedCategory.arrangeType === 3) {
  181. this.$parent.$parent.$parent.$emit('openJuannei', data, parentId, parentRow)
  182. } else {
  183. this.$parent.$parent.$emit('openJuannei', data, parentId, parentRow)
  184. }
  185. },
  186. // table选中加上选中状态
  187. tableRowClassName({ row, rowIndex }) {
  188. let color = ''
  189. this.selections.forEach(item => {
  190. if (item.id === row.id) {
  191. color = 'rowStyle'
  192. }
  193. })
  194. return color
  195. },
  196. // table - 全选
  197. selectAll(val) {
  198. this.selections = val
  199. },
  200. onMouseDown(event) {
  201. this.mousedownTime = Date.now()
  202. this.mousedownX = event.clientX
  203. this.mousedownY = event.clientY
  204. },
  205. onMouseUp() {
  206. // 可以在这里添加更多逻辑,比如清除临时数据等
  207. },
  208. // table - 双击查看详情
  209. tableDoubleClick(row) {
  210. if (this.timer) {
  211. clearTimeout(this.timer)
  212. }
  213. this.arcId = row.id
  214. this.$nextTick(() => {
  215. if (this.selectedCategory.arrangeType !== 1) {
  216. this.$refs.archivesInfo.isHasFile = false
  217. if (this.activeIndex === 1) {
  218. this.$refs.archivesInfo.detailTitle = '文件详情'
  219. this.$refs.archivesInfo.isHasFile = true
  220. this.$refs.archivesInfo.getDetial(3, row.id)
  221. } else {
  222. this.$refs.archivesInfo.detailTitle = '案卷详情'
  223. this.$refs.archivesInfo.getDetial(2, row.id)
  224. }
  225. } else {
  226. this.$refs.archivesInfo.isHasFile = true
  227. this.$refs.archivesInfo.detailTitle = '文件详情'
  228. this.$refs.archivesInfo.getDetial(3, row.id)
  229. }
  230. this.$refs.archivesInfo.isFourTest = true
  231. this.$refs.archivesInfo.archivesInfoVisible = true
  232. this.$refs.archivesInfo.archivesTabIndex = 0
  233. })
  234. },
  235. // table - 当前选中得row
  236. clickRowHandler(row) {
  237. // this.parentsData.smartQuery = {
  238. // 'retention': null,
  239. // 'security_class': null,
  240. // 'doc_type': null,
  241. // 'medium_type': null,
  242. // 'archive_year': null,
  243. // 'fonds_no': null
  244. // }
  245. if (this.timer) {
  246. clearTimeout(this.timer)
  247. }
  248. if (this.selectedCategory.arrangeType === 1) {
  249. if (this.activeIndex === 0) {
  250. this.title = '文件'
  251. }
  252. } else {
  253. if (this.activeIndex === 0) {
  254. this.title = '案卷'
  255. }
  256. }
  257. const clickTime = Date.now()
  258. const clickX = event.clientX
  259. const clickY = event.clientY
  260. const timeDiff = clickTime - this.mousedownTime
  261. const distance = Math.sqrt(
  262. Math.pow(clickX - this.mousedownX, 2) + Math.pow(clickY - this.mousedownY, 2)
  263. )
  264. // 时间差较短且鼠标移动距离较小,判定为点击操作
  265. if (timeDiff < 300 && distance < 10) {
  266. this.timer = setTimeout(() => {
  267. this.parentId = row.id
  268. localStorage.removeItem('currentPageSize')
  269. localStorage.removeItem('currentPage')
  270. this.openJuannei('所属' + this.title + ':' + row.archive_no, this.parentId, row)
  271. }, 300)
  272. }
  273. },
  274. // 触发单选
  275. handleCurrentChange(selection, row) {
  276. this.selections = selection
  277. },
  278. handleSizeChange(size) {
  279. this.currentPage = 1
  280. this.page.size = size
  281. this.page.page = 0
  282. localStorage.setItem('currentPageSize', size)
  283. if (this.activeIndex === 1) {
  284. this.getViewTable(3, null)
  285. } else {
  286. if (this.selectedCategory.arrangeType === 3) {
  287. this.getViewTable(2, this.parentsData.parentsProjectId)
  288. } else if (this.selectedCategory.arrangeType === 1) {
  289. this.getViewTable(3, null)
  290. } else {
  291. this.getViewTable(2, null)
  292. }
  293. }
  294. },
  295. handleCurrentPage(pageVal) {
  296. this.currentPage = pageVal
  297. this.page.page = pageVal - 1
  298. localStorage.setItem('currentPage', JSON.stringify(this.page.page))
  299. if (this.activeIndex === 1) {
  300. this.getViewTable(3, null)
  301. } else {
  302. if (this.selectedCategory.arrangeType === 3) {
  303. this.getViewTable(2, this.parentsData.parentsProjectId)
  304. } else if (this.selectedCategory.arrangeType === 1) {
  305. this.getViewTable(3, null)
  306. } else {
  307. this.getViewTable(2, null)
  308. }
  309. }
  310. }
  311. }
  312. }
  313. </script>
  314. <style lang='scss' scoped>
  315. @import "~@/assets/styles/collect-reorganizi.scss";
  316. @mixin management-fixed-style{
  317. [data-theme="dark"] & {
  318. background-color: #031435 !important;
  319. -webkit-box-shadow: -5px 5px 10px 1px rgba(15,164,222,.16);
  320. box-shadow: -5px 5px 10px 1px rgba(15,164,222,.16);
  321. }
  322. [data-theme="light"] & {
  323. background-color: #fff;
  324. }
  325. }
  326. .el-table {
  327. ::v-deep .el-table__fixed-right {
  328. @include management-fixed-style;
  329. }
  330. }
  331. </style>