[WIP] Фикс переменных, правка стилей

This commit is contained in:
megavrilinvv
2022-12-27 14:16:39 +03:00
parent 84f4379f2d
commit 687a56defb
8 changed files with 97 additions and 77 deletions

View File

@@ -78,9 +78,9 @@
span.title-section.font-semibold.text-xs(v-if="settings[section].options") {{settings[section].options[key]}}
span.title-section.font-semibold.text-xs(v-if="item.header") {{item.header}}
.flex(v-if="settings[section].options && !isChange")
span.text-sm.w-fit(:style="{fontWeight:key === 'numba'&&600}") {{key === 'issued_by_date' ? formattedDate : item}}
span.text-sm.w-fit(:style="{fontWeight:key === 'number'&&600}") {{key === 'issued_by_date' ? formattedDate : item}}
.copy.icon-copy.cursor-pointer.pl-4(
v-if="key === 'numba'",
v-if="key === 'number'",
@click="() => copyValue(item)"
)
.flex(v-if="item.name && !isChange")
@@ -105,7 +105,7 @@
span.title-section.font-semibold.text-xs(v-if="item.header") {{item.header}}
client-detail-input.text-sm.w-max-fit(
v-if="section!=='docs' && section!=='additional' && isChange && settings[section].options[key] !== 'Дата выдачи'",
:style="{fontWeight:key === 'numba'&&600}",
:style="{fontWeight:key === 'number'&&600}",
v-model:value="sectionInfo[key]",
:rows="section ==='pass' ? 2 : 1",
:placeholder="settings[section].placeholder[key] || settings[section].placeholder"
@@ -137,7 +137,7 @@
)
client-detail-input.text-sm.w-max-fit.pr-12.relative(
:maxLength="40",
:style="{fontWeight:key === 'numba'&&600}",
:style="{fontWeight:key === 'number'&&600}",
v-model:value="sectionInfo[key].title",
placeholder="Заголовок"
)
@@ -148,7 +148,7 @@
.title-section.text-xxs.font-semibold Описание
client-detail-input.text-sm.w-max-fit(
:maxLength="40",
:style="{fontWeight:key === 'numba'&&600}",
:style="{fontWeight:key === 'number'&&600}",
v-model:value="sectionInfo[key].description",
placeholder="Описание"
)

View File

