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

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