Commit 65dba003060e7c5d533d39cef6b898415732e599
1 parent
1f3f7892
开发完成admin功能
Showing
2 changed files
with
8 additions
and
90 deletions
src/components/fee/SelectAdminCommunity.vue deleted
| 1 | -<template> | |
| 2 | - <el-card> | |
| 3 | - <div class="community-selector"> | |
| 4 | - <el-scrollbar style="height: 650px"> | |
| 5 | - <ul class="community-list"> | |
| 6 | - <li | |
| 7 | - v-for="(item, index) in communitys" | |
| 8 | - :key="index" | |
| 9 | - class="community-item" | |
| 10 | - :class="{ 'selected': communityId === item.communityId }" | |
| 11 | - @click="handleSelectCommunity(item)" | |
| 12 | - > | |
| 13 | - {{ item.name }} | |
| 14 | - </li> | |
| 15 | - </ul> | |
| 16 | - </el-scrollbar> | |
| 17 | - </div> | |
| 18 | - </el-card> | |
| 19 | -</template> | |
| 20 | - | |
| 21 | -<script> | |
| 22 | -import { listAdminCommunitys } from '@/api/fee/adminPayFeeDetailApi' | |
| 23 | - | |
| 24 | -export default { | |
| 25 | - name: 'SelectAdminCommunity', | |
| 26 | - data() { | |
| 27 | - return { | |
| 28 | - communitys: [ | |
| 29 | - { name: this.$t('adminPayFeeDetail.allCommunities'), communityId: '' } | |
| 30 | - ], | |
| 31 | - communityId: '' | |
| 32 | - } | |
| 33 | - }, | |
| 34 | - created() { | |
| 35 | - this.loadCommunities() | |
| 36 | - }, | |
| 37 | - methods: { | |
| 38 | - async loadCommunities() { | |
| 39 | - try { | |
| 40 | - const params = { | |
| 41 | - page: 1, | |
| 42 | - row: 100 | |
| 43 | - } | |
| 44 | - const { data } = await listAdminCommunitys(params) | |
| 45 | - this.communitys = [...this.communitys, ...data] | |
| 46 | - } catch (error) { | |
| 47 | - this.$message.error(this.$t('adminPayFeeDetail.fetchCommunityError')) | |
| 48 | - } | |
| 49 | - }, | |
| 50 | - handleSelectCommunity(community) { | |
| 51 | - this.communityId = community.communityId | |
| 52 | - this.$emit('changeCommunity', community) | |
| 53 | - } | |
| 54 | - } | |
| 55 | -} | |
| 56 | -</script> | |
| 57 | - | |
| 58 | -<style lang="scss" scoped> | |
| 59 | -.community-selector { | |
| 60 | - .community-list { | |
| 61 | - list-style: none; | |
| 62 | - padding: 0; | |
| 63 | - margin: 0; | |
| 64 | - | |
| 65 | - .community-item { | |
| 66 | - padding: 12px 15px; | |
| 67 | - cursor: pointer; | |
| 68 | - text-align: center; | |
| 69 | - border-bottom: 1px solid #ebeef5; | |
| 70 | - transition: all 0.3s; | |
| 71 | - | |
| 72 | - &:hover { | |
| 73 | - background-color: #f5f7fa; | |
| 74 | - } | |
| 75 | - | |
| 76 | - &.selected { | |
| 77 | - background-color: #409eff; | |
| 78 | - color: white; | |
| 79 | - } | |
| 80 | - } | |
| 81 | - } | |
| 82 | -} | |
| 83 | -</style> | |
| 84 | 0 | \ No newline at end of file |
src/views/fee/communityPaymentList.vue
| 1 | 1 | <template> |
| 2 | 2 | <div class="community-payment-container"> |
| 3 | 3 | <el-row :gutter="20"> |
| 4 | - <el-col :span="4" class="tree-container"> | |
| 5 | - <select-admin-community @change-community="handleCommunityChange" /> | |
| 4 | + <el-col :span="4" class=""> | |
| 5 | + <select-admin-community :community-id="searchForm.communityId" | |
| 6 | + @changeCommunity="handleChangeCommunity" /> | |
| 6 | 7 | </el-col> |
| 7 | 8 | <el-col :span="20"> |
| 8 | 9 | <el-card class="search-card"> |
| 9 | - <div slot="header"> | |
| 10 | + <div slot="header" class="flex justify-between"> | |
| 10 | 11 | <span>{{ $t('communityPayment.search') }}</span> |
| 11 | 12 | </div> |
| 12 | - <el-form :inline="true" :model="searchForm"> | |
| 13 | + <el-form :inline="true" :model="searchForm" class="text-left"> | |
| 13 | 14 | <el-form-item> |
| 14 | 15 | <el-input |
| 15 | 16 | v-model="searchForm.paymentName" |
| ... | ... | @@ -37,7 +38,7 @@ |
| 37 | 38 | </el-card> |
| 38 | 39 | |
| 39 | 40 | <el-card class="list-card"> |
| 40 | - <div slot="header"> | |
| 41 | + <div slot="header" class="flex justify-between"> | |
| 41 | 42 | <span>{{ $t('communityPayment.title') }}</span> |
| 42 | 43 | <el-button |
| 43 | 44 | v-if="searchForm.communityId" |
| ... | ... | @@ -97,7 +98,7 @@ |
| 97 | 98 | </template> |
| 98 | 99 | |
| 99 | 100 | <script> |
| 100 | -import SelectAdminCommunity from '@/components/fee/SelectAdminCommunity' | |
| 101 | +import SelectAdminCommunity from '@/components/community/selectAdminCommunity' | |
| 101 | 102 | import AddCommunityPayment from '@/components/fee/AddCommunityPayment' |
| 102 | 103 | import EditCommunityPayment from '@/components/fee/EditCommunityPayment' |
| 103 | 104 | import DeleteCommunityPayment from '@/components/fee/DeleteCommunityPayment' |
| ... | ... | @@ -145,7 +146,7 @@ export default { |
| 145 | 146 | this.$message.error(this.$t('communityPayment.fetchError')) |
| 146 | 147 | } |
| 147 | 148 | }, |
| 148 | - handleCommunityChange(community) { | |
| 149 | + handleChangeCommunity(community) { | |
| 149 | 150 | this.searchForm.communityId = community.communityId |
| 150 | 151 | this.fetchPayments() |
| 151 | 152 | }, | ... | ... |