Диплом: Автоматизация учета аренды площадей клиентами компании ООО "Грандтитул"

Внимание! Если размещение файла нарушает Ваши авторские права, то обязательно сообщите нам
127
+ '&searchCreatedDate=' + vm.searchCreatedDate +
'&searchUpdatedDate=' + vm.searchUpdatedDate*/
)
.then(function(response){
vm.paginateData=response.data;
if(response.data.data.length>0){
vm.reFind=true;
vm.searchCaptionClases='alert alert-success';
if(response.data.last_page===1){
vm.searchCaption="Ответполучен. Всегорезультатов: "+response.data.data.length+". ";
}else{
vm.searchCaption="Ответполучен. Показано c "+response.data.from+" по
"+(response.data.from+response.data.data.length-1)+" из "+response.data.total;
}
}else{
vm.searchCaptionClases='alert alert-warning';
vm.searchCaption='Попробуйте другие варианты поиска.';
}
})
.catch(function(error){
alert('Ошибка! Не могу связаться с API. Попробуйтезаного.'+error);
});
},
getData:function(param,page){
this.searchCaption="Ожидайтеответ...";
leturl="";
switch(param){
case'prev':
url+='&page='+(this.paginateData.current_page-1);
break;
case'next':
url+='&page='+(this.paginateData.current_page+1);
break;
default:
url+='&page='+page;
break;
}
this.uploadData(url);
},
startAlert:function(message){
this.finalCaption=message;
setTimeout(()=>{
this.dismissAlert();
},5000);
},
dismissAlert:function(){
this.finalCaption="";
}
},
mounted(){
letvm=this;
$('#createdAtField').datepicker({
position:'bottom left',
autoClose:true,
dateFormat:'yyyy-mm-dd',
range:true,
toggleSelected:false,
onSelect:function(fn,date){
vm.createdAtField=fn;
}
});
}
});
}
<script>
export default {
128
mounted() {
console.log('Component mounted.')
},
props: [
'operations', 'types'
],
data: function () {
//let vm = this;
return {
address: "",
operation_id: "",
type_id: "",
description: "",
description2: "",
client_id : "",
sq: "",
sq2: "",
price: "",
floor: "",
floor_all: "",
count_room: "",
}
},
methods: {
storeModel: function () {
let vm = this;
vm.$validator.validateAll().then((result) => {
if (result) {
axios({
method: 'post',
url: '/buildings',
data: {
address: vm.address,
operation_id: vm.operation_id,
building_type_id: vm.type_id,
description: vm.description,
description2: vm.description2,
client_id: vm.client_id,
sq: vm.sq,
sq2: vm.sq2,
price: vm.price,
floor: vm.floor,
floor_all: vm.floor_all,
count_room: vm.count_room,
}
})
.then(response => {
if (response.data.success) {
vm.$parent.storeModel(response.data.model);
vm.clearFields();
} else {
}
});
}
});
},
clearFields: function () {
this.address = "";
this.operation_id = "";
this.type_id = "";
this.description = "";
this.description2 = "";
this.client_id = "";
this.sq = "";
this.sq2 = "";
this.price = "";
this.floor = "";
this.floor_all = "";
this.count_room = "";
},
129
cancelCreate: function () {
this.$parent.cancelCreate();
}
},
mounted() {
let vm = this;
window.selectStart();
$('.clientFieldSelect2').on('select2:select', function(e){
vm.client_id = e.target.value;
});
},
}
</script>
<script>
export default {
props: ['buildings', 'types', 'operations'],
data: function () {
return {
operation_id: "",
type_id: "",
description: "",
description2: "",
client_id: "",
sq: "",
sq2: "",
count_room: [],
price: "",
floor: "",
floor_all: "",
address: "",
toEditId: 0
}
},
computed: {
renderBuildings: function () {
return this.buildings;
},
},
methods: {
startEdit: function (building) {
this.toEditId = building.id;
this.operation_id = building.operation_id;
this.type_id = building.building_type_id;
this.description = building.description;
this.description2 = building.description2;
this.client_id = building.client;
this.sq = building.sq;
this.sq2 = building.sq2;
this.count_room = building.count_room;
this.price = building.price;
this.floor = building.floor;
this.floor_all = building.floor_all;
this.address = building.address;
this.$nextTick(function(){
let option = new Option(building.client.f_name + ' ' +
building.client.l_name, building.client.id, true, true);
$('.clientFieldSelect2').append(option).trigger('change');
});
},
editBuilding: function () {
let vm = this;
vm.$validator.validateAll().then((result) => {
if (result) {
axios({
method: 'put',
url: '/buildings/' + vm.toEditId,
data: {
operation_id: vm.operation_id,
building_type_id: vm.type_id,
130
description: vm.description,
description2: vm.description2,
client_id: vm.client_id,
sq: vm.sq,
sq2: vm.sq2,
count_room: vm.count_room,
price: vm.price,
floor: vm.floor,
floor_all: vm.floor_all,
address: vm.address
}
})
.then(response => {
if (response.data.success) {
vm.$parent.updateModel(response.data.updated);
vm.toEditId = 0;
} else {
}
})
.catch(e => {
console.log(e);
});
}
});
},
cancelEdit: function () {
this.toEditId = 0;
this.operation_id = "";
this.type_id = "";
this.description = "";
this.description2 = "";
this.client_id = "";
this.sq = "";
this.sq2 = "";
this.count_room = [];
this.price = "";
this.floor = "";
this.floor_all = "";
this.address = "";
},
deleteModel: function (model) {
let vm = this;
if (confirm('Вы хотите удалить недвижимость с идентификатором № ' +
model.id)) {
axios({
method: 'delete',
url: '/buildings/' + model.id
})
.then(function (response) {
if (response.data.success) {
vm.$parent.deleteModel(model);
}
})
.catch(function (error) {
alert(error);
console.log(error);
});
}
}
},
updated() {
let vm = this;
window.selectStart();
$('.clientFieldSelect2').on('select2:select', function(e){
vm.client_id = e.target.value;
});
}
}
</script>

Смотрите также:

"Автоматизация обработки заявок ООО "Проектно-Строительная Компания"
"Автоматизация процесса аттестации персонала для ООО "Нэт Бай Нэт Холдинг"
"Анализ интернет-активности конкурентов ( на примере конкурентов "Газпром нефть")
"Бухгалтерский учёт и аудит расчётов с подотчётними лицами в организации на примере ООО "ЛОЦ 10""
«Психологическое сопровождение персонала в организации на примере ООО «Крокус»
Cовершенствование деловой оценки персонала в организации (на примере ООО "Даймонд кейтеринг развитие")
IPO - инструмент финансирования деятельности организации. На примере ПАО «Нефтяная компания «Лукойл»
PR как средство продвижения организации (на примере ПАО "Тамбовский завод "Комсомолец им. Н.С. Артемова")
PR-коммуникации в сфере общественного питания (на примере кафе-кондитерской «Cream Cheese»)
SMM как средство повышения эффективности работы учреждений социокультурной сферы (на примере Малого театра)