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

169 lines
5.5 KiB

  1. <template>
  2. <div class="lend-query">
  3. <div class="head-container">
  4. <!-- <el-button icon="el-icon-download" size="mini" class="margin-r" disabled
  5. >导出</el-button
  6. > -->
  7. <crudOperation />
  8. <el-select
  9. v-model="lendState"
  10. class="filter-item"
  11. style="width: 100px; height: 30px;margin-left:10px"
  12. >
  13. <el-option
  14. v-for="item in lendStateOptions"
  15. :key="item.value"
  16. :label="item.label"
  17. :value="item.value"
  18. />
  19. </el-select>
  20. <el-input
  21. v-model="keyWord"
  22. size="small"
  23. clearable
  24. placeholder="请输入关键词"
  25. style="width: 300px;margin:0 10px 0 -20px;padding-left:8px"
  26. class="input-prepend filter-item"
  27. @keyup.enter.native="crud.toQuery"
  28. >
  29. <el-select slot="prepend" v-model="cateSearch" style="width: 90px">
  30. <el-option
  31. v-for="item in cateSearchOptions"
  32. :key="item.value"
  33. :label="item.label"
  34. :value="item.value"
  35. />
  36. </el-select>
  37. </el-input>
  38. <rrOperation />
  39. </div>
  40. <!--表格渲染-->
  41. <el-table
  42. ref="table"
  43. style="width: 100%"
  44. height="calc(100vh - 356px)"
  45. :data="tableData"
  46. :cell-class-name="cell"
  47. @row-click="clickRowHandler"
  48. @row-dblclick="handleDbClick"
  49. >
  50. <el-table-column type="selection" width="55" />
  51. <el-table-column type="index" label="序号" align="center" width="55" />
  52. <el-table-column prop="lendStatus" align="center" label="借阅状态" width="100">
  53. <template slot-scope="scope">
  54. <!-- 已借 / 待借 -->
  55. <span class="cell-lend" style="width:76px">{{ scope.row.lendStatus }}</span>
  56. </template>
  57. </el-table-column>
  58. <el-table-column prop="docNum" align="center" label="单据号" width="160" />
  59. <el-table-column prop="fieldName" align="center" label="门类名称" width="150" />
  60. <el-table-column prop="archivesID" align="center" label="档号" width="200" />
  61. <el-table-column prop="titleName" align="center" label="题名" width="200" />
  62. <el-table-column prop="fieldName" align="center" label="盒名称" width="150" />
  63. <el-table-column prop="storagePath" align="center" label="存放位置" width="250" />
  64. <el-table-column prop="borrowerName" align="center" label="借阅人" width="90" />
  65. <el-table-column prop="borrowDays" align="center" label="借阅时间" width="180" />
  66. <el-table-column prop="borrowGoal" align="center" label="借阅目的" width="90" />
  67. <el-table-column align="center" prop="operationTime" label="归还时间" width="200" />
  68. </el-table>
  69. <!-- 档案详情 -->
  70. <archiveDetail ref="archiveDetailDom" />
  71. <!-- 分页 -->
  72. <pagination />
  73. </div>
  74. </template>
  75. <script>
  76. import CRUD, { presenter } from '@crud/crud'
  77. import pagination from '@crud/Pagination'
  78. import rrOperation from '@crud/RR.operation'
  79. import crudOperation from '@crud/CRUD.operation'
  80. import data3 from '../data3.json'
  81. import archiveDetail from '../returnArchives/module/archiveDetail.vue'
  82. export default {
  83. name: 'LendQuery',
  84. components: { pagination, rrOperation, crudOperation, archiveDetail },
  85. mixins: [presenter()],
  86. cruds() {
  87. return CRUD({
  88. url: 'api/case/initCaseList',
  89. // crudMethod: caseCrudMethod,
  90. title: '档案盒',
  91. optShow: {
  92. add: false,
  93. edit: false,
  94. del: false,
  95. download: true,
  96. group: false
  97. }
  98. })
  99. },
  100. data() {
  101. return {
  102. tableData: [],
  103. lendStateOptions: [
  104. { value: '选项1', label: '全部' },
  105. { value: '选项2', label: '待登记' },
  106. { value: '选项3', label: '待借阅' },
  107. { value: '选项4', label: '待归还' },
  108. { value: '选项5', label: '逾期' },
  109. { value: '选项6', label: '已归还' }
  110. ],
  111. lendState: '全部',
  112. keyWord: '',
  113. cateSearch: '借阅人',
  114. cateSearchOptions: [
  115. { value: '选项1', label: '借阅人' },
  116. { value: '选项2', label: '档号' },
  117. { value: '选项3', label: '题名' },
  118. { value: '选项4', label: '位置' },
  119. { value: '选项5', label: '档案盒' },
  120. { value: '选项6', label: '条形码' },
  121. { value: '选项7', label: 'TID' }
  122. ]
  123. }
  124. },
  125. mounted() {
  126. this.getData()
  127. },
  128. methods: {
  129. getData() {
  130. this.tableData = data3.rows
  131. },
  132. clickRowHandler(row) {
  133. this.$refs.table.toggleRowSelection(row)
  134. },
  135. cell({ row, columnIndex }) {
  136. if (row.lendStatus === '逾期' && columnIndex === 2) {
  137. return 'no-lend'
  138. } else if (row.lendStatus === '待归还' && columnIndex === 2) {
  139. return 'have-lend'
  140. }
  141. },
  142. // 档案详情
  143. handleDbClick(row) {
  144. // this.$refs.table.clearSelection()
  145. const archiveDetailDom = this.$refs.archiveDetailDom
  146. // const arr = data3.rows.filter(item => item.docNum === row.docNum)
  147. archiveDetailDom.rowData = row
  148. console.log(row)
  149. // 借阅状态样式类名
  150. if (row.lendStatus === '待归还') {
  151. archiveDetailDom.classLend = 'have-lend'
  152. } else if (row.lendStatus === '逾期') {
  153. archiveDetailDom.classLend = 'no-lend'
  154. }
  155. archiveDetailDom.detailVisible = true
  156. }
  157. }
  158. }
  159. </script>
  160. <style rel="stylesheet/scss" lang="scss" scoped>
  161. @import '~@/assets/styles/lend-manage.scss';
  162. @import "~@/assets/styles/archives-manage.scss";
  163. ::v-deep .el-icon-arrow-up:before{
  164. color: #339CFF;
  165. }
  166. </style>