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: {
basic: {
full_name: "",
birth_date: "",
birth_date: null,
priority: {
id: null,
label: "",
@@ -147,7 +147,7 @@ export default {
pass: {
series_number: "",
issued_by_org: "",
issued_by_date: "",
issued_by_date: null,
issued_by_org_code: "",
},
snils: {
@@ -270,9 +270,13 @@ export default {
);
} else
fetchWrapper.post("general/identity_document/create/", {
...this.filterDataEmptyProperty(
this.infoClient.identity_document.pass
),
series_number: this.infoClient.identity_document.pass.series_number,
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,
kind: "Паспорт",
});
@@ -313,7 +317,10 @@ export default {
formData.append("photo", e);
});
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(
(el) => el.priority === this.infoClient.basic.priority.id
);

View File

@@ -28,7 +28,7 @@ export default {
return this.modelValue?.toISOString().split("T")[0];
},
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>
.field
display: flex
align-items: center
border: 1.5px solid var(--border-light-grey-color)
border-radius: 4px
padding: 8px 16px
input
width: 100%
cursor: text
border: none
outline: none

View File

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

View File

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

View File

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

View File

@@ -40,7 +40,7 @@
.flex.gap-x-2
.flex.flex-col(class="gap-y-1.5")
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.flex-col(class="gap-y-1.5")
span.text-xxs.opacity-40.font-bold.leading-3.font-bold Начало
@@ -130,7 +130,7 @@ export default {
endTime: "",
members: {},
employees: {},
eventDate: "",
eventDate: Date,
status: {},
id: null,
ifClearedForm: true,
@@ -188,13 +188,14 @@ export default {
return true;
},
disabledUpdateButton() {
let start = moment.parseZone(this.selectedEventData.start);
let end = moment.parseZone(this.selectedEventData.end);
let start = moment(this.selectedEventData.start);
let end = moment(this.selectedEventData.end);
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.endTime === end.format("HH:mm") &&
this.status.label === this.selectedEventData.status &&
this.findStatus(this.status.label) === this.selectedEventData.status &&
this.employees.employee.id ===
this.personId(this.selectedEventData.employees, "employee") &&
this.members.person.id ===
@@ -202,17 +203,18 @@ export default {
) {
return true;
}
if (!this.eventDate) return true;
return false;
},
startDate() {
return this.selectedEventData.start
? moment.parseZone(this.selectedEventData.start)
: this.currentDate;
? new Date(this.selectedEventData.start)
: this.currentDate.toDate();
},
endDate() {
return this.selectedEventData.end
? moment.parseZone(this.selectedEventData.end)
: this.currentDate;
? new Date(this.selectedEventData.end)
: this.currentDate.toDate();
},
eventEmployee() {
if (this.selectedEventData.employees) {
@@ -312,7 +314,8 @@ export default {
if (foundedEmployee)
foundedSchedule = foundedEmployee.schedules.find(
(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) {
this.addErrorNotification(
@@ -417,7 +420,10 @@ export default {
this.closeForm();
},
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) {
let foundPerson = requestedList.find(({ id }) => id === object[field].id);
@@ -490,7 +496,7 @@ export default {
},
fetchMembersData() {
fetchWrapper
.get("general/person/?limit=100")
.get("general/person/?limit=200")
.then((res) => this.saveMembersData(res));
},
fetchOwnersData() {
@@ -557,8 +563,8 @@ export default {
immediate: true,
handler(newDate) {
if (newDate) {
this.eventDate = newDate.format("YYYY-MM-DD");
this.startTime = newDate.format("HH:mm");
this.eventDate = newDate;
this.startTime = moment(newDate).format("HH:mm");
}
},
},
@@ -566,7 +572,7 @@ export default {
immediate: true,
handler(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,
xls: exelIcon,
},
isOpenPackage: false,
isOpenPackage: true,
isOpenAddDoc: false,
showModal: false,
};

View File

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

View File

@@ -17,7 +17,7 @@
)
.flex.flex-col.h-full.table-container.w-full.mt-8.mb-3
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")
.flex.flex-col
clients-table-row(
@@ -133,6 +133,7 @@ export default {
clearingTextSearch: false,
showMedicalCard: false,
createdClientName: "",
selectedClientId: "",
};
},
computed: {
@@ -262,7 +263,8 @@ export default {
this.titleModal = "Создать мед.карту";
this.openModal();
},
createMedicalCard() {
createMedicalCard(id) {
this.selectedClientId = id;
this.showMedicalCard = true;
this.closeModal();
},

View File

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

View File

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

View File

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

View File

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