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

159 lines
5.1 KiB

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