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 | 28 | :rules="[{ required: true, message: $t('batchAddParkingSpace.parkingSpaceTypePlaceholder'), trigger: 'change' }]"> |
| 29 | 29 | <el-select v-model="form.parkingType" :placeholder="$t('batchAddParkingSpace.parkingSpaceTypePlaceholder')" |
| 30 | 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 | 33 | </template> |
| 34 | 34 | </el-select> |
| 35 | 35 | </el-form-item> |
| ... | ... | @@ -80,6 +80,7 @@ export default { |
| 80 | 80 | try { |
| 81 | 81 | const data = await getDict('parking_space', 'parking_type') |
| 82 | 82 | this.parkingTypes = data |
| 83 | + | |
| 83 | 84 | } catch (error) { |
| 84 | 85 | this.$message.error(this.$t('common.loadDictError')) |
| 85 | 86 | } | ... | ... |
src/components/car/chooseParkingArea.vue
| 1 | 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 | 4 | <div slot="header"> |
| 9 | 5 | <el-row :gutter="20"> |
| 10 | 6 | <el-col :span="18"></el-col> |
| 11 | 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 | 11 | {{ $t('chooseParkingArea.query') }} |
| 23 | 12 | </el-button> |
| 24 | - <el-button | |
| 25 | - type="primary" | |
| 26 | - @click="resetParkingAreas" | |
| 27 | - > | |
| 13 | + <el-button type="primary" @click="resetParkingAreas"> | |
| 28 | 14 | {{ $t('chooseParkingArea.reset') }} |
| 29 | 15 | </el-button> |
| 30 | - </el-input-group> | |
| 31 | 16 | </el-col> |
| 32 | 17 | </el-row> |
| 33 | 18 | </div> |
| 34 | - | |
| 19 | + | |
| 35 | 20 | <el-table :data="parkingAreas" border> |
| 36 | 21 | <el-table-column prop="paId" :label="$t('chooseParkingArea.parkingLotId')" align="center"></el-table-column> |
| 37 | 22 | <el-table-column prop="num" :label="$t('chooseParkingArea.parkingLotNum')" align="center"></el-table-column> |
| 38 | 23 | <el-table-column prop="typeCd" :label="$t('chooseParkingArea.parkingLotType')" align="center"></el-table-column> |
| 39 | 24 | <el-table-column :label="$t('chooseParkingArea.operation')" align="center" width="120"> |
| 40 | 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 | 27 | {{ $t('chooseParkingArea.select') }} |
| 47 | 28 | </el-button> |
| 48 | 29 | </template> |
| 49 | 30 | </el-table-column> |
| 50 | 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 | 38 | </el-dialog> |
| 64 | 39 | </template> |
| 65 | 40 | |
| ... | ... | @@ -88,7 +63,7 @@ export default { |
| 88 | 63 | this.visible = true |
| 89 | 64 | this.loadParkingAreas() |
| 90 | 65 | }, |
| 91 | - | |
| 66 | + | |
| 92 | 67 | async loadParkingAreas() { |
| 93 | 68 | try { |
| 94 | 69 | const params = { |
| ... | ... | @@ -97,35 +72,35 @@ export default { |
| 97 | 72 | communityId: getCommunityId(), |
| 98 | 73 | num: this.searchForm.num |
| 99 | 74 | } |
| 100 | - | |
| 75 | + | |
| 101 | 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 | 79 | } catch (error) { |
| 105 | 80 | this.$message.error(this.$t('common.loadError')) |
| 106 | 81 | } |
| 107 | 82 | }, |
| 108 | - | |
| 83 | + | |
| 109 | 84 | selectParkingArea(row) { |
| 110 | 85 | this.$emit('choose', row) |
| 111 | 86 | this.visible = false |
| 112 | 87 | }, |
| 113 | - | |
| 88 | + | |
| 114 | 89 | queryParkingAreas() { |
| 115 | 90 | this.pagination.current = 1 |
| 116 | 91 | this.loadParkingAreas() |
| 117 | 92 | }, |
| 118 | - | |
| 93 | + | |
| 119 | 94 | resetParkingAreas() { |
| 120 | 95 | this.searchForm.num = '' |
| 121 | 96 | this.queryParkingAreas() |
| 122 | 97 | }, |
| 123 | - | |
| 98 | + | |
| 124 | 99 | handlePageChange(page) { |
| 125 | 100 | this.pagination.current = page |
| 126 | 101 | this.loadParkingAreas() |
| 127 | 102 | }, |
| 128 | - | |
| 103 | + | |
| 129 | 104 | handleSizeChange(size) { |
| 130 | 105 | this.pagination.size = size |
| 131 | 106 | this.loadParkingAreas() | ... | ... |
src/views/car/listParkingSpaceList.vue
| ... | ... | @@ -14,24 +14,20 @@ |
| 14 | 14 | <div class="search-content"> |
| 15 | 15 | <el-row :gutter="20"> |
| 16 | 16 | <el-col :sm="4"> |
| 17 | - <el-input-group> | |
| 18 | 17 | <el-input v-model="listParkingSpaceInfo.conditions.areaNum" |
| 19 | 18 | :placeholder="$t('listParkingSpace.parkingLotPlaceholder')"></el-input> |
| 20 | - </el-input-group> | |
| 21 | 19 | </el-col> |
| 22 | 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 | 22 | <i class="el-icon-search"></i> |
| 26 | 23 | {{ $t('listParkingSpace.select') }} |
| 27 | 24 | </el-button> |
| 28 | - </el-input-group> | |
| 29 | 25 | </el-col> |
| 30 | - <el-col :sm="6"> | |
| 26 | + <el-col :sm="4"> | |
| 31 | 27 | <el-input v-model.trim="listParkingSpaceInfo.num" |
| 32 | 28 | :placeholder="$t('listParkingSpace.parkingSpaceNumPlaceholder')"></el-input> |
| 33 | 29 | </el-col> |
| 34 | - <el-col :sm="6"> | |
| 30 | + <el-col :sm="4"> | |
| 35 | 31 | <el-select v-model="listParkingSpaceInfo.conditions.state" |
| 36 | 32 | :placeholder="$t('listParkingSpace.parkingSpaceStatePlaceholder')" style="width:100%"> |
| 37 | 33 | <el-option value="" :label="$t('listParkingSpace.parkingSpaceStatePlaceholder')"></el-option> | ... | ... |