【前端】智能库房综合管理系统前端项目
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.

132 lines
4.4 KiB

3 years ago
3 years ago
3 years ago
  1. <template>
  2. <div class="to-lend">
  3. <div class="head-container">
  4. <el-button size="mini" class="iconfont icon-dengji-fanbai" :disabled="!selections.length" @click="handleRecord">登记</el-button>
  5. <el-button size="mini" class="iconfont icon-yichu-fanbai" :disabled="!selections.length" @click="handleRemove">移出</el-button>
  6. </div>
  7. <!--表格渲染-->
  8. <el-table
  9. ref="table"
  10. v-loading="crud.loading"
  11. style="min-width: 100%"
  12. height="calc(100vh - 355px)"
  13. :data="crud.data"
  14. @selection-change="selectionChangeHandler"
  15. @row-click="clickRowHandler"
  16. @row-dblclick="handleLendDbClick"
  17. >
  18. <el-table-column type="selection" width="55" />
  19. <el-table-column type="index" label="序号" align="center" width="55" />
  20. <el-table-column prop="categoryName" label="门类名称" align="center" min-width="85" />
  21. <el-table-column prop="archiveNo" label="档号" align="center" min-width="120" />
  22. <el-table-column prop="maintitle" align="center" label="题名" min-width="120" />
  23. <el-table-column prop="caseName" align="center" label="盒名称" min-width="85" />
  24. <el-table-column prop="folderLocationDetails" align="center" label="存放位置" min-width="160">
  25. <template slot-scope="scope">
  26. <div v-if="scope.row.folderLocationDetails && scope.row.folderLocationDetails.includes(',')">
  27. <el-tag
  28. v-for="(item,index) in scope.row.folderLocationDetails.split(',')"
  29. :key="index"
  30. :type="item"
  31. effect="dark"
  32. >
  33. {{ item }}
  34. </el-tag>
  35. </div>
  36. <div v-else>
  37. <el-tag v-if="scope.row.folderLocationDetails" effect="dark">{{ scope.row.folderLocationDetails }}</el-tag>
  38. </div>
  39. </template>
  40. </el-table-column>
  41. <el-table-column prop="borrowType" align="center" label="借阅状态" min-width="60">
  42. <template slot-scope="scope">
  43. <span class="cell-lend no-lend" style="width:80px">{{ scope.row.borrowType | borrowStatus }}
  44. </span>
  45. </template>
  46. </el-table-column>
  47. <el-table-column prop="createTime" align="center" label="操作时间" min-width="120">
  48. <template slot-scope="scope">
  49. <div>{{ scope.row.createTime | parseTime }}</div>
  50. </template>
  51. </el-table-column>
  52. </el-table>
  53. <!-- 借阅登记模态框 -->
  54. <lend-record ref="lendRecordDom" />
  55. <!-- 移出确认弹框 -->
  56. <delConfirm ref="delConfirmDom" :list-name="listName" :is-list-type="isListType" />
  57. <!-- 档案详情 -->
  58. <archiveDetail ref="archiveDetailDom" />
  59. <!-- 分页 -->
  60. <pagination />
  61. </div>
  62. </template>
  63. <script>
  64. import CRUD, { presenter } from '@crud/crud'
  65. import { lendingCrud } from '../mixins/lending'
  66. import pagination from '@crud/Pagination'
  67. import lendRecord from './module/lendRecord.vue'
  68. import delConfirm from '../components/delConfirm.vue'
  69. import archiveDetail from './module/archiveDetail.vue'
  70. export default {
  71. name: 'ToLend',
  72. components: { pagination, delConfirm, archiveDetail, lendRecord },
  73. mixins: [presenter(), lendingCrud],
  74. cruds() {
  75. return CRUD({
  76. url: 'api/borrow/initWaitRegisterList',
  77. title: '待借档案',
  78. optShow: {
  79. add: false,
  80. edit: false,
  81. del: false,
  82. download: false,
  83. group: false
  84. }
  85. })
  86. },
  87. data() {
  88. return {
  89. selections: [],
  90. listName: '待借列表',
  91. isListType: 1 // 移出框类型判断 待借1 / 借阅2
  92. }
  93. },
  94. created() {
  95. },
  96. methods: {
  97. // 登记借出
  98. handleRecord() {
  99. this.$refs.lendRecordDom.recordFormVisible = true
  100. this.$refs.lendRecordDom.recordSelections = this.selections
  101. },
  102. // 移出
  103. handleRemove() {
  104. if (this.selections.length > 0) {
  105. this.$refs.delConfirmDom.deleteVisible = true
  106. this.$refs.delConfirmDom.deltSelections = this.selections
  107. }
  108. },
  109. // 档案详情
  110. handleLendDbClick(row) {
  111. // this.$refs.table.clearSelection()
  112. this.$nextTick(() => {
  113. this.$refs.archiveDetailDom.detailVisible = true
  114. this.$refs.archiveDetailDom.rowData = row
  115. })
  116. },
  117. clickRowHandler(row) {
  118. this.$refs.table.toggleRowSelection(row) // 单击选中
  119. }
  120. }
  121. }
  122. </script>
  123. <style lang="scss" scoped>
  124. @import '~@/assets/styles/lend-manage.scss';
  125. ::v-deep .el-range-separator{
  126. color: #fff;
  127. padding-top:2px ;
  128. }
  129. </style>