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

144 lines
4.8 KiB

  1. <template>
  2. <div>
  3. <div class="head-container">
  4. <el-button size="mini" class="iconfont icon-jiechu-fanbai" :disabled="!selections.length" @click="handleLendBtn">借出</el-button>
  5. <el-button size="mini" class="iconfont icon-dengji-fanbai" :disabled="!selections.length" @click="handelReRecord">重新登记</el-button>
  6. <el-button size="mini" class="iconfont icon-yichu-fanbai" :disabled="!selections.length" @click="handleRemove">移出</el-button>
  7. <el-button :disabled="selections.length !== 1" :loading="crud.downloadLoading" size="mini" icon="el-icon-download">导出</el-button>
  8. </div>
  9. <!--表格渲染-->
  10. <el-table
  11. ref="table"
  12. :data="tableData"
  13. style="min-width: 100%"
  14. height="calc(100vh - 355px)"
  15. :cell-class-name="cell"
  16. :default-sort="{ prop: 'operationTime', order: 'descending' }"
  17. @selection-change="selectionChangeHandler"
  18. @row-click="clickRowHandler"
  19. @row-dblclick="handleDbClick"
  20. >
  21. <el-table-column type="selection" width="55" />
  22. <el-table-column type="index" label="序号" align="center" width="55" />
  23. <el-table-column prop="docNum" align="center" label="单据号" min-width="85" />
  24. <el-table-column prop="archiveNum" align="center" label="数量" min-width="50" />
  25. <el-table-column prop="borrowerName" align="center" label="借阅人" min-width="60" />
  26. <el-table-column prop="borrowerDepartment" align="center" label="所属部门" min-width="85" />
  27. <el-table-column prop="borrowerIdType" align="center" label="证件类型" min-width="85" />
  28. <el-table-column prop="borrowerIdNum" align="center" label="证件号码" min-width="120" />
  29. <el-table-column prop="borrowerTel" align="center" label="电话号码" min-width="85" />
  30. <el-table-column prop="borrowDays" align="center" label="借阅时间" min-width="150" />
  31. <el-table-column prop="borrowGoal" align="center" label="借阅目的" min-width="70" />
  32. <el-table-column prop="noLendStatus" align="center" label="借阅状态" min-width="70">
  33. <template slot-scope="scope">
  34. <!-- 待借阅 -->
  35. <span class="cell-lend" style="width:76px">{{ scope.row.noLendStatus }}</span>
  36. </template>
  37. </el-table-column>
  38. <el-table-column sortable prop="operationTime" align="center" label="操作时间" min-width="120" />
  39. </el-table>
  40. <!--借出弹框-->
  41. <lendDialog ref="lendDialogDom" />
  42. <!-- 移出确认弹框 -->
  43. <delConfirm ref="delConfirmDom" :list-name="listName" />
  44. <!-- 档案详情 -->
  45. <archiveDetail ref="archiveDetailDom" />
  46. <!-- 分页 -->
  47. <pagination />
  48. </div>
  49. </template>
  50. <script>
  51. import pagination from '@crud/Pagination'
  52. import CRUD, { presenter } from '@crud/crud'
  53. // import crudOperation from '@crud/CRUD.operation'
  54. import delConfirm from '../components/delConfirm.vue'
  55. import archiveDetail from './module/archiveDetail.vue'
  56. import lendDialog from './module/lendDialog.vue'
  57. import data1 from '../data1.json'
  58. export default {
  59. components: { pagination, archiveDetail, delConfirm, lendDialog },
  60. mixins: [presenter()],
  61. cruds() {
  62. return CRUD({
  63. url: 'api/case/initCaseList',
  64. // crudMethod: caseCrudMethod,
  65. title: '档案盒',
  66. optShow: {
  67. add: false,
  68. edit: false,
  69. del: false,
  70. download: true,
  71. group: false
  72. }
  73. })
  74. },
  75. data() {
  76. return {
  77. tableData: [],
  78. selections: [],
  79. lendForm: {},
  80. listName: '借出确认'
  81. }
  82. },
  83. created() {
  84. this.getData()
  85. },
  86. methods: {
  87. getData() {
  88. this.tableData = data1.rows
  89. },
  90. selectionChangeHandler(val) {
  91. this.selections = val
  92. },
  93. // 档案详情
  94. handleDbClick(row) {
  95. // this.$refs.table.clearSelection()
  96. const archiveDetailDom = this.$refs.archiveDetailDom
  97. archiveDetailDom.detailVisible = true
  98. const arr = data1.rows.filter(item => item.docNum === row.docNum)
  99. archiveDetailDom.rowData = row
  100. archiveDetailDom.tableData = arr
  101. console.log(arr)
  102. },
  103. clickRowHandler(row) {
  104. this.$refs.table.toggleRowSelection(row)
  105. },
  106. // 重新登记返回上一级
  107. handelReRecord() {
  108. console.log(11)
  109. this.$emit('callBack', { index: 0 })
  110. },
  111. // 移出
  112. handleRemove() {
  113. if (this.selections.length > 0) {
  114. this.$refs.delConfirmDom.deleteVisible = true
  115. }
  116. },
  117. cell({ row, columnIndex }) {
  118. if (columnIndex === 11) {
  119. return 'no-lend'
  120. }
  121. },
  122. handleLendBtn() {
  123. if (this.selections.length > 0) {
  124. this.$refs.lendDialogDom.table = this.selections
  125. this.$refs.lendDialogDom.lendFormVisible = true
  126. }
  127. }
  128. }
  129. }
  130. </script>
  131. <style lang="scss" scoped>
  132. @import '~@/assets/styles/lend-manage.scss';
  133. ::v-deep .el-dialog__footer {
  134. background-color: #031435;
  135. }
  136. .el-dialog .dialog-footer {
  137. padding: 0;
  138. margin: 0;
  139. }
  140. </style>