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

183 lines
5.7 KiB

  1. <template>
  2. <div class="lend-query">
  3. <head-slot>
  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 v-model="query.name" clearable size="small" placeholder="输入岗位名称搜索" prefix-icon="el-icon-search" style="width: 200px;" class="filter-item" @keyup.enter.native="crud.toQuery" /> -->
  21. <el-input
  22. v-model="keyWord"
  23. size="small"
  24. clearable
  25. placeholder="请输入关键词"
  26. style="width: 300px"
  27. class="input-prepend"
  28. @keyup.enter.native="crud.toQuery"
  29. >
  30. <el-select slot="prepend" v-model="cateSearch" style="width: 100px">
  31. <el-option
  32. v-for="item in cateSearchOptions"
  33. :key="item.value"
  34. :label="item.label"
  35. :value="item.value"
  36. />
  37. </el-select>
  38. </el-input>
  39. <rrOperation />
  40. </head-slot>
  41. <!--表格渲染-->
  42. <el-table
  43. ref="table"
  44. style="min-width: 100%"
  45. height="calc(100vh - 355px)"
  46. :data="tableData"
  47. :cell-class-name="cell"
  48. @selection-change="selectionChangeHandler"
  49. @row-click="clickRowHandler"
  50. @row-dblclick="handleDbClick"
  51. >
  52. <el-table-column type="selection" width="55" />
  53. <el-table-column type="index" label="序号" width="55" />
  54. <el-table-column prop="isLendStatus" label="借阅状态" min-width="60">
  55. <template slot-scope="scope">
  56. <!-- 已借 / 待借 -->
  57. <span class="cell-lend">{{ scope.row.isLendStatus }}</span>
  58. </template>
  59. </el-table-column>
  60. <el-table-column prop="isFieldName" label="所属门类" min-width="85" />
  61. <el-table-column prop="isArchivesID" label="档号" min-width="130" />
  62. <el-table-column prop="isTitleName" label="题名" min-width="130" />
  63. <el-table-column prop="isFieldName" label="盒名称" min-width="85" />
  64. <el-table-column prop="isStoragePath" label="存放位置" min-width="130" />
  65. <el-table-column prop="borrowerName" label="借阅人" min-width="60" />
  66. <el-table-column prop="borrowDays" label="借阅时间" min-width="130" />
  67. <el-table-column prop="borrowGoal" label="借阅目的" min-width="85" />
  68. <el-table-column v-if="false" sortable prop="isOperationTime" label="操作时间" min-width="85" />
  69. </el-table>
  70. <!-- 档案详情 -->
  71. <archiveDetail ref="archiveDetailDom" />
  72. <!-- 分页 -->
  73. <pagination />
  74. </div>
  75. </template>
  76. <script>
  77. import headSlot from '../components/headSlot.vue'
  78. import CRUD, { presenter } from '@crud/crud'
  79. import pagination from '@crud/Pagination'
  80. import rrOperation from '@crud/RR.operation'
  81. import crudOperation from '@crud/CRUD.operation'
  82. import data1 from '../data1.json'
  83. import archiveDetail from './module/archiveDetail.vue'
  84. export default {
  85. components: { headSlot, pagination, rrOperation, crudOperation, archiveDetail },
  86. mixins: [presenter()],
  87. cruds() {
  88. return CRUD({
  89. // title: '岗位',
  90. // url: 'api/job',
  91. // crudMethod: { ...crudJob },
  92. optShow: {
  93. add: false,
  94. edit: false,
  95. del: false,
  96. download: true,
  97. group: false
  98. }
  99. })
  100. },
  101. data() {
  102. return {
  103. tableData: [],
  104. lendStateOptions: [
  105. { value: '选项1', label: '全部' },
  106. { value: '选项2', label: '待登记' },
  107. { value: '选项3', label: '待借阅' },
  108. { value: '选项4', label: '待归还' },
  109. { value: '选项5', label: '逾期' },
  110. { value: '选项6', label: '已归还' }
  111. ],
  112. lendState: '全部',
  113. keyWord: '',
  114. cateSearch: '借阅人',
  115. cateSearchOptions: [
  116. { value: '选项1', label: '借阅人' },
  117. { value: '选项2', label: '档号' },
  118. { value: '选项3', label: '题名' },
  119. { value: '选项4', label: '位置' },
  120. { value: '选项5', label: '档案盒' },
  121. { value: '选项6', label: '条形码' },
  122. { value: '选项7', label: 'TID' }
  123. ]
  124. }
  125. },
  126. mounted() {
  127. this.getData()
  128. },
  129. methods: {
  130. getData() {
  131. this.tableData = data1.rows
  132. },
  133. selectionChangeHandler() {
  134. console.log('selectionChangeHandler')
  135. },
  136. clickRowHandler(row) {
  137. this.$refs.table.toggleRowSelection(row)
  138. },
  139. cell({ row, columnIndex }) {
  140. if (row.isLendStatus === '待借' && columnIndex === 2) {
  141. return 'no-lend'
  142. } else if (row.isLendStatus === '已借' && columnIndex === 2) {
  143. return 'have-lend'
  144. } else if (row.isLendStatus === '' && columnIndex === 2) {
  145. return 'other-lend'
  146. }
  147. },
  148. // 档案详情
  149. handleDbClick(row) {
  150. this.$refs.archiveDetailDom.detailVisible = true
  151. const arr = data1.rows.filter(item => item.isDocNum === row.isDocNum)
  152. this.$refs.archiveDetailDom.rowData = arr
  153. }
  154. }
  155. }
  156. </script>
  157. <style rel="stylesheet/scss" lang="scss" scoped>
  158. @import '~@/assets/styles/lend-manage.scss';
  159. ::v-deep.input-prepend {
  160. margin: 0 10px 0 -10px;
  161. background-color: #021941;
  162. border-radius: 3px;
  163. // word-spacing: -10px;
  164. border: 1px solid #339cff;
  165. .el-select {
  166. background-color: #021941;
  167. color: #fff;
  168. }
  169. .el-input__inner {
  170. background-color: #021941;
  171. border: none;
  172. caret-color: #fff;
  173. height: 28px;
  174. line-height: 28px;
  175. }
  176. .el-input-group__prepend {
  177. border: none;
  178. }
  179. }
  180. </style>