[WIP] Добавил на форму создания записи: ФИО, Основную информацию, ДУЛ, Адрес, изображение
This commit is contained in:
@@ -1,66 +1,185 @@
|
||||
<template lang="pug">
|
||||
base-modal(v-model="isShowForm", title="Создание записи")
|
||||
.flex.flex-col.pt-6.gap-y-4(:style="{maxWidth: '682px'}")
|
||||
.flex.gap-x-10
|
||||
.flex.flex-col.gap-y-4.text-smm
|
||||
.flex.gap-x-3.items-center
|
||||
.text.font-semibold Статус
|
||||
.flex.gap-x-1
|
||||
.input.flex.items-center.pl-4
|
||||
.text-input.font-medium Не принят
|
||||
q-btn.change.flex.w-7.h-7(dense, padding="4px 4px")
|
||||
img(:src="folder")
|
||||
.flex.gap-x-3.items-center
|
||||
.text.font-semibold Дата:
|
||||
.flex.gap-x-1
|
||||
.input.flex.items-center.pl-4
|
||||
.text-input.font-medium 24 мая 2020
|
||||
q-btn.change.flex.w-7.h-7(dense, padding="4px 4px")
|
||||
img(:src="calendar")
|
||||
.flex.gap-x-3.items-center
|
||||
.text.font-semibold Время:
|
||||
.flex.gap-x-1
|
||||
.input.flex.items-center.pl-4
|
||||
.text-input.font-medium 13:00 - 14:00
|
||||
q-btn.change.flex.w-7.h-7(dense, padding="4px 4px")
|
||||
img(:src="time")
|
||||
.flex.h-14.gap-x-3.items-center.text-smm
|
||||
.text.font-semibold Медкарта:
|
||||
.flex.gap-x-1
|
||||
.name.flex.items-center.px-4.pt-2.pb-1.gap-x-2
|
||||
.photo.flex.h-10.w-10.items-center.justify-center
|
||||
img(:src="noname")
|
||||
.flex.flex-col.font-medium
|
||||
.text-input Имя Фамилия
|
||||
.name-date.text-xsx Дата
|
||||
.change.flex.items-center
|
||||
q-btn(dense, padding="24px 8px")
|
||||
q-icon(name="app:icon-plus", size="12px")
|
||||
.flex.items-center.gap-x-3
|
||||
.text.font-semibold.text-smm Услуги
|
||||
.flex.gap-x-1
|
||||
.services.flex
|
||||
.change.flex.w-7.h-7
|
||||
.flex.flex-col.pt-6.gap-y-4(:style="{maxWidth: '682px'}")
|
||||
.flex.gap-x-10
|
||||
.flex.flex-col.gap-y-4.text-smm
|
||||
.flex.gap-x-3.items-center
|
||||
.text.font-semibold Статус
|
||||
.flex.gap-x-1
|
||||
.input.flex.items-center.pl-4
|
||||
.text-input.font-medium Не принят
|
||||
q-btn.change.flex.w-7.h-7(dense, padding="4px 4px")
|
||||
img(:src="folder")
|
||||
.flex.gap-x-3.items-center
|
||||
.text.font-semibold Дата:
|
||||
.flex.gap-x-1
|
||||
.input.flex.items-center.pl-4
|
||||
.text-input.font-medium 24 мая 2020
|
||||
q-btn.change.flex.w-7.h-7(dense, padding="4px 4px")
|
||||
img(:src="calendar")
|
||||
.flex.gap-x-3.items-center
|
||||
.text.font-semibold Время:
|
||||
.flex.gap-x-1
|
||||
.input.flex.items-center.pl-4
|
||||
.text-input.font-medium 13:00 - 14:00
|
||||
q-btn.change.flex.w-7.h-7(dense, padding="4px 4px")
|
||||
img(:src="time")
|
||||
.flex.h-14.gap-x-3.items-center.text-smm
|
||||
.text.font-semibold Медкарта:
|
||||
.flex.gap-x-1
|
||||
.name.flex.items-center.px-4.pt-2.pb-1.gap-x-2
|
||||
.photo.flex.h-10.w-10.items-center.justify-center
|
||||
img(:src="noname")
|
||||
.flex.flex-col.font-medium
|
||||
.text-input Имя Фамилия
|
||||
.name-date.text-xsx Дата
|
||||
.change.flex.items-center
|
||||
q-btn(dense, padding="24px 8px")
|
||||
q-icon(name="app:icon-plus", size="12px")
|
||||
.flex.items-center.gap-x-3.text-smm
|
||||
.text.font-semibold Услуги:
|
||||
.flex.gap-x-1
|
||||
.services.flex.items-center.px-4.font-medium.text
|
||||
span Выберите услуги
|
||||
q-btn.change.flex.w-7.h-7(dense, padding="4px 4px")
|
||||
img(:src="folder")
|
||||
base-input-full-name(:info-client="infoClient")
|
||||
.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="infoClient.basic",
|
||||
:phone="infoClient.phone",
|
||||
:email="infoClient.email",
|
||||
:add-network="addNewNetwork",
|
||||
:priority-list="priorityList",
|
||||
:identity-document="infoClient.identity_document",
|
||||
:addresses="infoClient.addresses",
|
||||
:save-file="saveDocFile",
|
||||
:networks-list="getNetworksList",
|
||||
)
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { column } from "@/pages/clients/utils/tableConfig";
|
||||
import { v_model } from "@/shared/mixins/v-model";
|
||||
import BaseModal from "@/components/base/BaseModal.vue";
|
||||
import noname from "@/assets/icons/noname.svg";
|
||||
import folder from "@/assets/icons/folder.svg";
|
||||
import time from "@/assets/icons/time.svg";
|
||||
import calendar from "@/assets/icons/calendar-grey.svg";
|
||||
import FormCreateBasicInfo from "@/pages/clients/components/FormCreateBasicInfo";
|
||||
import FormCreateIdentityDocuments from "@/pages/clients/components/FormCreateIdentityDocuments";
|
||||
import FormCreateAddresses from "@/pages/clients/components/FormCreateAddresses";
|
||||
import BaseInput from "@/components/base/BaseInput.vue";
|
||||
import BaseInputFullName from "@/components/base/BaseInputFullName.vue";
|
||||
|
||||
export default {
|
||||
name: "RecordCreationForm",
|
||||
components: { BaseModal },
|
||||
components: {
|
||||
BaseModal,
|
||||
FormCreateBasicInfo,
|
||||
FormCreateIdentityDocuments,
|
||||
FormCreateAddresses,
|
||||
BaseInput,
|
||||
BaseInputFullName,
|
||||
},
|
||||
props: { isShowForm: Boolean },
|
||||
mixins: [v_model],
|
||||
data() {
|
||||
return { noname, folder, time, calendar, isPhoto: false };
|
||||
return {
|
||||
noname,
|
||||
folder,
|
||||
time,
|
||||
calendar,
|
||||
isPhoto: false,
|
||||
infoClient: {
|
||||
basic: { contacts: [] },
|
||||
phone: { username: "" },
|
||||
email: { username: "" },
|
||||
identity_document: {},
|
||||
addresses: {},
|
||||
},
|
||||
forms: [
|
||||
{
|
||||
title: "Основное",
|
||||
id: "basic",
|
||||
component: "form-create-basic-info",
|
||||
},
|
||||
{
|
||||
title: "ДУЛ",
|
||||
id: "doc",
|
||||
component: "form-create-identity-documents",
|
||||
},
|
||||
{
|
||||
title: "Адрес",
|
||||
id: "address",
|
||||
component: "form-create-addresses",
|
||||
},
|
||||
],
|
||||
currentForm: "form-create-basic-info",
|
||||
priorityList: [
|
||||
{
|
||||
id: 1,
|
||||
label: "Высокий",
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
label: "Средний",
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
label: "Низкий",
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
label: "-",
|
||||
},
|
||||
],
|
||||
networksSettings: column.find((el) => el.name === "networks")?.settings,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
getNetworksList() {
|
||||
let contacts = [];
|
||||
this.infoClient.basic.contacts.forEach((elem) =>
|
||||
contacts.push(elem.kind.id)
|
||||
);
|
||||
let filteredNetworks = this.networksSettings.filter(
|
||||
({ id }) => !contacts.includes(id)
|
||||
);
|
||||
return filteredNetworks;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
changePhoto() {
|
||||
this.isPhoto = true;
|
||||
},
|
||||
selectForm(componentName) {
|
||||
this.currentForm = this.forms.find(
|
||||
(elem) => elem.component === componentName
|
||||
)?.component;
|
||||
},
|
||||
saveDocFile(e) {
|
||||
this.infoClient.doc = e.target.files;
|
||||
},
|
||||
addNewNetwork() {
|
||||
const newNetwork = this.getNetworksList;
|
||||
if (newNetwork[0])
|
||||
this.infoClient.basic.contacts.push({
|
||||
kind: {
|
||||
id: newNetwork[0].id,
|
||||
icon: newNetwork[0].icon,
|
||||
},
|
||||
username: "",
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@@ -102,4 +221,14 @@ export default {
|
||||
border-radius: 6px
|
||||
height: 28px
|
||||
width: 560px
|
||||
|
||||
.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)
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user