[WIP] Добавил возможность удаления note, фикс стилей
This commit is contained in:
@@ -126,13 +126,26 @@
|
||||
.flex.flex-col.gap-y-4(v-if="section === 'addresses' && isChange")
|
||||
client-detail-section-address(:dope-address="dopeAddress")
|
||||
.flex.flex-col.gap-y-2(v-if="section === 'additional' && isChange")
|
||||
//- .title-section.text-xxs.font-semibold {{item.title}}
|
||||
client-detail-input.text-sm.w-max-fit(
|
||||
.flex.justify-between
|
||||
.title-section.text-xxs.font-semibold Заголовок
|
||||
.icon-cancel.cancel.cursor-pointer.pr-3.text-xsm(
|
||||
v-if="isChange",
|
||||
:id="item.id",
|
||||
@click="deleteNote(item.id)"
|
||||
)
|
||||
client-detail-input.text-sm.w-max-fit.pr-12.relative(
|
||||
:maxLength="40",
|
||||
:style="{fontWeight:key === 'numba'&&600}",
|
||||
v-model:value="sectionInfo[key].title",
|
||||
placeholder="Заголовок"
|
||||
)
|
||||
.text.flex.absolute.text-xsx.top-18px(
|
||||
class="right-2.5",
|
||||
:style="{color: 'var(--font-grey-color)'}"
|
||||
) {{`${sectionInfo[key].title.length}/40`}}
|
||||
.title-section.text-xxs.font-semibold Описание
|
||||
client-detail-input.text-sm.w-max-fit(
|
||||
:maxLength="40",
|
||||
:style="{fontWeight:key === 'numba'&&600}",
|
||||
v-model:value="sectionInfo[key].description",
|
||||
placeholder="Описание"
|
||||
@@ -193,6 +206,7 @@ export default {
|
||||
sectionInfo: Object,
|
||||
section: String,
|
||||
deleteDoc: Function,
|
||||
deleteNote: Function,
|
||||
updateDocument: Function,
|
||||
updateAddress: Function,
|
||||
updateNotes: Function,
|
||||
|
||||
@@ -32,7 +32,8 @@
|
||||
:section-info="dataNotes",
|
||||
:lack-notes="lackNotes",
|
||||
:create-note="createNote",
|
||||
:update-notes="updateNotes"
|
||||
:update-notes="updateNotes",
|
||||
:delete-note="deleteNote"
|
||||
)
|
||||
</template>
|
||||
|
||||
@@ -47,6 +48,7 @@ export default {
|
||||
dataNotes: Array,
|
||||
saveNewDoc: Function,
|
||||
deleteDoc: Function,
|
||||
deleteNote: Function,
|
||||
dataDocument: Object,
|
||||
updateDocument: Function,
|
||||
updateAddress: Function,
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
:cols="24",
|
||||
@input="$emit('update:value', $event.target.value)",
|
||||
:placeholder="placeholder",
|
||||
:maxLength="maxLength"
|
||||
)
|
||||
input.w-full.outline-0.not-italic.font-medium(
|
||||
v-else,
|
||||
@@ -30,6 +31,7 @@ export default {
|
||||
default: "Поиск",
|
||||
},
|
||||
rows: Number,
|
||||
maxLength: Number,
|
||||
},
|
||||
directives: { mask },
|
||||
computed: {
|
||||
|
||||
@@ -95,14 +95,15 @@
|
||||
:data-notes="dataNotes"
|
||||
:save-new-doc="saveNewDoc",
|
||||
:delete-doc="deleteDoc",
|
||||
:delete-note="postDeleteNote"
|
||||
:update-document="postUpdateIdentityDocument",
|
||||
:update-address="postUpdateAddress",
|
||||
:update-notes="postUpdateNotes",
|
||||
:lack-data="lackData",
|
||||
:lack-address="lackAddress",
|
||||
:dope-address="dopeAddress",
|
||||
:lack-attachments="lackAttachments",
|
||||
:lack-notes="lackNotes"
|
||||
:lack-notes="lackNotes",
|
||||
:dope-address="dopeAddress",
|
||||
:create-address="postCreateAddress",
|
||||
:create-document="postCreateIdentityDocument",
|
||||
:create-note="postCreateNote",
|
||||
@@ -433,15 +434,14 @@ export default {
|
||||
this.lackAttachments = this.dataAttachments[0]?.id ? true : false;
|
||||
},
|
||||
saveNote(data) {
|
||||
if (data?.note[0]) {
|
||||
this.dataNotes = [...data.note];
|
||||
this.dataNotes = data?.note.filter((e) => !e.deleted_flg);
|
||||
if (this.dataNotes[0]) {
|
||||
this.lackNotes = true;
|
||||
} else {
|
||||
this.lackNotes = false;
|
||||
this.dataNotes = [{ title: "", description: "" }];
|
||||
}
|
||||
},
|
||||
|
||||
saveIdentityDocument(data) {
|
||||
if (data?.id) {
|
||||
this.docId = data.id;
|
||||
@@ -659,6 +659,11 @@ export default {
|
||||
.then(() => this.fetchClientDetail(this.id));
|
||||
});
|
||||
},
|
||||
postDeleteNote(noteId) {
|
||||
fetchWrapper
|
||||
.del(`general/note/${noteId}/delete/`)
|
||||
.then(() => this.fetchClientDetail(this.id));
|
||||
},
|
||||
},
|
||||
|
||||
watch: {
|
||||
|
||||
@@ -34,4 +34,5 @@ export default {
|
||||
.wrapper
|
||||
overflow: auto
|
||||
border-top-left-radius: 4px
|
||||
border-top-right-radius: 4px
|
||||
</style>
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
<script>
|
||||
import BaseButton from "@/components/base/BaseButton";
|
||||
import BaseInput from "@/components/base/BaseInput";
|
||||
|
||||
export default {
|
||||
name: "TableCreateNote",
|
||||
components: { BaseButton, BaseInput },
|
||||
@@ -25,7 +26,6 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
username: "",
|
||||
title: "",
|
||||
description: "",
|
||||
};
|
||||
|
||||
@@ -11,6 +11,7 @@ export default { name: "MedicalCardWrapper" };
|
||||
.wrapper
|
||||
overflow: auto
|
||||
border-top-left-radius: 4px
|
||||
border-top-right-radius: 4px
|
||||
.wrapper-medical
|
||||
background-color: var(--default-white)
|
||||
height: calc(100vh - 64px)
|
||||
|
||||
Reference in New Issue
Block a user