Добавил пациента в store

This commit is contained in:
dderbentsov
2022-12-24 17:12:55 +03:00
parent 1d8eb0a294
commit 7c44bab78e
3 changed files with 23 additions and 7 deletions

View File

@@ -552,6 +552,9 @@ export default {
this.isOpenPopup = !this.isOpenPopup;
},
openDetailInfo(e) {
if (!this.isOpenDetailInfo)
this.$store.state.currentPatient = this.client;
else this.$store.state.currentPatient = {};
this.isOpenDetailInfo = !this.isOpenDetailInfo;
this.isOpenDetailInfo && this.fetchClientDetail(e.currentTarget.id);
},

View File

@@ -1,7 +1,7 @@
<template lang="pug">
.wrap.flex.flex-col.gap-y-6
.flex.flex.flex-col.gap-y-9
span.font-bold.text-xl Создание пакета документов
span.font-bold.text-xl Договор
.flex.justify-center.items-center.gap-x-2
base-button.button(:size="32", :rounded="true")
span(v-if="!isServices") 1
@@ -12,11 +12,11 @@
span(:style="{color: isServices ? 'var(--btn-blue-color)' : 'var(--font-dark-blue-color)' }") Услуги
.base.flex.flex-col.gap-y-6(v-if="!isServices")
.flex.flex-col.gap-y-6
span.font-bold Основное
span.font-bold Пациент
.flex.flex-col(class="gap-y-1.5")
.counter.font-semibold.text-smm Название пакета
.counter.font-semibold.text-smm ФИО
base-input(
v-model:value="packageDocs.packageName",
v-model:value="patient",
placeholder="Введите название для пакета документов"
)
span.counter
@@ -92,8 +92,14 @@ export default {
return {
isServices: false,
packageDocs: {
packageName: "",
packageName: this.$store.state.currentPatient?.last_name,
},
patient:
this.$store.state.currentPatient?.last_name +
" " +
this.$store.state.currentPatient?.first_name +
" " +
this.$store.state.currentPatient?.patronymic,
isAllServices: false,
userIds: [],
services: [

View File

@@ -1,8 +1,15 @@
import { createStore } from "vuex";
export default createStore({
state: {},
mutations: {},
state: {
currentPatient: {},
test: "Привет",
},
mutations: {
setCurrentPatient(state, patient) {
state.currentPatient = patient;
},
},
actions: {},
modules: {},
});