[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

@@ -31,13 +31,13 @@ const dataClients = {
updated_at: "2022-10-24T15:44:29.235350Z", updated_at: "2022-10-24T15:44:29.235350Z",
deleted_flg: false, deleted_flg: false,
kind: "Паспорт", kind: "Паспорт",
numba: "1233 123312", number: "1233 123312",
issued_by_org: "Отделом УФМС России по рязанской области", issued_by_org: "Отделом УФМС России по рязанской области",
issued_by_date: "2022-10-10", issued_by_date: "2022-10-10",
issued_by_org_code: "426234", issued_by_org_code: "426234",
created_by: null, created_by: null,
updated_by: null, updated_by: null,
person_id: "14ff401c-2b7b-4d9a-9159-720c74d8b23c", person: "14ff401c-2b7b-4d9a-9159-720c74d8b23c",
}, },
], ],
}, },
@@ -67,13 +67,13 @@ const dataClients = {
updated_at: "2022-10-24T15:44:29.235350Z", updated_at: "2022-10-24T15:44:29.235350Z",
deleted_flg: false, deleted_flg: false,
kind: "Паспорт", kind: "Паспорт",
numba: "9543 547021", number: "9543 547021",
issued_by_org: "Отделом УФМС России по владимирской области", issued_by_org: "Отделом УФМС России по владимирской области",
issued_by_date: "2014-09-08", issued_by_date: "2014-09-08",
issued_by_org_code: "743126", issued_by_org_code: "743126",
created_by: null, created_by: null,
updated_by: null, updated_by: null,
person_id: "db831a14-e836-481f-a653-6325de7c311e", person: "db831a14-e836-481f-a653-6325de7c311e",
}, },
], ],
}, },
@@ -113,13 +113,13 @@ const dataClients = {
updated_at: "2022-10-24T15:44:29.235350Z", updated_at: "2022-10-24T15:44:29.235350Z",
deleted_flg: false, deleted_flg: false,
kind: "Паспорт", kind: "Паспорт",
numba: "4308 205732", number: "4308 205732",
issued_by_org: "Отделом УФМС России по московской области", issued_by_org: "Отделом УФМС России по московской области",
issued_by_date: "2018-11-03", issued_by_date: "2018-11-03",
issued_by_org_code: "902571", issued_by_org_code: "902571",
created_by: null, created_by: null,
updated_by: null, updated_by: null,
person_id: "db8jd58x-e836-481f-a653-oq1m4e7c09e1", person: "db8jd58x-e836-481f-a653-oq1m4e7c09e1",
}, },
], ],
}, },
@@ -154,13 +154,13 @@ const dataClients = {
updated_at: "2022-10-24T15:44:29.235350Z", updated_at: "2022-10-24T15:44:29.235350Z",
deleted_flg: false, deleted_flg: false,
kind: "Паспорт", kind: "Паспорт",
numba: "1602 671922", number: "1602 671922",
issued_by_org: "Отделом УФМС России по тульской области", issued_by_org: "Отделом УФМС России по тульской области",
issued_by_date: "2017-01-21", issued_by_date: "2017-01-21",
issued_by_org_code: "101238", issued_by_org_code: "101238",
created_by: null, created_by: null,
updated_by: null, updated_by: null,
person_id: "cs5ms771-e836-kdc4-a653-sc4n567sx123", person: "cs5ms771-e836-kdc4-a653-sc4n567sx123",
}, },
], ],
}, },
@@ -169,12 +169,12 @@ const dataClients = {
const clientDetail = [ const clientDetail = [
{ {
person_id: "14ff401c-2b7b-4d9a-9159-720c74d8b23c", person: "14ff401c-2b7b-4d9a-9159-720c74d8b23c",
snils: { snils: {
numba: "812183139 21", number: "812183139 21",
}, },
inn: { inn: {
numba: "138291382731", number: "138291382731",
}, },
birthday: { birthday: {
date: "1994-12-04", date: "1994-12-04",
@@ -239,12 +239,12 @@ const clientDetail = [
], ],
}, },
{ {
person_id: "db831a14-e836-481f-a653-6325de7c311e", person: "db831a14-e836-481f-a653-6325de7c311e",
snils: { snils: {
numba: "834001555 35", number: "834001555 35",
}, },
inn: { inn: {
numba: "371942327342", number: "371942327342",
}, },
birthday: { birthday: {
date: "1997-09-03", date: "1997-09-03",
@@ -307,12 +307,12 @@ const clientDetail = [
], ],
}, },
{ {
person_id: "db8jd58x-e836-481f-a653-oq1m4e7c09e1", person: "db8jd58x-e836-481f-a653-oq1m4e7c09e1",
snils: { snils: {
numba: "812183139 21", number: "812183139 21",
}, },
inn: { inn: {
numba: "138291382731", number: "138291382731",
}, },
birthday: { birthday: {
date: "1990-11-05", date: "1990-11-05",
@@ -377,12 +377,12 @@ const clientDetail = [
], ],
}, },
{ {
person_id: "cs5ms771-e836-kdc4-a653-sc4n567sx123", person: "cs5ms771-e836-kdc4-a653-sc4n567sx123",
snils: { snils: {
numba: "834001555 35", number: "834001555 35",
}, },
inn: { inn: {
numba: "371942327342", number: "371942327342",
}, },
birthday: { birthday: {
date: "2000-08-17", date: "2000-08-17",
@@ -720,7 +720,7 @@ export function clientsServer() {
this.passthrough("https://astra-dev.dopcore.com/**"); this.passthrough("https://astra-dev.dopcore.com/**");
this.get("/api/detail/:id", (schema, request) => { this.get("/api/detail/:id", (schema, request) => {
let id = request.params.id; let id = request.params.id;
return clientDetail.find((el) => el.person_id === id); return clientDetail.find((el) => el.person === id);
}); });
this.get("/api/detail/identity_document/:id", (schema, request) => { this.get("/api/detail/identity_document/:id", (schema, request) => {
let id = request.params.id; let id = request.params.id;

View File

@@ -152,11 +152,11 @@ export default {
}, },
snils: { snils: {
kind: "СНИЛС", kind: "СНИЛС",
numba: "", number: "",
}, },
inn: { inn: {
kind: "ИНН", kind: "ИНН",
numba: "", number: "",
}, },
}, },
addresses: { addresses: {
@@ -273,7 +273,7 @@ export default {
...this.filterDataEmptyProperty( ...this.filterDataEmptyProperty(
this.infoClient.identity_document.pass this.infoClient.identity_document.pass
), ),
person_id: id, person: id,
kind: "Паспорт", kind: "Паспорт",
}); });
} }
@@ -283,26 +283,26 @@ export default {
.length > 0 && .length > 0 &&
fetchWrapper.post("general/address/create/", { fetchWrapper.post("general/address/create/", {
...this.filterDataEmptyProperty(this.infoClient.addresses), ...this.filterDataEmptyProperty(this.infoClient.addresses),
person_id: id, person: id,
}); });
}, },
createContacts(id) { createContacts(id) {
if (this.infoClient.phone.username) if (this.infoClient.phone.username)
fetchWrapper.post("general/contact/create/", { fetchWrapper.post("general/contact/create/", {
...this.filterDataEmptyProperty(this.infoClient.phone), ...this.filterDataEmptyProperty(this.infoClient.phone),
person_id: id, person: id,
}); });
if (this.infoClient.email.username) if (this.infoClient.email.username)
fetchWrapper.post("general/contact/create/", { fetchWrapper.post("general/contact/create/", {
...this.filterDataEmptyProperty(this.infoClient.email), ...this.filterDataEmptyProperty(this.infoClient.email),
person_id: id, person: id,
}); });
this.infoClient.basic.contacts.forEach((el) => { this.infoClient.basic.contacts.forEach((el) => {
if (el.username) if (el.username)
fetchWrapper.post("general/contact/create/", { fetchWrapper.post("general/contact/create/", {
kind: el.kind, kind: el.kind,
username: el.username, username: el.username,
person_id: id, person: id,
}); });
}); });
}, },

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

View File

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

View File

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

View File

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

View File

@@ -161,6 +161,20 @@ export default {
}) })
.then(() => this.fetchSchedules()); .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) { createNewDate(e) {
let schedules = { let schedules = {
start_date: e.start, start_date: e.start,

View File

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