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

170 lines
5.7 KiB

  1. <template>
  2. <div class="lend-confirm">
  3. <headSlot>
  4. <el-button icon="el-icon-plus" size="mini" :disabled="selections.length ? false : true " @click="lendFormVisible = true">借出</el-button>
  5. <el-button icon="el-icon-edit" size="mini" @click="handelReRecord">重新登记</el-button>
  6. <el-button icon="el-icon-minus" size="mini" :disabled="selections.length ? false : true " @click="handleRemove">移出</el-button>
  7. <crudOperation style="margin-left:10px" />
  8. </headSlot>
  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: 'isOperationTime', 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="序号" width="55" />
  23. <el-table-column prop="isCategoryName" label="所属门类" min-width="85" />
  24. <el-table-column prop="isArchivesID" label="档号" min-width="125" />
  25. <el-table-column prop="isTitleName" label="题名" min-width="120" />
  26. <el-table-column prop="isFieldName" label="盒名称" min-width="85" />
  27. <el-table-column prop="isStoragePath" label="存放位置" min-width="130" />
  28. <el-table-column prop="borrowerName" label="借阅人" min-width="60" />
  29. <el-table-column prop="borrowDays" label="借阅时间" min-width="115" />
  30. <el-table-column prop="borrowGoal" label="借阅目的" min-width="60" />
  31. <el-table-column prop="isLendStatus" label="借阅状态" min-width="60">
  32. <template slot-scope="scope">
  33. <!-- 已借 / 待借 -->
  34. <span class="cell-lend">{{ scope.row.isLendStatus }}</span>
  35. </template>
  36. </el-table-column>
  37. <el-table-column sortable prop="isOperationTime" label="操作时间" min-width="85" />
  38. </el-table>
  39. <!--借出弹框-->
  40. <el-dialog ref="dialogTable" title="借出" :visible.sync="lendFormVisible">
  41. <span class="dialog-right-top" />
  42. <span class="dialog-left-bottom" />
  43. <el-table :data="selections" :cell-class-name="cellWarn">
  44. <el-table-column type="index" label="序号" width="55" />
  45. <el-table-column prop="isCategoryName" label="所属门类" />
  46. <el-table-column prop="isArchivesID" label="档号" min-width="140" />
  47. <el-table-column prop="isTitleName" label="题名" min-width="140" />
  48. <el-table-column prop="isWarnState" label="状态" min-width="85">
  49. <template slot-scope="scope">
  50. <!-- 已解除 / 未解除/解除失败 -->
  51. <span class="clear">{{ scope.row.isWarnState }}</span>
  52. </template>
  53. </el-table-column>
  54. </el-table>
  55. <div slot="footer" class="dialog-footer">
  56. <el-button disabled>解除警报</el-button>
  57. </div>
  58. </el-dialog>
  59. <!-- 移出确认弹框 -->
  60. <delConfirm ref="delConfirmDom" :list-name="listName" />
  61. <!-- 档案详情 -->
  62. <archiveDetail ref="archiveDetailDom" />
  63. <!-- 分页 -->
  64. <pagination />
  65. </div>
  66. </template>
  67. <script>
  68. import headSlot from '../components/headSlot.vue'
  69. import pagination from '@crud/Pagination'
  70. import CRUD, { presenter } from '@crud/crud'
  71. import crudOperation from '@crud/CRUD.operation'
  72. import delConfirm from '../components/delConfirm.vue'
  73. import archiveDetail from './module/archiveDetail.vue'
  74. import data1 from '../data1.json'
  75. export default {
  76. components: { headSlot, pagination, crudOperation, archiveDetail, delConfirm },
  77. mixins: [presenter()],
  78. cruds() {
  79. return CRUD({
  80. // title: '岗位',
  81. // url: 'api/job',
  82. // crudMethod: { ...crudJob },
  83. optShow: {
  84. add: false,
  85. edit: false,
  86. del: false,
  87. download: true,
  88. group: false
  89. }
  90. })
  91. },
  92. data() {
  93. return {
  94. tableData: [],
  95. selections: [],
  96. lendFormVisible: false,
  97. lendForm: {},
  98. listName: '借出确认'
  99. }
  100. },
  101. mounted() {
  102. this.getData()
  103. this.dialogTableStyle()
  104. },
  105. methods: {
  106. getData() {
  107. this.tableData = data1.rows
  108. },
  109. selectionChangeHandler(val) {
  110. this.selections = val
  111. console.log(val)
  112. },
  113. // 档案详情
  114. handleDbClick(row) {
  115. this.$refs.archiveDetailDom.detailVisible = true
  116. this.$refs.archiveDetailDom.rowData = row
  117. },
  118. clickRowHandler(row) {
  119. this.$refs.table.toggleRowSelection(row)
  120. },
  121. // 重新登记返回上一级
  122. handelReRecord() {
  123. console.log(11)
  124. this.$emit('callBack', { index: 0 })
  125. },
  126. // 移出
  127. handleRemove() {
  128. this.$refs.delConfirmDom.deleteVisible = true
  129. },
  130. dialogTableStyle() {
  131. const dialogTableDom = this.$refs.dialogTable
  132. const targetDialog = dialogTableDom.$refs.dialog
  133. targetDialog.style.width = '800px'
  134. },
  135. cell({ row, columnIndex }) {
  136. if (row.isLendStatus === '待借' && columnIndex === 10) {
  137. return 'no-lend'
  138. } else if (row.isLendStatus === '已借' && columnIndex === 10) {
  139. return 'have-lend'
  140. } else if (row.isLendStatus === '' && columnIndex === 10) {
  141. return 'other-lend'
  142. }
  143. },
  144. cellWarn({ row, columnIndex }) {
  145. if (row.isWarnState === '已解除' && columnIndex === 4) {
  146. return 'no-clear'
  147. } else if (row.isWarnState === '未解除' && columnIndex === 4) {
  148. return 'have-clear'
  149. } else if (row.isWarnState === '解除失败' && columnIndex === 4) {
  150. return 'fail-clear'
  151. }
  152. }
  153. }
  154. }
  155. </script>
  156. <style lang="scss" scoped>
  157. @import '~@/assets/styles/lend-manage.scss';
  158. ::v-deep .el-dialog__footer {
  159. background-color: #031435;
  160. }
  161. .el-dialog .dialog-footer {
  162. padding: 0;
  163. margin: 0;
  164. }
  165. </style>