Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. <template>
  2. <!-- eslint-disable max-len -->
  3. <div>
  4. <br />
  5. <div class="col-md-12" style="text-align:centre">
  6. <div class="myWell">
  7. <h4>Address</h4>
  8. </div>
  9. <div class="form-group row"></div>
  10. <div class="row" style="text-align:left">
  11. <div class="col-md-6" style="margin-bottom: 1em">
  12. <label>Street Number *</label>
  13. <div class="input-group-prepend">
  14. <span class="input-group-text">
  15. <eva-icon name="home-outline" fill="#60CBEB"></eva-icon>
  16. </span>
  17. <input
  18. class="form-control"
  19. type="text"
  20. name="streetnumber"
  21. v-model="address.streetNumber"
  22. />
  23. </div>
  24. </div>
  25. <div class="col-md-6" style="margin-bottom: 1em">
  26. <label>Street Name *</label>
  27. <div class="input-group-prepend">
  28. <span class="input-group-text">
  29. <eva-icon name="home-outline" fill="#60CBEB"></eva-icon>
  30. </span>
  31. <input class="form-control" type="text" name="streetname" v-model="address.streetName" />
  32. </div>
  33. </div>
  34. <div class="col-md-6" style="margin-bottom: 1em">
  35. <label>Province *</label>
  36. <div class="input-group-prepend">
  37. <span class="input-group-text">
  38. <eva-icon name="home-outline" fill="#60CBEB"></eva-icon>
  39. </span>
  40. <select
  41. class="form-control"
  42. name="propertyType"
  43. id="propertyType"
  44. @change="ProvinceSelected"
  45. v-model="address.province"
  46. >
  47. <option value="0">Please select province</option>
  48. <option
  49. v-for="province in provinces"
  50. :value="province.id"
  51. :key="province.description"
  52. >{{ province.description }}</option>
  53. </select>
  54. </div>
  55. </div>
  56. <div class="col-md-6" style="margin-bottom: 1em">
  57. <label>City *</label>
  58. <div class="input-group-prepend">
  59. <span class="input-group-text">
  60. <eva-icon name="home-outline" fill="#60CBEB"></eva-icon>
  61. </span>
  62. <select
  63. class="form-control"
  64. name="propertyType"
  65. id="propertyType"
  66. @change="CitySelected"
  67. v-model="address.city"
  68. >
  69. <option value="0">Please select city</option>
  70. <option
  71. v-for="city in cities"
  72. :value="city.description"
  73. :key="city.id"
  74. >{{ city.description }}</option>
  75. </select>
  76. </div>
  77. </div>
  78. <div class="col-md-6" style="margin-bottom: 1em">
  79. <label>Suburb *</label>
  80. <div class="input-group-prepend">
  81. <span class="input-group-text">
  82. <eva-icon name="home-outline" fill="#60CBEB"></eva-icon>
  83. </span>
  84. <select
  85. class="form-control"
  86. name="propertyType"
  87. id="suburbselector"
  88. v-model="address.suburb"
  89. @change="getPostalCode"
  90. >
  91. <option value="0">Please select suburb</option>
  92. <option
  93. v-for="suburb in suburbs"
  94. :value="suburb.description"
  95. :key="suburb.description"
  96. >{{ suburb.description }}</option>
  97. </select>
  98. </div>
  99. </div>
  100. <div class="col-md-6" style="margin-bottom: 1em">
  101. <label>Postal Code *</label>
  102. <div class="input-group-prepend">
  103. <span class="input-group-text">
  104. <eva-icon name="home-outline" fill="#60CBEB"></eva-icon>
  105. </span>
  106. <input class="form-control" type="text" name="postalcode" v-model="address.postalCode" />
  107. </div>
  108. </div>
  109. </div>
  110. </div>
  111. </div>
  112. </template>
  113. <script>
  114. import { mapState, mapActions } from 'vuex';
  115. export default {
  116. data() {
  117. return {
  118. propertyType: 'Residential',
  119. };
  120. },
  121. props: {
  122. address: {},
  123. },
  124. computed: {
  125. ...mapState('searchTab', ['provinces', 'cities', 'suburbs']),
  126. },
  127. methods: {
  128. ...mapActions('searchTab', ['getProvince', 'getCities', 'getSuburbs']),
  129. ProvinceSelected(item) {
  130. if (item.target.options.selectedIndex > 0) {
  131. this.selectedProvince = this.provinces[
  132. item.target.options.selectedIndex - 1
  133. ].description;
  134. this.getCities(Object.assign({}, { province: this.selectedProvince }));
  135. }
  136. },
  137. CitySelected(item) {
  138. if (item.target.options.selectedIndex > 0) {
  139. this.selectedCity = this.cities[
  140. item.target.options.selectedIndex - 1
  141. ].description;
  142. this.getSuburbs(
  143. Object.assign(
  144. {},
  145. { province: this.selectedProvince, city: this.selectedCity },
  146. ),
  147. );
  148. }
  149. },
  150. getPostalCode(item) {
  151. this.address.postalCode = this.suburbs[
  152. item.target.options.selectedIndex - 1
  153. ].postalCode;
  154. },
  155. },
  156. mounted() {
  157. this.getProvince();
  158. },
  159. };
  160. </script>
  161. <style>
  162. .goDown {
  163. margin-top: 150px;
  164. }
  165. </style>