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

167 lines
6.0 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  1. <template>
  2. <div class="lendConfirm-box">
  3. <div class="head-container">
  4. <el-button size="mini" class="iconfont icon-jiechu-fanbai" :disabled="!selections.length" @click="handleLendBtn">借出</el-button>
  5. <el-button size="mini" class="iconfont icon-dengji-fanbai" :disabled="!selections.length" @click="handelReRecord">重新登记</el-button>
  6. <el-button size="mini" class="iconfont icon-yichu-fanbai" :disabled="!selections.length" @click="handleRemove">移出</el-button>
  7. <el-button size="mini" icon="el-icon-download" :disabled="!selections.length" :loading="crud.downloadLoading">导出</el-button>
  8. </div>
  9. <!--表格渲染-->
  10. <!-- height="calc(100vh - 355px)" -->
  11. <el-table
  12. ref="table"
  13. v-loading="crud.loading"
  14. :data="crud.data"
  15. :row-key="getRowKey"
  16. style="min-width: 100%"
  17. @select-all="selectAll"
  18. @selection-change="selectionChangeHandler"
  19. @row-click="clickRowHandler"
  20. @row-dblclick="handleDbClick"
  21. @select="handleCurrentChange"
  22. >
  23. <el-table-column type="selection" :reserve-selection="true" width="55" />
  24. <el-table-column type="index" label="序号" align="center" width="55" />
  25. <el-table-column prop="orderNo" align="center" label="单据号" min-width="100" />
  26. <el-table-column prop="borrowNum" align="center" label="数量" min-width="50" />
  27. <el-table-column prop="borrowerName" align="center" label="借阅人" min-width="60" />
  28. <el-table-column prop="department" align="center" label="所属部门" min-width="85" />
  29. <el-table-column prop="cardType" align="center" label="证件类型" min-width="85" />
  30. <el-table-column prop="idcard" align="center" label="证件号码" min-width="120" />
  31. <el-table-column prop="phone" align="center" label="电话号码" min-width="85" />
  32. <el-table-column prop="lendDates" align="center" label="借阅时间" min-width="150">
  33. <template slot-scope="scope">
  34. <div>{{ parseTime(scope.row.startTime, '{y}-{m}-{d}') + ' 至 ' + parseTime(scope.row.endTime, '{y}-{m}-{d}') }}</div>
  35. </template>
  36. </el-table-column>
  37. <el-table-column prop="purpose" align="center" label="借阅目的" min-width="70" />
  38. <el-table-column prop="borrowType" align="center" label="借阅状态" min-width="70">
  39. <template slot-scope="scope">
  40. <!-- 待借阅 -->
  41. <span class="cell-lend no-lend" style="width:76px">{{ scope.row.borrowType | borrowStatus }}</span>
  42. </template>
  43. </el-table-column>
  44. <el-table-column prop="createTime" align="center" label="操作时间" min-width="120">
  45. <template slot-scope="scope">
  46. <div>{{ scope.row.createTime | parseTime }}</div>
  47. </template>
  48. </el-table-column>
  49. </el-table>
  50. <!-- 分页 -->
  51. <pagination />
  52. <!--借出弹框-->
  53. <releaseAlarm ref="releaseAlarmDom" />
  54. <!-- 移出确认弹框 -->
  55. <delConfirm ref="delConfirmDom" :list-name="listName" :is-list-type="isListType" />
  56. <!-- 档案详情 -->
  57. <archiveDetail ref="archiveDetailDom" />
  58. </div>
  59. </template>
  60. <script>
  61. import { FetchReRegister } from '@/api/archivesManage/lendManage'
  62. import pagination from '@crud/Pagination'
  63. import CRUD, { presenter } from '@crud/crud'
  64. import { lendingCrud } from '../mixins/lending'
  65. import delConfirm from '../components/delConfirm'
  66. import archiveDetail from '../components/archiveDetail'
  67. import releaseAlarm from '../components/releaseAlarm'
  68. export default {
  69. name: 'LendConfirm',
  70. components: { pagination, archiveDetail, delConfirm, releaseAlarm },
  71. mixins: [presenter(), lendingCrud],
  72. cruds() {
  73. return CRUD({
  74. url: 'api/borrow/initWaitBorrowList',
  75. // crudMethod: caseCrudMethod,
  76. title: '借出确认',
  77. optShow: {
  78. add: false,
  79. edit: false,
  80. del: false,
  81. download: true,
  82. group: false
  83. }
  84. })
  85. },
  86. data() {
  87. return {
  88. selections: [],
  89. listName: '借出确认',
  90. isListType: 2, // 移出框类型判断 待借1 / 借阅2
  91. lendDates: null
  92. }
  93. },
  94. created() {
  95. this.getBorrowRule()
  96. },
  97. methods: {
  98. // table - 全选
  99. selectAll(val) {
  100. this.selections = val
  101. if (this.selections.length === 1) {
  102. this.$emit('getSelections', this.selections[0])
  103. } else {
  104. this.$emit('getSelections', null)
  105. }
  106. },
  107. // 触发单选
  108. handleCurrentChange(selection, row) {
  109. this.selections = selection
  110. if (selection.length === 1) {
  111. this.$emit('getSelections', selection[0])
  112. } else {
  113. this.$emit('getSelections', null)
  114. }
  115. },
  116. clickRowHandler(row) {
  117. this.$refs.table.clearSelection()
  118. this.$refs.table.toggleRowSelection(row)
  119. this.selections = []
  120. this.selections.push(row)
  121. this.$emit('getSelections', row)
  122. },
  123. // 重新登记返回上一级
  124. handelReRecord() {
  125. const params = this.selections.map(item => item.orderNo)
  126. FetchReRegister(params).then(data => {
  127. console.log(data)
  128. if (data) {
  129. this.$message({
  130. message: '重新登记成功',
  131. type: 'success'
  132. })
  133. this.$emit('callBack', { index: 0 })
  134. this.crud.refresh()
  135. }
  136. })
  137. },
  138. // 移出
  139. handleRemove() {
  140. if (this.selections.length > 0) {
  141. this.$refs.delConfirmDom.deleteVisible = true
  142. this.$refs.delConfirmDom.deltSelections = this.selections
  143. }
  144. },
  145. // 借出
  146. handleLendBtn() {
  147. if (this.selections.length > 0) {
  148. if (this.lineStateVal === 'offline') {
  149. // 离线
  150. this.$refs.releaseAlarmDom.lendSelections = this.selections
  151. this.$refs.releaseAlarmDom.getLendTid(0)
  152. } else {
  153. // 在线
  154. const params = this.selections.map(item => item.orderNo)
  155. this.confirmLendOrReturn(0, params, this.selections)
  156. }
  157. this.$emit('getSelections', null)
  158. }
  159. }
  160. }
  161. }
  162. </script>
  163. <style lang="scss" scoped>
  164. @import '~@/assets/styles/lend-manage.scss';
  165. </style>