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

192 lines
6.1 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="width: 100%"
  45. height="calc(100vh - 355px)"
  46. :data="tableData"
  47. :cell-class-name="cell"
  48. @row-click="clickRowHandler"
  49. @row-dblclick="handleDbClick"
  50. >
  51. <el-table-column type="selection" width="55" />
  52. <el-table-column type="index" label="序号" align="center" width="55" />
  53. <el-table-column prop="lendStatus" align="center" label="借阅状态" width="100">
  54. <template slot-scope="scope">
  55. <!-- 已借 / 待借 -->
  56. <span class="cell-lend" style="width:76px">{{ scope.row.lendStatus }}</span>
  57. </template>
  58. </el-table-column>
  59. <el-table-column prop="docNum" align="center" label="单据号" width="160" />
  60. <el-table-column prop="fieldName" align="center" label="门类名称" width="150" />
  61. <el-table-column prop="archivesID" align="center" label="档号" width="200" />
  62. <el-table-column prop="titleName" align="center" label="题名" width="200" />
  63. <el-table-column prop="fieldName" align="center" label="盒名称" width="150" />
  64. <el-table-column prop="storagePath" align="center" label="存放位置" width="250" />
  65. <el-table-column prop="borrowerName" align="center" label="借阅人" width="90" />
  66. <el-table-column prop="borrowDays" align="center" label="借阅时间" width="180" />
  67. <el-table-column prop="borrowGoal" align="center" label="借阅目的" width="90" />
  68. <el-table-column align="center" prop="operationTime" label="归还时间" width="200" />
  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 data3 from '../data3.json'
  83. import archiveDetail from '../returnArchives/module/archiveDetail.vue'
  84. export default {
  85. name: 'LendQuery',
  86. components: { headSlot, pagination, rrOperation, crudOperation, archiveDetail },
  87. mixins: [presenter()],
  88. cruds() {
  89. return CRUD({
  90. url: 'api/case/initCaseList',
  91. // crudMethod: caseCrudMethod,
  92. title: '档案盒',
  93. optShow: {
  94. add: false,
  95. edit: false,
  96. del: false,
  97. download: true,
  98. group: false
  99. }
  100. })
  101. },
  102. data() {
  103. return {
  104. tableData: [],
  105. lendStateOptions: [
  106. { value: '选项1', label: '全部' },
  107. { value: '选项2', label: '待登记' },
  108. { value: '选项3', label: '待借阅' },
  109. { value: '选项4', label: '待归还' },
  110. { value: '选项5', label: '逾期' },
  111. { value: '选项6', label: '已归还' }
  112. ],
  113. lendState: '全部',
  114. keyWord: '',
  115. cateSearch: '借阅人',
  116. cateSearchOptions: [
  117. { value: '选项1', label: '借阅人' },
  118. { value: '选项2', label: '档号' },
  119. { value: '选项3', label: '题名' },
  120. { value: '选项4', label: '位置' },
  121. { value: '选项5', label: '档案盒' },
  122. { value: '选项6', label: '条形码' },
  123. { value: '选项7', label: 'TID' }
  124. ]
  125. }
  126. },
  127. mounted() {
  128. this.getData()
  129. },
  130. methods: {
  131. getData() {
  132. this.tableData = data3.rows
  133. },
  134. clickRowHandler(row) {
  135. this.$refs.table.toggleRowSelection(row)
  136. },
  137. cell({ row, columnIndex }) {
  138. if (row.lendStatus === '逾期' && columnIndex === 2) {
  139. return 'no-lend'
  140. } else if (row.lendStatus === '待归还' && columnIndex === 2) {
  141. return 'have-lend'
  142. }
  143. },
  144. // 档案详情
  145. handleDbClick(row) {
  146. this.$refs.table.clearSelection()
  147. const archiveDetailDom = this.$refs.archiveDetailDom
  148. // const arr = data3.rows.filter(item => item.docNum === row.docNum)
  149. archiveDetailDom.rowData = row
  150. console.log(row)
  151. // 借阅状态样式类名
  152. if (row.lendStatus === '待归还') {
  153. archiveDetailDom.classLend = 'have-lend'
  154. } else if (row.lendStatus === '逾期') {
  155. archiveDetailDom.classLend = 'no-lend'
  156. }
  157. archiveDetailDom.detailVisible = true
  158. }
  159. }
  160. }
  161. </script>
  162. <style rel="stylesheet/scss" lang="scss" scoped>
  163. @import '~@/assets/styles/lend-manage.scss';
  164. ::v-deep.input-prepend {
  165. margin: 0 10px 0 -10px;
  166. background-color: #021941;
  167. border-radius: 3px;
  168. // word-spacing: -10px;
  169. border: 1px solid #339cff;
  170. .el-select {
  171. background-color: #021941;
  172. color: #339CFF;
  173. }
  174. .el-input__inner {
  175. background-color: #021941;
  176. border: none;
  177. caret-color: #fff;
  178. color: #fff;
  179. height: 28px;
  180. line-height: 28px;
  181. }
  182. .el-input-group__prepend {
  183. border: none;
  184. }
  185. }
  186. ::v-deep .el-icon-arrow-up:before{
  187. color: #339CFF;
  188. }
  189. </style>