%PDF- %PDF-
Direktori : /home/ugotscom/bos_naturals/resources/js/components/properties/ |
Current File : /home/ugotscom/bos_naturals/resources/js/components/properties/editproperty2.vue |
<template> <div class="row"> <div class="container"> {{properties}} {{id}} {{property}} <form @submit.prevent="updateProperty()"> <div class="form-group"> <label for="title">Title</label> <input type="text" v-model="property.title" class="form-control"> </div> <div class="form-group"> <label for="title">Property_name</label> <input type="text" v-model="property.property_name" class="form-control"> </div> <div class="form-group"> <label for="exampleFormControlTextarea2">Description</label> <textarea class="form-control rounded-0" id="exampleFormControlTextarea2" rows="3" v-model="property.description" ></textarea> </div> <input type="radio" name="buy" v-model="property.property_for" value="1" id="Rent">Rent <input type="radio" name="rent" v-model="property.property_for" value="2" id="Ssle">Sale <input type="radio" name="rent" v-model="property.property_for" value="3" id="Maintenance">Maintenance <div class="form-group"> <label for="">Property Type</label> <select v-model="property.property_type" class="form-control"> <optgroup label="Residential"> <option value="1">Apartment</option> <option value="2">House</option> <option value="3">Villa Gated Community</option> <option value="4">Residential Land</option> </optgroup> <optgroup label="Commercial"> <option value="4">Commercial Office Space</option> <option value="5">Office in IT Park/ SEZ</option> <option value="6">Shop/Showroom/Retail Space</option> <option value="7">Commercial Land</option> <option value="8">Warehouse/ Godown</option> </optgroup> </select> </div> <div v-if="this.property_type==1"> <label for="Area">Area</label> <input type="text" class="form-control" v-model="area"> <label for="BHK">BHK</label> <div class="cntr"> <label for="opt1" class="radio1"> <input type="radio" name="rdo1" id="opt1" value="1" v-model="bhk" class="hidden"/> <span class="label"></span>1 </label> <label for="opt2" class="radio1"> <input type="radio" name="rdo2" id="opt2" value="2" v-model="bhk" class="hidden"/> <span class="label"></span>2 </label> <label for="opt3" class="radio1"> <input type="radio" name="rdo3" id="opt3" value="3" v-model="bhk" class="hidden"/> <span class="label"></span>3 </label> <label for="opt3" class="radio1"> <input type="radio" name="rdo4" id="opt4" value="4" v-model="bhk" class="hidden"/> <span class="label"></span>4 </label> </div> <label for="BHK">Bathroom</label> <div class="cntr"> </div> <label for="BHK">Furnishing</label> <div class="cntr"> <label for="opt3" class="radio1"> <input type="radio" name="furnishing" id="furn1" value="4" v-model="property.furnishing" class="hidden"/> <span class="label"></span>Unfurnished </label> <label for="opt3" class="radio1"> <input type="radio" name="furnishing" id="furn1" value="5" v-model="property.furnishing" class="hidden"/> <span class="label"></span>Semi-furnished </label> <label for="opt3" class="radio1"> <input type="radio" name="furnishing" id="furn1" value="6" v-model="property.furnishing" class="hidden"/> <span class="label"></span>Fully-furnished </label> </div> <label for="">Project</label> <input type="text" class="form-control" v-model="project">Project add </div> <div class="form-group"> <label for="">Locality</label> <select v-model="property.location" class="form-control"> <option v-for="option in locationlist" :value="option.location_id" :key="option.location_id">{{option.location}}</option> </select> </div> <div class="form-group"> <label for="title">Location</label> <input type="text" data-content="Content." data-placement='top' class="form-control" id="location" placeholder="property location" name="location" autocomplete="off"> <ul class="list-group loc-dropdown"> </ul> </div> <label for="">Latitude</label> <input id="lat" type='text' name='lat'> <label for="">Longitude</label> <input id="lng" type='text' name='lng'> <button v-on:click="updatelocation()">Add Coordinates</button> <div v-if="this.property_for==1"> <div class="form-group"> <label for="price">Price</label> <input type="text" class="form-control" v-model="property.price"> </div> <div class="form-group"> <label for="price">Maintenance</label> <input type="text" class="form-control" v-model="property.mmc"> </div> </div> <div v-else> <div class="form-group"> <label for="price">Price</label> <input type="text" class="form-control" v-model="property.price"> </div> </div> <label for="">Featured Image</label> <br> <img :src="'/images/'+property.image" width="200px" > <input type="file" class="form-control" name="image" v-on:change="onImageChange" /> <img :src="image" class="preview" style="width:200px;"> <label for="">Add Images</label> <input type="file" multiple class="form-control" name="image" v-on:change="onImageChanges" /> <div v-for="(image, key) in images" :key="key"> <img :src="image" class="preview" style="width:200px;"> </div> <button type="submit" value="submit" class="btn btn-primary">Submit</button> </form> </div> </div> </template> <script> export default { data(){ return { id:this.$route.params.id, properties:[], locationlist:'', property:{ title:"ghgh", Property_name:"", description:"", property_for:"", property_type:"", furnishing:"", price:"", mmc:"", image:"", status:"" } } }, methods:{ loadusers(){ axios.get('/properties/propertydetails/'+this.id) .then(response => { this.properties = response.data; this.property.title =this.properties[0].title this.property.Property_name =this.properties[0].property_name this.property.description =this.properties[0].description this.property.property_for =this.properties[0].property_for this.property.property_type =this.properties[0].property_type this.property.furnishing =this.properties[0].furnishing this.property.location =this.properties[0].location this.property.price =this.properties[0].price this.property.mmc =this.properties[0].mmc this.property.image =this.properties[0].featured_image }) }, updateProperty() { axios.patch('/properties/'+this.id ) .then( response => this.$router.push({ path: '/properties/'}) ); }, loadlocations:function(){ axios.get('/locations').then(response=> {this.locationlist = response.data}); }, }, mounted() { this.loadusers(); }, created:function(){ this.loadlocatitions() } } </script>