Merge branch 'ASTRA-81' into 'master'
[WIP] Добавил текст формы Данных обследования See merge request andrusyakka/urban-couscous!383
This commit is contained in:
@@ -13,18 +13,19 @@
|
||||
q-checkbox.text-smm.font-medium(v-model="data.results.checked" label="Без особенностей" size="36px")
|
||||
.textarea.flex.w-full
|
||||
base-input.w-full(
|
||||
v-model="data.results.text",
|
||||
v-model="modelValue",
|
||||
type="textarea",
|
||||
outlined,
|
||||
resize="vertical",
|
||||
placeholder="Введите данные..."
|
||||
)
|
||||
.font-medium.text-smm(v-else) {{data.results?.text}}
|
||||
.font-medium.text-smm(v-else) {{displayedValue}}
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import MedicalFormWrapper from "@/pages/newMedicalCard/components/MedicalFormWrapper.vue";
|
||||
import BaseInput from "@/components/base/BaseInput.vue";
|
||||
import { mapState } from "vuex";
|
||||
|
||||
export default {
|
||||
name: "DiseaseForm",
|
||||
@@ -34,7 +35,29 @@ export default {
|
||||
fillInspection: Boolean,
|
||||
},
|
||||
data() {
|
||||
return { change: false };
|
||||
return { change: false, modelValue: null };
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
protocolData: (state) => state.medical.protocolData,
|
||||
}),
|
||||
state() {
|
||||
return this.protocolData[this.data.state];
|
||||
},
|
||||
findedListItem() {
|
||||
if (this.data.results?.text && this.modelValue)
|
||||
return this.data.results?.text === this.modelValue;
|
||||
return null;
|
||||
},
|
||||
reference() {
|
||||
if (this.findedListItem && this.findedListItem?.text)
|
||||
return this.findedListItem?.text;
|
||||
return this.data.results?.text;
|
||||
},
|
||||
displayedValue() {
|
||||
if (this.findedListItem?.text) return this.findedListItem?.text;
|
||||
return this.modelValue;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
openCard() {
|
||||
@@ -45,10 +68,22 @@ export default {
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
state: {
|
||||
immediate: true,
|
||||
handler(value) {
|
||||
if (!this.fillInspection) this.modelValue = value;
|
||||
},
|
||||
},
|
||||
fillInspection: {
|
||||
immediate: true,
|
||||
handler(newVal) {
|
||||
if (newVal) this.change = false;
|
||||
if (newVal) {
|
||||
this.change = true;
|
||||
this.modelValue = null;
|
||||
} else {
|
||||
this.change = false;
|
||||
this.modelValue = this.state;
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user