Merge branch 'UC-206' into 'master'

WIP Частично исправлены inputDate на форме клиента

See merge request andrusyakka/urban-couscous!229
This commit is contained in:
Daria Golova
2022-12-27 16:01:42 +00:00
13 changed files with 58 additions and 40 deletions

View File

@@ -121,7 +121,7 @@ export default {
infoClient: { infoClient: {
basic: { basic: {
full_name: "", full_name: "",
birth_date: "", birth_date: null,
priority: { priority: {
id: null, id: null,
label: "", label: "",
@@ -147,7 +147,7 @@ export default {
pass: { pass: {
series_number: "", series_number: "",
issued_by_org: "", issued_by_org: "",
issued_by_date: "", issued_by_date: null,
issued_by_org_code: "", issued_by_org_code: "",
}, },
snils: { snils: {
@@ -270,9 +270,13 @@ export default {
); );
} else } else
fetchWrapper.post("general/identity_document/create/", { fetchWrapper.post("general/identity_document/create/", {
...this.filterDataEmptyProperty( series_number: this.infoClient.identity_document.pass.series_number,
this.infoClient.identity_document.pass issued_by_org: this.infoClient.identity_document.pass.issued_by_org,
), issued_by_date: moment(
this.infoClient.identity_document.pass.issued_by_date
).format("YYYY-MM-DD"),
issued_by_org_code:
this.infoClient.identity_document.pass.issued_by_org_code,
person: id, person: id,
kind: "Паспорт", kind: "Паспорт",
}); });
@@ -313,7 +317,10 @@ export default {
formData.append("photo", e); formData.append("photo", e);
}); });
if (this.infoClient.basic.birth_date) if (this.infoClient.basic.birth_date)
formData.append("birth_date", this.infoClient.basic.birth_date); formData.append(
"birth_date",
moment(this.infoClient.basic.birth_date).format("YYYY-MM-DD")
);
let foundElement = this.prioritySettings.settings.find( let foundElement = this.prioritySettings.settings.find(
(el) => el.priority === this.infoClient.basic.priority.id (el) => el.priority === this.infoClient.basic.priority.id
); );

View File

@@ -28,7 +28,7 @@ export default {
return this.modelValue?.toISOString().split("T")[0]; return this.modelValue?.toISOString().split("T")[0];
}, },
set(value) { set(value) {
this.$emit("update:modelValue", new Date(value)); this.$emit("update:modelValue", value ? new Date(value) : null);
}, },
}, },
}, },
@@ -37,11 +37,13 @@ export default {
<style lang="sass" scoped> <style lang="sass" scoped>
.field .field
display: flex
align-items: center align-items: center
border: 1.5px solid var(--border-light-grey-color) border: 1.5px solid var(--border-light-grey-color)
border-radius: 4px border-radius: 4px
padding: 8px 16px padding: 8px 16px
input input
width: 100%
cursor: text cursor: text
border: none border: none
outline: none outline: none

View File

@@ -202,10 +202,8 @@ export default {
], ],
start: `${this.currentDate.format( start: `${this.currentDate.format(
"YYYY-MM-DD" "YYYY-MM-DD"
)}T${hours}:${minuts}:00Z`, )}T${hours}:${minuts}:00`,
end: `${this.currentDate.format( end: `${this.currentDate.format("YYYY-MM-DD")}T${hours}:${minuts}:00`,
"YYYY-MM-DD"
)}T${hours}:${minuts}:00Z`,
}); });
}, },
}, },

View File

