Compare commits
1 Commits
create_cli
...
10-editing
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3ccfe8fccd |
@@ -2,16 +2,3 @@ include:
|
||||
- project: 'astra/microservice-ci'
|
||||
ref: main
|
||||
file: '/templates/microservice.yaml'
|
||||
|
||||
#e2e-dev:
|
||||
# image: node:18.10.0
|
||||
# stage: deploy
|
||||
# dependencies:
|
||||
# - deploy-dev
|
||||
# only:
|
||||
# - master
|
||||
# services:
|
||||
# - selenium/standalone-chrome
|
||||
# script:
|
||||
# - npm ci
|
||||
# - npm run test:e2e --host=selenium__standalone-chrome --baseUrl=https://astra-dev.dopcore.com
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM docker.io/node:16-alpine AS builder
|
||||
FROM node:16-alpine AS builder
|
||||
|
||||
WORKDIR /front
|
||||
|
||||
@@ -7,7 +7,7 @@ COPY . .
|
||||
RUN npm ci
|
||||
RUN npm run build
|
||||
|
||||
FROM docker.io/nginx:1.21.6-alpine as runner
|
||||
FROM nginx:1.21.6-alpine as runner
|
||||
|
||||
COPY ./deploy/nginx.conf /etc/nginx/nginx.conf
|
||||
COPY --from=builder /front/dist /var/www/html
|
||||
|
||||
@@ -2,6 +2,7 @@ apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ .Values.app.fullName }}
|
||||
namespace: default
|
||||
spec:
|
||||
ports:
|
||||
- port: {{ .Values.app.server.port }}
|
||||
|
||||
8842
package-lock.json
generated
8842
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -5,8 +5,7 @@
|
||||
"scripts": {
|
||||
"serve": "vue-cli-service serve",
|
||||
"build": "vue-cli-service build",
|
||||
"lint": "vue-cli-service lint",
|
||||
"test:e2e": "wdio run ./wdio.conf.js"
|
||||
"lint": "vue-cli-service lint"
|
||||
},
|
||||
"dependencies": {
|
||||
"@dop/astra-ui": "^0.2.5",
|
||||
@@ -25,10 +24,6 @@
|
||||
"@vue/cli-plugin-eslint": "~5.0.0",
|
||||
"@vue/cli-plugin-vuex": "^5.0.8",
|
||||
"@vue/cli-service": "~5.0.0",
|
||||
"@wdio/cli": "^8.16.3",
|
||||
"@wdio/jasmine-framework": "^8.16.3",
|
||||
"@wdio/local-runner": "^8.16.3",
|
||||
"@wdio/spec-reporter": "^8.16.3",
|
||||
"@webdiscus/pug-loader": "^2.9.4",
|
||||
"eslint": "^8.25.0",
|
||||
"eslint-config-prettier": "^8.3.0",
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
import TheHeader from "@/components/TheHeader";
|
||||
import TheSidebar from "@/components/TheSidebar";
|
||||
import TheNotificationProvider from "@/components/Notifications/TheNotificationProvider";
|
||||
import { mapState } from "vuex";
|
||||
|
||||
export default {
|
||||
name: "LoggedInLayout",
|
||||
components: { TheNotificationProvider, TheHeader, TheSidebar },
|
||||
@@ -33,14 +33,10 @@ export default {
|
||||
return {
|
||||
isOpenForm: false,
|
||||
updatedClients: false,
|
||||
url: "https://astra-dev.dopcore.com/api/store/",
|
||||
createdClientId: "",
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
url: (state) => state.imgUrl,
|
||||
}),
|
||||
},
|
||||
methods: {
|
||||
openForm() {
|
||||
this.isOpenForm = true;
|
||||
|
||||
@@ -1,183 +0,0 @@
|
||||
<template lang="pug">
|
||||
.flex.flex-col.pt-6.gap-y-4(:style="{maxWidth: '682px'}")
|
||||
base-input-full-name(v-model="patientData" )
|
||||
.flex.flex-col.flex-auto.l.gap-y-8
|
||||
.flex
|
||||
button.title-info.px-6.py-2.cursor-pointer.w-full.text-sm(
|
||||
v-for="form in forms",
|
||||
@click="selectForm(form.component)",
|
||||
:class="{active: form.component === currentForm}",
|
||||
:key="form.id",
|
||||
:id="form.id",
|
||||
:disabled="form.disabled"
|
||||
) {{form.title}}
|
||||
component(
|
||||
v-bind:is="currentForm",
|
||||
v-model="patientData"
|
||||
)
|
||||
.footer.flex.gap-2
|
||||
base-button(type="secondary", label="Отменить", width="126px", @click="$emit('close')")
|
||||
base-button(width="168px", label="Создать", @click="createPatient")
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { v_model } from "@/shared/mixins/v-model";
|
||||
import FormCreateBasicInfo from "@/pages/clients/components/FormCreateBasicInfo.vue";
|
||||
import FormCreateIdentityDocuments from "@/pages/clients/components/FormCreateIdentityDocuments.vue";
|
||||
import FormCreateAddresses from "@/pages/clients/components/FormCreateAddresses.vue";
|
||||
import FormCreateAttachments from "@/pages/clients/components/FormCreateAttachments.vue";
|
||||
import BaseInputFullName from "@/components/base/BaseInputFullName.vue";
|
||||
import HeaderRecordForm from "../pages/newCalendar/components/HeaderRecordForm.vue";
|
||||
import BaseCalendar from "@/components/base/Calendar/BaseCalendar.vue";
|
||||
import BaseButton from "@/components/base/BaseButton.vue";
|
||||
import BaseModal from "@/components/base/BaseModal.vue";
|
||||
import ServicesModal from "../pages/newCalendar/components/ServicesModal.vue";
|
||||
import { fetchWrapper } from "@/shared/fetchWrapper";
|
||||
|
||||
const forms = [
|
||||
{
|
||||
title: "Основное",
|
||||
id: "basic",
|
||||
component: "form-create-basic-info",
|
||||
},
|
||||
{
|
||||
title: "ДУЛ",
|
||||
id: "doc",
|
||||
component: "form-create-identity-documents",
|
||||
disabled: true,
|
||||
},
|
||||
{
|
||||
title: "Адрес",
|
||||
id: "address",
|
||||
component: "form-create-addresses",
|
||||
disabled: true,
|
||||
},
|
||||
{
|
||||
title: "Дополнительное",
|
||||
id: "additional",
|
||||
component: "form-create-attachments",
|
||||
disabled: true,
|
||||
},
|
||||
];
|
||||
|
||||
export default {
|
||||
name: "PatientCreationForm",
|
||||
components: {
|
||||
FormCreateBasicInfo,
|
||||
FormCreateIdentityDocuments,
|
||||
FormCreateAddresses,
|
||||
FormCreateAttachments,
|
||||
BaseInputFullName,
|
||||
BaseCalendar,
|
||||
HeaderRecordForm,
|
||||
BaseButton,
|
||||
BaseModal,
|
||||
ServicesModal,
|
||||
},
|
||||
emits: ["close"],
|
||||
mixins: [v_model],
|
||||
data() {
|
||||
return {
|
||||
patientData: {
|
||||
full_name: "",
|
||||
phone: "",
|
||||
birth_date: "",
|
||||
},
|
||||
currentForm: "form-create-basic-info",
|
||||
forms,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
nameObject() {
|
||||
const nameArr = this.patientData?.full_name?.split(" ");
|
||||
return {
|
||||
last_name: nameArr?.[0] || "",
|
||||
first_name: nameArr?.[1] || "",
|
||||
patronymic: nameArr?.[2] || "",
|
||||
};
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
async createPatient() {
|
||||
const body = {
|
||||
...this.nameObject,
|
||||
};
|
||||
if (this.patientData.phone) {
|
||||
body.contacts = [
|
||||
{
|
||||
category: "PHONE",
|
||||
value: this.patientData.phone,
|
||||
},
|
||||
];
|
||||
}
|
||||
if (this.patientData.birth_date)
|
||||
body.birth_date = this.patientData.birth_date;
|
||||
const data = await fetchWrapper.post("persons/", body);
|
||||
this.$emit("close", data);
|
||||
},
|
||||
handleChangePatientData(val) {
|
||||
this.patientData = { ...this.patientData, ...val };
|
||||
},
|
||||
selectForm(componentName) {
|
||||
this.currentForm = this.forms.find(
|
||||
(elem) => elem.component === componentName
|
||||
)?.component;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="sass" scoped>
|
||||
.dark-blue
|
||||
color: var(--font-dark-blue-color)
|
||||
min-width: 50px
|
||||
|
||||
.text
|
||||
color: var(--font-grey-color)
|
||||
width: 76px
|
||||
|
||||
.change
|
||||
background: var(--bg-light-grey)
|
||||
color: var(--font-grey-color)
|
||||
|
||||
.services
|
||||
background: var(--bg-light-grey)
|
||||
color: var(--font-grey-color)
|
||||
width: 560px
|
||||
|
||||
.service
|
||||
display: -webkit-box
|
||||
overflow: hidden
|
||||
|
||||
.gradient
|
||||
width: 10%
|
||||
height: 28px
|
||||
right: 0
|
||||
|
||||
.other
|
||||
width: 46px
|
||||
background: var(--bg-light-grey)
|
||||
|
||||
.price
|
||||
background: var(--bg-light-grey)
|
||||
width: 82px
|
||||
color: var(--font-grey-color)
|
||||
|
||||
.title-info
|
||||
color: var(--font-grey-color)
|
||||
border-bottom: 1.5px solid var(--font-grey-color)
|
||||
&:hover
|
||||
color: var(--btn-blue-color)
|
||||
border-bottom: 1.5px solid var(--btn-blue-color)
|
||||
&.active
|
||||
color: var(--btn-blue-color)
|
||||
border-bottom: 1.5px solid var(--btn-blue-color)
|
||||
|
||||
.footer
|
||||
border-top: 1px solid var(--border-light-grey-color)
|
||||
margin: 40px -32px 0px
|
||||
padding: 16px 32px 0px 32px
|
||||
|
||||
.icon :deep(path)
|
||||
fill: var(--font-grey-color)
|
||||
</style>
|
||||
@@ -70,9 +70,17 @@ export default {
|
||||
return this.pageSettings.find((el) => el.id === "settings");
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
let href = window.location.href.slice(22);
|
||||
this.pageSettings.forEach((el, index) => {
|
||||
el.path === href.substr(href.lastIndexOf("#"))
|
||||
? (this.pageSettings[index].active = true)
|
||||
: (this.pageSettings[index].active = false);
|
||||
});
|
||||
},
|
||||
watch: {
|
||||
"$route.path"(value) {
|
||||
if (value === "/calendar") {
|
||||
"$route.path"() {
|
||||
if (this.$router.currentRoute._value.fullPath === "/calendar") {
|
||||
this.currentPageBorder = true;
|
||||
this.pageSettings.forEach((el) =>
|
||||
el.path === "#/calendar" ? (el.active = true) : (el.active = false)
|
||||
@@ -80,13 +88,6 @@ export default {
|
||||
} else this.currentPageBorder = false;
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.pageSettings.forEach((el, index) => {
|
||||
el.path === "#" + this.$route.path
|
||||
? (this.pageSettings[index].active = true)
|
||||
: (this.pageSettings[index].active = false);
|
||||
});
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
iconLeft
|
||||
)
|
||||
template(v-slot:iconLeft)
|
||||
q-icon.icon(name="app:search", size="20px", style="color: var(--font-grey-color)")
|
||||
q-icon(name="app:icon-search", size="20px", style="color: var(--font-grey-color)")
|
||||
.field.flex.flex-col.overflow-y-scroll(:class="{'filed-category': findSelected(selected?.id)}")
|
||||
.flex.items-center(v-for="benefit in benefitData", :key="benefit.id")
|
||||
q-item(tag="label", :style="{alignItems: benefit.name.length > 28 ? 'start' : 'center'}")
|
||||
@@ -43,7 +43,7 @@
|
||||
@click="saveCategories(selected)"
|
||||
)
|
||||
.right-side.flex.px-10.font-bold.relative
|
||||
q-icon(name="app:cancel").text-sm.absolute.top-4.right-4.cursor-pointer(@click="closeModalCategories")
|
||||
q-icon(name="app:icon-cancel").text-sm.absolute.top-4.right-4.cursor-pointer(@click="closeModalCategories")
|
||||
.flex.gap-y-6.flex-col.w-full(v-if="selected?.id && selected?.name !== 'Без льготы'")
|
||||
.right-header.flex
|
||||
span.text-6xl {{selected?.name}}
|
||||
@@ -185,9 +185,6 @@ export default {
|
||||
.grey-color
|
||||
color: var(--font-grey-color)
|
||||
|
||||
.icon :deep(path)
|
||||
fill: var(--font-grey-color)
|
||||
|
||||
.q-item
|
||||
padding: 0
|
||||
min-height: 40px
|
||||
|
||||
@@ -55,7 +55,6 @@ export default {
|
||||
default: false,
|
||||
},
|
||||
type: {
|
||||
type: String,
|
||||
default: "text",
|
||||
},
|
||||
accept: {
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
:readonly="readonly",
|
||||
:disable="disabled",
|
||||
mask="##.##.####",
|
||||
:rules="[(val) => rule ? rule(val) : defaultRule(val)]",
|
||||
:rules="[checkInput]",
|
||||
:lazy-rules="lazyRule",
|
||||
:item-aligned="itemAligned",
|
||||
no-error-icon,
|
||||
@@ -60,8 +60,7 @@ export default {
|
||||
width: Number,
|
||||
lazyRule: [Boolean, String],
|
||||
itemAligned: Boolean,
|
||||
rule: Function,
|
||||
modelValue: String,
|
||||
modelValue: Date,
|
||||
placeholder: String,
|
||||
disabled: Boolean,
|
||||
label: String,
|
||||
@@ -80,15 +79,27 @@ export default {
|
||||
computed: {
|
||||
value: {
|
||||
get() {
|
||||
this.changeInternalDate(
|
||||
moment(this.checkFormat(this.modelValue)).isValid()
|
||||
? moment(this.modelValue)
|
||||
: null
|
||||
);
|
||||
return this.convertISOFormat(this.modelValue);
|
||||
if (
|
||||
moment(this.modelValue).isValid() &&
|
||||
typeof this.modelValue === "object"
|
||||
) {
|
||||
this.changeInternalDate(moment(this.modelValue));
|
||||
return moment(this.modelValue).format("DD.MM.YYYY");
|
||||
}
|
||||
if (moment(this.convertFormat(this.modelValue)).isValid()) {
|
||||
this.changeInternalDate(moment(this.modelValue));
|
||||
return this.modelValue;
|
||||
}
|
||||
this.changeInternalDate(null);
|
||||
return null;
|
||||
},
|
||||
set(value) {
|
||||
this.$emit("update:modelValue", this.convertRUFormat(value));
|
||||
this.$emit(
|
||||
"update:modelValue",
|
||||
moment(this.convertFormat(value)).isValid()
|
||||
? new Date(moment(this.convertFormat(value)))
|
||||
: null
|
||||
);
|
||||
},
|
||||
},
|
||||
sizeVariable() {
|
||||
@@ -137,22 +148,13 @@ export default {
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
convertISOFormat(date) {
|
||||
return date?.split("-")?.reverse()?.join(".");
|
||||
convertFormat(date) {
|
||||
return date && date?.length === 10
|
||||
? date.split(".").reverse().join("-")
|
||||
: null;
|
||||
},
|
||||
convertRUFormat(date) {
|
||||
return date?.split(".")?.reverse()?.join("-");
|
||||
},
|
||||
checkFormat(date) {
|
||||
return date && date?.length === 10 ? date : null;
|
||||
},
|
||||
defaultRule(val) {
|
||||
return (
|
||||
!val ||
|
||||
moment(
|
||||
this.checkFormat(val) ? this.convertRUFormat(val) : null
|
||||
).isValid()
|
||||
);
|
||||
checkInput(val) {
|
||||
return moment(this.convertFormat(val)).isValid();
|
||||
},
|
||||
closeCalendar() {
|
||||
this.calendarVisibility = false;
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
padding="2px 0 0 0"
|
||||
)
|
||||
q-icon(name="app:ok", size="20px")
|
||||
base-input.w-full(v-model="value.full_name", placeholder="ФИО пациента*", size="M")
|
||||
base-input.w-full(v-model="infoClient.basic.full_name", placeholder="ФИО пациента*", size="M")
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -49,12 +49,11 @@ import BaseModal from "./BaseModal.vue";
|
||||
import addImageIcon from "@/assets/icons/photo.svg";
|
||||
import BaseButton from "@/components/base/BaseButton.vue";
|
||||
import BaseInput from "@/components/base/BaseInput.vue";
|
||||
import { v_model } from "@/shared/mixins/v-model";
|
||||
|
||||
export default {
|
||||
name: "BaseInputFullName",
|
||||
components: { BaseModal, BaseInput, BaseButton },
|
||||
mixins: [v_model],
|
||||
props: { infoClient: Object },
|
||||
data() {
|
||||
return {
|
||||
defaultIcon: addImageIcon,
|
||||
|
||||
@@ -15,8 +15,9 @@
|
||||
:popup-content-style="{height: candidates?.length > 3 ? '216px' : ''}"
|
||||
v-model="value"
|
||||
ref="selectRef"
|
||||
@blur="pasteFullName"
|
||||
)
|
||||
//template(#selected)
|
||||
// .text-dark.text-sm.font-medium(v-if="person") {{ person.last_name + ' ' + person.first_name + ' ' + person.patronymic }}
|
||||
template(v-slot:iconLeft)
|
||||
q-icon.search-icon(name="app:search", size="20px")
|
||||
template(v-slot:customOption="{props, data}")
|
||||
@@ -47,7 +48,7 @@ export default {
|
||||
BaseSelect,
|
||||
},
|
||||
mixins: [v_model],
|
||||
emits: ["create-person"],
|
||||
emits: ["createPerson"],
|
||||
data() {
|
||||
return {
|
||||
fullName: "",
|
||||
@@ -59,7 +60,6 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
pickedFullName() {
|
||||
if (!this.value.first_name) return "";
|
||||
return (
|
||||
this.value.last_name +
|
||||
" " +
|
||||
@@ -70,14 +70,13 @@ export default {
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
pickedFullName() {
|
||||
this.pasteFullName();
|
||||
pickedFullName(val) {
|
||||
this.$refs?.selectRef?.updateInputValue(val, true);
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
createPerson() {
|
||||
this.$refs?.selectRef?.hidePopup();
|
||||
this.$emit("create-person");
|
||||
this.$emit("createPerson");
|
||||
},
|
||||
filterFn(val, update) {
|
||||
fetchWrapper.get(`persons/?full_name=${val}`).then((result) => {
|
||||
@@ -88,10 +87,8 @@ export default {
|
||||
});
|
||||
});
|
||||
},
|
||||
pasteFullName() {
|
||||
this.$nextTick(() => {
|
||||
this.$refs?.selectRef?.updateInputValue(this.pickedFullName, true);
|
||||
});
|
||||
test(slotProps) {
|
||||
console.log(slotProps);
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -20,9 +20,8 @@
|
||||
:placeholder="useInput && placeholder ? placeholder : ''",
|
||||
@filter="filterFn",
|
||||
:popup-content-style="popupContentStyle"
|
||||
@blur="$emit('blur')"
|
||||
)
|
||||
template(#selected)
|
||||
template(v-slot:selected)
|
||||
slot(name="selected")
|
||||
template(v-slot:option="scope", v-if="!customOption")
|
||||
q-item(v-bind="scope.itemProps", style="justify-content: center", v-if="value?.icon")
|
||||
@@ -80,7 +79,7 @@ export default {
|
||||
filterFn: Function,
|
||||
popupContentStyle: Object,
|
||||
},
|
||||
emits: ["update:modelValue", "blur"],
|
||||
emits: ["update:modelValue"],
|
||||
computed: {
|
||||
value: {
|
||||
get() {
|
||||
@@ -164,9 +163,6 @@ export default {
|
||||
updateInputValue(value, noFilter) {
|
||||
this.$refs?.selectRef?.updateInputValue(value, noFilter);
|
||||
},
|
||||
hidePopup() {
|
||||
this.$refs?.selectRef?.hidePopup();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
round,
|
||||
padding="2px 0 0 0"
|
||||
)
|
||||
q-icon.icon(name="app:ok", size="40px")
|
||||
q-icon(name="app:ok", size="20px")
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -118,7 +118,4 @@ export default {
|
||||
min-height: 400px
|
||||
height: 100%
|
||||
border-radius: 50%
|
||||
|
||||
.icon :deep(path)
|
||||
fill: var(--default-white)
|
||||
</style>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<template lang="pug">
|
||||
.wrapper-form.h-full
|
||||
.wrapper-addresses.h-full
|
||||
.flex.flex-col.gap-y-6
|
||||
base-input(
|
||||
v-model="form.full_address",
|
||||
v-model="addresses.full_address",
|
||||
placeholder="Введите адрес целиком",
|
||||
label="Полный адрес",
|
||||
size="M"
|
||||
@@ -12,42 +12,42 @@
|
||||
span.text-sm.separator.px-2 или
|
||||
.grid.grid-cols-2.gap-y-6.gap-x-4
|
||||
base-input(
|
||||
v-model="form.city",
|
||||
v-model="addresses.city",
|
||||
label="Город",
|
||||
placeholder="Введите город",
|
||||
disabled,
|
||||
size="M"
|
||||
)
|
||||
base-input(
|
||||
v-model="form.region",
|
||||
v-model="addresses.region",
|
||||
label="Область",
|
||||
placeholder="Введите область",
|
||||
disabled,
|
||||
size="M"
|
||||
)
|
||||
base-input(
|
||||
v-model="form.street",
|
||||
v-model="addresses.street",
|
||||
label="Улица",
|
||||
placeholder="Введите улицу",
|
||||
disabled,
|
||||
size="M"
|
||||
)
|
||||
base-input(
|
||||
v-model="form.house",
|
||||
v-model="addresses.house",
|
||||
label="Дом",
|
||||
placeholder="Номер дома",
|
||||
disabled,
|
||||
size="M"
|
||||
)
|
||||
base-input(
|
||||
v-model="form.flat",
|
||||
v-model="addresses.flat",
|
||||
label="Квартира",
|
||||
placeholder="Номер квартиры",
|
||||
disabled,
|
||||
size="M"
|
||||
)
|
||||
base-input(
|
||||
v-model="form.zip_code",
|
||||
v-model="addresses.zip_code",
|
||||
label="Индекс",
|
||||
mask="######",
|
||||
placeholder="000000",
|
||||
@@ -63,32 +63,17 @@ import BaseInput from "@/components/base/BaseInput.vue";
|
||||
export default {
|
||||
name: "FormCreateAddresses",
|
||||
components: { BaseInput, BaseCustomSelect },
|
||||
emits: ["change"],
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
full_address: "",
|
||||
city: "",
|
||||
region: "",
|
||||
street: "",
|
||||
house: "",
|
||||
flat: "",
|
||||
zip_code: "",
|
||||
},
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
form(val) {
|
||||
this.$emit("change", val);
|
||||
},
|
||||
props: {
|
||||
addresses: Object,
|
||||
saveClient: Function,
|
||||
saveFile: Function,
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="sass" scoped>
|
||||
.wrapper-form
|
||||
.wrapper-addresses
|
||||
height: 380px
|
||||
width: 570px
|
||||
overflow-y: auto
|
||||
&::-webkit-scrollbar
|
||||
width: 4px
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
.wrapper.flex.flex-col.flex-auto.h-full.gap-y-8.justify-between
|
||||
.place.flex.flex-col.justify-center.items-center.py-3
|
||||
.upload.text-center.text-sm.flex.w-fit
|
||||
input.hidden(@change="() => {}" type="file" id="file-upload")
|
||||
input.hidden(@change="(e) => addAttachment(e)" type="file" id="file-upload")
|
||||
span Загрузите элемент
|
||||
label.label.cursor-pointer(for="file-upload") с компьютера
|
||||
span или перетащите их сюда
|
||||
@@ -11,6 +11,9 @@
|
||||
<script>
|
||||
export default {
|
||||
name: "FormCreateAttachments",
|
||||
props: {
|
||||
addAttachment: Function,
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
@@ -1,21 +1,46 @@
|
||||
<template lang="pug">
|
||||
.wrapper-info
|
||||
.wrapper-info.h-full
|
||||
.grid.grid-cols-2.gap-x-4.gap-y-6
|
||||
base-select(
|
||||
:items="priorityList",
|
||||
placeholder="Приоритет клиента",
|
||||
v-model="basicInfo.priority",
|
||||
label="Приоритет",
|
||||
size="M"
|
||||
)
|
||||
base-input-date(
|
||||
v-model="value.birth_date",
|
||||
v-model="basicInfo.birth_date",
|
||||
size="M",
|
||||
important,
|
||||
label="Дата рождения",
|
||||
placeholder="Дата рождения"
|
||||
)
|
||||
base-input(
|
||||
v-model="value.phone",
|
||||
v-model="phone.username",
|
||||
placeholder="+7 (915) 644–92–23",
|
||||
mask="+7 (###) ###-##-##",
|
||||
label="Номер телефона",
|
||||
size="M",
|
||||
important
|
||||
)
|
||||
base-input(
|
||||
v-model="email.username",
|
||||
placeholder="user@yandex.ru",
|
||||
label="Email",
|
||||
important,
|
||||
size="M",
|
||||
)
|
||||
.flex.flex-col.col-start-1.col-end-3.w-100(class="gap-y-1.5")
|
||||
span.text-sm.font-semibold.opacity-40.input-info Ссылки на соцсети
|
||||
.flex(class="gap-x-1.5" v-for="network in basicInfo.contacts" :key="network.kind.id")
|
||||
base-adding-network(
|
||||
:items="networksList",
|
||||
:network="network",
|
||||
)
|
||||
span.add-network.cursor-pointer(
|
||||
v-show="networksList.length !== 0",
|
||||
@click="addNetwork"
|
||||
) Добавить соцсеть
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -23,7 +48,6 @@ import BaseAddingNetwork from "@/components/base/BaseAddingNetwork";
|
||||
import BaseSelect from "@/components/base/BaseSelect";
|
||||
import BaseInput from "@/components/base/BaseInput.vue";
|
||||
import BaseInputDate from "@/components/base/BaseInputDate.vue";
|
||||
import { v_model } from "@/shared/mixins/v-model";
|
||||
|
||||
export default {
|
||||
name: "FormCreateBasicInfo",
|
||||
@@ -33,12 +57,22 @@ export default {
|
||||
BaseSelect,
|
||||
BaseInputDate,
|
||||
},
|
||||
mixins: [v_model],
|
||||
props: {
|
||||
priorityList: Array,
|
||||
phone: Object,
|
||||
email: Object,
|
||||
basicInfo: Object,
|
||||
saveClient: Function,
|
||||
addNetwork: Function,
|
||||
networksList: Array,
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="sass" scoped>
|
||||
.wrapper-info
|
||||
max-height: 336px
|
||||
min-height: 272px
|
||||
overflow-y: auto
|
||||
&::-webkit-scrollbar
|
||||
width: 4px
|
||||
|
||||
@@ -4,27 +4,27 @@
|
||||
span.title-info.text-base.font-bold Паспортные данные
|
||||
.grid.grid-cols-2.gap-x-4.gap-y-6
|
||||
base-input(
|
||||
v-model="form.series_number",
|
||||
v-model="identityDocument.pass.series_number",
|
||||
mask="#### ######",
|
||||
placeholder="0000 000000",
|
||||
label="Серия и номер",
|
||||
size="M"
|
||||
)
|
||||
base-input(
|
||||
v-model="form.issued_by_org",
|
||||
v-model="identityDocument.pass.issued_by_org",
|
||||
placeholder="Точно как в паспорте",
|
||||
label="Кем выдан",
|
||||
size="M"
|
||||
)
|
||||
base-input(
|
||||
v-model="form.issued_by_org_code",
|
||||
v-model="identityDocument.pass.issued_by_org_code",
|
||||
mask="###-###",
|
||||
placeholder="000–000",
|
||||
label="Код подразделения",
|
||||
size="M"
|
||||
)
|
||||
base-input-date(
|
||||
v-model="form.issued_by_date",
|
||||
v-model="identityDocument.pass.issued_by_date",
|
||||
placeholder="Дата",
|
||||
label="Дата выдачи",
|
||||
size="M"
|
||||
@@ -33,7 +33,7 @@
|
||||
span.title-info.text-base.font-bold СНИЛС и ИНН
|
||||
.grid.grid-cols-2.gap-x-4.gap-y-6
|
||||
base-input(
|
||||
v-model="form.snils",
|
||||
v-model="identityDocument.snils.number",
|
||||
mask="###-###-### ##",
|
||||
placeholder="000–000–000 00",
|
||||
label="Номер СНИЛС",
|
||||
@@ -41,7 +41,7 @@
|
||||
size="M"
|
||||
)
|
||||
base-input(
|
||||
v-model="form.inn",
|
||||
v-model="identityDocument.inn.number",
|
||||
placeholder="000000000000",
|
||||
mask="############",
|
||||
label="Номер ИНН",
|
||||
@@ -57,23 +57,9 @@ import BaseInputDate from "@/components/base/BaseInputDate.vue";
|
||||
export default {
|
||||
name: "FormCreateIdentityDocuments",
|
||||
components: { BaseInput, BaseInputDate },
|
||||
emits: ["change"],
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
series_number: "",
|
||||
issued_by_org: "",
|
||||
issued_by_org_code: "",
|
||||
issued_by_date: "",
|
||||
snils: "",
|
||||
inn: "",
|
||||
},
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
form(val) {
|
||||
this.$emit("change", val);
|
||||
},
|
||||
props: {
|
||||
identityDocument: Object,
|
||||
saveClient: Function,
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -10,11 +10,9 @@
|
||||
)
|
||||
template(#iconLeft)
|
||||
q-icon.search-icon(name="app:search", size="20px")
|
||||
base-button(width="216px", @click="showCreateModal = true")
|
||||
base-button(width="216px", @click="openCreateMedcardPage")
|
||||
q-icon.plus.mr-2(name="app:plus", size="24px")
|
||||
span Создать медкарту
|
||||
base-modal(v-model="showCreateModal", title="Создать медицинскую карту", modal-padding)
|
||||
patient-creation-form(@close="handleClosePatientForm")
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -23,37 +21,19 @@ import BaseSelect from "@/components/base/BaseSelect.vue";
|
||||
import BaseButton from "@/components/base/BaseButton.vue";
|
||||
|
||||
import debounce from "lodash/debounce";
|
||||
import BaseModal from "@/components/base/BaseModal.vue";
|
||||
import PatientCreationForm from "@/components/PatientCreationForm.vue";
|
||||
import { mapActions } from "vuex";
|
||||
export default {
|
||||
name: "MedicalCardSearchHeader",
|
||||
components: {
|
||||
PatientCreationForm,
|
||||
BaseModal,
|
||||
BaseInput,
|
||||
BaseSelect,
|
||||
BaseButton,
|
||||
},
|
||||
components: { BaseInput, BaseSelect, BaseButton },
|
||||
emits: ["search"],
|
||||
data() {
|
||||
return {
|
||||
filterString: "",
|
||||
showCreateModal: false,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
handleClosePatientForm(val) {
|
||||
this.showCreateModal = false;
|
||||
if (!val) return;
|
||||
this.getMedicalCardData({
|
||||
personId: val.id,
|
||||
successCallback: (id) => this.$router.push("medical-card/" + id),
|
||||
});
|
||||
openCreateMedcardPage() {
|
||||
alert("Создать медкарту с ФИО: " + this.filterString);
|
||||
},
|
||||
...mapActions({
|
||||
getMedicalCardData: "getMedicalCardDataByPersonId",
|
||||
}),
|
||||
},
|
||||
watch: {
|
||||
filterString: debounce(function (value) {
|
||||
|
||||
@@ -5,23 +5,23 @@
|
||||
)
|
||||
q-avatar(size="36px")
|
||||
img(:src="avatar")
|
||||
span.font-semibold.text-dark {{patientName}}
|
||||
span.font-semibold.text-dark {{fullName}}
|
||||
.field(:style="headerStyle(headerConfig[1])")
|
||||
span.text-dark {{ convertDate(medcardInfo?.person?.birth_date) }} г.
|
||||
span.text-dark {{ formatDate(person?.birth_date) }} г.
|
||||
.field.gap-x-2(:style="headerStyle(headerConfig[2])")
|
||||
.rounded-full.h-2.w-2(:style="{background: patientPriority?.color}")
|
||||
span(:style="{color: patientPriority?.color}") {{ patientPriority?.text }}
|
||||
.field(:style="headerStyle(headerConfig[3])")
|
||||
.medcard-number.rounded.h-7.py-1.pl-3.pr-2.flex.items-center.justify-between.w-full.cursor-pointer(
|
||||
@click="copyValue(medcardInfo?.number)"
|
||||
@click="copyMedicalCardNumber"
|
||||
)
|
||||
span.text-dark.cursor-pointer {{ medcardInfo?.number }}
|
||||
q-icon.copy(size="18px", name="app:copy")
|
||||
.field(:style="headerStyle(headerConfig[4])")
|
||||
span.text-dark {{ convertDate(medcardInfo?.created_at) }} г.
|
||||
span.text-dark {{ formatDate(medcardInfo?.created_at) }} г.
|
||||
.field.gap-x-3(:style="headerStyle(headerConfig[5])")
|
||||
.track.h-2.flex-1.rounded
|
||||
.thumb.h-full.rounded(:style="thumbStyle")
|
||||
.thumb.h-full.rounded(:style="fillingThumbStyle")
|
||||
span.grey-color {{ medcardInfo?.filling_percentage || 0 }}%
|
||||
.field(:style="{...headerStyle(headerConfig[6])}")
|
||||
q-icon.medcard.cursor-pointer(name="app:medcard", size="20px", @click="openMedicalCard")
|
||||
@@ -51,15 +51,18 @@ export default {
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
patientName() {
|
||||
return `${this.medcardInfo?.person?.last_name} ${this.medcardInfo?.person?.first_name} ${this.medcardInfo?.person?.patronymic}`;
|
||||
fullName() {
|
||||
return `${this.person?.last_name} ${this.person?.first_name} ${this.person?.patronymic}`;
|
||||
},
|
||||
person() {
|
||||
return this.medcardInfo?.person;
|
||||
},
|
||||
patientPriority() {
|
||||
return priorityList?.find(
|
||||
({ priority }) => (this.medcardInfo.priority || null) === priority
|
||||
);
|
||||
},
|
||||
thumbStyle() {
|
||||
fillingThumbStyle() {
|
||||
let percentage = this.medcardInfo?.filling_percentage || 0;
|
||||
return {
|
||||
width: `calc(${percentage}%)`,
|
||||
@@ -77,16 +80,13 @@ export default {
|
||||
getMedicalCardData: "getMedicalCardDataByPersonId",
|
||||
}),
|
||||
openMedicalCard() {
|
||||
this.getMedicalCardData({
|
||||
personId: this.medcardInfo.person_id,
|
||||
successCallback: (id) => this.$router.push("medical-card/" + id),
|
||||
});
|
||||
this.$router.push("medical-card/" + this.medcardInfo.id);
|
||||
},
|
||||
convertDate(date) {
|
||||
formatDate(date) {
|
||||
return moment(date)?.format("DD MMMM YYYY");
|
||||
},
|
||||
copyValue(text) {
|
||||
navigator.clipboard.writeText(text);
|
||||
copyMedicalCardNumber() {
|
||||
navigator.clipboard.writeText(this.medcardInfo.number);
|
||||
addNotification(
|
||||
new Date().getTime(),
|
||||
"",
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
calendar-sidebar(v-if="!isOpen", :open-sidebar="openSidebar", :create-form="createForm")
|
||||
calendar-open-sidebar(v-else, :open-sidebar="openSidebar", :create-form="createForm")
|
||||
calendar-wrapper.ml-2(:open-sidebar="isOpen")
|
||||
base-modal(v-model="isShowForm", title="Создание записи", modal-padding)
|
||||
base-modal(v-model="isShowForm", title="Создание записи <Переделка>", modal-padding)
|
||||
create-event-form(:close-form="closeForm")
|
||||
base-modal(v-model="previewVisibility", :hideHeader="true", :modalPadding="true")
|
||||
calendar-record-preview(v-model:preview-visibility="previewVisibility")
|
||||
@@ -39,7 +39,6 @@ export default {
|
||||
computed: {
|
||||
...mapState({
|
||||
selectedRecordId: (state) => state.calendar.selectedRecordId,
|
||||
selectedDates: (state) => state.calendar.selectedDates,
|
||||
}),
|
||||
},
|
||||
methods: {
|
||||
@@ -54,12 +53,7 @@ export default {
|
||||
},
|
||||
...mapActions({
|
||||
changeSelectedRecordId: "changeSelectedRecordId",
|
||||
changeSelectedDates: "changeSelectedDates",
|
||||
getEvents: "getEvents",
|
||||
}),
|
||||
convertDate(date) {
|
||||
return moment(date?.split(".")?.reverse()?.join("-"));
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
selectedRecordId(value) {
|
||||
@@ -68,59 +62,6 @@ export default {
|
||||
previewVisibility(value) {
|
||||
if (!value) this.changeSelectedRecordId(null);
|
||||
},
|
||||
"$route.query": {
|
||||
immediate: true,
|
||||
deep: true,
|
||||
handler(value) {
|
||||
if (this.$route.path === "/calendar") {
|
||||
if (!value?.start || !value?.end) {
|
||||
this.changeSelectedDates({
|
||||
from: moment().clone().startOf("week"),
|
||||
to: moment().clone().endOf("week"),
|
||||
});
|
||||
this.$router.replace({
|
||||
query: {
|
||||
start: this.selectedDates?.from?.format("DD.MM.YYYY"),
|
||||
end: this.selectedDates?.to?.format("DD.MM.YYYY"),
|
||||
},
|
||||
});
|
||||
} else if (
|
||||
value?.start !== this.selectedDates?.from?.format("DD.MM.YYYY") ||
|
||||
value?.end !== this.selectedDates?.to?.format("DD.MM.YYYY")
|
||||
)
|
||||
this.changeSelectedDates({
|
||||
from: this.convertDate(value?.start),
|
||||
to: this.convertDate(value?.end),
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
selectedDates: {
|
||||
deep: true,
|
||||
immediate: true,
|
||||
handler(newVal, oldVal) {
|
||||
if (
|
||||
!newVal?.from?.isSame(oldVal?.from) ||
|
||||
!newVal?.to?.isSame(oldVal?.to)
|
||||
) {
|
||||
this.getEvents();
|
||||
if (
|
||||
this.$route.query?.start !== newVal?.from?.format("DD.MM.YYYY") &&
|
||||
this.$route.query?.end !== newVal?.to?.format("DD.MM.YYYY")
|
||||
) {
|
||||
this.$router.replace({
|
||||
query: {
|
||||
start: newVal?.from?.format("DD.MM.YYYY"),
|
||||
end: newVal?.to?.format("DD.MM.YYYY"),
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
beforeUnmount() {
|
||||
this.$route.query = {};
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -22,10 +22,10 @@
|
||||
)
|
||||
base-input.search(
|
||||
size="M"
|
||||
:width="386",
|
||||
:width="350",
|
||||
v-model="currentWeek",
|
||||
)
|
||||
.h-5.w-5.flex.items-center.justify-center.ml-3
|
||||
.h-5.w-5.flex.items-center.justify-center
|
||||
q-icon.calendar-icon.text.cursor-pointer(
|
||||
:name="calendarVisibility ? 'app:cancel-mini' : 'app:calendar'",
|
||||
size="20px",
|
||||
@@ -36,7 +36,7 @@
|
||||
transition-show="scale",
|
||||
transition-hide="scale"
|
||||
self="top middle",
|
||||
:offset="[160, 8]"
|
||||
:offset="[140, 8]"
|
||||
)
|
||||
base-calendar(
|
||||
v-model="dates",
|
||||
@@ -54,22 +54,19 @@
|
||||
dense,
|
||||
@click="nextWeek"
|
||||
)
|
||||
.h-10.p-1.flex.items-center.justify-between.bg-secondary.rounded.text-grey-color.ml-52.border
|
||||
.h-10.p-1.flex.items-center.justify-between.bg-secondary.rounded.text-grey-color.ml-52
|
||||
q-btn-toggle(
|
||||
v-model="value",
|
||||
:options="displayTypesList",
|
||||
no-caps,
|
||||
toggle-color="light-blue-4",
|
||||
padding="0px"
|
||||
)
|
||||
template(v-slot:one)
|
||||
.w-12.h-8.flex.items-center.justify-center.rounded(
|
||||
:class="{'active-toggle': value === 'expanded'}"
|
||||
)
|
||||
.w-12.h-8.flex.items-center.justify-center
|
||||
date-switcher-svg(name-svg="expanded", :active="value === 'expanded'")
|
||||
template(v-slot:two)
|
||||
.w-12.h-8.flex.items-center.justify-center.rounded(
|
||||
:class="{'active-toggle': value === 'collapsed'}"
|
||||
)
|
||||
.w-12.h-8.flex.items-center.justify-center
|
||||
date-switcher-svg(name-svg="compressed", :active="value === 'collapsed'")
|
||||
</template>
|
||||
|
||||
@@ -106,7 +103,7 @@ export default {
|
||||
currentWeek() {
|
||||
return `${this.dates?.from?.format(
|
||||
"D MMMM YYYY"
|
||||
)} — ${this.dates?.to?.format("D MMMM YYYY")}`;
|
||||
)} - ${this.dates?.to?.format("D MMMM YYYY")}`;
|
||||
},
|
||||
...mapState({
|
||||
selectedDates: (state) => state.calendar.selectedDates,
|
||||
@@ -114,18 +111,15 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
previousWeek() {
|
||||
const diff = this.dates?.to?.diff(this.dates?.from, "days") + 1;
|
||||
this.dates.from = this.dates.from.clone().subtract(diff, "day");
|
||||
this.dates.to = this.dates.to.clone().subtract(diff, "day");
|
||||
this.dates.from = this.dates.from.clone().subtract(1, "week");
|
||||
this.dates.to = this.dates.to.clone().subtract(1, "week");
|
||||
},
|
||||
nextWeek() {
|
||||
const diff = this.dates?.to?.diff(this.dates?.from, "days") + 1;
|
||||
this.dates.from = this.dates.from.clone().add(diff, "day");
|
||||
this.dates.to = this.dates.to.clone().add(diff, "day");
|
||||
this.dates.from = this.dates.from.clone().add(1, "week");
|
||||
this.dates.to = this.dates.to.clone().add(1, "week");
|
||||
},
|
||||
...mapActions({
|
||||
changeSelectedDates: "changeSelectedDates",
|
||||
getEvents: "getEvents",
|
||||
}),
|
||||
saveDatesChange() {
|
||||
this.calendarVisibility = false;
|
||||
@@ -148,18 +142,10 @@ export default {
|
||||
this.changeSelectedDates(val);
|
||||
},
|
||||
},
|
||||
selectedDates: {
|
||||
deep: true,
|
||||
immediate: true,
|
||||
handler(val) {
|
||||
if (
|
||||
!val?.from.isSame(this.dates?.from) ||
|
||||
!val?.to.isSame(this.dates?.to)
|
||||
)
|
||||
},
|
||||
mounted() {
|
||||
this.initializeDates();
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -202,12 +188,6 @@ export default {
|
||||
|
||||
.calendar-icon :deep(path)
|
||||
fill: var(--font-dark-blue-color)
|
||||
|
||||
.active-toggle
|
||||
background: var(--btn-blue-color)
|
||||
|
||||
.border-toggle
|
||||
border: 1px solid var(--gray-secondary)
|
||||
</style>
|
||||
<style lang="sass">
|
||||
.q-field--outlined.q-field--readonly .q-field__control:before
|
||||
|
||||
@@ -15,17 +15,14 @@
|
||||
size="20px",
|
||||
@click.stop="changeTimeDisplay(true)"
|
||||
)
|
||||
.color-black.pl-4.flex-1.font-semibold.py-6px.relative.cursor-default(
|
||||
.color-black.pl-4.flex-1.font-semibold.py-6px.relative(
|
||||
:class="{'pl-6px collapsed-name': expandedTime}"
|
||||
) {{trimPatientName(record?.person?.last_name, record?.person?.first_name, record?.person?.patronymic)}}
|
||||
.gradient.absolute.w-5.h-full.right-0(v-if="expandedTime")
|
||||
.info-block.justify-center(v-if="expandedType")
|
||||
q-icon(
|
||||
:name="record?.person?.has_medical_card ? 'app:medcard-green' : 'app:medcard'",
|
||||
size="20px",
|
||||
)
|
||||
.last-item.info-block.justify-center
|
||||
.recording-status(:class="recordingStatus?.class")
|
||||
.info-block.justify-center
|
||||
img.w-5.h-5(:src="recordingStatus?.icon")
|
||||
.last-item.info-block.justify-center(v-if="expandedType")
|
||||
img.w-5.h-5(:src="medicalСardStatus?.icon")
|
||||
.body.background-grey.flex.flex-col.justify-between.pl-4.pr-2.color-grey(
|
||||
:style="bodyHeight",
|
||||
:class="bodyPadding"
|
||||
@@ -36,8 +33,8 @@
|
||||
:key="contact.value",
|
||||
)
|
||||
q-icon.network-icon(:name="contact.icon", size="16px")
|
||||
.text-xxs.cursor-default {{ contact.value }}
|
||||
.h-6.w-6.color-black.background-dark-grey.text-xxs.rounded.flex.items-center.justify-center.cursor-default(
|
||||
.text-xxs {{ contact.value }}
|
||||
.h-6.w-6.color-black.background-dark-grey.text-xxs.rounded.flex.items-center.justify-center(
|
||||
v-if="collapsedDisplayCondition"
|
||||
) +1
|
||||
</template>
|
||||
@@ -64,27 +61,15 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
contacts() {
|
||||
let contactList = [];
|
||||
this.record?.person?.contacts?.find((elem) => {
|
||||
if (elem.category === "PHONE") {
|
||||
contactList.push({
|
||||
kind: elem?.category,
|
||||
icon: networks?.find((item) => item.id === elem.category)?.icon,
|
||||
value: elem?.value,
|
||||
});
|
||||
return true;
|
||||
}
|
||||
});
|
||||
this.record?.person?.contacts?.find((elem) => {
|
||||
if (elem.category === "EMAIL") {
|
||||
contactList.push({
|
||||
kind: elem?.category,
|
||||
icon: networks?.find((item) => item.id === elem.category)?.icon,
|
||||
value: elem?.value,
|
||||
});
|
||||
return true;
|
||||
}
|
||||
});
|
||||
let contactList = this.record?.person?.contacts
|
||||
?.filter(
|
||||
(elem) => elem.category === "PHONE" || elem.category === "EMAIL"
|
||||
)
|
||||
?.map((elem) => ({
|
||||
kind: elem.category,
|
||||
icon: networks.find((item) => item.id === elem.category)?.icon,
|
||||
value: elem.value,
|
||||
}));
|
||||
if (this.collapsedDisplayCondition) {
|
||||
contactList.length = 1;
|
||||
return contactList;
|
||||
@@ -95,10 +80,14 @@ export default {
|
||||
return !this.bodyClass?.["flex-col"] && !this.expandedType;
|
||||
},
|
||||
recordingStatus() {
|
||||
const status = statuses?.[0]?.data?.find(
|
||||
return statuses[0].data.find(
|
||||
(elem) => elem.value === this.record?.status
|
||||
);
|
||||
return status || statuses?.[0]?.data?.[0];
|
||||
},
|
||||
medicalСardStatus() {
|
||||
return statuses[1].data.find(
|
||||
(elem) => elem.value === this.record?.medicalCard?.status
|
||||
);
|
||||
},
|
||||
startTime() {
|
||||
return moment.parseZone(this.record?.start);
|
||||
@@ -216,18 +205,4 @@ export default {
|
||||
fill: var(--font-dark-blue-color)
|
||||
.time-icon :deep(path)
|
||||
fill: var(--font-grey-color)
|
||||
.recording-status
|
||||
border-radius: 9999px
|
||||
width: 17px
|
||||
height: 17px
|
||||
.not-accepted
|
||||
border: 1.2px solid var(--font-grey-color)
|
||||
.accepted
|
||||
background-color: var(--system-color-green)
|
||||
.rejected
|
||||
background-color: var(--system-color-red)
|
||||
.reception
|
||||
background-color: var(--btn-blue-color)
|
||||
span
|
||||
cursor: default
|
||||
</style>
|
||||
|
||||
@@ -239,6 +239,7 @@ export default {
|
||||
this.changeCurrentTime();
|
||||
this.timeCoilInitialization();
|
||||
this.startTimer();
|
||||
this.getEvents();
|
||||
},
|
||||
beforeUnmount() {
|
||||
this.stopTimer();
|
||||
|
||||
@@ -6,12 +6,11 @@
|
||||
:choice-status="choiceStatus"
|
||||
v-model="time"
|
||||
)
|
||||
base-input-with-search(v-model="patient", @create-person="createPerson")
|
||||
base-input-with-search(v-model="patient", @createPerson="createPerson")
|
||||
.flex.flex-col.flex-auto.l.gap-y-8
|
||||
.wrapper-info.h-full
|
||||
.grid.grid-cols-2.gap-x-4.gap-y-6
|
||||
base-input(
|
||||
:disabled="!!patient.id"
|
||||
v-model="phone",
|
||||
placeholder="+7 (915) 644–92–23",
|
||||
mask="+7 (###) ###-##-##",
|
||||
@@ -20,7 +19,6 @@
|
||||
important
|
||||
)
|
||||
base-input-date(
|
||||
:disabled="!!patient.id"
|
||||
v-model="birth_date",
|
||||
size="M",
|
||||
important,
|
||||
@@ -31,8 +29,6 @@
|
||||
.footer.flex.gap-2
|
||||
base-button(type="secondary", label="Отменить", width="126px", @click="closeForm")
|
||||
base-button(width="168px", label="Создать запись", @click="createEvent")
|
||||
base-modal(v-model="showCreateModal", title="Создать пациента", modal-padding)
|
||||
patient-creation-form(@close="handleClosePatientForm")
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -45,8 +41,6 @@ import BaseInput from "@/components/base/BaseInput.vue";
|
||||
import BaseInputDate from "@/components/base/BaseInputDate.vue";
|
||||
import { fetchWrapper } from "@/shared/fetchWrapper";
|
||||
import { mapActions } from "vuex";
|
||||
import PatientCreationForm from "@/components/PatientCreationForm.vue";
|
||||
import BaseModal from "@/components/base/BaseModal.vue";
|
||||
|
||||
export default {
|
||||
name: "CreateEventForm",
|
||||
@@ -57,42 +51,29 @@ export default {
|
||||
BaseInputWithSearch,
|
||||
BaseInput,
|
||||
BaseInputDate,
|
||||
PatientCreationForm,
|
||||
BaseModal,
|
||||
},
|
||||
props: { isShowForm: Boolean, closeForm: Function },
|
||||
data() {
|
||||
return {
|
||||
patient: {},
|
||||
phone: "",
|
||||
birth_date: "",
|
||||
birth_date: {},
|
||||
time: {},
|
||||
patientData: patientData,
|
||||
currentStatus: patientData.statuses.find((e) => e.name === "Не принят"),
|
||||
showCreateModal: false,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
primaryNumber() {
|
||||
return this.patient?.contacts?.find((e) => e.category === "PHONE")?.value;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
...mapActions({
|
||||
getEvents: "getEvents",
|
||||
}),
|
||||
createPerson() {
|
||||
this.showCreateModal = true;
|
||||
alert("crea");
|
||||
},
|
||||
|
||||
choiceStatus(e) {
|
||||
this.currentStatus = e;
|
||||
},
|
||||
handleClosePatientForm(val) {
|
||||
this.showCreateModal = false;
|
||||
if (!val) return;
|
||||
this.patient = val;
|
||||
},
|
||||
async createEvent() {
|
||||
const event = await fetchWrapper.post("events", {
|
||||
start: this.time.start.toISOString(),
|
||||
@@ -109,16 +90,6 @@ export default {
|
||||
},
|
||||
},
|
||||
mounted() {},
|
||||
watch: {
|
||||
patient(val) {
|
||||
if (val.birth_date) {
|
||||
this.birth_date = val.birth_date;
|
||||
}
|
||||
if (this.primaryNumber) {
|
||||
this.phone = this.primaryNumber;
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
264
src/pages/newCalendar/components/del_RecordCreationForm copy.vue
Normal file
264
src/pages/newCalendar/components/del_RecordCreationForm copy.vue
Normal file
@@ -0,0 +1,264 @@
|
||||
<template lang="pug">
|
||||
.flex.flex-col.pt-6.gap-y-4(:style="{maxWidth: '682px'}")
|
||||
header-record-form(
|
||||
:current-status="currentStatus",
|
||||
:statuses="patientData.statuses",
|
||||
:choice-status="choiceStatus"
|
||||
)
|
||||
.flex.items-center.gap-x-3.text-smm
|
||||
.text.font-semibold Жалобы:
|
||||
.flex.gap-x-1
|
||||
.services.flex.items-center.px-4.font-medium.text-smm.gap-x-1.h-9.rounded-md(
|
||||
:class="{'other-serivices': services.length}"
|
||||
)
|
||||
.service.flex.gap-x-1.items-center.rounded.relative(
|
||||
:style="{ width: otherColor ? '415px' : 'full'}"
|
||||
)
|
||||
span(v-if="!services.length") Выберите услуги
|
||||
.dark-blue.flex.px-4.items-center.rounded.h-7(
|
||||
id="service",
|
||||
v-else,
|
||||
v-for="service in services",
|
||||
:style="{background: service.color}"
|
||||
) {{service.title}}
|
||||
.gradient.flex.absolute(
|
||||
:style="{background: `linear-gradient(270deg, ${otherColor} 0%, rgba(247, 217, 255, 0) 100%)`}"
|
||||
)
|
||||
.other.flex.h-7.items-center.justify-center.rounded(v-if="otherColor") {{`+${otherServices.length}`}}
|
||||
.price.flex.items-center.items-center.justify-center.rounded-md(v-if="services.length") {{sumService}}
|
||||
q-btn.change.flex.w-7.h-9.rounded-md(@click="isShowServices = true", dense, padding="4px 4px")
|
||||
q-icon.icon(name="app:folder", size="20px")
|
||||
base-modal(v-model="isShowServices", title="Услуги", modal-padding)
|
||||
services-modal(:close-services="closeServices", :save-services="saveServices")
|
||||
base-input-full-name(:info-client="patientData")
|
||||
.flex.flex-col.flex-auto.l.gap-y-8
|
||||
.flex
|
||||
button.title-info.px-6.py-2.cursor-pointer.w-full.text-sm(
|
||||
v-for="form in forms",
|
||||
@click="selectForm(form.component)",
|
||||
:class="{active: form.component === currentForm}",
|
||||
:key="form.id",
|
||||
:id="form.id"
|
||||
) {{form.title}}
|
||||
component(
|
||||
v-bind:is="currentForm",
|
||||
:basic-info="patientData.basic",
|
||||
:phone="patientData.phone",
|
||||
:email="patientData.email",
|
||||
:add-network="addNewNetwork",
|
||||
:priority-list="patientData.priorityList",
|
||||
:identity-document="patientData.identity_document",
|
||||
:addresses="patientData.addresses",
|
||||
:save-file="saveDocFile",
|
||||
:networks-list="getNetworksList",
|
||||
)
|
||||
.footer.flex.gap-2
|
||||
base-button(type="secondary", label="Отменить", width="126px", @click="closeForm")
|
||||
base-button(width="168px", label="Создать запись", @click="closeForm", disabled)
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import folder from "@/assets/icons/folder.svg";
|
||||
import { column } from "@/pages/clients/utils/tableConfig";
|
||||
import { v_model } from "@/shared/mixins/v-model";
|
||||
import FormCreateBasicInfo from "@/pages/clients/components/FormCreateBasicInfo";
|
||||
import FormCreateIdentityDocuments from "@/pages/clients/components/FormCreateIdentityDocuments";
|
||||
import FormCreateAddresses from "@/pages/clients/components/FormCreateAddresses";
|
||||
import FormCreateAttachments from "@/pages/clients/components/FormCreateAttachments.vue";
|
||||
import BaseInputFullName from "@/components/base/BaseInputFullName.vue";
|
||||
import { patientData } from "@/pages/newCalendar/utils/calendarConfig.js";
|
||||
import HeaderRecordForm from "./HeaderRecordForm.vue";
|
||||
import BaseCalendar from "@/components/base/Calendar/BaseCalendar.vue";
|
||||
import BaseButton from "@/components/base/BaseButton.vue";
|
||||
import BaseModal from "@/components/base/BaseModal.vue";
|
||||
import ServicesModal from "./ServicesModal.vue";
|
||||
|
||||
export default {
|
||||
name: "RecordCreationForm",
|
||||
components: {
|
||||
FormCreateBasicInfo,
|
||||
FormCreateIdentityDocuments,
|
||||
FormCreateAddresses,
|
||||
FormCreateAttachments,
|
||||
BaseInputFullName,
|
||||
BaseCalendar,
|
||||
HeaderRecordForm,
|
||||
BaseButton,
|
||||
BaseModal,
|
||||
ServicesModal,
|
||||
},
|
||||
props: { isShowForm: Boolean, closeForm: Function },
|
||||
mixins: [v_model],
|
||||
data() {
|
||||
return {
|
||||
folder,
|
||||
isPhoto: false,
|
||||
patientData: patientData,
|
||||
currentStatus: patientData.statuses.find((e) => e.name === "Не принят"),
|
||||
services: [
|
||||
{ id: 0, title: "Чистка зубов", price: 500, color: "#D8E3FF" },
|
||||
{ id: 1, title: "Осмотр", price: 1300, color: "#FFF0CA" },
|
||||
{
|
||||
id: 2,
|
||||
title: "Лечение среднего кариеса",
|
||||
price: 500,
|
||||
color: "#F7D9FF",
|
||||
},
|
||||
{ id: 3, title: "Осмотр зубов", price: 1300, color: "#FFF0CA" },
|
||||
],
|
||||
forms: [
|
||||
{
|
||||
title: "Основное",
|
||||
id: "basic",
|
||||
component: "form-create-basic-info",
|
||||
},
|
||||
{
|
||||
title: "ДУЛ",
|
||||
id: "doc",
|
||||
component: "form-create-identity-documents",
|
||||
},
|
||||
{
|
||||
title: "Адрес",
|
||||
id: "address",
|
||||
component: "form-create-addresses",
|
||||
},
|
||||
{
|
||||
title: "Дополнительное",
|
||||
id: "additional",
|
||||
component: "form-create-attachments",
|
||||
},
|
||||
],
|
||||
currentForm: "form-create-basic-info",
|
||||
networksSettings: column.find((el) => el.name === "networks")?.settings,
|
||||
otherColor: null,
|
||||
otherServices: [],
|
||||
isShowServices: false,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
getNetworksList() {
|
||||
let contacts = [];
|
||||
this.patientData.basic.contacts.forEach((elem) =>
|
||||
contacts.push(elem.kind.id)
|
||||
);
|
||||
let filteredNetworks = this.networksSettings.filter(
|
||||
({ id }) => !contacts.includes(id)
|
||||
);
|
||||
return filteredNetworks;
|
||||
},
|
||||
sumService() {
|
||||
let sum = this.services.reduce((acc, el) => acc + el.price, 0) + " ₽";
|
||||
return sum.length >= 5
|
||||
? sum.replace(/(\d{1,3}(?=(?:\d\d\d)+(?!\d)))/g, "$1" + " ")
|
||||
: sum;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
changePhoto() {
|
||||
this.isPhoto = true;
|
||||
},
|
||||
selectForm(componentName) {
|
||||
this.currentForm = this.forms.find(
|
||||
(elem) => elem.component === componentName
|
||||
)?.component;
|
||||
},
|
||||
saveDocFile(e) {
|
||||
this.patientData.doc = e.target.files;
|
||||
},
|
||||
addNewNetwork() {
|
||||
const newNetwork = this.getNetworksList;
|
||||
if (newNetwork[0])
|
||||
this.patientData.basic.contacts.push({
|
||||
kind: {
|
||||
id: newNetwork[0].id,
|
||||
icon: newNetwork[0].icon,
|
||||
},
|
||||
username: "",
|
||||
});
|
||||
},
|
||||
choiceStatus(e) {
|
||||
this.currentStatus = e;
|
||||
},
|
||||
addShadow() {
|
||||
let defaultWidth = 415;
|
||||
const target = document.querySelectorAll("#service");
|
||||
target.forEach((e) => {
|
||||
defaultWidth = defaultWidth - e.offsetWidth;
|
||||
if (defaultWidth <= 10) return this.otherServices.push(e);
|
||||
});
|
||||
this.otherColor = this.otherServices[0]?.style.background;
|
||||
},
|
||||
closeServices() {
|
||||
this.isShowServices = false;
|
||||
},
|
||||
saveServices(selectedServices) {
|
||||
this.isShowServices = false;
|
||||
selectedServices.forEach((e) => this.services.push(e));
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.addShadow();
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="sass" scoped>
|
||||
.dark-blue
|
||||
color: var(--font-dark-blue-color)
|
||||
min-width: 50px
|
||||
|
||||
.text
|
||||
color: var(--font-grey-color)
|
||||
width: 76px
|
||||
|
||||
.change
|
||||
background: var(--bg-light-grey)
|
||||
color: var(--font-grey-color)
|
||||
|
||||
.services
|
||||
background: var(--bg-light-grey)
|
||||
color: var(--font-grey-color)
|
||||
width: 560px
|
||||
|
||||
.service
|
||||
display: -webkit-box
|
||||
overflow: hidden
|
||||
|
||||
.gradient
|
||||
width: 10%
|
||||
height: 28px
|
||||
right: 0
|
||||
|
||||
.other-serivices
|
||||
width: 474px
|
||||
padding: 4px
|
||||
border: 1px solid var(--border-light-grey-color)
|
||||
background: var(--default-white)
|
||||
|
||||
.other
|
||||
width: 46px
|
||||
background: var(--bg-light-grey)
|
||||
|
||||
.price
|
||||
background: var(--bg-light-grey)
|
||||
width: 82px
|
||||
color: var(--font-grey-color)
|
||||
|
||||
.title-info
|
||||
color: var(--font-grey-color)
|
||||
border-bottom: 1.5px solid var(--font-grey-color)
|
||||
&:hover
|
||||
color: var(--btn-blue-color)
|
||||
border-bottom: 1.5px solid var(--btn-blue-color)
|
||||
&.active
|
||||
color: var(--btn-blue-color)
|
||||
border-bottom: 1.5px solid var(--btn-blue-color)
|
||||
|
||||
.footer
|
||||
border-top: 1px solid var(--border-light-grey-color)
|
||||
margin: 40px -32px 0px
|
||||
padding: 16px 32px 0px 32px
|
||||
|
||||
.icon :deep(path)
|
||||
fill: var(--font-grey-color)
|
||||
</style>
|
||||
@@ -48,29 +48,10 @@ export const statuses = [
|
||||
label: "Не принят",
|
||||
icon: not_accepted,
|
||||
value: "not_accepted",
|
||||
class: "not-accepted",
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
label: "Принят",
|
||||
icon: accepted,
|
||||
value: "accepted",
|
||||
class: "accepted",
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
label: "Отказ",
|
||||
icon: rejected,
|
||||
value: "rejected",
|
||||
class: "rejected",
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
label: "На приеме",
|
||||
icon: reception,
|
||||
value: "reception",
|
||||
class: "reception",
|
||||
},
|
||||
{ id: 1, label: "Принят", icon: accepted, value: "accepted" },
|
||||
{ id: 2, label: "Отказ", icon: rejected, value: "rejected" },
|
||||
{ id: 3, label: "На приеме", icon: reception, value: "reception" },
|
||||
],
|
||||
},
|
||||
{
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
padding="0",
|
||||
@click="(e) => addNewAllergy(e)"
|
||||
)
|
||||
q-icon.icon(name="app:plus", size="24px", left)
|
||||
q-icon(name="app:icon-plus", size="12px", left)
|
||||
span Добавить
|
||||
</template>
|
||||
|
||||
@@ -158,9 +158,7 @@ export default {
|
||||
.label-field
|
||||
color: var(--font-grey-color)
|
||||
.on-left
|
||||
margin-right: 4px
|
||||
margin-right: 10px
|
||||
.q-btn :deep(.q-ripple)
|
||||
display: none
|
||||
.icon :deep(path)
|
||||
fill: var(--btn-blue-color)
|
||||
</style>
|
||||
|
||||
@@ -114,7 +114,6 @@ export default {
|
||||
basic: (state) => state.medical.basicData,
|
||||
isNew: (state) => state.medical.medicalCard.type === "new",
|
||||
medicalCard: (state) => state.medical.medicalCard,
|
||||
addresses: (state) => state.medical.medicalCard.person.addresses,
|
||||
}),
|
||||
},
|
||||
methods: {
|
||||
@@ -134,21 +133,21 @@ export default {
|
||||
}
|
||||
Object.keys(this.basic).map((key) => {
|
||||
if (key === "registrationAddress")
|
||||
this.postAdresses(
|
||||
this.getRequestChangeData(
|
||||
this.basic.registrationAddress,
|
||||
this.initDataBasic[key],
|
||||
"REGISTRATION_ADDRESS"
|
||||
"Адрес регистрации"
|
||||
);
|
||||
if (key === "residenceAddress")
|
||||
this.postAdresses(
|
||||
this.getRequestChangeData(
|
||||
this.basic.residenceAddress,
|
||||
this.initDataBasic[key],
|
||||
"CURRENT_ADDRESS"
|
||||
"Адрес проживания"
|
||||
);
|
||||
});
|
||||
this.isEdit = false;
|
||||
},
|
||||
postAdresses(updateData, initData, key) {
|
||||
getRequestChangeData(updateData, initData, key) {
|
||||
let isInitDataEmpty = [...Object.keys(removeEmptyFields(initData))]
|
||||
.length;
|
||||
if (Object.keys(removeEmptyFields(updateData)).length) {
|
||||
@@ -160,7 +159,7 @@ export default {
|
||||
});
|
||||
if (JSON.stringify(updateData) !== JSON.stringify(initData))
|
||||
return this.updateAddress({
|
||||
id: this.addresses.find(({ category }) => category === key).id,
|
||||
id: this.basic.personalData.id,
|
||||
address: updateData,
|
||||
category: key,
|
||||
});
|
||||
@@ -182,10 +181,22 @@ export default {
|
||||
const form = this.$refs.formBasicData;
|
||||
form.validate().then((validate) => {
|
||||
if (validate) {
|
||||
this.updateBasicData();
|
||||
this.isLoadingData = false;
|
||||
this.isEdit = false;
|
||||
this.isCheckChange = false;
|
||||
let person = this.basic.personalData;
|
||||
this.$store.dispatch("setMedicalCardData", {
|
||||
...this.medicalCard,
|
||||
person: {
|
||||
...this.medicalCard.person,
|
||||
...person,
|
||||
},
|
||||
});
|
||||
//let updateBasic = this.updateBasicData();
|
||||
// Promise.allSettled(updateBasic)
|
||||
// .then(() => this.$store.dispatch("getMedicalCardData"))
|
||||
// .then(() => {
|
||||
// this.isLoadingData = false;
|
||||
// this.isEdit = false;
|
||||
// this.isCheckChange = false;
|
||||
// });
|
||||
} else {
|
||||
getFieldsNameUnvalidated(form).forEach((errorKey) => {
|
||||
addNotification(
|
||||
|
||||
@@ -20,12 +20,12 @@
|
||||
@click="() => copyLinkNetwork(data.value)"
|
||||
style="background-color: var(--bg-light-grey)"
|
||||
)
|
||||
q-icon.icon(:name="mapNetworks[data.category].icon" :class="{old: data.id, new: data.filled}")
|
||||
span.text-sm.font-medium {{ mapNetworks[data.category].title || data.value }}
|
||||
q-icon.icon(:name="mapNetworks[data.kind].icon" :class="{old: data.id, new: data.filled}")
|
||||
span.text-sm.font-medium {{ mapNetworks[data.kind].title || data.value }}
|
||||
.flex.gap-10px(v-else v-click-outside="() => checkNetworksField(index)" :key="key+index")
|
||||
base-select-networks(
|
||||
:list-data="Object.values(mapNetworks)"
|
||||
:option-data="data.category"
|
||||
:option-data="data.kind"
|
||||
:choose-option="(e) => chooseNetwork(e, index)"
|
||||
:style-border="true"
|
||||
:size-input="50"
|
||||
@@ -74,9 +74,9 @@ import {
|
||||
getFieldsNameUnvalidated,
|
||||
} from "@/shared/utils/changesObjects";
|
||||
import { contactsDataForm } from "@/pages/newMedicalCard/utils/medicalConfig";
|
||||
import { getRequestArrayData } from "@/shared/utils/wrapperRequestChangeData";
|
||||
import { mapState, mapGetters } from "vuex";
|
||||
import BaseInput from "@/components/base/BaseInput.vue";
|
||||
import { mapActions } from "vuex";
|
||||
|
||||
export default {
|
||||
name: "ContactsForm",
|
||||
@@ -106,14 +106,13 @@ export default {
|
||||
}),
|
||||
},
|
||||
methods: {
|
||||
...mapActions({
|
||||
createContact: "postCreateContact",
|
||||
updateContact: "postUpdateContact",
|
||||
delContacts: "deleteContact",
|
||||
}),
|
||||
checkNetworksField(index) {
|
||||
if (this.contacts.networks[index].category)
|
||||
if (
|
||||
this.contacts.networks[index].kind &&
|
||||
this.contacts.networks[index].username
|
||||
) {
|
||||
this.contacts.networks[index].filled = true;
|
||||
}
|
||||
},
|
||||
openEdit() {
|
||||
this.isEdit = true;
|
||||
@@ -124,46 +123,35 @@ export default {
|
||||
this.isCheckChange = false;
|
||||
},
|
||||
updateContacts() {
|
||||
this.isLoadingData = true;
|
||||
const allNewContacts = [
|
||||
...this.contacts.phones,
|
||||
...this.contacts.emails,
|
||||
...this.contacts.networks,
|
||||
];
|
||||
const notEmptyContacts = allNewContacts.filter((el) => el.category);
|
||||
return this.changeContacts(this.initAllContacts, notEmptyContacts);
|
||||
},
|
||||
changeContacts(initData, notEmptyContacts) {
|
||||
const deleteRequests = initData
|
||||
.filter((el) => !notEmptyContacts.find((data) => data.id === el.id))
|
||||
.map((el) => this.delContacts({ id: el.id }));
|
||||
const requests = notEmptyContacts.map((el) => {
|
||||
const requestObj = {
|
||||
category: el.category,
|
||||
value: el.value,
|
||||
};
|
||||
delete requestObj.id;
|
||||
if (!el?.id)
|
||||
return this.createContact({ obj: requestObj, id: this.personId });
|
||||
if (
|
||||
el?.id &&
|
||||
checkChangeData(
|
||||
initData.find((obj) => obj.id === el.id),
|
||||
el
|
||||
)
|
||||
)
|
||||
return this.updateContact({ obj: requestObj, id: el.id });
|
||||
});
|
||||
return requests.concat(deleteRequests);
|
||||
const notEmptyContacts = allNewContacts.filter(
|
||||
(el) => el.kind && el.username
|
||||
);
|
||||
return getRequestArrayData(
|
||||
this.initAllContacts,
|
||||
notEmptyContacts,
|
||||
"person",
|
||||
this.personId,
|
||||
"general",
|
||||
"contact"
|
||||
);
|
||||
},
|
||||
saveChange() {
|
||||
const form = this.$refs.formContacts;
|
||||
form.validate().then((validate) => {
|
||||
if (validate) {
|
||||
this.updateContacts();
|
||||
this.isLoadingData = true;
|
||||
Promise.allSettled(this.updateContacts())
|
||||
.then(() => this.$store.dispatch("getMedicalCardData"))
|
||||
.then(() => {
|
||||
this.isLoadingData = false;
|
||||
this.isEdit = false;
|
||||
this.isCheckChange = false;
|
||||
});
|
||||
} else {
|
||||
getFieldsNameUnvalidated(form).forEach((errorKey) => {
|
||||
addNotification(
|
||||
@@ -184,25 +172,27 @@ export default {
|
||||
);
|
||||
},
|
||||
chooseNetwork(e, index) {
|
||||
this.contacts.networks[index].category = e.currentTarget.id;
|
||||
this.contacts.networks[index].kind = e.currentTarget.id;
|
||||
},
|
||||
addNewContact(e, key) {
|
||||
if (e.pointerType) {
|
||||
if (key === "networks") {
|
||||
this.contacts[key].push({
|
||||
filled: false,
|
||||
category: this.configData[key]?.category,
|
||||
kind: this.configData[key]?.kind,
|
||||
username: null,
|
||||
});
|
||||
} else {
|
||||
this.contacts[key].push({
|
||||
category: this.configData[key]?.category,
|
||||
kind: this.configData[key]?.kind,
|
||||
username: null,
|
||||
});
|
||||
}
|
||||
}
|
||||
this.checkChangeInput();
|
||||
},
|
||||
deleteContact(key, index) {
|
||||
this.contacts[key]?.splice(index, 1);
|
||||
this.contacts[key].splice(index, 1);
|
||||
this.checkChangeInput();
|
||||
},
|
||||
copyLinkNetwork(value) {
|
||||
|
||||
@@ -19,20 +19,19 @@
|
||||
q-avatar(
|
||||
rounded,
|
||||
size="40px",
|
||||
v-if="docData[data.dataKey]?.attachments?.photo"
|
||||
v-if="docData[data.dataKey][field.key]?.photo"
|
||||
)
|
||||
img.h-10.w-10.object-cover(
|
||||
:src="docData[data.dataKey]?.attachments?.photo",
|
||||
:src="docData[data.dataKey][field.key]?.photo",
|
||||
:alt="docData[data.dataKey][field.label]"
|
||||
)
|
||||
q-badge.delete(
|
||||
floating,
|
||||
v-if="isEdit",
|
||||
rounded,
|
||||
@click="removeImage(data?.dataKey, field?.key)",
|
||||
:style="{padding: 0}"
|
||||
@click="removeImage(data?.dataKey, field?.key)"
|
||||
)
|
||||
q-icon.cancel-icon(name="app:cancel-mini", size="16px")
|
||||
q-icon(name="app:icon-cancel", size="8px")
|
||||
.replace-photo.font-medium.text-base.cursor-pointer(
|
||||
v-if="isEdit",
|
||||
@click="openModal(data.dataKey)",
|
||||
@@ -45,30 +44,46 @@
|
||||
base-input-date(
|
||||
v-if="field.type === 'date'",
|
||||
v-model="docData[data.dataKey][field.key]",
|
||||
:name="data.dataKey + ':' + field.key",
|
||||
:name="field.key",
|
||||
@update:model-value="checkChangeDocData",
|
||||
:readonly="!isEdit",
|
||||
:width="302",
|
||||
:mask="field?.inputMask",
|
||||
:rule="(val) => !personDataField.includes(data.dataKey + ':' + field.key) ? checkPassportFields(val, field.rules) : field.rules(val)",
|
||||
size="M",
|
||||
:rule="[(val) => !personDataField.includes(field.key) ? checkPassportFields(val, field.rules) : field.rules(val)]",
|
||||
:autogrow="field.key === 'issued_by_org'",
|
||||
size="M"
|
||||
)
|
||||
base-input(
|
||||
v-if="field.type === 'text'",
|
||||
v-if="field.type === 'text' && field.key !== 'issued_by_org'",
|
||||
v-model="docData[data.dataKey][field.key]",
|
||||
:name="data.dataKey + ':' + field.key",
|
||||
:name="field.key",
|
||||
@update:model-value="checkChangeDocData",
|
||||
:readonly="!isEdit",
|
||||
:type="field.type",
|
||||
:width="302",
|
||||
:mask="field?.inputMask",
|
||||
:rule="[(val) => !personDataField.includes(data.dataKey + ':' + field.key) ? checkPassportFields(val, field.rules) : field.rules(val, initialDocData?.[data.dataKey]?.id)]",
|
||||
:rule="[(val) => !personDataField.includes(field.key) ? checkPassportFields(val, field.rules) : field.rules(val)]",
|
||||
size="M"
|
||||
)
|
||||
.icon-copy.my-auto.text-lg.label-field.cursor-pointer(
|
||||
v-if="checkCopiedFields(field.key) && !!docData[data.dataKey][field.key]",
|
||||
@click="copyValue(docData[data.dataKey][field.key])"
|
||||
)
|
||||
base-textarea(
|
||||
v-if="field.type === 'text' && field.key === 'issued_by_org'",
|
||||
v-model="docData[data.dataKey][field.key]",
|
||||
:name="field.key",
|
||||
@update:model-value="checkChangeDocData",
|
||||
:readonly="!isEdit",
|
||||
:type="field.type",
|
||||
:width="302",
|
||||
:mask="field?.inputMask",
|
||||
:rule="[(val) => !personDataField.includes(field.key) ? checkPassportFields(val, field.rules) : field.rules(val)]",
|
||||
autogrow,
|
||||
size="auto",
|
||||
height="57px"
|
||||
padding="10px 16px"
|
||||
)
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -86,7 +101,7 @@ import TheNotificationProvider from "@/components/Notifications/TheNotificationP
|
||||
import { addNotification } from "@/components/Notifications/notificationContext";
|
||||
import BaseInput from "@/components/base/BaseInput.vue";
|
||||
import BaseInputDate from "@/components/base/BaseInputDate.vue";
|
||||
import { mapActions } from "vuex";
|
||||
import BaseTextarea from "@/components/base/BaseTextarea.vue.vue";
|
||||
export default {
|
||||
name: "DocumentsForm",
|
||||
components: {
|
||||
@@ -97,6 +112,7 @@ export default {
|
||||
BaseUploadPhoto,
|
||||
TheNotificationProvider,
|
||||
BaseInputDate,
|
||||
BaseTextarea,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -105,6 +121,7 @@ export default {
|
||||
docData: null,
|
||||
isCheckChange: false,
|
||||
isLoadingData: true,
|
||||
approvedPassportData: false,
|
||||
copiedFields: [
|
||||
"series",
|
||||
"number",
|
||||
@@ -113,42 +130,34 @@ export default {
|
||||
],
|
||||
initializationData: {
|
||||
passport: {
|
||||
category: "passport",
|
||||
id: null,
|
||||
series: null,
|
||||
number: null,
|
||||
issued_by: null,
|
||||
issued_by_org: null,
|
||||
issued_by_org_code: null,
|
||||
issued_at: null,
|
||||
attachments: null,
|
||||
issued_by_date: null,
|
||||
photo: null,
|
||||
},
|
||||
insurance_number: {
|
||||
id: null,
|
||||
category: "insurance_number",
|
||||
number: null,
|
||||
attachments: null,
|
||||
insurance_number: null,
|
||||
photo_insurance_number: null,
|
||||
},
|
||||
tax_identification_number: {
|
||||
id: null,
|
||||
category: "tax_identification_number",
|
||||
number: null,
|
||||
attachments: null,
|
||||
tax_identification_number: null,
|
||||
photo_tax_identification_number: null,
|
||||
},
|
||||
},
|
||||
personDataField: [
|
||||
"insurance_number:number",
|
||||
"tax_identification_number:number",
|
||||
],
|
||||
personDataField: ["insurance_number", "tax_identification_number"],
|
||||
showModal: false,
|
||||
photoId: "",
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
initialDocData() {
|
||||
return this.$store.state.medical.documents;
|
||||
return this.$store.state.medical?.documents;
|
||||
},
|
||||
passportFields() {
|
||||
let excludedFields = ["attachments", "id", "category"];
|
||||
let excludedFields = ["photo", "id"];
|
||||
return Object.keys(this.docData.passport).filter(
|
||||
(key) => !excludedFields.includes(key)
|
||||
);
|
||||
@@ -164,13 +173,15 @@ export default {
|
||||
.getValidationComponents()
|
||||
.filter((elem) => !this.personDataField.includes(elem.name))
|
||||
.forEach((elem) => elem.resetValidation());
|
||||
this.approvedPassportData = true;
|
||||
return true;
|
||||
}
|
||||
this.approvedPassportData = false;
|
||||
return defaultRule(val);
|
||||
},
|
||||
removeImage(docKey, field) {
|
||||
this.docData[docKey][field] = {};
|
||||
this.checkChangeDocData();
|
||||
this.isCheckChange = true;
|
||||
},
|
||||
copyValue(text) {
|
||||
navigator.clipboard.writeText(text);
|
||||
@@ -179,7 +190,9 @@ export default {
|
||||
return !this.isEdit && this.copiedFields.some((elem) => elem === key);
|
||||
},
|
||||
cancelEdit() {
|
||||
this.docData = this.destruct(this.initialDocData);
|
||||
this.docData = JSON.parse(JSON.stringify(this.initialDocData));
|
||||
this.docData.passport.issued_by_date =
|
||||
this.initialDocData?.passport?.issued_by_date;
|
||||
this.isEdit = false;
|
||||
this.isCheckChange = false;
|
||||
this.$refs.documentForm.resetValidation();
|
||||
@@ -188,10 +201,7 @@ export default {
|
||||
this.isEdit = true;
|
||||
},
|
||||
checkChangeDocData() {
|
||||
this.isCheckChange = checkChangeData(
|
||||
this.destruct(this.initialDocData),
|
||||
this.docData
|
||||
);
|
||||
this.isCheckChange = checkChangeData(this.initialDocData, this.docData);
|
||||
},
|
||||
openModal(id) {
|
||||
this.photoId = id;
|
||||
@@ -207,48 +217,95 @@ export default {
|
||||
if (!validate) {
|
||||
getFieldsNameUnvalidated(form).forEach((elem) => {
|
||||
let error = {};
|
||||
this.configData.forEach(({ dataKey, fields }) => {
|
||||
let findedElem = fields.find(
|
||||
(el) => dataKey + ":" + el.key === elem
|
||||
);
|
||||
this.configData.forEach(({ fields }) => {
|
||||
let findedElem = fields.find((el) => el.key === elem);
|
||||
if (findedElem) error = findedElem?.errorMessage;
|
||||
});
|
||||
this.addErrorNotification(error?.title, error?.message);
|
||||
});
|
||||
} else {
|
||||
let request = [];
|
||||
Object.keys(this.docData).forEach((elem) => {
|
||||
this.checkChangePhoto(elem, "attachments");
|
||||
let newData = JSON.parse(JSON.stringify(this.docData[elem]));
|
||||
newData.attachments = {};
|
||||
if (!checkChangeData(this.initialDocData?.[elem], newData)) return;
|
||||
delete newData.id;
|
||||
if (newData?.issued_by_org_code) {
|
||||
console.log(
|
||||
"passport issued_by_org_code",
|
||||
newData.issued_by_org_code
|
||||
let passportFormData = new FormData();
|
||||
let documentsFormData = new FormData();
|
||||
form.getValidationComponents().forEach((elem) => {
|
||||
if (!this.personDataField.includes(elem.name)) {
|
||||
if (elem.name === "issued_by_date") {
|
||||
passportFormData.append(
|
||||
elem.name,
|
||||
this.convertFormat(elem.modelValue) ?? ""
|
||||
);
|
||||
delete newData.issued_by_org_code;
|
||||
}
|
||||
delete newData.attachments;
|
||||
Object.keys(this.docData[elem])?.forEach((key) => {
|
||||
if (!this.docData[elem]?.[key]) delete newData?.[key];
|
||||
} else passportFormData.append(elem.name, elem.modelValue ?? "");
|
||||
} else documentsFormData.append(elem.name, elem.modelValue ?? "");
|
||||
});
|
||||
if (!this.initialDocData?.[elem]?.id) {
|
||||
newData.person_id =
|
||||
this.$store.state.medical?.basicData?.personalData?.id;
|
||||
request.push(this.createData("documents/", newData));
|
||||
} else {
|
||||
this.checkChangePhoto("passport", "photo", passportFormData);
|
||||
this.checkChangePhoto(
|
||||
"insurance_number",
|
||||
"photo_insurance_number",
|
||||
documentsFormData
|
||||
);
|
||||
this.checkChangePhoto(
|
||||
"tax_identification_number",
|
||||
"photo_tax_identification_number",
|
||||
documentsFormData
|
||||
);
|
||||
let request = [];
|
||||
if (!this.approvedPassportData) {
|
||||
if (!this.initialDocData.passport?.id) {
|
||||
passportFormData.append("kind", "PASSPORT");
|
||||
passportFormData.append(
|
||||
"person",
|
||||
this.$store.state.medical?.basicData?.personalData?.id
|
||||
);
|
||||
request.push(
|
||||
this.updateData(
|
||||
`documents/${this.initialDocData?.[elem]?.id}`,
|
||||
newData
|
||||
this.sendData(
|
||||
"general/identity_document/create/",
|
||||
passportFormData
|
||||
)
|
||||
);
|
||||
} else {
|
||||
if (this.checkPhotoDeletion("passport", "photo"))
|
||||
request.push(
|
||||
this.deletePhoto(
|
||||
`general/identity_document/${this.initialDocData.passport?.id}/delete_photo/`
|
||||
)
|
||||
);
|
||||
request.push(
|
||||
this.sendData(
|
||||
`general/identity_document/${this.initialDocData.passport?.id}/update/`,
|
||||
passportFormData
|
||||
)
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
if (
|
||||
this.checkPhotoDeletion(
|
||||
"insurance_number",
|
||||
"photo_insurance_number"
|
||||
)
|
||||
)
|
||||
request.push(
|
||||
this.deletePhoto(
|
||||
`general/person/${this.$store.state.medical?.basicData?.personalData?.id}/delete_photo_insurance_number/`
|
||||
)
|
||||
);
|
||||
if (
|
||||
this.checkPhotoDeletion(
|
||||
"tax_identification_number",
|
||||
"photo_tax_identification_number"
|
||||
)
|
||||
)
|
||||
request.push(
|
||||
this.deletePhoto(
|
||||
`general/person/${this.$store.state.medical?.basicData?.personalData?.id}/delete_photo_tax_identification_number/`
|
||||
)
|
||||
);
|
||||
request.push(
|
||||
this.sendData(
|
||||
`general/person/${this.$store.state.medical?.basicData?.personalData?.id}/update/`,
|
||||
documentsFormData
|
||||
)
|
||||
);
|
||||
Promise.allSettled(request).then(() => {
|
||||
this.getMedicalDataById(this.$route.params.id);
|
||||
this.$store.dispatch("getMedicalCardData");
|
||||
this.isEdit = false;
|
||||
this.isCheckChange = false;
|
||||
this.$refs.form?.resetValidation();
|
||||
@@ -256,19 +313,18 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
checkChangePhoto(updatedObjId, field) {
|
||||
checkChangePhoto(updatedObjId, field, formData) {
|
||||
if (this.docData[updatedObjId][field]?.file)
|
||||
console.log(
|
||||
updatedObjId,
|
||||
field,
|
||||
this.docData[updatedObjId][field]?.file[0]
|
||||
formData.append(field, this.docData[updatedObjId][field]?.file[0]);
|
||||
},
|
||||
checkPhotoDeletion(updatedObjId, field) {
|
||||
return (
|
||||
!Object.keys(this.docData[updatedObjId][field]).length &&
|
||||
this.initialDocData[updatedObjId][field]?.photo
|
||||
);
|
||||
},
|
||||
async createData(url, body) {
|
||||
return await fetchWrapper.post(url, body);
|
||||
},
|
||||
async updateData(url, body) {
|
||||
return await fetchWrapper.patch(url, body);
|
||||
async sendData(url, body) {
|
||||
return await fetchWrapper.post(url, body, "formData");
|
||||
},
|
||||
async deletePhoto(url) {
|
||||
return await fetchWrapper.del(url);
|
||||
@@ -277,19 +333,7 @@ export default {
|
||||
addNotification(title + message, title, message, "error", 5000);
|
||||
},
|
||||
convertFormat(date) {
|
||||
return date ? date.split(".").reverse().join("-") : "";
|
||||
},
|
||||
...mapActions({
|
||||
getMedicalDataById: "getMedicalDataById",
|
||||
}),
|
||||
destruct(data) {
|
||||
const { passport, insurance_number, tax_identification_number } =
|
||||
JSON.parse(JSON.stringify(data));
|
||||
return {
|
||||
passport: passport,
|
||||
insurance_number: insurance_number,
|
||||
tax_identification_number: tax_identification_number,
|
||||
};
|
||||
return date ? date.split(".").reverse().join("-") : null;
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
@@ -297,8 +341,11 @@ export default {
|
||||
deep: true,
|
||||
immediate: true,
|
||||
handler(value) {
|
||||
if (Object.keys(value).length) this.docData = this.destruct(value);
|
||||
else this.docData = this.initializationData;
|
||||
if (Object.keys(value).length) {
|
||||
this.docData = JSON.parse(JSON.stringify(this.initialDocData));
|
||||
this.docData.passport.issued_by_date =
|
||||
this.initialDocData?.passport?.issued_by_date;
|
||||
} else this.docData = this.initializationData;
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -323,13 +370,9 @@ export default {
|
||||
min-width: 302px
|
||||
.icon-copy .cursor
|
||||
cursor: pointer !important
|
||||
.icon-cancel :deep(path)
|
||||
fill: var(--default-white)
|
||||
.q-badge
|
||||
padding: 4px
|
||||
cursor: pointer
|
||||
.delete
|
||||
background-color: var(--btn-red-color)
|
||||
.cancel-icon :deep(path)
|
||||
fill: white
|
||||
</style>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
:save="saveChange",
|
||||
:cancel="cancelEdit"
|
||||
)
|
||||
q-form.form-wrap.gap-24.w-full(ref="insuranceForm", :no-error-focus="true")
|
||||
.form-wrap.gap-24.w-full
|
||||
.flex.flex-col.gap-4(v-for="insurance in insuranceConfig", :key="insurance.insuranceKey")
|
||||
.font-semibold.text-sm.whitespace-nowrap {{insurance.insuranceLabel}}
|
||||
.flex.w-full.justify-between.items-center.gap-4(
|
||||
@@ -17,27 +17,23 @@
|
||||
:style="{marginTop: field.label === 'Документы' ? '20px' : null}"
|
||||
)
|
||||
.label-field.font-sm.text-sm.whitespace-nowrap {{`${field.label} :`}}
|
||||
.flex.gap-3.items-center.h-10.w-10(
|
||||
v-if="field.type === 'photo'",
|
||||
:style="{'min-width': field.label === 'Документы' ? '324px' : '302px'}"
|
||||
)
|
||||
.flex.w-10.h-10.relative(v-if="insuranceData[insurance.insuranceKey]?.attachments?.photo")
|
||||
.avatar-field.flex.gap-3.items-center.h-10.w-10(v-if="field.type === 'avatar'")
|
||||
.flex.w-10.h-10.relative(v-if="basic[insurance.insuranceKey][field.key]?.photo")
|
||||
img.rounded.avatar.object-cover(
|
||||
:src="insuranceData[insurance.insuranceKey]?.attachments?.photo",
|
||||
:src="basic[insurance.insuranceKey][field.key].photo",
|
||||
alt="AV"
|
||||
)
|
||||
q-badge.delete(
|
||||
floating,
|
||||
v-if="isEdit",
|
||||
@click="removeImage(insurance?.insuranceKey, field?.key)",
|
||||
rounded,
|
||||
:style="{padding: 0}"
|
||||
rounded
|
||||
)
|
||||
q-icon.cancel-icon(name="app:cancel-mini", size="16px")
|
||||
q-icon(name="app:icon-cancel", size="8px")
|
||||
.replace-photo.font-medium.text-base.cursor-pointer(
|
||||
v-if="isEdit",
|
||||
@click="changeModal(insurance.insuranceKey)"
|
||||
) {{ insuranceData[insurance.insuranceKey]?.attachments?.photo ? "Заменить фото" : "Добавить фото" }}
|
||||
) {{ basic[insurance.insuranceKey][field.key]?.photo ? "Заменить фото" : "Добавить фото" }}
|
||||
base-modal(
|
||||
v-if="insurance.insuranceKey === photoId"
|
||||
v-model="showModal",
|
||||
@@ -45,18 +41,18 @@
|
||||
)
|
||||
base-upload-photo(
|
||||
:key="insurance.insuranceKey"
|
||||
v-model="insuranceData[photoId][field.key]"
|
||||
v-model="basic[photoId][field.key]"
|
||||
:confirm-upload="confirmChangePhoto"
|
||||
)
|
||||
.category.flex.h-10.relative.gap-x-2(v-else-if="field.type === 'select'")
|
||||
.category-select.flex.items-center.change.px-4.rounded {{selectCategory(basic[insurance.insuranceKey][field.key])}}
|
||||
q-btn.change.flex.w-7.h-9.rounded-md(
|
||||
v-if="isEdit",
|
||||
@click="openModalCategories",
|
||||
dense,
|
||||
padding="8px"
|
||||
.flex.h-10.relative(
|
||||
v-else-if="field.type === 'select'",
|
||||
@click="openModalCategories"
|
||||
)
|
||||
q-icon.icon(name="app:folder", size="24px")
|
||||
q-field.items-center.categories(
|
||||
:style="{cursor: isEdit ? 'pointer' : 'default'}",
|
||||
:readonly="!isEdit",
|
||||
outlined
|
||||
) {{selectCategory(basic[insurance.insuranceKey][field.key])}}
|
||||
base-modal(
|
||||
default-padding,
|
||||
hide-header,
|
||||
@@ -81,36 +77,33 @@
|
||||
) {{"\xa0" + basic?.benefit[insurance?.discount] + "%"}}
|
||||
.input-container.flex.flex-col.relative(v-else)
|
||||
base-input(
|
||||
v-model="insuranceData[insurance.insuranceKey][field.key]",
|
||||
v-model="basic[insurance.insuranceKey][field.key]",
|
||||
@update:model-value="checkChangeInput",
|
||||
:mask="field?.inputMask",
|
||||
:readonly="!isEdit",
|
||||
size="M",
|
||||
:name="insurance.insuranceKey + ':' + field.key",
|
||||
:rule="[(val) => checkFields(val, insurance.insuranceKey, field.rules)]"
|
||||
:type="field.type",
|
||||
size="M"
|
||||
)
|
||||
q-icon.my-auto.text-lg.label-field.cursor-pointer.copy(
|
||||
q-icon.my-auto.text-lg.label-field.cursor-pointer(
|
||||
size="18px",
|
||||
name="app:copy",
|
||||
v-if="checkCopiedFields(field.key, insuranceData[insurance.insuranceKey])",
|
||||
@click="copyValue(insuranceData[insurance.insuranceKey][field.key])"
|
||||
name="app:icon-copy",
|
||||
v-if="checkCopiedFields(field.key, basic[insurance.insuranceKey])",
|
||||
@click="copyValue(basic[insurance.insuranceKey][field.key])"
|
||||
)
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { baseInsuranceForm } from "@/pages/newMedicalCard/utils/medicalConfig";
|
||||
import { mapActions, mapGetters, mapState } from "vuex";
|
||||
import { mapGetters, mapState } from "vuex";
|
||||
import MedicalFormWrapper from "@/pages/newMedicalCard/components/MedicalFormWrapper.vue";
|
||||
import BaseAvatar from "@/components/base/BaseAvatar.vue";
|
||||
import { fetchWrapper } from "@/shared/fetchWrapper";
|
||||
import BaseModal from "@/components/base/BaseModal.vue";
|
||||
import BaseUploadPhoto from "@/components/base/BaseUploadPhoto.vue";
|
||||
import BaseCategorySelection from "@/components/base/BaseCategorySelection.vue";
|
||||
import { checkChangeData } from "@/shared/utils/changesObjects";
|
||||
import { addNotification } from "@/components/Notifications/notificationContext";
|
||||
import BaseInput from "@/components/base/BaseInput.vue";
|
||||
import {
|
||||
checkChangeData,
|
||||
getFieldsNameUnvalidated,
|
||||
} from "@/shared/utils/changesObjects.js";
|
||||
|
||||
export default {
|
||||
name: "InsuranceForm",
|
||||
@@ -132,70 +125,28 @@ export default {
|
||||
showModalCategories: false,
|
||||
photoId: "",
|
||||
copiedFields: ["series", "number"],
|
||||
insuranceData: {},
|
||||
initializationData: {
|
||||
OMS: {
|
||||
category: "OMS",
|
||||
id: null,
|
||||
series: null,
|
||||
number: null,
|
||||
issued_by: null,
|
||||
issued_at: "",
|
||||
attachments: null,
|
||||
},
|
||||
DMS: {
|
||||
category: "OMS",
|
||||
id: null,
|
||||
series: null,
|
||||
number: null,
|
||||
issued_by: null,
|
||||
issued_at: "",
|
||||
attachments: null,
|
||||
},
|
||||
},
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters({
|
||||
url: "getUrl",
|
||||
avatar: "getAvatar",
|
||||
initDataBasic: "getBasicData",
|
||||
}),
|
||||
...mapState({
|
||||
basic: (state) => state.medical?.basicData,
|
||||
benefitData: (state) => state.medical?.benefitData,
|
||||
basic: (state) => state.medical.basicData,
|
||||
benefitData: (state) => state.medical.benefitData,
|
||||
}),
|
||||
initialDocData() {
|
||||
return this.$store.state.medical.documents;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
checkFields(val, insuranceKey, defaultRule) {
|
||||
const filteredFields = ["series", "number"];
|
||||
if (
|
||||
filteredFields?.every(
|
||||
(elem) => !this.insuranceData?.[insuranceKey]?.[elem]
|
||||
) &&
|
||||
!this.initialDocData?.[insuranceKey]?.id
|
||||
) {
|
||||
this.$refs.insuranceForm
|
||||
.getValidationComponents()
|
||||
.filter(
|
||||
(elem) =>
|
||||
elem.name === `${insuranceKey}:series` ||
|
||||
elem.name === `${insuranceKey}:number`
|
||||
)
|
||||
.forEach((elem) => elem.resetValidation());
|
||||
return true;
|
||||
}
|
||||
return defaultRule(val);
|
||||
},
|
||||
filterDataBenefit(text) {
|
||||
if (text.length > 1)
|
||||
return this.$store.dispatch("getBenefitDataSearch", text);
|
||||
this.$store.dispatch("getBenefitData", text);
|
||||
},
|
||||
removeImage(docKey, field) {
|
||||
this.insuranceData[docKey][field] = {};
|
||||
this.checkChangeInput();
|
||||
this.basic[docKey][field] = {};
|
||||
this.isCheckChange = true;
|
||||
},
|
||||
checkCopiedFields(key, item) {
|
||||
return (
|
||||
@@ -219,7 +170,6 @@ export default {
|
||||
this.isCheckChange = true;
|
||||
},
|
||||
changeModal(id) {
|
||||
if (id === "benefit") return;
|
||||
this.photoId = id;
|
||||
this.showModal = true;
|
||||
},
|
||||
@@ -227,101 +177,191 @@ export default {
|
||||
this.showModalCategories = false;
|
||||
},
|
||||
openModalCategories() {
|
||||
//if (this.isEdit) this.showModalCategories = true;
|
||||
if (this.isEdit) this.showModalCategories = true;
|
||||
},
|
||||
checkChangeInput() {
|
||||
this.isCheckChange = checkChangeData(
|
||||
this.destruct(this.initialDocData),
|
||||
this.insuranceData
|
||||
);
|
||||
this.isCheckChange =
|
||||
JSON.stringify(this.initDataBasic) !== JSON.stringify(this.basic)
|
||||
? true
|
||||
: false;
|
||||
},
|
||||
confirmChangePhoto() {
|
||||
this.showModal = false;
|
||||
this.isCheckChange = true;
|
||||
},
|
||||
saveChange() {
|
||||
const form = this.$refs.insuranceForm;
|
||||
form.validate().then((validate) => {
|
||||
if (!validate) {
|
||||
getFieldsNameUnvalidated(form).forEach((elem) => {
|
||||
let error = {};
|
||||
this.insuranceConfig.forEach(({ insuranceKey, fields }) => {
|
||||
let findedElem = fields.find(
|
||||
(el) => insuranceKey + ":" + el.key === elem
|
||||
);
|
||||
if (findedElem) error = findedElem?.errorMessage;
|
||||
});
|
||||
this.addErrorNotification(error?.title, error?.message);
|
||||
});
|
||||
} else {
|
||||
let request = [];
|
||||
Object.keys(this.insuranceData).forEach((elem) => {
|
||||
this.checkChangePhoto(elem, "attachments");
|
||||
let newData = JSON.parse(JSON.stringify(this.insuranceData[elem]));
|
||||
newData.attachments = {};
|
||||
if (!checkChangeData(this.initialDocData?.[elem], newData)) return;
|
||||
delete newData.id;
|
||||
delete newData.attachments;
|
||||
Object.keys(this.insuranceData[elem])?.forEach((key) => {
|
||||
if (!this.insuranceData?.[elem]?.[key]) delete newData?.[key];
|
||||
});
|
||||
if (!this.initialDocData?.[elem]?.id) {
|
||||
newData.person_id =
|
||||
this.$store.state.medical?.basicData?.personalData?.id;
|
||||
request.push(this.createData("documents/", newData));
|
||||
} else
|
||||
request.push(
|
||||
this.updateData(
|
||||
`documents/${this.initialDocData?.[elem]?.id}`,
|
||||
newData
|
||||
|
||||
updateBasicData() {
|
||||
let insuranceDMS = this.basic.insuranceDMS;
|
||||
let insuranceOMS = this.basic.insuranceOMS;
|
||||
let personal = this.basic.personalData;
|
||||
let benefit = this.basic.benefit;
|
||||
|
||||
const insuranceFormDataDMS = new FormData();
|
||||
const insuranceFormDataOMS = new FormData();
|
||||
const benefitFormData = new FormData();
|
||||
|
||||
if (insuranceDMS.series && insuranceDMS.number) {
|
||||
for (let key in insuranceDMS) {
|
||||
if (insuranceDMS[key] && key !== "photo" && key !== "id")
|
||||
insuranceFormDataDMS.append(key, insuranceDMS[key]);
|
||||
}
|
||||
}
|
||||
if (
|
||||
insuranceDMS.photo.file &&
|
||||
insuranceDMS.photo.photo !== this.initDataBasic.insuranceDMS.photo.photo
|
||||
)
|
||||
insuranceFormDataDMS.append("photo", insuranceDMS.photo.file[0]);
|
||||
|
||||
if (insuranceOMS.series && insuranceOMS.number) {
|
||||
for (let key in insuranceOMS) {
|
||||
if (insuranceOMS[key] && key !== "photo" && key !== "id")
|
||||
insuranceFormDataOMS.append(key, insuranceOMS[key]);
|
||||
}
|
||||
}
|
||||
if (
|
||||
insuranceOMS.photo.file &&
|
||||
insuranceOMS.photo.photo !== this.initDataBasic.insuranceOMS.photo.photo
|
||||
)
|
||||
insuranceFormDataOMS.append("photo", insuranceOMS.photo.file[0]);
|
||||
|
||||
const request = Object.keys(this.basic).map((key) => {
|
||||
if (
|
||||
key === "insuranceDMS" &&
|
||||
!insuranceDMS?.id &&
|
||||
insuranceDMS.series &&
|
||||
insuranceDMS.number
|
||||
) {
|
||||
insuranceFormDataDMS.append("title", "DMS");
|
||||
insuranceFormDataDMS.append("person", personal.id);
|
||||
return this.sendData(
|
||||
`general/insurance_policy/create/`,
|
||||
insuranceFormDataDMS
|
||||
);
|
||||
}
|
||||
if (
|
||||
key === "insuranceOMS" &&
|
||||
!insuranceOMS?.id &&
|
||||
insuranceOMS.series &&
|
||||
insuranceOMS.number
|
||||
) {
|
||||
insuranceFormDataOMS.append("title", "OMS");
|
||||
insuranceFormDataOMS.append("person", personal.id);
|
||||
return this.sendData(
|
||||
`general/insurance_policy/create/`,
|
||||
insuranceFormDataOMS
|
||||
);
|
||||
}
|
||||
if (
|
||||
checkChangeData(this.initDataBasic.insuranceDMS, insuranceDMS) &&
|
||||
key === "insuranceDMS" &&
|
||||
insuranceDMS.id
|
||||
) {
|
||||
this.checkedPhoto(
|
||||
insuranceDMS.photo,
|
||||
insuranceDMS.id,
|
||||
"insurance_policy",
|
||||
"delete_photo"
|
||||
);
|
||||
insuranceFormDataDMS.append("title", "DMS");
|
||||
return this.sendData(
|
||||
`general/insurance_policy/${insuranceDMS.id}/update/`,
|
||||
insuranceFormDataDMS
|
||||
);
|
||||
} else if (
|
||||
insuranceDMS.id &&
|
||||
(!insuranceDMS.series || !insuranceDMS.number)
|
||||
) {
|
||||
this.addErrorNotification(
|
||||
"Ошибка заполнения формы ДМС",
|
||||
"Пожалуйста заполните все поля"
|
||||
);
|
||||
}
|
||||
if (
|
||||
checkChangeData(this.initDataBasic.insuranceOMS, insuranceOMS) &&
|
||||
key === "insuranceOMS" &&
|
||||
insuranceOMS.id
|
||||
) {
|
||||
this.checkedPhoto(
|
||||
insuranceOMS.photo,
|
||||
insuranceOMS.id,
|
||||
"insurance_policy",
|
||||
"delete_photo"
|
||||
);
|
||||
insuranceFormDataOMS.append("title", "OMS");
|
||||
return this.sendData(
|
||||
`general/insurance_policy/${insuranceOMS.id}/update/`,
|
||||
insuranceFormDataOMS
|
||||
);
|
||||
} else if (
|
||||
insuranceOMS.id &&
|
||||
(!insuranceOMS.series || !insuranceOMS.number)
|
||||
) {
|
||||
this.addErrorNotification(
|
||||
"Ошибка заполнения формы ОМС",
|
||||
"Пожалуйста заполните все поля"
|
||||
);
|
||||
}
|
||||
if (
|
||||
checkChangeData(this.initDataBasic.benefit, benefit) &&
|
||||
key === "benefit"
|
||||
) {
|
||||
this.checkedPhoto(
|
||||
benefit.photo,
|
||||
personal.id,
|
||||
"person",
|
||||
"delete_photo_benefit"
|
||||
);
|
||||
fetchWrapper.post(`general/person/${personal.id}/update/`, {
|
||||
benefit: benefit.id,
|
||||
});
|
||||
if (request.length)
|
||||
Promise.allSettled(request).then(() => {
|
||||
this.getMedicalDataById(this.$route.params.id);
|
||||
this.isEdit = false;
|
||||
this.isCheckChange = false;
|
||||
this.$refs.form?.resetValidation();
|
||||
});
|
||||
if (
|
||||
benefit.photo.file &&
|
||||
benefit.photo.photo !== this.initDataBasic.benefit.photo.photo
|
||||
) {
|
||||
benefitFormData.append("photo_benefit", benefit.photo.file[0]);
|
||||
return this.sendData(
|
||||
`general/person/${personal.id}/update/`,
|
||||
benefitFormData
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
return request;
|
||||
},
|
||||
checkChangePhoto(updatedObjId, field) {
|
||||
if (this.insuranceData[updatedObjId][field]?.file)
|
||||
console.log(
|
||||
updatedObjId,
|
||||
field,
|
||||
this.insuranceData[updatedObjId][field]?.file[0]
|
||||
);
|
||||
checkedPhoto(photo, id, key, title) {
|
||||
if (!photo?.photo) {
|
||||
return this.delPhoto(`general/${key}/${id}/${title}/`);
|
||||
}
|
||||
},
|
||||
addErrorNotification(title, message) {
|
||||
addNotification(title + message, title, message, "error", 5000);
|
||||
},
|
||||
async createData(url, body) {
|
||||
return await fetchWrapper.post(url, body);
|
||||
|
||||
async sendData(url, body) {
|
||||
return await fetchWrapper.post(url, body, "formData");
|
||||
},
|
||||
async updateData(url, body) {
|
||||
return await fetchWrapper.patch(url, body);
|
||||
async delPhoto(url) {
|
||||
return await fetchWrapper.del(url);
|
||||
},
|
||||
cancelEdit() {
|
||||
this.insuranceData = this.destruct(this.initialDocData);
|
||||
this.$store.dispatch("returnInitData");
|
||||
this.isEdit = false;
|
||||
this.isCheckChange = false;
|
||||
},
|
||||
openEdit() {
|
||||
this.isEdit = true;
|
||||
},
|
||||
destruct(data) {
|
||||
const { OMS, DMS } = JSON.parse(JSON.stringify(data));
|
||||
return {
|
||||
OMS: OMS,
|
||||
DMS: DMS,
|
||||
};
|
||||
saveChange() {
|
||||
this.isLoadingData = true;
|
||||
let updateBasic = this.updateBasicData();
|
||||
Promise.allSettled(updateBasic)
|
||||
.then(() => this.$store.dispatch("getMedicalCardData"))
|
||||
.then(() => {
|
||||
this.isLoadingData = false;
|
||||
this.isEdit = false;
|
||||
this.isCheckChange = false;
|
||||
});
|
||||
},
|
||||
...mapActions({
|
||||
getMedicalDataById: "getMedicalDataById",
|
||||
}),
|
||||
},
|
||||
watch: {
|
||||
showModalCategories: {
|
||||
@@ -330,15 +370,6 @@ export default {
|
||||
if (newVal) this.$store.dispatch("getBenefitData");
|
||||
},
|
||||
},
|
||||
initialDocData: {
|
||||
deep: true,
|
||||
immediate: true,
|
||||
handler(newVal) {
|
||||
if (Object.keys(newVal).length) {
|
||||
this.insuranceData = this.destruct(newVal);
|
||||
} else this.insuranceData = this.initializationData;
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@@ -351,6 +382,9 @@ export default {
|
||||
background: rgba(0, 0, 0, 0.05)
|
||||
color: var(--font-dark-blue-color)
|
||||
|
||||
.avatar-field
|
||||
min-width: 302px
|
||||
|
||||
.avatar
|
||||
height: 100%
|
||||
|
||||
@@ -381,25 +415,27 @@ export default {
|
||||
.delete
|
||||
background-color: var(--btn-red-color)
|
||||
|
||||
.category
|
||||
width: 324px
|
||||
|
||||
.category-select
|
||||
min-width: 276px
|
||||
.categories :deep(.q-field__control)
|
||||
height: 40px
|
||||
color: var(--font-dark-blue-color)
|
||||
padding: 0 16px
|
||||
background: var(--bg-light-grey) !important
|
||||
&:before
|
||||
border: none !important
|
||||
transition: none
|
||||
&:after
|
||||
border: none !important
|
||||
transition: none
|
||||
transform: none !important
|
||||
|
||||
.icon :deep(path)
|
||||
fill: var(--font-grey-color)
|
||||
|
||||
.icon-cancel :deep(path)
|
||||
fill: var(--default-white)
|
||||
|
||||
.copy :deep(path)
|
||||
fill: var(--font-grey-color)
|
||||
|
||||
.change
|
||||
background: var(--bg-light-grey)
|
||||
color: var(--font-grey-color)
|
||||
border: 1px solid var(--gray-secondary)
|
||||
.categories :deep(.q-field__native)
|
||||
font-weight: 500
|
||||
font-size: 16px
|
||||
line-height: normal
|
||||
color: var(--font-dark-blue-color)
|
||||
padding: 8px 0
|
||||
background: var(--bg-light-grey) !important
|
||||
|
||||
.q-field--outlined.q-field--readonly :deep(.q-field__control)
|
||||
background: var(--bg-light-grey) !important
|
||||
@@ -411,7 +447,4 @@ export default {
|
||||
|
||||
.q-field--outlined.q-field--readonly :deep(.q-field__native)
|
||||
cursor: default
|
||||
|
||||
.cancel-icon :deep(path)
|
||||
fill: white
|
||||
</style>
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
@click="() => copyLinkNetwork(network.username)"
|
||||
style="background-color: var(--bg-light-grey)"
|
||||
)
|
||||
q-icon.icon(:name="mapNetworks[network.category].icon" :class="{old: network.id, new: !network.id}")
|
||||
span.text-smm.font-medium {{ mapNetworks[network.category].title || network.username }}
|
||||
q-icon.icon(:name="mapNetworks[network.kind].icon" :class="{old: network.id, new: !network.id}")
|
||||
span.text-smm.font-medium {{ mapNetworks[network.kind].title || network.username }}
|
||||
.flex.relative
|
||||
q-btn(
|
||||
v-if="isEdit"
|
||||
@@ -129,7 +129,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
newNetwork: {
|
||||
category: mapNetworks["TELEGRAM"],
|
||||
kind: mapNetworks["TELEGRAM"],
|
||||
username: "",
|
||||
},
|
||||
isEdit: false,
|
||||
@@ -169,13 +169,13 @@ export default {
|
||||
saveNetwork() {
|
||||
if (this.newNetwork.username) {
|
||||
this.confidants[this.index].networks.push({
|
||||
category: this.newNetwork.category.id,
|
||||
kind: this.newNetwork.kind.id,
|
||||
username: this.newNetwork.username,
|
||||
});
|
||||
this.isOpenPopupAdding = false;
|
||||
this.isCheckChange = true;
|
||||
this.newNetwork = {
|
||||
category: mapNetworks["TELEGRAM"],
|
||||
kind: mapNetworks["TELEGRAM"],
|
||||
username: "",
|
||||
};
|
||||
} else {
|
||||
|
||||
@@ -27,19 +27,19 @@
|
||||
icon-left
|
||||
)
|
||||
template(v-slot:iconLeft)
|
||||
q-icon.icon-grey(name="app:search", size="20px" )
|
||||
q-icon(name="app:search", size="20px", style="color: var(--font-grey-color)")
|
||||
.button
|
||||
q-btn(
|
||||
:style="{width: '40px', height: '40px'}",
|
||||
icon="filter_alt",
|
||||
:style="{width: '40px', height: '40px', color: 'var(--font-grey-color)'}",
|
||||
padding="0"
|
||||
)
|
||||
q-icon.icon-grey(name="app:filter", size="24px")
|
||||
.button
|
||||
q-btn(
|
||||
:style="{width: '40px', height: '40px'}",
|
||||
icon="app:sort-number",
|
||||
:style="{width: '40px', height: '40px', color: 'var(--font-grey-color)'}",
|
||||
padding="0"
|
||||
)
|
||||
q-icon.icon-grey(name="app:sort-number", size="24px")
|
||||
.field.flex.flex-col.overflow-y-scroll.gap-y-1(v-if="data.results.diseases")
|
||||
.letter.flex.items-center.font-bold.text-base Некоторые инфекционные и паразитарные болезни
|
||||
.checkbox.flex.gap-x-2.items-center(v-for="disease in data.results.diseases")
|
||||
@@ -171,7 +171,4 @@ export default {
|
||||
|
||||
.search :deep(.q-field__prepend)
|
||||
padding-right: 6px
|
||||
|
||||
.icon-grey :deep(path)
|
||||
fill: var(--font-grey-color)
|
||||
</style>
|
||||
|
||||
@@ -42,19 +42,19 @@
|
||||
size="M",
|
||||
)
|
||||
template(v-slot:iconLeft)
|
||||
q-icon.icon-grey(name="app:search", size="20px" )
|
||||
q-icon(name="app:search", size="20px", style="color: var(--font-grey-color)")
|
||||
.button
|
||||
q-btn(
|
||||
:style="{width: '40px', height: '40px'}",
|
||||
icon="filter_alt",
|
||||
:style="{width: '40px', height: '40px', color: 'var(--font-grey-color)'}",
|
||||
padding="0"
|
||||
)
|
||||
q-icon.icon-grey(name="app:filter", size="24px")
|
||||
.button
|
||||
q-btn(
|
||||
:style="{width: '40px', height: '40px'}",
|
||||
icon="app:sort-number",
|
||||
:style="{width: '40px', height: '40px', color: 'var(--font-grey-color)'}",
|
||||
padding="0"
|
||||
)
|
||||
q-icon.icon-grey(name="app:sort-number", size="24px")
|
||||
.field.flex.flex-col.overflow-y-scroll
|
||||
.checkbox.flex.flex-col(v-for="complaint in textSorting(data.results.tags)")
|
||||
.letter.flex.items-center.font-bold.justify-center {{ complaint.sym }}
|
||||
@@ -71,7 +71,7 @@
|
||||
width="40px",
|
||||
@click="showModal = true",
|
||||
)
|
||||
q-icon.icon-white(name="app:plus", size="24px")
|
||||
q-icon(name="app:plus", size="16px")
|
||||
base-modal(v-model="showModal", title="Создание тега", modal-padding)
|
||||
tag-creation-form(:close-modal="closeModal", :create-tag="createTag")
|
||||
.flex.gap-x-20.w-full(v-if="change || fillInspection")
|
||||
@@ -365,10 +365,4 @@ export default {
|
||||
&::placeholder
|
||||
color: var(--font-grey-color)
|
||||
opacity: 1
|
||||
|
||||
.icon-grey :deep(path)
|
||||
fill: var(--font-grey-color)
|
||||
|
||||
.icon-white :deep(path)
|
||||
fill: var(--default-white)
|
||||
</style>
|
||||
|
||||
@@ -25,19 +25,19 @@
|
||||
size="M"
|
||||
)
|
||||
template(v-slot:iconLeft)
|
||||
q-icon.icon-grey(name="app:search", size="20px" )
|
||||
q-icon(name="app:search", size="20px", style="color: var(--font-grey-color)")
|
||||
.button
|
||||
q-btn(
|
||||
:style="{width: '40px', height: '40px'}",
|
||||
icon="filter_alt",
|
||||
:style="{width: '40px', height: '40px', color: 'var(--font-grey-color)'}",
|
||||
padding="0"
|
||||
)
|
||||
q-icon.icon-grey(name="app:filter", size="24px")
|
||||
.button
|
||||
q-btn(
|
||||
:style="{width: '40px', height: '40px'}",
|
||||
icon="app:sort-number",
|
||||
:style="{width: '40px', height: '40px', color: 'var(--font-grey-color)'}",
|
||||
padding="0"
|
||||
)
|
||||
q-icon.icon-grey(name="app:sort-number", size="24px")
|
||||
.field.flex.flex-col.overflow-y-scroll(v-if="data.results.tags")
|
||||
.checkbox.flex.flex-col(v-for="complaint in textSorting(data.results.tags)")
|
||||
.letter.flex.items-center.font-bold.justify-center {{ complaint.sym }}
|
||||
@@ -54,12 +54,12 @@
|
||||
width="40px",
|
||||
@click="showModal = true",
|
||||
)
|
||||
q-icon.icon-white(name="app:plus", size="24px")
|
||||
q-icon(name="app:plus", size="16px")
|
||||
base-modal(v-model="showModal", title="Создание тега", modal-padding)
|
||||
tag-creation-form(: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.icon-blue(left, name="app:plus", size="24px")
|
||||
q-icon(left, name="app:plus", size="12px")
|
||||
span.font-medium Добавить описание зуба
|
||||
</template>
|
||||
|
||||
@@ -175,8 +175,6 @@ export default {
|
||||
cursor: pointer
|
||||
border-radius: 4px
|
||||
background: var(--bg-light-grey)
|
||||
&:hover
|
||||
background: var(--border-light-grey-color)
|
||||
|
||||
.field
|
||||
margin-right: -10px
|
||||
@@ -216,7 +214,7 @@ export default {
|
||||
.q-btn :deep(.q-ripple)
|
||||
display: none
|
||||
.on-left
|
||||
margin-right: 4px
|
||||
margin-right: 8px
|
||||
|
||||
.input :deep(.q-field__native)
|
||||
font-weight: 500
|
||||
@@ -230,13 +228,4 @@ export default {
|
||||
|
||||
.search :deep(.q-field__prepend)
|
||||
padding-right: 6px
|
||||
|
||||
.icon-grey :deep(path)
|
||||
fill: var(--font-grey-color)
|
||||
|
||||
.icon-white :deep(path)
|
||||
fill: var(--default-white)
|
||||
|
||||
.icon-blue :deep(path)
|
||||
fill: var(--btn-blue-color)
|
||||
</style>
|
||||
|
||||
@@ -18,15 +18,16 @@
|
||||
anchor="bottom left",
|
||||
self="top left"
|
||||
)
|
||||
.tag.item.flex.py-2.px-4.items-center.cursor-pointer.w-full.gap-x-2(
|
||||
@click="addCategory"
|
||||
)
|
||||
span Добавить категорию
|
||||
.menu-wrapper.flex.flex-col.h-40.overflow-y-auto
|
||||
.options.flex(v-for="item in options")
|
||||
.item.flex.py-2.px-4.items-center.cursor-pointer(
|
||||
@click="selected(item.label)"
|
||||
) {{item.label}}
|
||||
.tag.item.flex.py-2.px-4.items-center.cursor-pointer.w-full.gap-x-2(
|
||||
@click="addCategory"
|
||||
)
|
||||
q-icon(name="app:icon-plus", size="10px",)
|
||||
span Добавить категорию
|
||||
.flex.flex-col(class="gap-x-1.5")
|
||||
base-input(
|
||||
v-model="model.tag",
|
||||
|
||||
@@ -36,16 +36,16 @@
|
||||
.toogle.flex.flex-toogle.h-10.p-1.rounded.absolute
|
||||
q-btn.w-12.h-full.rounded(
|
||||
size="12px",
|
||||
:style="{'backgroundColor': !isShowSecondView ? 'var(--btn-blue-color)' : 'var(--bg-light-grey)'}",
|
||||
:style="{'backgroundColor': !isShowSecondView ? 'var(--bg-aqua-blue)' : 'var(--bg-light-grey)'}",
|
||||
@click="()=>{ isShowSecondView=false }",
|
||||
)
|
||||
q-icon.tooth(:class="{'tooth-active': !isShowSecondView}", name="app:tooth-outline", size="24px")
|
||||
img(:src="teeth")
|
||||
q-btn.w-12.h-full.rounded(
|
||||
size="12px",
|
||||
:style="{'backgroundColor': isShowSecondView ? 'var(--btn-blue-color)' : 'var(--bg-light-grey)'}",
|
||||
:style="{'backgroundColor': isShowSecondView ? 'var(--bg-aqua-blue)' : 'var(--bg-light-grey)'}",
|
||||
@click="()=>{isShowSecondView=true }",
|
||||
)
|
||||
q-icon.tooth(:class="{'tooth-active': isShowSecondView}", name="app:tooth", size="22px")
|
||||
img(:src="teeth_2")
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -119,10 +119,4 @@ export default {
|
||||
background-color: var(--bg-light-grey)
|
||||
top: 16px
|
||||
right: 24px
|
||||
|
||||
.tooth :deep(path)
|
||||
fill: var(--font-grey-color)
|
||||
|
||||
.tooth-active :deep(path)
|
||||
fill: var(--default-white)
|
||||
</style>
|
||||
|
||||
@@ -17,17 +17,17 @@
|
||||
)
|
||||
.flex.flex-col.gap-y-6px
|
||||
span.color-grey.line-height.text-sm.font-semibold Врач
|
||||
.flex.gap-x-2.items-center
|
||||
.flex.gap-x-2
|
||||
base-avatar(:size="40")
|
||||
img.object-cover.h-full(
|
||||
v-if="userData?.avatar",
|
||||
:src="url + userData?.avatar",
|
||||
v-if="userData?.photo",
|
||||
:src="userData?.photo",
|
||||
alt="avatar"
|
||||
)
|
||||
span.text-sm.text-dark(v-else) {{ avatar }}
|
||||
span.text-sm.color-blue(v-else) {{ avatar }}
|
||||
.flex.flex-col
|
||||
span.text-sm.text-dark.line-height.mb-2px.font-medium {{ employeeName }}
|
||||
span.color-grey.line-height.text-xsx.font-medium {{ userData?.job_title ? userData?.job_title : "Терапевт" }}
|
||||
span.text-sm.color-blue.line-height.mb-2px {{ employeeName }}
|
||||
span.color-grey.line-height.text-sm {{ userData?.job_title ? userData?.job_title : "Терапевт" }}
|
||||
.flex.gap-2.mt-8
|
||||
base-button(
|
||||
type="secondary",
|
||||
@@ -47,7 +47,7 @@ import BaseAvatar from "@/components/base/BaseAvatar.vue";
|
||||
import BaseInputDate from "@/components/base/BaseInputDate.vue";
|
||||
import BaseInputTime from "@/components/base/BaseInputTime.vue";
|
||||
import * as moment from "moment/moment";
|
||||
import { mapGetters, mapActions, mapState } from "vuex";
|
||||
import { mapGetters, mapActions } from "vuex";
|
||||
import BaseButton from "@/components/base/BaseButton.vue";
|
||||
export default {
|
||||
name: "MedicalProtocolCreateModal",
|
||||
@@ -64,15 +64,12 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
protocolData: {
|
||||
date: "",
|
||||
date: null,
|
||||
startTime: null,
|
||||
},
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
url: (state) => state.imgUrl,
|
||||
}),
|
||||
...mapGetters({
|
||||
userData: "getUserData",
|
||||
}),
|
||||
@@ -96,27 +93,19 @@ export default {
|
||||
...mapActions({
|
||||
createProtocol: "createProtocol",
|
||||
}),
|
||||
checkFormat(date) {
|
||||
return date && date?.length === 10 ? date : null;
|
||||
},
|
||||
saveProtocol() {
|
||||
if (
|
||||
!Object.keys(this.protocolData).every((key) => this.protocolData[key])
|
||||
)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
let time = this.protocolData.startTime.split(":");
|
||||
let start = moment(this.checkFormat(this.protocolData.date))
|
||||
?.hour(time[0])
|
||||
?.minute(time[1]);
|
||||
let start = moment(this.protocolData.date).hour(time[0]).minute(time[1]);
|
||||
let createdProtocol = {
|
||||
start: start.isValid() ? start.format() : null,
|
||||
end: start.isValid() ? start.add(30, "m").format() : null,
|
||||
status: null,
|
||||
};
|
||||
if (
|
||||
Object.keys(createdProtocol)?.some((elem) => !createdProtocol?.[elem])
|
||||
)
|
||||
return;
|
||||
createdProtocol.status = null;
|
||||
this.createProtocol(createdProtocol);
|
||||
this.changeShownCreateModal(false);
|
||||
this.createInspection();
|
||||
|
||||
@@ -9,14 +9,14 @@
|
||||
.flex.font-bold.text-6xl {{elem.label}}
|
||||
.flex.gap-x-4
|
||||
.button
|
||||
q-btn.btn(
|
||||
icon="app:printer",
|
||||
q-btn(
|
||||
icon="print",
|
||||
size="20px",
|
||||
:style="{width: '40px', height: '40px', color: 'var(--font-grey-color)'}",
|
||||
padding="0"
|
||||
)
|
||||
.button
|
||||
q-btn.btn(
|
||||
q-btn(
|
||||
icon="app:basket",
|
||||
size="20px",
|
||||
:style="{width: '40px', height: '40px', color: 'var(--font-grey-color)'}",
|
||||
@@ -204,7 +204,4 @@ export default {
|
||||
cursor: pointer
|
||||
border-radius: 4px
|
||||
background: var(--bg-light-grey)
|
||||
|
||||
.btn :deep(path)
|
||||
fill: var(--font-grey-color)
|
||||
</style>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
@click="changeShownCreateModal(true)",
|
||||
v-if="createInspection"
|
||||
)
|
||||
q-icon.plus-icon(name="app:big-plus", size="24px")
|
||||
q-icon(name="app:plus", size="18px")
|
||||
.p-4.rounded.background.list.flex.flex-col.gap-y-6
|
||||
.flex
|
||||
base-select(
|
||||
@@ -157,6 +157,4 @@ export default {
|
||||
color: var(--default-white)
|
||||
.color-grey
|
||||
color: var(--font-grey-color)
|
||||
.plus-icon :deep(path)
|
||||
fill: white
|
||||
</style>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template lang="pug">
|
||||
.base-info-wrapper.w-full.flex.gap-x-2.flex-1.font-medium.text-m
|
||||
.base-info-wrapper.w-full.flex.gap-x-2.flex-1
|
||||
medical-sidebar(v-model="currentMenuItem")
|
||||
component(
|
||||
v-if="currentMenuItem",
|
||||
@@ -49,5 +49,4 @@ export default {
|
||||
.base-info-wrapper
|
||||
height: 80.4%
|
||||
max-height: calc(100% - 190px - 8px)
|
||||
color: var(--font-dark-blue-color)
|
||||
</style>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
padding="0",
|
||||
@click="addNewConfidant"
|
||||
)
|
||||
q-icon.icon(name="app:plus", size="24px", left)
|
||||
q-icon(name="app:icon-plus", size="12px", left)
|
||||
span Добавить контакт
|
||||
</template>
|
||||
|
||||
@@ -46,9 +46,7 @@ export default {
|
||||
&::-webkit-scrollbar
|
||||
width: 0
|
||||
.on-left
|
||||
margin-right: 4px
|
||||
margin-right: 10px
|
||||
.q-btn :deep(.q-ripple)
|
||||
display: none
|
||||
.icon :deep(path)
|
||||
fill: var(--btn-blue-color)
|
||||
</style>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
name="app:edit",
|
||||
v-if="!isEdit && !noEditBtn",
|
||||
@click="openEdit",
|
||||
size="20px"
|
||||
size="20"
|
||||
)
|
||||
.flex.w-full.gap-11px.items-center.justify-between(v-else)
|
||||
span.font-bold.text-base.whitespace-nowrap {{title}}
|
||||
@@ -30,13 +30,13 @@
|
||||
:style="{color: 'var(--btn-blue-color)'}"
|
||||
)
|
||||
base-button(type="secondary", width="142px")
|
||||
q-icon.sample.mr-2(name="app:sample", size="20px")
|
||||
img.mr-2(:src="layers")
|
||||
span.text-smm.font-medium Шаблоны
|
||||
.flex.w-fit.gap-10px.items-center.delete-button.cursor-pointer(
|
||||
v-if="!isEdit && titleDelete && deleteItem",
|
||||
@click="deleteItem"
|
||||
)
|
||||
q-icon(name="app:basket" size="20px")
|
||||
q-icon(name="app:basket" size="20")
|
||||
span.text-smm.font-medium {{ titleDelete }}
|
||||
slot
|
||||
.flex.h-fit.w-fit.gap-2(v-if="isEdit && buttonsPresence")
|
||||
@@ -134,6 +134,4 @@ export default {
|
||||
transition: 0.3s ease
|
||||
.medical-form-move
|
||||
transition: 0.3s ease
|
||||
.sample :deep(path)
|
||||
fill: var(--btn-blue-color)
|
||||
</style>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template lang="pug">
|
||||
.patient-info.pt-4.pr-6.flex.flex-col.justify-between.rounded.font-medium.text-m
|
||||
.patient-info.pt-4.pr-6.flex.flex-col.justify-between.rounded
|
||||
.ml-6.flex.justify-between
|
||||
q-breadcrumbs
|
||||
template(v-slot:separator)
|
||||
@@ -9,7 +9,7 @@
|
||||
color="grey",
|
||||
)
|
||||
q-breadcrumbs-el(:label="routes[routingHistory.state.back]")
|
||||
q-breadcrumbs-el(:label="`Медкарта #${medicalCardData?.number}`")
|
||||
q-breadcrumbs-el(:label="`${routes[routingHistory.state.current]} #${medicalCardData?.number}`")
|
||||
q-btn(
|
||||
flat,
|
||||
text-color="grey",
|
||||
@@ -30,7 +30,6 @@
|
||||
:style="{color: 'var(--font-dark-blue-color)', 'line-height': '135%'}",
|
||||
) {{patientName}}
|
||||
q-chip(
|
||||
v-if="priority?.text",
|
||||
square,
|
||||
text-color="white",
|
||||
:style="{height: '20px', background: priority?.color, padding: '2px 8px'}",
|
||||
|
||||
@@ -49,7 +49,6 @@ export const baseDataForm = [
|
||||
key: "photo",
|
||||
label: "Фото",
|
||||
type: "avatar",
|
||||
disabled: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -61,28 +60,22 @@ export const baseDataForm = [
|
||||
key: "region",
|
||||
label: "Регион",
|
||||
type: "text",
|
||||
rules: [(val) => ruleNotValue(val)],
|
||||
error: "Поле 'Регион' должны быть заполнены",
|
||||
},
|
||||
{
|
||||
key: "city",
|
||||
label: "Город",
|
||||
type: "text",
|
||||
rules: [(val) => ruleNotValue(val)],
|
||||
error: "Поле 'Город' должны быть заполнены",
|
||||
},
|
||||
{
|
||||
key: "street",
|
||||
label: "Улица",
|
||||
type: "text",
|
||||
rules: [(val) => ruleNotValue(val)],
|
||||
error: "Поле 'Улица' должны быть заполнены",
|
||||
},
|
||||
{
|
||||
key: "house",
|
||||
label: "Дом",
|
||||
type: "text",
|
||||
rules: [(val) => ruleNotValue(val)],
|
||||
rules: [(val) => !/^[\W0]/.test(val)],
|
||||
error:
|
||||
"Номер дома должен начинатся не с нуля и только с цифробуквенного символа",
|
||||
},
|
||||
@@ -152,32 +145,32 @@ export const mapNetworks = {
|
||||
VK: {
|
||||
id: "VK",
|
||||
title: "VK",
|
||||
icon: "app:vk",
|
||||
icon: "app:icon-vk",
|
||||
network: "VK",
|
||||
},
|
||||
TELEGRAM: {
|
||||
id: "TELEGRAM",
|
||||
title: "Telegram",
|
||||
icon: "app:tg",
|
||||
icon: "app:icon-tg",
|
||||
network: "TELEGRAM",
|
||||
},
|
||||
GMAIL: {
|
||||
id: "GMAIL",
|
||||
title: "Gmail",
|
||||
icon: "app:google",
|
||||
icon: "app:icon-google",
|
||||
network: "GMAIL",
|
||||
},
|
||||
SLACK: {
|
||||
id: "SLACK",
|
||||
title: "Slack",
|
||||
icon: "app:slack",
|
||||
icon: "app:icon-slack",
|
||||
network: "SLACK",
|
||||
markerLink: "slack",
|
||||
},
|
||||
DISCORD: {
|
||||
id: "DISCORD",
|
||||
title: "Discord",
|
||||
icon: "app:discord",
|
||||
icon: "app:icon-discord",
|
||||
network: "DISCORD",
|
||||
},
|
||||
VIBER: {
|
||||
@@ -200,7 +193,7 @@ export const contactsDataForm = {
|
||||
fieldName: "Телефон",
|
||||
error:
|
||||
"Не корректно введен номер телефона. Номер телефона должен состоять из 10 цифр (без учета +7)",
|
||||
category: "PHONE",
|
||||
kind: "PHONE",
|
||||
rules: [(val) => ruleLengthValue(val, 18)],
|
||||
inputMask: "+7 (###) ###-##-##",
|
||||
},
|
||||
@@ -210,14 +203,14 @@ export const contactsDataForm = {
|
||||
error:
|
||||
"Не корректно введен адрес почты. Почта должна содержать локальное имя, знак @ и имя домена",
|
||||
rules: [(val) => ruleEmailValue(val)],
|
||||
category: "EMAIL",
|
||||
kind: "EMAIL",
|
||||
},
|
||||
networks: {
|
||||
title: "Социальные сети",
|
||||
fieldName: "Соцсеть",
|
||||
error: "Отсутсвует ссылка соцсети",
|
||||
rules: [(val) => ruleNotValue(val)],
|
||||
category: "TELEGRAM",
|
||||
kind: "TELEGRAM",
|
||||
},
|
||||
};
|
||||
|
||||
@@ -379,63 +372,47 @@ export const baseInfoMenu = [
|
||||
export const baseInsuranceForm = [
|
||||
{
|
||||
insuranceLabel: "ОМС",
|
||||
insuranceKey: "OMS",
|
||||
insuranceKey: "insuranceOMS",
|
||||
fields: [
|
||||
{
|
||||
key: "series",
|
||||
label: "Серия",
|
||||
type: "text",
|
||||
rules: (val) => ruleNotValue(val),
|
||||
errorMessage: {
|
||||
title: "Ошибка валидации",
|
||||
message: "Серия полиса ОМС не заполнена",
|
||||
},
|
||||
inputMask: "####",
|
||||
},
|
||||
{
|
||||
key: "number",
|
||||
label: "Номер",
|
||||
type: "text",
|
||||
rules: (val) => ruleNotValue(val),
|
||||
errorMessage: {
|
||||
title: "Ошибка валидации",
|
||||
message: "Номер полиса ОМС не заполнен",
|
||||
},
|
||||
inputMask: "####-####-####",
|
||||
},
|
||||
{
|
||||
key: "attachments",
|
||||
key: "photo",
|
||||
label: "Фото ОМС",
|
||||
type: "photo",
|
||||
type: "avatar",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
insuranceLabel: "ДМС",
|
||||
insuranceKey: "DMS",
|
||||
insuranceKey: "insuranceDMS",
|
||||
fields: [
|
||||
{
|
||||
key: "series",
|
||||
label: "Серия",
|
||||
type: "text",
|
||||
rules: (val) => ruleNotValue(val),
|
||||
errorMessage: {
|
||||
title: "Ошибка валидации",
|
||||
message: "Серия полиса ДМС не заполнена",
|
||||
},
|
||||
inputMask: "####",
|
||||
},
|
||||
{
|
||||
key: "number",
|
||||
label: "Номер",
|
||||
type: "text",
|
||||
rules: (val) => ruleNotValue(val),
|
||||
errorMessage: {
|
||||
title: "Ошибка валидации",
|
||||
message: "Номер полиса ДМС не заполнен",
|
||||
},
|
||||
inputMask: "####-####-####",
|
||||
},
|
||||
{
|
||||
key: "attachments",
|
||||
key: "photo",
|
||||
label: "Фото ДМС",
|
||||
type: "photo",
|
||||
type: "avatar",
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -452,7 +429,7 @@ export const baseInsuranceForm = [
|
||||
{
|
||||
key: "photo",
|
||||
label: "Документы",
|
||||
type: "photo",
|
||||
type: "avatar",
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -491,7 +468,7 @@ export const documentForm = [
|
||||
rules: (val) => ruleLengthValue(val, 6),
|
||||
},
|
||||
{
|
||||
key: "issued_by",
|
||||
key: "issued_by_org",
|
||||
label: "Кем выдан",
|
||||
type: "text",
|
||||
errorMessage: {
|
||||
@@ -512,7 +489,7 @@ export const documentForm = [
|
||||
rules: (val) => ruleLengthValue(val, 7),
|
||||
},
|
||||
{
|
||||
key: "issued_at",
|
||||
key: "issued_by_date",
|
||||
label: "Дата выдачи",
|
||||
type: "date",
|
||||
rules: (val) => ruleDateValue(val),
|
||||
@@ -522,7 +499,7 @@ export const documentForm = [
|
||||
},
|
||||
},
|
||||
{
|
||||
key: "attachments",
|
||||
key: "photo",
|
||||
label: "Фото паспорта",
|
||||
type: "photo",
|
||||
},
|
||||
@@ -533,7 +510,7 @@ export const documentForm = [
|
||||
dataKey: "insurance_number",
|
||||
fields: [
|
||||
{
|
||||
key: "number",
|
||||
key: "insurance_number",
|
||||
label: "Номер СНИЛС",
|
||||
type: "text",
|
||||
inputMask: "###-###-### ##",
|
||||
@@ -541,10 +518,10 @@ export const documentForm = [
|
||||
title: "Ошибка валидации",
|
||||
message: "СНИЛС содержит менее 11 цифр",
|
||||
},
|
||||
rules: (val, id) => ruleOptionalFields(val, 14, id),
|
||||
rules: (val) => ruleOptionalFields(val, 14),
|
||||
},
|
||||
{
|
||||
key: "attachments",
|
||||
key: "photo_insurance_number",
|
||||
label: "Фото СНИЛС",
|
||||
type: "photo",
|
||||
},
|
||||
@@ -555,7 +532,7 @@ export const documentForm = [
|
||||
dataKey: "tax_identification_number",
|
||||
fields: [
|
||||
{
|
||||
key: "number",
|
||||
key: "tax_identification_number",
|
||||
label: "Номер ИНН",
|
||||
type: "text",
|
||||
inputMask: "############",
|
||||
@@ -563,10 +540,10 @@ export const documentForm = [
|
||||
title: "Ошибка валидации",
|
||||
message: "ИНН содержит менее 12 цифр",
|
||||
},
|
||||
rules: (val, id) => ruleOptionalFields(val, 12, id),
|
||||
rules: (val) => ruleOptionalFields(val, 12),
|
||||
},
|
||||
{
|
||||
key: "attachments",
|
||||
key: "photo_tax_identification_number",
|
||||
label: "Фото ИНН",
|
||||
type: "photo",
|
||||
},
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
const getOrigin = () =>
|
||||
process.env.NODE_ENV === "development"
|
||||
? "https://astra-dev.dopcore.com"
|
||||
: window.origin;
|
||||
|
||||
function prepareUrl(url) {
|
||||
if (url.startsWith("http")) return url;
|
||||
return `${getOrigin()}/api/${url}`;
|
||||
return `https://astra-dev.dopcore.com/api/${url}`;
|
||||
}
|
||||
|
||||
function handleRequest(method, url, headers, attempts, body, type) {
|
||||
@@ -50,7 +45,7 @@ function request(method, url, headers = {}, body, type = "") {
|
||||
requestOptions.body = JSON.stringify(body);
|
||||
}
|
||||
}
|
||||
if (method === "POST" || method === "PUT" || method === "PATCH") {
|
||||
if (method === "POST" || method === "PUT") {
|
||||
if (type && type === "formData") {
|
||||
requestOptions = {
|
||||
method: method,
|
||||
@@ -88,10 +83,6 @@ function post(url, body, type, headers, attempts = 3) {
|
||||
return handleRequest("POST", url, headers, attempts, body, type);
|
||||
}
|
||||
|
||||
function patch(url, body, type, headers, attempts = 3) {
|
||||
return handleRequest("PATCH", url, headers, attempts, body, type);
|
||||
}
|
||||
|
||||
function put(url, headers, body, attempts = 3) {
|
||||
return handleRequest("PUT", url, headers, attempts, null, body);
|
||||
}
|
||||
@@ -101,5 +92,4 @@ export const fetchWrapper = {
|
||||
del,
|
||||
post,
|
||||
put,
|
||||
patch,
|
||||
};
|
||||
|
||||
@@ -20,6 +20,10 @@ export function getObjectChangeField(objInit, objUpdate) {
|
||||
return resultObj;
|
||||
}
|
||||
|
||||
export function checkTypeofObject(obj) {
|
||||
return typeof obj === "object" && obj !== "null";
|
||||
}
|
||||
|
||||
export function checkChangeData(dataInit, dataChange) {
|
||||
return JSON.stringify(dataInit) !== JSON.stringify(dataChange);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import * as moment from "moment/moment";
|
||||
|
||||
export function ruleNotValue(val, text) {
|
||||
return !!val || text || false;
|
||||
}
|
||||
@@ -8,8 +7,8 @@ export function ruleLengthValue(val, minLength, text) {
|
||||
return (val && val.length === minLength) || text || false;
|
||||
}
|
||||
|
||||
export function ruleOptionalFields(val, minLength, id, text) {
|
||||
return (!val && !id) || val.length === minLength || text || false;
|
||||
export function ruleOptionalFields(val, minLength, text) {
|
||||
return !val || val.length === minLength || text || false;
|
||||
}
|
||||
|
||||
export function ruleEmailValue(val, text) {
|
||||
@@ -22,16 +21,12 @@ export function ruleMaxLength(val, maxLength, text) {
|
||||
}
|
||||
|
||||
export function ruleDateValue(val, text) {
|
||||
let date = moment(
|
||||
val && val?.length === 10 ? val.split(".").reverse().join("-") : null
|
||||
);
|
||||
return (
|
||||
(date.isValid() && !date.isAfter(moment().format("YYYY-MM-DD"))) ||
|
||||
(val && !moment(val).isAfter(moment().format("YYYY-MM-DD"))) ||
|
||||
text ||
|
||||
false
|
||||
);
|
||||
}
|
||||
|
||||
export function ruleNumberInput(val, max, min, text) {
|
||||
return (val <= max && val >= min) || text || false;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,31 @@
|
||||
import { fetchWrapper } from "../fetchWrapper";
|
||||
import { checkChangeData } from "./changesObjects";
|
||||
import { removeEmptyFields, checkChangeData } from "./changesObjects";
|
||||
|
||||
export function getRequestChangeData(
|
||||
createData,
|
||||
updateData,
|
||||
initData,
|
||||
key,
|
||||
id
|
||||
) {
|
||||
let isInitDataEmpty = [...Object.keys(removeEmptyFields(initData))].length;
|
||||
if (Object.keys(removeEmptyFields(updateData)).length) {
|
||||
if (!isInitDataEmpty) {
|
||||
return fetchWrapper.post(
|
||||
`general/${key}/create/`,
|
||||
removeEmptyFields(createData)
|
||||
);
|
||||
}
|
||||
if (JSON.stringify(updateData) !== JSON.stringify(initData)) {
|
||||
return fetchWrapper.post(
|
||||
`general/${key}/${id}/update/`,
|
||||
removeEmptyFields(updateData)
|
||||
);
|
||||
}
|
||||
return Promise.resolve();
|
||||
}
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
export function getRequestArrayData(
|
||||
initData,
|
||||
|
||||
@@ -5,7 +5,6 @@ import calendar from "./modules/calendar";
|
||||
export default createStore({
|
||||
state: {
|
||||
url: "https://astra-dev.dopcore.com",
|
||||
imgUrl: "https://astra-dev.dopcore.com/api/store/",
|
||||
routingHistory: window.history,
|
||||
userData: {},
|
||||
},
|
||||
|
||||
@@ -25,8 +25,8 @@ const actions = {
|
||||
commit("setSelectedRecordId", id);
|
||||
},
|
||||
getEvents({ commit, state }) {
|
||||
const start = state.selectedDates.from.format("YYYY-MM-DDTHH:mm:ss");
|
||||
const end = state.selectedDates.to.format("YYYY-MM-DDTHH:mm:ss");
|
||||
const start = state.selectedDates.from.toISOString();
|
||||
const end = state.selectedDates.to.toISOString();
|
||||
fetchWrapper.get(`events?start=${start}&end=${end}`).then((data) => {
|
||||
if (Array.isArray(data)) {
|
||||
commit("setEvents", data);
|
||||
|
||||
@@ -34,6 +34,20 @@ const state = () => ({
|
||||
house: null,
|
||||
flat: null,
|
||||
},
|
||||
insuranceDMS: {
|
||||
series: null,
|
||||
number: null,
|
||||
photo: null,
|
||||
id: null,
|
||||
organization: null,
|
||||
},
|
||||
insuranceOMS: {
|
||||
series: null,
|
||||
number: null,
|
||||
photo: null,
|
||||
id: null,
|
||||
organization: null,
|
||||
},
|
||||
benefit: {
|
||||
id: null,
|
||||
discount: null,
|
||||
@@ -120,14 +134,13 @@ const state = () => ({
|
||||
const getters = {
|
||||
getBasicData(state, rootState) {
|
||||
let registrationAddress =
|
||||
state.medicalCard?.person?.addresses?.find(
|
||||
(el) => el.category === "REGISTRATION_ADDRESS"
|
||||
) || {};
|
||||
state.medicalCard?.person?.address?.find((el) => el.registration_flg) ||
|
||||
{};
|
||||
let residenceAddress =
|
||||
state?.medicalCard?.person?.addresses?.find(
|
||||
(el) => el.category === "CURRENT_ADDRESS"
|
||||
) || {};
|
||||
state?.medicalCard?.person?.address?.find((el) => el.residence_flg) || {};
|
||||
let person = state.medicalCard.person;
|
||||
let OMS = person?.insurance_policy?.find((e) => e.title === "OMS");
|
||||
let DMS = person?.insurance_policy?.find((e) => e.title === "DMS");
|
||||
return {
|
||||
personalData: {
|
||||
last_name: person?.last_name || "",
|
||||
@@ -137,7 +150,7 @@ const getters = {
|
||||
(person?.gender &&
|
||||
genderOptions.find((el) => el.id === person?.gender)) ||
|
||||
"",
|
||||
birth_date: person?.birth_date || "",
|
||||
birth_date: person?.birth_date ? new Date(person?.birth_date) : "",
|
||||
photo: person?.photo
|
||||
? {
|
||||
photo: rootState.getUrl + person.photo,
|
||||
@@ -160,6 +173,30 @@ const getters = {
|
||||
house: residenceAddress?.house || "",
|
||||
flat: residenceAddress?.flat || "",
|
||||
},
|
||||
insuranceDMS: {
|
||||
series: DMS?.series,
|
||||
number: DMS?.number,
|
||||
photo: DMS?.photo
|
||||
? {
|
||||
photo: rootState.getUrl + DMS?.photo,
|
||||
file: null,
|
||||
}
|
||||
: {},
|
||||
id: DMS?.id,
|
||||
organization: DMS?.organization,
|
||||
},
|
||||
insuranceOMS: {
|
||||
series: OMS?.series,
|
||||
number: OMS?.number,
|
||||
photo: OMS?.photo
|
||||
? {
|
||||
photo: rootState.getUrl + OMS?.photo,
|
||||
file: null,
|
||||
}
|
||||
: {},
|
||||
id: OMS?.id,
|
||||
organization: OMS?.organization,
|
||||
},
|
||||
benefit: {
|
||||
name: person?.benefit?.name,
|
||||
id: person?.benefit?.id,
|
||||
@@ -174,44 +211,53 @@ const getters = {
|
||||
};
|
||||
},
|
||||
getDocumentsData(state, rootState) {
|
||||
const fields = [
|
||||
"passport",
|
||||
"insurance_number",
|
||||
"tax_identification_number",
|
||||
"OMS",
|
||||
"DMS",
|
||||
];
|
||||
let result = {};
|
||||
fields.forEach((elem) => {
|
||||
const document = state.medicalCard?.person?.documents?.find(
|
||||
({ category }) => category === elem
|
||||
let person = state.medicalCard?.person;
|
||||
const passport = person?.identity_document?.find(
|
||||
(el) => el.kind === "PASSPORT"
|
||||
);
|
||||
const isPassport = elem === "passport";
|
||||
const isPolicy = elem === "OMS" || elem === "DMS";
|
||||
result[elem] = {
|
||||
category: elem,
|
||||
id: document?.id || "",
|
||||
series: document?.series || (isPolicy || isPassport ? "" : "000"),
|
||||
number: document?.number || "",
|
||||
issued_by: document?.issued_by || (isPassport ? "" : "000"),
|
||||
issued_by_org_code:
|
||||
document?.issued_by_org_code || (isPassport ? "000-000" : ""),
|
||||
issued_at: document?.issued_at || "",
|
||||
attachments: document?.attachments?.length
|
||||
return {
|
||||
passport: {
|
||||
id: passport?.id ?? "",
|
||||
series: passport?.series ?? "",
|
||||
number: passport?.number ?? "",
|
||||
issued_by_org: passport?.issued_by_org ?? "",
|
||||
issued_by_org_code: passport?.issued_by_org_code ?? "",
|
||||
issued_by_date: passport?.issued_by_date
|
||||
? new Date(passport?.issued_by_date)
|
||||
: null,
|
||||
photo: passport?.photo
|
||||
? {
|
||||
photo: rootState.getUrl + document?.attachments?.[0],
|
||||
photo: rootState.getUrl + passport.photo,
|
||||
file: null,
|
||||
}
|
||||
: {},
|
||||
},
|
||||
insurance_number: {
|
||||
insurance_number: person?.insurance_number ?? "",
|
||||
photo_insurance_number: person?.photo_insurance_number
|
||||
? {
|
||||
photo: rootState.getUrl + person.photo_insurance_number,
|
||||
file: null,
|
||||
}
|
||||
: {},
|
||||
},
|
||||
tax_identification_number: {
|
||||
tax_identification_number: person?.tax_identification_number ?? "",
|
||||
photo_tax_identification_number: person?.photo_tax_identification_number
|
||||
? {
|
||||
photo: rootState.getUrl + person?.photo_tax_identification_number,
|
||||
file: null,
|
||||
}
|
||||
: {},
|
||||
},
|
||||
};
|
||||
});
|
||||
return result;
|
||||
},
|
||||
getContactsData(state) {
|
||||
let phones =
|
||||
state.medicalCard?.person?.contacts
|
||||
?.filter((el) => el.category === "PHONE")
|
||||
?.map((el) => {
|
||||
el.value = el.value.length > 10 ? el.value.slice(1) : el.value;
|
||||
return { ...el };
|
||||
}) || [];
|
||||
let emails =
|
||||
@@ -389,23 +435,11 @@ const actions = {
|
||||
});
|
||||
},
|
||||
postUpdateAddress(context, { id, address, category }) {
|
||||
fetchWrapper.patch(`address/${id}`, {
|
||||
fetchWrapper.post(`address/${id}`, {
|
||||
...address,
|
||||
category: category,
|
||||
});
|
||||
},
|
||||
postCreateContact(context, { obj, id }) {
|
||||
fetchWrapper.post("contacts", {
|
||||
person_id: id,
|
||||
...obj,
|
||||
});
|
||||
},
|
||||
postUpdateContact(context, { obj, id }) {
|
||||
fetchWrapper.patch(`contacts/${id}`, obj);
|
||||
},
|
||||
deleteContact(context, { id }) {
|
||||
fetchWrapper.del(`contacts/${id}`);
|
||||
},
|
||||
deleteItemData({ commit }, props) {
|
||||
commit("setDataWithouDeleted", props);
|
||||
},
|
||||
@@ -425,26 +459,17 @@ const actions = {
|
||||
commit("setBenefitData", res.results);
|
||||
});
|
||||
},
|
||||
createMedicalCard(ctx, { personId, successCallback }) {
|
||||
fetchWrapper
|
||||
.post("medical_cards", {
|
||||
person_id: personId,
|
||||
createMedicalCard(ctx, id) {
|
||||
fetchWrapper.post("medical_cards", {
|
||||
person_id: id,
|
||||
number: String(Math.floor(1 + Math.random() * (100000000 + 1 - 1))),
|
||||
})
|
||||
.then(() => {
|
||||
this.dispatch("getMedicalCardDataByPersonId", {
|
||||
personId,
|
||||
successCallback,
|
||||
});
|
||||
});
|
||||
return this.getMedicalCardDataByPersonId(ctx, id);
|
||||
},
|
||||
getMedicalCardDataByPersonId({ commit }, { personId, successCallback }) {
|
||||
fetchWrapper.get(`medical_cards/person/${personId}`).then((data) => {
|
||||
if (!data || data?.detail) {
|
||||
return this.dispatch("createMedicalCard", {
|
||||
personId,
|
||||
successCallback,
|
||||
});
|
||||
if (!data) {
|
||||
return this.createMedicalCard({ commit }, personId);
|
||||
}
|
||||
commit("setMedicalCard", data);
|
||||
commit("setBasicData");
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
const { expect } = require("@wdio/globals");
|
||||
|
||||
describe("Smoke test", function () {
|
||||
it("should display login page", async function () {
|
||||
await browser.url("/");
|
||||
|
||||
await $("#app").waitForDisplayed();
|
||||
expect(await browser.getUrl()).toMatch("/#/login");
|
||||
});
|
||||
|
||||
it("should auth to system", async function () {
|
||||
await browser.url("/");
|
||||
|
||||
await $("#app").waitForDisplayed();
|
||||
|
||||
await $("input[type=text]").setValue("admin");
|
||||
await $("input[type=password]").setValue("123");
|
||||
|
||||
await $("button[type=button]").click();
|
||||
|
||||
await $("img[alt=Logo]").waitForDisplayed();
|
||||
|
||||
expect(await browser.getUrl()).toMatch("/#/calendar");
|
||||
});
|
||||
});
|
||||
288
wdio.conf.js
288
wdio.conf.js
@@ -1,288 +0,0 @@
|
||||
exports.config = {
|
||||
//
|
||||
// ====================
|
||||
// Runner Configuration
|
||||
// ====================
|
||||
// WebdriverIO supports running e2e tests as well as unit and component tests.
|
||||
runner: "local",
|
||||
//
|
||||
// ==================
|
||||
// Specify Test Files
|
||||
// ==================
|
||||
// Define which test specs should run. The pattern is relative to the directory
|
||||
// of the configuration file being run.
|
||||
//
|
||||
// The specs are defined as an array of spec files (optionally using wildcards
|
||||
// that will be expanded). The test for each spec file will be run in a separate
|
||||
// worker process. In order to have a group of spec files run in the same worker
|
||||
// process simply enclose them in an array within the specs array.
|
||||
//
|
||||
// If you are calling `wdio` from an NPM script (see https://docs.npmjs.com/cli/run-script),
|
||||
// then the current working directory is where your `package.json` resides, so `wdio`
|
||||
// will be called from there.
|
||||
//
|
||||
specs: ["./test/specs/**/*.js"],
|
||||
// Patterns to exclude.
|
||||
exclude: [
|
||||
// 'path/to/excluded/files'
|
||||
],
|
||||
//
|
||||
// ============
|
||||
// Capabilities
|
||||
// ============
|
||||
// Define your capabilities here. WebdriverIO can run multiple capabilities at the same
|
||||
// time. Depending on the number of capabilities, WebdriverIO launches several test
|
||||
// sessions. Within your capabilities you can overwrite the spec and exclude options in
|
||||
// order to group specific specs to a specific capability.
|
||||
//
|
||||
// First, you can define how many instances should be started at the same time. Let's
|
||||
// say you have 3 different capabilities (Chrome, Firefox, and Safari) and you have
|
||||
// set maxInstances to 1; wdio will spawn 3 processes. Therefore, if you have 10 spec
|
||||
// files and you set maxInstances to 10, all spec files will get tested at the same time
|
||||
// and 30 processes will get spawned. The property handles how many capabilities
|
||||
// from the same test should run tests.
|
||||
//
|
||||
maxInstances: 10,
|
||||
//
|
||||
// If you have trouble getting all important capabilities together, check out the
|
||||
// Sauce Labs platform configurator - a great tool to configure your capabilities:
|
||||
// https://saucelabs.com/platform/platform-configurator
|
||||
//
|
||||
capabilities: [
|
||||
{
|
||||
browserName: "chrome",
|
||||
},
|
||||
],
|
||||
|
||||
//
|
||||
// ===================
|
||||
// Test Configurations
|
||||
// ===================
|
||||
// Define all options that are relevant for the WebdriverIO instance here
|
||||
//
|
||||
// Level of logging verbosity: trace | debug | info | warn | error | silent
|
||||
logLevel: "info",
|
||||
//
|
||||
// Set specific log levels per logger
|
||||
// loggers:
|
||||
// - webdriver, webdriverio
|
||||
// - @wdio/browserstack-service, @wdio/devtools-service, @wdio/sauce-service
|
||||
// - @wdio/mocha-framework, @wdio/jasmine-framework
|
||||
// - @wdio/local-runner
|
||||
// - @wdio/sumologic-reporter
|
||||
// - @wdio/cli, @wdio/config, @wdio/utils
|
||||
// Level of logging verbosity: trace | debug | info | warn | error | silent
|
||||
// logLevels: {
|
||||
// webdriver: 'info',
|
||||
// '@wdio/appium-service': 'info'
|
||||
// },
|
||||
//
|
||||
// If you only want to run your tests until a specific amount of tests have failed use
|
||||
// bail (default is 0 - don't bail, run all tests).
|
||||
bail: 0,
|
||||
//
|
||||
// Set a base URL in order to shorten url command calls. If your `url` parameter starts
|
||||
// with `/`, the base url gets prepended, not including the path portion of your baseUrl.
|
||||
// If your `url` parameter starts without a scheme or `/` (like `some/path`), the base url
|
||||
// gets prepended directly.
|
||||
baseUrl: "http://localhost:8080",
|
||||
//
|
||||
// Default timeout for all waitFor* commands.
|
||||
waitforTimeout: 10000,
|
||||
//
|
||||
// Default timeout in milliseconds for request
|
||||
// if browser driver or grid doesn't send response
|
||||
connectionRetryTimeout: 120000,
|
||||
//
|
||||
// Default request retries count
|
||||
connectionRetryCount: 3,
|
||||
//
|
||||
// Test runner services
|
||||
// Services take over a specific job you don't want to take care of. They enhance
|
||||
// your test setup with almost no effort. Unlike plugins, they don't add new
|
||||
// commands. Instead, they hook themselves up into the test process.
|
||||
// services: [],
|
||||
//
|
||||
// Framework you want to run your specs with.
|
||||
// The following are supported: Mocha, Jasmine, and Cucumber
|
||||
// see also: https://webdriver.io/docs/frameworks
|
||||
//
|
||||
// Make sure you have the wdio adapter package for the specific framework installed
|
||||
// before running any tests.
|
||||
framework: "jasmine",
|
||||
//
|
||||
// The number of times to retry the entire specfile when it fails as a whole
|
||||
// specFileRetries: 1,
|
||||
//
|
||||
// Delay in seconds between the spec file retry attempts
|
||||
// specFileRetriesDelay: 0,
|
||||
//
|
||||
// Whether or not retried spec files should be retried immediately or deferred to the end of the queue
|
||||
// specFileRetriesDeferred: false,
|
||||
//
|
||||
// Test reporter for stdout.
|
||||
// The only one supported by default is 'dot'
|
||||
// see also: https://webdriver.io/docs/dot-reporter
|
||||
reporters: ["spec"],
|
||||
|
||||
//
|
||||
// Options to be passed to Jasmine.
|
||||
jasmineOpts: {
|
||||
// Jasmine default timeout
|
||||
defaultTimeoutInterval: 60000,
|
||||
//
|
||||
// The Jasmine framework allows interception of each assertion in order to log the state of the application
|
||||
// or website depending on the result. For example, it is pretty handy to take a screenshot every time
|
||||
// an assertion fails.
|
||||
expectationResultHandler: function (passed, assertion) {
|
||||
// do something
|
||||
},
|
||||
},
|
||||
|
||||
//
|
||||
// =====
|
||||
// Hooks
|
||||
// =====
|
||||
// WebdriverIO provides several hooks you can use to interfere with the test process in order to enhance
|
||||
// it and to build services around it. You can either apply a single function or an array of
|
||||
// methods to it. If one of them returns with a promise, WebdriverIO will wait until that promise got
|
||||
// resolved to continue.
|
||||
/**
|
||||
* Gets executed once before all workers get launched.
|
||||
* @param {object} config wdio configuration object
|
||||
* @param {Array.<Object>} capabilities list of capabilities details
|
||||
*/
|
||||
// onPrepare: function (config, capabilities) {
|
||||
// },
|
||||
/**
|
||||
* Gets executed before a worker process is spawned and can be used to initialise specific service
|
||||
* for that worker as well as modify runtime environments in an async fashion.
|
||||
* @param {string} cid capability id (e.g 0-0)
|
||||
* @param {object} caps object containing capabilities for session that will be spawn in the worker
|
||||
* @param {object} specs specs to be run in the worker process
|
||||
* @param {object} args object that will be merged with the main configuration once worker is initialized
|
||||
* @param {object} execArgv list of string arguments passed to the worker process
|
||||
*/
|
||||
// onWorkerStart: function (cid, caps, specs, args, execArgv) {
|
||||
// },
|
||||
/**
|
||||
* Gets executed just after a worker process has exited.
|
||||
* @param {string} cid capability id (e.g 0-0)
|
||||
* @param {number} exitCode 0 - success, 1 - fail
|
||||
* @param {object} specs specs to be run in the worker process
|
||||
* @param {number} retries number of retries used
|
||||
*/
|
||||
// onWorkerEnd: function (cid, exitCode, specs, retries) {
|
||||
// },
|
||||
/**
|
||||
* Gets executed just before initialising the webdriver session and test framework. It allows you
|
||||
* to manipulate configurations depending on the capability or spec.
|
||||
* @param {object} config wdio configuration object
|
||||
* @param {Array.<Object>} capabilities list of capabilities details
|
||||
* @param {Array.<String>} specs List of spec file paths that are to be run
|
||||
* @param {string} cid worker id (e.g. 0-0)
|
||||
*/
|
||||
// beforeSession: function (config, capabilities, specs, cid) {
|
||||
// },
|
||||
/**
|
||||
* Gets executed before test execution begins. At this point you can access to all global
|
||||
* variables like `browser`. It is the perfect place to define custom commands.
|
||||
* @param {Array.<Object>} capabilities list of capabilities details
|
||||
* @param {Array.<String>} specs List of spec file paths that are to be run
|
||||
* @param {object} browser instance of created browser/device session
|
||||
*/
|
||||
// before: function (capabilities, specs) {
|
||||
// },
|
||||
/**
|
||||
* Runs before a WebdriverIO command gets executed.
|
||||
* @param {string} commandName hook command name
|
||||
* @param {Array} args arguments that command would receive
|
||||
*/
|
||||
// beforeCommand: function (commandName, args) {
|
||||
// },
|
||||
/**
|
||||
* Hook that gets executed before the suite starts
|
||||
* @param {object} suite suite details
|
||||
*/
|
||||
// beforeSuite: function (suite) {
|
||||
// },
|
||||
/**
|
||||
* Function to be executed before a test (in Mocha/Jasmine) starts.
|
||||
*/
|
||||
// beforeTest: function (test, context) {
|
||||
// },
|
||||
/**
|
||||
* Hook that gets executed _before_ a hook within the suite starts (e.g. runs before calling
|
||||
* beforeEach in Mocha)
|
||||
*/
|
||||
// beforeHook: function (test, context) {
|
||||
// },
|
||||
/**
|
||||
* Hook that gets executed _after_ a hook within the suite starts (e.g. runs after calling
|
||||
* afterEach in Mocha)
|
||||
*/
|
||||
// afterHook: function (test, context, { error, result, duration, passed, retries }) {
|
||||
// },
|
||||
/**
|
||||
* Function to be executed after a test (in Mocha/Jasmine only)
|
||||
* @param {object} test test object
|
||||
* @param {object} context scope object the test was executed with
|
||||
* @param {Error} result.error error object in case the test fails, otherwise `undefined`
|
||||
* @param {*} result.result return object of test function
|
||||
* @param {number} result.duration duration of test
|
||||
* @param {boolean} result.passed true if test has passed, otherwise false
|
||||
* @param {object} result.retries information about spec related retries, e.g. `{ attempts: 0, limit: 0 }`
|
||||
*/
|
||||
// afterTest: function(test, context, { error, result, duration, passed, retries }) {
|
||||
// },
|
||||
|
||||
/**
|
||||
* Hook that gets executed after the suite has ended
|
||||
* @param {object} suite suite details
|
||||
*/
|
||||
// afterSuite: function (suite) {
|
||||
// },
|
||||
/**
|
||||
* Runs after a WebdriverIO command gets executed
|
||||
* @param {string} commandName hook command name
|
||||
* @param {Array} args arguments that command would receive
|
||||
* @param {number} result 0 - command success, 1 - command error
|
||||
* @param {object} error error object if any
|
||||
*/
|
||||
// afterCommand: function (commandName, args, result, error) {
|
||||
// },
|
||||
/**
|
||||
* Gets executed after all tests are done. You still have access to all global variables from
|
||||
* the test.
|
||||
* @param {number} result 0 - test pass, 1 - test fail
|
||||
* @param {Array.<Object>} capabilities list of capabilities details
|
||||
* @param {Array.<String>} specs List of spec file paths that ran
|
||||
*/
|
||||
// after: function (result, capabilities, specs) {
|
||||
// },
|
||||
/**
|
||||
* Gets executed right after terminating the webdriver session.
|
||||
* @param {object} config wdio configuration object
|
||||
* @param {Array.<Object>} capabilities list of capabilities details
|
||||
* @param {Array.<String>} specs List of spec file paths that ran
|
||||
*/
|
||||
// afterSession: function (config, capabilities, specs) {
|
||||
// },
|
||||
/**
|
||||
* Gets executed after all workers got shut down and the process is about to exit. An error
|
||||
* thrown in the onComplete hook will result in the test run failing.
|
||||
* @param {object} exitCode 0 - success, 1 - fail
|
||||
* @param {object} config wdio configuration object
|
||||
* @param {Array.<Object>} capabilities list of capabilities details
|
||||
* @param {<Object>} results object containing test results
|
||||
*/
|
||||
// onComplete: function(exitCode, config, capabilities, results) {
|
||||
// },
|
||||
/**
|
||||
* Gets executed when a refresh happens.
|
||||
* @param {string} oldSessionId session ID of the old session
|
||||
* @param {string} newSessionId session ID of the new session
|
||||
*/
|
||||
// onReload: function(oldSessionId, newSessionId) {
|
||||
// }
|
||||
};
|
||||
Reference in New Issue
Block a user