Commit e9417fb07f8ecd2199fdc1642a73a81440922a0f
1 parent
0e772b97
v1.9 停车位页面无法选择停车bug
Showing
3 changed files
with
29 additions
and
57 deletions
src/components/car/batchAddParkingSpace.vue
| @@ -28,8 +28,8 @@ | @@ -28,8 +28,8 @@ | ||
| 28 | :rules="[{ required: true, message: $t('batchAddParkingSpace.parkingSpaceTypePlaceholder'), trigger: 'change' }]"> | 28 | :rules="[{ required: true, message: $t('batchAddParkingSpace.parkingSpaceTypePlaceholder'), trigger: 'change' }]"> |
| 29 | <el-select v-model="form.parkingType" :placeholder="$t('batchAddParkingSpace.parkingSpaceTypePlaceholder')" | 29 | <el-select v-model="form.parkingType" :placeholder="$t('batchAddParkingSpace.parkingSpaceTypePlaceholder')" |
| 30 | style="width:100%"> | 30 | style="width:100%"> |
| 31 | - <template slot="prepend" v-for="item in parkingTypes" > | ||
| 32 | - <el-option :label="item.name" :key="item.statusCd" :value="item.statusCd" v-if="item.statusCd !== '2'"></el-option> | 31 | + <template v-for="(item,index) in parkingTypes" > |
| 32 | + <el-option :label="item.name" :key="index" :value="item.statusCd" v-if="item.statusCd != '2'"></el-option> | ||
| 33 | </template> | 33 | </template> |
| 34 | </el-select> | 34 | </el-select> |
| 35 | </el-form-item> | 35 | </el-form-item> |
| @@ -80,6 +80,7 @@ export default { | @@ -80,6 +80,7 @@ export default { | ||
| 80 | try { | 80 | try { |
| 81 | const data = await getDict('parking_space', 'parking_type') | 81 | const data = await getDict('parking_space', 'parking_type') |
| 82 | this.parkingTypes = data | 82 | this.parkingTypes = data |
| 83 | + | ||
| 83 | } catch (error) { | 84 | } catch (error) { |
| 84 | this.$message.error(this.$t('common.loadDictError')) | 85 | this.$message.error(this.$t('common.loadDictError')) |
| 85 | } | 86 | } |
src/components/car/chooseParkingArea.vue
| 1 | <template> | 1 | <template> |
| 2 | - <el-dialog | ||
| 3 | - :title="$t('chooseParkingArea.title')" | ||
| 4 | - :visible.sync="visible" | ||
| 5 | - width="70%" | ||
| 6 | - > | ||
| 7 | - <el-card> | 2 | + <el-dialog :title="$t('chooseParkingArea.title')" :visible.sync="visible" width="70%"> |
| 3 | + | ||
| 8 | <div slot="header"> | 4 | <div slot="header"> |
| 9 | <el-row :gutter="20"> | 5 | <el-row :gutter="20"> |
| 10 | <el-col :span="18"></el-col> | 6 | <el-col :span="18"></el-col> |
| 11 | <el-col :span="6"> | 7 | <el-col :span="6"> |
| 12 | - <el-input-group> | ||
| 13 | - <el-input | ||
| 14 | - v-model="searchForm.num" | ||
| 15 | - :placeholder="$t('chooseParkingArea.parkingLotNumPlaceholder')" | ||
| 16 | - ></el-input> | ||
| 17 | - <el-button | ||
| 18 | - slot="append" | ||
| 19 | - type="primary" | ||
| 20 | - @click="queryParkingAreas" | ||
| 21 | - > | 8 | + <el-input v-model="searchForm.num" |
| 9 | + :placeholder="$t('chooseParkingArea.parkingLotNumPlaceholder')"></el-input> | ||
| 10 | + <el-button slot="append" type="primary" @click="queryParkingAreas"> | ||
| 22 | {{ $t('chooseParkingArea.query') }} | 11 | {{ $t('chooseParkingArea.query') }} |
| 23 | </el-button> | 12 | </el-button> |
| 24 | - <el-button | ||
| 25 | - type="primary" | ||
| 26 | - @click="resetParkingAreas" | ||
| 27 | - > | 13 | + <el-button type="primary" @click="resetParkingAreas"> |
| 28 | {{ $t('chooseParkingArea.reset') }} | 14 | {{ $t('chooseParkingArea.reset') }} |
| 29 | </el-button> | 15 | </el-button> |
| 30 | - </el-input-group> | ||
| 31 | </el-col> | 16 | </el-col> |
| 32 | </el-row> | 17 | </el-row> |
| 33 | </div> | 18 | </div> |
| 34 | - | 19 | + |
| 35 | <el-table :data="parkingAreas" border> | 20 | <el-table :data="parkingAreas" border> |
| 36 | <el-table-column prop="paId" :label="$t('chooseParkingArea.parkingLotId')" align="center"></el-table-column> | 21 | <el-table-column prop="paId" :label="$t('chooseParkingArea.parkingLotId')" align="center"></el-table-column> |
| 37 | <el-table-column prop="num" :label="$t('chooseParkingArea.parkingLotNum')" align="center"></el-table-column> | 22 | <el-table-column prop="num" :label="$t('chooseParkingArea.parkingLotNum')" align="center"></el-table-column> |
| 38 | <el-table-column prop="typeCd" :label="$t('chooseParkingArea.parkingLotType')" align="center"></el-table-column> | 23 | <el-table-column prop="typeCd" :label="$t('chooseParkingArea.parkingLotType')" align="center"></el-table-column> |
| 39 | <el-table-column :label="$t('chooseParkingArea.operation')" align="center" width="120"> | 24 | <el-table-column :label="$t('chooseParkingArea.operation')" align="center" width="120"> |
| 40 | <template slot-scope="scope"> | 25 | <template slot-scope="scope"> |
| 41 | - <el-button | ||
| 42 | - type="primary" | ||
| 43 | - size="mini" | ||
| 44 | - @click="selectParkingArea(scope.row)" | ||
| 45 | - > | 26 | + <el-button type="primary" size="mini" @click="selectParkingArea(scope.row)"> |
| 46 | {{ $t('chooseParkingArea.select') }} | 27 | {{ $t('chooseParkingArea.select') }} |
| 47 | </el-button> | 28 | </el-button> |
| 48 | </template> | 29 | </template> |
| 49 | </el-table-column> | 30 | </el-table-column> |
| 50 | </el-table> | 31 | </el-table> |
| 51 | - | ||
| 52 | - <el-pagination | ||
| 53 | - @size-change="handleSizeChange" | ||
| 54 | - @current-change="handlePageChange" | ||
| 55 | - :current-page="pagination.current" | ||
| 56 | - :page-sizes="[10, 20, 30, 50]" | ||
| 57 | - :page-size="pagination.size" | ||
| 58 | - layout="total, sizes, prev, pager, next, jumper" | ||
| 59 | - :total="pagination.total" | ||
| 60 | - style="margin-top:20px;text-align:right" | ||
| 61 | - ></el-pagination> | ||
| 62 | - </el-card> | 32 | + |
| 33 | + <el-pagination @size-change="handleSizeChange" @current-change="handlePageChange" | ||
| 34 | + :current-page="pagination.current" :page-sizes="[10, 20, 30, 50]" :page-size="pagination.size" | ||
| 35 | + layout="total, sizes, prev, pager, next, jumper" :total="pagination.total" | ||
| 36 | + style="margin-top:20px;text-align:right"></el-pagination> | ||
| 37 | + | ||
| 63 | </el-dialog> | 38 | </el-dialog> |
| 64 | </template> | 39 | </template> |
| 65 | 40 | ||
| @@ -88,7 +63,7 @@ export default { | @@ -88,7 +63,7 @@ export default { | ||
| 88 | this.visible = true | 63 | this.visible = true |
| 89 | this.loadParkingAreas() | 64 | this.loadParkingAreas() |
| 90 | }, | 65 | }, |
| 91 | - | 66 | + |
| 92 | async loadParkingAreas() { | 67 | async loadParkingAreas() { |
| 93 | try { | 68 | try { |
| 94 | const params = { | 69 | const params = { |
| @@ -97,35 +72,35 @@ export default { | @@ -97,35 +72,35 @@ export default { | ||
| 97 | communityId: getCommunityId(), | 72 | communityId: getCommunityId(), |
| 98 | num: this.searchForm.num | 73 | num: this.searchForm.num |
| 99 | } | 74 | } |
| 100 | - | 75 | + |
| 101 | const res = await listParkingAreas(params) | 76 | const res = await listParkingAreas(params) |
| 102 | - this.parkingAreas = res.data.parkingAreas | ||
| 103 | - this.pagination.total = res.data.total | 77 | + this.parkingAreas = res.parkingAreas |
| 78 | + this.pagination.total = res.total | ||
| 104 | } catch (error) { | 79 | } catch (error) { |
| 105 | this.$message.error(this.$t('common.loadError')) | 80 | this.$message.error(this.$t('common.loadError')) |
| 106 | } | 81 | } |
| 107 | }, | 82 | }, |
| 108 | - | 83 | + |
| 109 | selectParkingArea(row) { | 84 | selectParkingArea(row) { |
| 110 | this.$emit('choose', row) | 85 | this.$emit('choose', row) |
| 111 | this.visible = false | 86 | this.visible = false |
| 112 | }, | 87 | }, |
| 113 | - | 88 | + |
| 114 | queryParkingAreas() { | 89 | queryParkingAreas() { |
| 115 | this.pagination.current = 1 | 90 | this.pagination.current = 1 |
| 116 | this.loadParkingAreas() | 91 | this.loadParkingAreas() |
| 117 | }, | 92 | }, |
| 118 | - | 93 | + |
| 119 | resetParkingAreas() { | 94 | resetParkingAreas() { |
| 120 | this.searchForm.num = '' | 95 | this.searchForm.num = '' |
| 121 | this.queryParkingAreas() | 96 | this.queryParkingAreas() |
| 122 | }, | 97 | }, |
| 123 | - | 98 | + |
| 124 | handlePageChange(page) { | 99 | handlePageChange(page) { |
| 125 | this.pagination.current = page | 100 | this.pagination.current = page |
| 126 | this.loadParkingAreas() | 101 | this.loadParkingAreas() |
| 127 | }, | 102 | }, |
| 128 | - | 103 | + |
| 129 | handleSizeChange(size) { | 104 | handleSizeChange(size) { |
| 130 | this.pagination.size = size | 105 | this.pagination.size = size |
| 131 | this.loadParkingAreas() | 106 | this.loadParkingAreas() |
src/views/car/listParkingSpaceList.vue
| @@ -14,24 +14,20 @@ | @@ -14,24 +14,20 @@ | ||
| 14 | <div class="search-content"> | 14 | <div class="search-content"> |
| 15 | <el-row :gutter="20"> | 15 | <el-row :gutter="20"> |
| 16 | <el-col :sm="4"> | 16 | <el-col :sm="4"> |
| 17 | - <el-input-group> | ||
| 18 | <el-input v-model="listParkingSpaceInfo.conditions.areaNum" | 17 | <el-input v-model="listParkingSpaceInfo.conditions.areaNum" |
| 19 | :placeholder="$t('listParkingSpace.parkingLotPlaceholder')"></el-input> | 18 | :placeholder="$t('listParkingSpace.parkingLotPlaceholder')"></el-input> |
| 20 | - </el-input-group> | ||
| 21 | </el-col> | 19 | </el-col> |
| 22 | <el-col :sm="2"> | 20 | <el-col :sm="2"> |
| 23 | - <el-input-group> | ||
| 24 | - <el-button slot="append" type="primary" @click="openChooseParkingArea"> | 21 | + <el-button type="primary" @click="openChooseParkingArea"> |
| 25 | <i class="el-icon-search"></i> | 22 | <i class="el-icon-search"></i> |
| 26 | {{ $t('listParkingSpace.select') }} | 23 | {{ $t('listParkingSpace.select') }} |
| 27 | </el-button> | 24 | </el-button> |
| 28 | - </el-input-group> | ||
| 29 | </el-col> | 25 | </el-col> |
| 30 | - <el-col :sm="6"> | 26 | + <el-col :sm="4"> |
| 31 | <el-input v-model.trim="listParkingSpaceInfo.num" | 27 | <el-input v-model.trim="listParkingSpaceInfo.num" |
| 32 | :placeholder="$t('listParkingSpace.parkingSpaceNumPlaceholder')"></el-input> | 28 | :placeholder="$t('listParkingSpace.parkingSpaceNumPlaceholder')"></el-input> |
| 33 | </el-col> | 29 | </el-col> |
| 34 | - <el-col :sm="6"> | 30 | + <el-col :sm="4"> |
| 35 | <el-select v-model="listParkingSpaceInfo.conditions.state" | 31 | <el-select v-model="listParkingSpaceInfo.conditions.state" |
| 36 | :placeholder="$t('listParkingSpace.parkingSpaceStatePlaceholder')" style="width:100%"> | 32 | :placeholder="$t('listParkingSpace.parkingSpaceStatePlaceholder')" style="width:100%"> |
| 37 | <el-option value="" :label="$t('listParkingSpace.parkingSpaceStatePlaceholder')"></el-option> | 33 | <el-option value="" :label="$t('listParkingSpace.parkingSpaceStatePlaceholder')"></el-option> |