@@ -207,7 +207,7 @@ export default {
}, },
methods: { methods: {
trimTime(time) { trimTime(time) {
return time.slice(11, -4); return time.slice(11, 16);
}, },
composeFullName(object) { composeFullName(object) {
return `${object.last_name} ${object.first_name ?? ""} ${ return `${object.last_name} ${object.first_name ?? ""} ${

View File

@@ -137,7 +137,7 @@ export default {
if (!this.disabled) this.$emit("close-description-card"); if (!this.disabled) this.$emit("close-description-card");
}, },
trimTime(time) { trimTime(time) {
return time.slice(11, -4); return time.slice(11, 16);
}, },
composeFullName(object) { composeFullName(object) {
return `${object.last_name} ${object.first_name ?? ""} ${ return `${object.last_name} ${object.first_name ?? ""} ${

View File

@@ -40,7 +40,7 @@
.flex.gap-x-2 .flex.gap-x-2
.flex.flex-col(class="gap-y-1.5") .flex.flex-col(class="gap-y-1.5")
span.text-xxs.opacity-40.font-bold.leading-3.font-bold Дата span.text-xxs.opacity-40.font-bold.leading-3.font-bold Дата
base-input-date.select(v-model:value="eventDate") base-input-date.h-10(v-model="eventDate")
.flex.gap-x-2.items-center .flex.gap-x-2.items-center
.flex.flex-col(class="gap-y-1.5") .flex.flex-col(class="gap-y-1.5")
span.text-xxs.opacity-40.font-bold.leading-3.font-bold Начало span.text-xxs.opacity-40.font-bold.leading-3.font-bold Начало
@@ -130,7 +130,7 @@ export default {
endTime: "", endTime: "",
members: {}, members: {},
employees: {}, employees: {},
eventDate: "", eventDate: Date,
status: {}, status: {},
id: null, id: null,
ifClearedForm: true, ifClearedForm: true,
@@ -188,13 +188,14 @@ export default {
return true; return true;
}, },
disabledUpdateButton() { disabledUpdateButton() {
let start = moment.parseZone(this.selectedEventData.start); let start = moment(this.selectedEventData.start);
let end = moment.parseZone(this.selectedEventData.end); let end = moment(this.selectedEventData.end);
if ( if (
this.eventDate === start.format("YYYY-MM-DD") && moment(this.eventDate).format("YYYY-MM-DD") ===
start.format("YYYY-MM-DD") &&
this.startTime === start.format("HH:mm") && this.startTime === start.format("HH:mm") &&
this.endTime === end.format("HH:mm") && this.endTime === end.format("HH:mm") &&
this.status.label === this.selectedEventData.status && this.findStatus(this.status.label) === this.selectedEventData.status &&
this.employees.employee.id === this.employees.employee.id ===
this.personId(this.selectedEventData.employees, "employee") && this.personId(this.selectedEventData.employees, "employee") &&
this.members.person.id === this.members.person.id ===
@@ -202,17 +203,18 @@ export default {
) { ) {
return true; return true;
} }
if (!this.eventDate) return true;
return false; return false;
}, },
startDate() { startDate() {
return this.selectedEventData.start return this.selectedEventData.start
? moment.parseZone(this.selectedEventData.start) ? new Date(this.selectedEventData.start)
: this.currentDate; : this.currentDate.toDate();
}, },
endDate() { endDate() {
return this.selectedEventData.end return this.selectedEventData.end
? moment.parseZone(this.selectedEventData.end) ? new Date(this.selectedEventData.end)
: this.currentDate; : this.currentDate.toDate();
}, },
eventEmployee() { eventEmployee() {
if (this.selectedEventData.employees) { if (this.selectedEventData.employees) {
@@ -312,7 +314,8 @@ export default {
if (foundedEmployee) if (foundedEmployee)
foundedSchedule = foundedEmployee.schedules.find( foundedSchedule = foundedEmployee.schedules.find(
(elem) => (elem) =>
elem.date === this.eventDate && elem.status === this.WORKING_STATUS elem.date === moment(this.eventDate).format("YYYY-MM-DD") &&
elem.status === this.WORKING_STATUS
); );
if (!foundedSchedule) { if (!foundedSchedule) {
this.addErrorNotification( this.addErrorNotification(
@@ -417,7 +420,10 @@ export default {
this.closeForm(); this.closeForm();
}, },
mergeDate(eventDate, time) { mergeDate(eventDate, time) {
return moment(`${eventDate} ${time}`).format("YYYY-MM-DDTHH:mm:ss"); let parseTime = time.split(":");
return moment(eventDate.setHours(parseTime[0], parseTime[1]), 0).format(
"YYYY-MM-DDTHH:mm:ss"
);
}, },
findPerson(requestedList, object, field) { findPerson(requestedList, object, field) {
let foundPerson = requestedList.find(({ id }) => id === object[field].id); let foundPerson = requestedList.find(({ id }) => id === object[field].id);
@@ -490,7 +496,7 @@ export default {
}, },
fetchMembersData() { fetchMembersData() {
fetchWrapper fetchWrapper
.get("general/person/?limit=100") .get("general/person/?limit=200")
.then((res) => this.saveMembersData(res)); .then((res) => this.saveMembersData(res));
}, },
fetchOwnersData() { fetchOwnersData() {
@@ -557,8 +563,8 @@ export default {
immediate: true, immediate: true,
handler(newDate) { handler(newDate) {
if (newDate) { if (newDate) {
this.eventDate = newDate.format("YYYY-MM-DD"); this.eventDate = newDate;
this.startTime = newDate.format("HH:mm"); this.startTime = moment(newDate).format("HH:mm");
} }
}, },
}, },
@@ -566,7 +572,7 @@ export default {
immediate: true, immediate: true,
handler(newDate) { handler(newDate) {
if (newDate) { if (newDate) {
this.endTime = newDate.format("HH:mm"); this.endTime = moment(newDate).format("HH:mm");
} }
}, },
}, },

View File

@@ -250,7 +250,7 @@ export default {
pdf: pdfIcon, pdf: pdfIcon,
xls: exelIcon, xls: exelIcon,
}, },
isOpenPackage: false, isOpenPackage: true,
isOpenAddDoc: false, isOpenAddDoc: false,
showModal: false, showModal: false,
}; };

View File

@@ -8,7 +8,7 @@
.button.keep-redaction.flex.gap-x-3 .button.keep-redaction.flex.gap-x-3
.icon-star-off.icon .icon-star-off.icon
span На ведение span На ведение
.button.keep-redaction.flex.gap-x-3(@click="createMedicalCard") .button.keep-redaction.flex.gap-x-3(@click="createMedicalCard(clientId)")
.icon-star-off.icon .icon-star-off.icon
span Мед. карта span Мед. карта
.button.delete.flex.gap-x-3( .button.delete.flex.gap-x-3(
@@ -29,6 +29,7 @@ export default {
openChangeData: Function, openChangeData: Function,
disabledDelete: Boolean, disabledDelete: Boolean,
createMedicalCard: Function, createMedicalCard: Function,
clientId: String,
}, },
methods: { methods: {
transmitDeleteClient() { transmitDeleteClient() {

View File

@@ -17,7 +17,7 @@
) )
.flex.flex-col.h-full.table-container.w-full.mt-8.mb-3 .flex.flex-col.h-full.table-container.w-full.mt-8.mb-3
base-modal(v-model="showMedicalCard") base-modal(v-model="showMedicalCard")
form-create-medical-card form-create-medical-card(:selected-client-id="selectedClientId")
clients-table-header(:check="selectedCheck" :is-check="selectAll") clients-table-header(:check="selectedCheck" :is-check="selectAll")
.flex.flex-col .flex.flex-col
clients-table-row( clients-table-row(
@@ -133,6 +133,7 @@ export default {
clearingTextSearch: false, clearingTextSearch: false,
showMedicalCard: false, showMedicalCard: false,
createdClientName: "", createdClientName: "",
selectedClientId: "",
}; };
}, },
computed: { computed: {
@@ -262,7 +263,8 @@ export default {
this.titleModal = "Создать мед.карту"; this.titleModal = "Создать мед.карту";
this.openModal(); this.openModal();
}, },
createMedicalCard() { createMedicalCard(id) {
this.selectedClientId = id;
this.showMedicalCard = true; this.showMedicalCard = true;
this.closeModal(); this.closeModal();
}, },

View File

@@ -21,6 +21,7 @@
clients-action-popup( clients-action-popup(
v-if="isOpenPopup", v-if="isOpenPopup",
:open-change-data="openChangeData", :open-change-data="openChangeData",
:client-id="client.id",
:disabled-delete="!!deletedClientId && !rowOverlay", :disabled-delete="!!deletedClientId && !rowOverlay",
@delete-client="transmitDeleteClient", @delete-client="transmitDeleteClient",
:create-medical-card="createMedicalCard" :create-medical-card="createMedicalCard"

View File

@@ -10,9 +10,8 @@
) )
.flex.flex-col(class="gap-y-1.5") .flex.flex-col(class="gap-y-1.5")
span.text-sm Дата рождения span.text-sm Дата рождения
base-input-date.input-date( base-input-date.input-info(
v-model:value="basicInfo.birth_date", v-model="basicInfo.birth_date",
:width-input="277"
) )
.flex.flex-col(class="gap-y-1.5") .flex.flex-col(class="gap-y-1.5")
span.text-sm Номер телефона span.text-sm Номер телефона
@@ -101,6 +100,7 @@ export default {
background-color: var(--btn-blue-color) background-color: var(--btn-blue-color)
.input-info .input-info
color: var(--font-dark-blue-color) color: var(--font-dark-blue-color)
height: 40px
.obligatory .obligatory
color: var(--font-obligatory-color) color: var(--font-obligatory-color)
.add-network .add-network
@@ -111,6 +111,4 @@ export default {
height: 100% height: 100%
border: 2px solid var(--border-light-grey-color) border: 2px solid var(--border-light-grey-color)
border-radius: 4px border-radius: 4px
.input-date
border: 1.5px solid var(--border-light-grey-color)
</style> </style>

View File

@@ -28,8 +28,8 @@
) )
.flex.flex-col(class="gap-y-1.5") .flex.flex-col(class="gap-y-1.5")
span.text-sm Дата выдачи span.text-sm Дата выдачи
base-input-date.input-date( base-input-date.input-info.h-10(
v-model:value="identityDocument.pass.issued_by_date", v-model="identityDocument.pass.issued_by_date",
placeholder="Дата", placeholder="Дата",
:width-input="277" :width-input="277"
) )

View File

@@ -51,6 +51,9 @@ export default {
MedicalPolicyDocuments, MedicalPolicyDocuments,
BaseStepper, BaseStepper,
}, },
props: {
selectedClientId: String,
},
data() { data() {
return { return {
isBaseData: true, isBaseData: true,