[WIP] Правка placeholder адреса

This commit is contained in:
megavrilinvv
2022-12-07 14:04:51 +03:00
parent 463a54b7e3
commit a4240f3651
4 changed files with 22 additions and 12 deletions

View File

@@ -104,11 +104,14 @@ export default {
saveEmployeesData(res) { saveEmployeesData(res) {
this.employeesData = res.results; this.employeesData = res.results;
}, },
logout() {
localStorage.removeItem("tokenAccess");
this.$router.push("/login");
},
fetchEmployeesData() { fetchEmployeesData() {
fetchWrapper.get("general/employee/").then((res) => { fetchWrapper.get("general/employee/").then((res) => {
if (res.type === "client_error") { if (res.type === "client_error") {
localStorage.removeItem("tokenAccess"); this.logout();
return this.$router.push("/login");
} else this.saveEmployeesData(res); } else this.saveEmployeesData(res);
}); });
}, },

View File

@@ -4,7 +4,7 @@
.text-info.text-xxs.font-semibold Город .text-info.text-xxs.font-semibold Город
base-select.cursor-grab( base-select.cursor-grab(
disable, disable,
placeholder="Выберите город", placeholder="Введите город",
v-model="dopeAddress.city", v-model="dopeAddress.city",
:style="{backgroundColor: 'var(--bg-disable-grey-color)'}" :style="{backgroundColor: 'var(--bg-disable-grey-color)'}"
) )

View File

@@ -118,6 +118,10 @@ export default {
this.fetchDataClients(); this.fetchDataClients();
} }
}, },
logout() {
localStorage.removeItem("tokenAccess");
this.$router.push("/login");
},
async fetchDataClients() { async fetchDataClients() {
let response = {}; let response = {};
if (this.textSearch) { if (this.textSearch) {
@@ -126,12 +130,16 @@ export default {
this.limit this.limit
}&offset=${(this.currentTablePage - 1) * this.limit}` }&offset=${(this.currentTablePage - 1) * this.limit}`
); );
if (response.type === "client_error") {
this.logout();
} else {
this.saveDataClients(response); this.saveDataClients(response);
this.saveFilteredClientsCount(response); this.saveFilteredClientsCount(response);
this.paginationInfo = { this.paginationInfo = {
currentPage: this.currentTablePage, currentPage: this.currentTablePage,
length: this.calculatePageCount(this.filteredClientsCount), length: this.calculatePageCount(this.filteredClientsCount),
}; };
}
} else { } else {
response = await fetchWrapper.get( response = await fetchWrapper.get(
`general/person/?limit=${this.limit}&offset=${ `general/person/?limit=${this.limit}&offset=${
@@ -139,8 +147,7 @@ export default {
}` }`
); );
if (response.type === "client_error") { if (response.type === "client_error") {
localStorage.removeItem("tokenAccess"); this.logout();
return this.$router.push("/login");
} else { } else {
this.saveDataClients(response); this.saveDataClients(response);
this.saveClientsCount(response); this.saveClientsCount(response);

View File

@@ -15,7 +15,7 @@
.text-info.text-xxs.font-semibold Город .text-info.text-xxs.font-semibold Город
base-input.input-info( base-input.input-info(
disabled, disabled,
placeholder="Выберите город", placeholder="Введите город",
v-model:value="addresses.city", v-model:value="addresses.city",
:style="{backgroundColor: 'var(--bg-disable-grey-color)'}" :style="{backgroundColor: 'var(--bg-disable-grey-color)'}"
) )