[WIP] Добавил модальное окно создания тэга на форму данных обследования, фикс компонента

This commit is contained in:
megavrilinvv
2023-06-29 17:13:42 +03:00
parent f61c405f0f
commit e6015ba458
3 changed files with 67 additions and 57 deletions

View File

@@ -61,8 +61,9 @@
)
.name.flex.items-center.font-medium.text-smm {{ name }}
.flex.h-10.w-10.absolute.right-4.bottom-4
q-btn(color="primary", dense, padding="4px 12px")
q-btn(@click="showModal = true", color="primary", dense, padding="4px 12px")
q-icon(name="app:icon-plus", size="17px")
tag-creation-form(:show-modal="showModal", :close-modal="closeModal", :create-tag="createTag")
.flex.gap-x-20.w-full(v-if="change || fillInspection")
.flex.flex-col.gap-y-3.w-full(v-for="file in protocolData[data.state].files")
.title.text-smm.font-semibold {{file.name}}
@@ -97,13 +98,14 @@
<script>
import MedicalFormWrapper from "@/pages/newMedicalCard/components/MedicalFormWrapper.vue";
import TagCreationForm from "@/pages/newMedicalCard/components/InitialInspectionProtocol/Forms/TagCreationForm.vue";
import BaseButton from "@/components/base/BaseButton.vue";
import BaseInput from "@/components/base/BaseInput.vue";
import { mapState } from "vuex";
export default {
name: "DataForm",
components: { MedicalFormWrapper, BaseButton, BaseInput },
components: { MedicalFormWrapper, BaseButton, BaseInput, TagCreationForm },
props: {
abc: Array,
data: Object,
@@ -113,6 +115,7 @@ export default {
data() {
return {
change: false,
showModal: false,
};
},
computed: {
@@ -183,6 +186,13 @@ export default {
reader.readAsDataURL(file);
});
},
closeModal() {
this.showModal = false;
},
createTag(model) {
this.showModal = false;
this.protocolData[this.data.state].complaints.push(model.tag);
},
},
watch: {
fillInspection: {

View File

@@ -50,8 +50,7 @@
.flex.h-10.w-10.absolute.right-4.bottom-4
q-btn(@click="showModal = true", color="primary", dense, padding="4px 12px")
q-icon(name="app:icon-plus", size="17px")
base-modal(v-model="showModal", title="Создание тега", modal-padding)
tag-creation-form(:close-modal="closeModal", :create-tag="createTag")
tag-creation-form(:show-modal="showModal", :close-modal="closeModal", :create-tag="createTag")
.flex(v-if="data.title === 'Осмотр полости рта' && (fillInspection || change)", :style="{color: 'var(--btn-blue-color)'}")
q-btn(no-caps, flat padding="2px 4px")
q-icon(left, name="app:plus", size="11px")
@@ -64,7 +63,6 @@ import BaseInput from "@/components/base/BaseInput.vue";
import MedicalFormWrapper from "@/pages/newMedicalCard/components/MedicalFormWrapper.vue";
import TagCreationForm from "@/pages/newMedicalCard/components/InitialInspectionProtocol/Forms/TagCreationForm.vue";
import { mapState } from "vuex";
import BaseModal from "@/components/base/BaseModal.vue";
export default {
name: "MedicalFormTag",
@@ -73,7 +71,6 @@ export default {
BaseInput,
MedicalFormWrapper,
TagCreationForm,
BaseModal,
},
props: { data: Object, abc: Array, fillInspection: Boolean },
data() {

View File

@@ -1,4 +1,5 @@
<template lang="pug">
base-modal(v-model="showModal", title="Создание тега", modal-padding)
.flex.flex-col
.flex.flex-col.justify-between.py-6(:style="{height: '194px'}")
.flex.flex-col(class="gap-y-1.5")
@@ -54,13 +55,15 @@
<script>
import BaseInput from "@/components/base/BaseInput.vue";
import BaseModal from "@/components/base/BaseModal.vue";
export default {
name: "TagCreationForm",
components: { BaseInput },
components: { BaseInput, BaseModal },
props: {
closeModal: Function,
createTag: Function,
showModal: Boolean,
},
data() {
return {