@@ -347,7 +347,7 @@ export default {
.post("general/contact/create/", {
kind: contact.kind,
username: contact.username,
person_id: this.client.id,
person: this.client.id,
})
.then(() => {
if (this.createdClientName) this.fetchCreatedClientData;
@@ -359,7 +359,7 @@ export default {
.post(`general/contact/${contact.id}/update/`, {
kind: contact.kind,
username: contact.username,
person_id: this.client.id,
person: this.client.id,
})
.then(() => {
if (this.createdClientName) this.fetchCreatedClientData;
@@ -430,7 +430,7 @@ export default {
.then((data) => this.saveAttachment(data.results));
},
saveAttachment(data) {
this.dataAttachments = data.filter((e) => e.person_id.id === this.id);
this.dataAttachments = data.filter((e) => e.person.id === this.id);
this.lackAttachments = this.dataAttachments[0]?.id ? true : false;
},
saveNote(data) {
@@ -446,8 +446,8 @@ export default {
if (data?.id) {
this.docId = data.id;
this.dataIdentityDocument = {
numba:
data.series && data.numba ? data?.series + " " + data?.numba : "",
number:
data.series && data.number ? data?.series + " " + data?.number : "",
issued_by_org: data.issued_by_org ? data?.issued_by_org : "",
issued_by_org_code: data.issued_by_org_code
? data?.issued_by_org_code
@@ -458,7 +458,7 @@ export default {
} else {
this.lackData = false;
this.dataIdentityDocument = {
numba: "",
number: "",
issued_by_org: "",
issued_by_org_code: "",
issued_by_date: "",
@@ -469,7 +469,7 @@ export default {
fetchWrapper
.post(`general/identity_document/${this.docId}/update/`, {
kind: "PASSPORT",
series_number: this.dataIdentityDocument.numba,
series_number: this.dataIdentityDocument.number,
issued_by_org: this.dataIdentityDocument.issued_by_org,
issued_by_org_code: this.dataIdentityDocument.issued_by_org_code,
issued_by_date: this.dataIdentityDocument.issued_by_date,
@@ -565,7 +565,7 @@ export default {
this.dataAttachments = [...data];
const formData = new FormData();
this.dataAttachments.forEach((e) => {
formData.append("person_id", this.id);
formData.append("person", this.id);
formData.append("document", e);
formData.append("title", e.name.substr(0, e.name.lastIndexOf(".")));
fetchWrapper
@@ -581,7 +581,7 @@ export default {
postCreateAddress() {
fetchWrapper
.post("general/address/create/", {
person_id: this.id,
person: this.id,
full_address:
this.mergeFullAddress() || this.dataAddress.full_address,
})
@@ -598,9 +598,9 @@ export default {
postCreateIdentityDocument() {
fetchWrapper
.post("general/identity_document/create/", {
person_id: this.id,
person: this.id,
kind: "PASSPORT",
series_number: this.dataIdentityDocument.numba,
series_number: this.dataIdentityDocument.number,
issued_by_org: this.dataIdentityDocument.issued_by_org,
issued_by_org_code: this.dataIdentityDocument.issued_by_org_code,
issued_by_date: this.dataIdentityDocument.issued_by_date,
@@ -639,7 +639,7 @@ export default {
} else
fetchWrapper
.post("general/note/create/", {
person_id: this.id,
person: this.id,
title: title,
description: description,
})

View File

@@ -41,7 +41,7 @@
base-input.input-info(
disabled,
v-mask="'###-###-### ##'",
v-model:value="identityDocument.snils.numba",
v-model:value="identityDocument.snils.number",
placeholder="000000000 00",
:width-input="277",
:style="{backgroundColor: 'var(--bg-disable-grey-color)'}"
@@ -51,7 +51,7 @@
base-input.input-info(
disabled,
v-mask="'############'",
v-model:value="identityDocument.inn.numba",
v-model:value="identityDocument.inn.number",
placeholder="000000000000",
:width-input="277",
:style="{backgroundColor: 'var(--bg-disable-grey-color)'}"

View File

@@ -108,19 +108,19 @@ export const detail = {
pass: {
title: "Паспортные данные",
options: {
numba: "Серия и номер",
number: "Серия и номер",
issued_by_org: "Выдан",
issued_by_org_code: "Код подразделения",
issued_by_date: "Дата выдачи",
},
sharps: {
numba: "#### ######",
number: "#### ######",
issued_by_org: "",
issued_by_org_code: "###-###",
issued_by_date: "##.##.####",
},
placeholder: {
numba: "0000 000000",
number: "0000 000000",
issued_by_org: "Точно как в паспорте",
issued_by_org_code: "000-000",
issued_by_date: "Дата",
@@ -131,20 +131,20 @@ export const detail = {
snils: {
title: "СНИЛС",
options: {
numba: "Номер",
number: "Номер",
},
placeholder: {
numba: "000-000-000 00",
number: "000-000-000 00",
},
width: 180,
},
inn: {
title: "ИНН",
options: {
numba: "Номер",
number: "Номер",
},
placeholder: {
numba: "000000000000",
number: "000000000000",
},
width: 180,
},
@@ -166,7 +166,7 @@ export const detail = {
docs: {
title: "Документы",
placeholder: {
numba: "Редактировать данные",
number: "Редактировать данные",
},
height: 280,
width: 360,
@@ -176,7 +176,7 @@ export const detail = {
additional: {
title: "Дополнительные данные",
placeholder: {
numba: "Редактировать данные",
number: "Редактировать данные",
},
height: 280,
width: 360,

View File

@@ -161,6 +161,20 @@ export default {
})
.then(() => this.fetchSchedules());
},
postUpdateSchedule(id) {
let currentEmployee = this.clearEmployee.find((e) => e.schedules);
fetchWrapper
.post(`accounts/schedules/${id}/update/`, {
employee: currentEmployee.id,
active_flg: true,
start_date: currentEmployee.schedules.start_date,
end_date: currentEmployee.schedules.end_date,
start_time: this.times.start_time,
end_time: this.times.end_time,
status: this.buttons.find((e) => e.active).work,
})
.then(() => this.fetchSchedules());
},
createNewDate(e) {
let schedules = {
start_date: e.start,

View File

@@ -14,21 +14,22 @@
.text.flex.font-bold(
:style="{opacity: changeOpacity(day)}"
) {{day.format("ddd")}}
.schedule-body.flex.w-full(v-for="schedule in serialized", :key="schedule.id")
.edit.flex.items-center.justify-center.h-11.w-11
.flex.icon-edit
.name-employee.flex.justify-center.items-center.cursor-pointer
span {{trimOwnerName(schedule.last_name, schedule.first_name, schedule.patronymic)}}
.cell.flex.flex-col.items-center.justify-center.w-11.h-11.cursor-pointer(
v-for="day in result",
:key="day",
:id="schedule.id + day",
@click="choiceCell(day, schedule.id)",
:class="selectTime(day, schedule.id)",
:style="{backgroundColor: day.format('YYYY-MM-DD') === choiceDay(day, schedule.id) ? choiceColor(day) : ''}"
)
.flex {{day.format("YYYY-MM-DD") === choiceDay(day, schedule.id) ? choiceWorks(day) : ''}}
.schedule-body.flex.w-full(v-if="clearEmployee")
.flex.w-full.flex-col(:style="{overflowY: 'scroll', maxHeight: '351px'}")
.schedule-body.flex.w-full(v-for="schedule in serialized", :key="schedule.id")
.edit.flex.items-center.justify-center.h-11.w-11
.flex.icon-edit
.name-employee.flex.justify-center.items-center.cursor-pointer
span {{trimOwnerName(schedule.last_name, schedule.first_name, schedule.patronymic)}}
.cell.flex.flex-col.items-center.justify-center.w-11.h-11.cursor-pointer(
v-for="day in result",
:key="day",
:id="schedule.id + day",
@click="choiceCell(day, schedule.id)",
:class="selectTime(day, schedule.id)",
:style="{backgroundColor: choiceDay(day, schedule.id) ? choiceColor(day) : ''}"
)
.flex {{choiceDay(day, schedule.id) ? choiceWorks(day) : ''}}
.schedule-body.flex.w-full(v-if="clearEmployee", :style="{height: '44px'}")
.edit.flex.items-center.justify-center.h-11.w-11(:style="{borderBottom: 'none'}")
.flex.icon-edit(v-if="currentEmployee.label")
//- base-button(
@@ -151,7 +152,8 @@ export default {
this.dateInterval.id = id;
} else if (time.isAfter(this.dateInterval.start)) {
this.dateInterval.end = formatTime;
this.$emit("new-date", this.dateInterval);
if (this.currentEmployee.label)
this.$emit("new-date", this.dateInterval);
} else this.dateInterval.start = formatTime;
},
selectTime(day, id) {
@@ -185,12 +187,16 @@ export default {
choiceWorks(day) {
let currentDay = day.format("YYYY-MM-DD");
let res = this.scheduleList.find((e) => e.date === currentDay).status;
// if (this.activeButton) {
// return this.buttons.find((e) => e.work === this.activeButton?.text[1])
// ?.text[1];
// }
return this.buttons.find((e) => e.work === res).text[1];
},
choiceColor(day) {
let currentDay = day.format("YYYY-MM-DD");
let res = this.scheduleList.find((e) => e.date === currentDay).status;
return this.buttons.find((e) => e.work === res).color;
if (res) return this.buttons.find((e) => e.work === res).color;
},
changeDays() {
this.days = moment().daysInMonth();
@@ -280,15 +286,15 @@ export default {
.status
background-color: var(--bg-color-status)
.status::before
.status::after
content: var(--text-status)
.from-date
background: limegreen
background-color: limegreen !important
.to-date
background: red
background-color: red !important
.middle-dates
background: yellow
background-color: yellow !important
</style>