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

281 lines
9.9 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
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. <template>
  2. <div>
  3. <CollectHeader ref="collectHeaderRef" :is-title-type="isTitleType" :selected-category="selectedCategory" :arc-id="arcId" :selections="selections" :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 ) ? '原文':'卷内'" prop="child" width="55" align="center">
  23. <template slot-scope="scope">
  24. {{ scope.row.child === '' ? 0 : scope.row.child }}
  25. </template>
  26. </el-table-column>
  27. <el-table-column v-for="field in tableDisplayFields" :key="field.id" :label="field.fieldCnName" :align="field.displayformatType" :width="field.displayLength" show-overflow-tooltip>
  28. <template slot="header">
  29. <el-tooltip
  30. class="item"
  31. effect="dark"
  32. :content="field.fieldCnName"
  33. placement="top-start"
  34. >
  35. <span>{{ field.fieldCnName }}</span>
  36. </el-tooltip>
  37. </template>
  38. <template slot-scope="scope">
  39. {{ scope.row[field.fieldName] }}
  40. </template>
  41. </el-table-column>
  42. <el-table-column v-if="!isRecycle && selectedCategory.arrangeType === 1" label="实体" width="88" align="center" :fixed="parentsData.fixedStatusBar ? false : 'right' ">
  43. <!-- slot-scope="scope" -->
  44. <template>
  45. <span class="row-state row-physical state-active"></span>
  46. <!-- <span :class="['row-state', 'row-physical', scope.row.tid ? 'state-active' : '' ]">{{ scope.row.tid ? '有': '无' }}</span> -->
  47. </template>
  48. </el-table-column>
  49. <el-table-column v-if="!isRecycle && selectedCategory.arrangeType === 1" label="标签" width="88" align="center" :fixed="parentsData.fixedStatusBar ? false : 'right' ">
  50. <template>
  51. <span class="row-state row-binding state-active">未绑</span>
  52. <!-- 未绑 / 已绑 -->
  53. <!-- <span :class="['row-state', 'row-binding', scope.row.tid ? 'state-active' : '' ]">{{ scope.row.tid ? '已绑': '未绑' }}</span> -->
  54. </template>
  55. </el-table-column>
  56. <el-table-column v-if="!isRecycle" label="装盒" width="88" align="center" :fixed="parentsData.fixedStatusBar ? false : 'right' ">
  57. <!-- state-active 已装/已入/已借/已绑 -->
  58. <template>
  59. <!-- 未装 / 已装 -->
  60. <span class="row-state row-packing state-active">已装</span>
  61. <!-- <span :class="['row-state', 'row-packing', scope.row.case_no ? 'state-active' : '' ]">{{ scope.row.case_no ? '已装': '未装' }}</span> -->
  62. </template>
  63. </el-table-column>
  64. <el-table-column v-if="!isRecycle" label="入库" width="88" align="center" :fixed="parentsData.fixedStatusBar ? false : 'right' ">
  65. <template>
  66. <span class="row-state row-warehousing state-active">已入</span>
  67. <!-- is_storage 为空的情况下即没装盒 / 0 未入 / 1 待入 / 2 已入 / 3 待出-->
  68. <!-- <span :class="['row-state', 'row-warehousing', (storageTxt[scope.$index] === '已入' )? 'state-active' : '' ]">{{ storageTxt[scope.$index] }}</span> -->
  69. </template>
  70. </el-table-column>
  71. <el-table-column v-if="!isRecycle && selectedCategory.arrangeType === 1" label="借阅" width="88" align="center" :fixed="parentsData.fixedStatusBar ? false : 'right' ">
  72. <template>
  73. <span class="row-state row-lending state-active">已借</span>
  74. <!-- is_borrow 4 已归还 / 为空 - 未加入待借列表 - 在库 / 2 待借阅在待借列表/借出确认列表 - 待借 / 1待登记 - 不可借- 表示 / 3 待归还 - 已借 -->
  75. <!-- <span :class="['row-state', 'row-lending', (borrowTxt[scope.$index] === '已借' )? 'state-active' : '' ]">{{ borrowTxt[scope.$index] }}</span> -->
  76. </template>
  77. </el-table-column>
  78. </el-table>
  79. <!--分页组件-->
  80. <el-pagination
  81. v-if="anjuanData.length !== 0"
  82. :current-page="page.page"
  83. :total="page.total"
  84. :page-size="page.size"
  85. :pager-count="5"
  86. layout="total, prev, pager, next, sizes"
  87. @size-change="handleSizeChange"
  88. @current-change="handleCurrentPage"
  89. />
  90. </div>
  91. <!-- 档案详情 -->
  92. <ArchivesInfo ref="archivesInfo" :selected-category="selectedCategory" :arc-id="arcId" />
  93. </div>
  94. </template>
  95. <script>
  96. import { header, form } from '@crud/crud'
  97. import { manageLibraryCrud } from '../mixins/index'
  98. import ArchivesInfo from '../module/archivesInfo/index'
  99. import CollectHeader from '../module/collectHeader'
  100. export default {
  101. name: 'Sorted',
  102. components: { ArchivesInfo, CollectHeader },
  103. mixins: [
  104. header(),
  105. form({}),
  106. manageLibraryCrud
  107. ],
  108. props: {
  109. isTitleType: {
  110. type: Number,
  111. default: 3
  112. },
  113. selectedCategory: {
  114. type: Object,
  115. default: function() {
  116. return {}
  117. }
  118. },
  119. test: {
  120. type: String,
  121. default: ''
  122. },
  123. isRecycle: {
  124. type: Boolean,
  125. default: false
  126. },
  127. smartQuery: {
  128. type: Object,
  129. default: function() {
  130. return {}
  131. }
  132. }
  133. },
  134. inject: ['parentsData'],
  135. data() {
  136. return {
  137. categoryId: '',
  138. arcId: '',
  139. title: '',
  140. selections: [],
  141. yearData: [],
  142. parentId: null
  143. }
  144. },
  145. watch: {
  146. selectedCategory: function(newValue, oldValue) {
  147. this.selections = []
  148. this.$refs.table.clearSelection()
  149. if (newValue.arrangeType !== 1) {
  150. this.title = '案卷'
  151. } else {
  152. this.title = '文件'
  153. }
  154. },
  155. tableDisplayFields(val) {
  156. this.doLayout()
  157. }
  158. },
  159. created() {
  160. },
  161. mounted() {
  162. },
  163. methods: {
  164. getCommonData(categoryLevel, parentId, type) {
  165. this.getViewTable(categoryLevel, parentId, type)
  166. },
  167. rowKey(row) {
  168. return row.id
  169. },
  170. sendYearDataToParent() {
  171. this.$parent.$parent.$emit('myYearEvent', this.yearData)
  172. },
  173. openJuannei(data, parentId) {
  174. // this.$emit('openJuannei', '这是来自案卷的通知')
  175. if (this.selectedCategory.arrangeType === 3) {
  176. this.$parent.$parent.$parent.$emit('openJuannei', data, parentId)
  177. } else {
  178. this.$parent.$parent.$emit('openJuannei', data, parentId)
  179. }
  180. },
  181. // table选中加上选中状态
  182. tableRowClassName({ row, rowIndex }) {
  183. let color = ''
  184. this.selections.forEach(item => {
  185. if (item.id === row.id) {
  186. color = 'rowStyle'
  187. }
  188. })
  189. return color
  190. },
  191. // table - 全选
  192. selectAll(val) {
  193. this.selections = val
  194. },
  195. // table - 双击查看详情
  196. tableDoubleClick(row) {
  197. if (this.timer) {
  198. clearTimeout(this.timer)
  199. }
  200. this.arcId = row.id
  201. this.$nextTick(() => {
  202. if (this.selectedCategory.arrangeType !== 1) {
  203. this.$refs.archivesInfo.isHasFile = false
  204. this.$refs.archivesInfo.detailTitle = '案卷详情'
  205. this.$refs.archivesInfo.getDetial(2, row.id)
  206. } else {
  207. this.$refs.archivesInfo.isHasFile = true
  208. this.$refs.archivesInfo.detailTitle = '文件详情'
  209. this.$refs.archivesInfo.getDetial(3, row.id)
  210. }
  211. this.$refs.archivesInfo.archivesInfoVisible = true
  212. this.$refs.archivesInfo.archivesTabIndex = 0
  213. })
  214. },
  215. // table - 当前选中得row
  216. clickRowHandler(row) {
  217. this.parentsData.smartQuery = {
  218. 'retention': null,
  219. 'security_class': null,
  220. 'doc_type': null,
  221. 'medium_type': null,
  222. 'archive_year': null,
  223. 'fonds_no': null
  224. }
  225. if (this.timer) {
  226. clearTimeout(this.timer)
  227. }
  228. if (this.selectedCategory.arrangeType === 1) {
  229. this.title = '文件'
  230. } else {
  231. this.title = '案卷'
  232. }
  233. this.timer = setTimeout(() => {
  234. this.parentId = row.id
  235. this.openJuannei('所属' + this.title + ':' + row.archive_no, this.parentId)
  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.selectedCategory.arrangeType === 3) {
  247. this.getViewTable(2, this.parentsData.parentsProjectId)
  248. } else {
  249. this.getViewTable(2, null)
  250. }
  251. },
  252. handleCurrentPage(val) {
  253. this.page.page = val
  254. if (this.selectedCategory.arrangeType === 3) {
  255. this.getViewTable(2, this.parentsData.parentsProjectId)
  256. } else {
  257. this.getViewTable(2, null)
  258. }
  259. }
  260. }
  261. }
  262. </script>
  263. <style lang='scss' scoped>
  264. @mixin management-fixed-style{
  265. [data-theme="dark"] & {
  266. background-color: #031435 !important;
  267. -webkit-box-shadow: -5px 5px 10px 1px rgba(15,164,222,.16);
  268. box-shadow: -5px 5px 10px 1px rgba(15,164,222,.16);
  269. }
  270. [data-theme="light"] & {
  271. background-color: #fff;
  272. }
  273. }
  274. .el-table {
  275. ::v-deep .el-table__fixed-right {
  276. @include management-fixed-style;
  277. }
  278. }
  279. </style>