Merge pull request #166 from dderbentsov/UC-90

Добавил приоритет клиента, обработку ввода паспортных данных, фикс чекбокса выбора клиента, Изменил инпуты для даты и ограничил вводимые значения; при наведении на аватар клиента, появляется иконка загрузки
This commit is contained in:
frontgavrilin
2022-11-30 18:45:29 +03:00
committed by GitHub
15 changed files with 58 additions and 59 deletions

View File

@@ -4,7 +4,6 @@
:is-open-form="isOpenForm", :is-open-form="isOpenForm",
:close-form="closeForm", :close-form="closeForm",
:open-form="openForm", :open-form="openForm",
:current-year="currentYear",
@update-client="setUpdatedClients" @update-client="setUpdatedClients"
) )
.flex.flex-auto .flex.flex-auto
@@ -12,7 +11,6 @@
router-view( router-view(
:open-form="openForm", :open-form="openForm",
:is-open-form="isOpenForm", :is-open-form="isOpenForm",
:current-year="currentYear",
:updated-clients="updatedClients", :updated-clients="updatedClients",
@reset-updated-clients="resetUpdatedClients" @reset-updated-clients="resetUpdatedClients"
) )
@@ -30,7 +28,6 @@ export default {
data() { data() {
return { return {
isOpenForm: false, isOpenForm: false,
currentYear: null,
updatedClients: false, updatedClients: false,
}; };
}, },
@@ -41,9 +38,6 @@ export default {
closeForm() { closeForm() {
this.isOpenForm = false; this.isOpenForm = false;
}, },
printCurrentYear() {
return new Date().getFullYear();
},
setUpdatedClients() { setUpdatedClients() {
this.updatedClients = true; this.updatedClients = true;
}, },
@@ -51,8 +45,5 @@ export default {
this.updatedClients = false; this.updatedClients = false;
}, },
}, },
mounted: function () {
this.currentYear = this.printCurrentYear();
},
}; };
</script> </script>

View File

@@ -3,7 +3,6 @@
base-client-form-create( base-client-form-create(
v-if="isOpenForm", v-if="isOpenForm",
:close-form="closeForm", :close-form="closeForm",
:current-year="currentYear",
@update-client="transmitUpdateClient" @update-client="transmitUpdateClient"
) )
.flex.items-center.box-border.cursor-pointer.mr-auto .flex.items-center.box-border.cursor-pointer.mr-auto
@@ -43,7 +42,6 @@ export default {
openForm: Function, openForm: Function,
closeForm: Function, closeForm: Function,
isOpenForm: Boolean, isOpenForm: Boolean,
currentYear: Number,
}, },
data() { data() {
return { return {

View File

@@ -12,7 +12,7 @@
v-for="img in image" v-for="img in image"
) )
.icon-download.text-xl(v-if="img === defaultIcon") .icon-download.text-xl(v-if="img === defaultIcon")
.flex.w-10.h-10(v-else) .wrapper-img.flex.w-10.h-10(v-else)
img.current-avatar(:src="img") img.current-avatar(:src="img")
base-popup.right-5.top-7(v-if="showPopup", :width="230") base-popup.right-5.top-7(v-if="showPopup", :width="230")
.flex.items-center.gap-x-2 .flex.items-center.gap-x-2
@@ -56,13 +56,11 @@
:choose-option="chooseOptionNetworks" :choose-option="chooseOptionNetworks"
:choose-priority="choosePriority" :choose-priority="choosePriority"
:priority-list="priorityList" :priority-list="priorityList"
:current-year="currentYear"
) )
.flex(:style="{display :'none'}" ref="doc") .flex(:style="{display :'none'}" ref="doc")
form-create-identity-documents( form-create-identity-documents(
:identity-document="infoClient.identity_document", :identity-document="infoClient.identity_document",
:save-client="saveClient", :save-client="saveClient"
:current-year="currentYear"
) )
.flex(:style="{display :'none'}" ref="address") .flex(:style="{display :'none'}" ref="address")
form-create-addresses( form-create-addresses(
@@ -109,7 +107,6 @@ export default {
}, },
props: { props: {
closeForm: Function, closeForm: Function,
currentYear: Number,
}, },
data() { data() {
return { return {
@@ -263,15 +260,14 @@ export default {
}, },
postNewClient() { postNewClient() {
const formData = new FormData(); const formData = new FormData();
formData.append("full_name", this.infoClient.basic.full_name);
this.imageData.forEach((e) => { this.imageData.forEach((e) => {
formData.append("photo", e); formData.append("photo", e);
formData.append("full_name", this.infoClient.basic.full_name);
}); });
if (this.infoClient.basic.birth_date) if (this.infoClient.basic.birth_date)
formData.append("birth_date", this.infoClient.basic.birth_date); formData.append("birth_date", this.infoClient.basic.birth_date);
let foundElement = this.prioritySettings.settings.find( let foundElement = this.prioritySettings.settings.find(
(el) => el.text === this.infoClient.basic.priority (el) => el.priority === this.infoClient.basic.priority.id
); );
if (foundElement) formData.append("priority", foundElement.priority); if (foundElement) formData.append("priority", foundElement.priority);
fetchWrapper fetchWrapper
@@ -452,4 +448,12 @@ export default {
background-size: cover background-size: cover
background-repeat: no-repeat background-repeat: no-repeat
background-position: center background-position: center
&:hover
display: none
.wrapper-img
background-size: 20px
background-repeat: no-repeat
background-position: center
background-image: url(@/assets/icons/download.svg)
</style> </style>

View File

@@ -1,14 +1,16 @@
<template lang="pug"> <template lang="pug">
.input-wrapper.flex.gap-x-2.px-4.box-border( .input-wrapper.flex.gap-x-2.px-4.box-border(
class="py-2.5" class="py-2.5",
:style="{ minWidth: widthInput + 'px' }" :style="{ minWidth: widthInput + 'px' }"
) )
input.input.w-full.outline-0.not-italic.date( input.input.w-full.outline-0.not-italic.date(
:value="value" :value="value",
type="date" type="date",
@input="$emit('update:value', $event.target.value)" @input="$emit('update:value', $event.target.value)",
:placeholder="placeholder" :placeholder="placeholder",
:maxlength="maxLength" :maxlength="maxLength",
max="9999-12-31",
min="0000-01-01"
) )
.slot(v-if="withIcon" :class="iconPosition") .slot(v-if="withIcon" :class="iconPosition")
slot.cursor-pointer slot.cursor-pointer

View File

@@ -2,7 +2,6 @@
clients-wrapper( clients-wrapper(
:open-form="openForm", :open-form="openForm",
:is-open-form="isOpenForm", :is-open-form="isOpenForm",
:current-year="currentYear",
:updated-clients="updatedClients", :updated-clients="updatedClients",
@reset-updated-clients="transmitReset" @reset-updated-clients="transmitReset"
) )
@@ -15,7 +14,6 @@ export default {
components: { ClientsWrapper }, components: { ClientsWrapper },
props: { props: {
openForm: Function, openForm: Function,
currentYear: Number,
isOpenForm: Boolean, isOpenForm: Boolean,
updatedClients: Boolean, updatedClients: Boolean,
}, },

View File

@@ -68,13 +68,11 @@
v-model:value="sectionInfo[key]", v-model:value="sectionInfo[key]",
:width="settings[section].width", :width="settings[section].width",
:placeholder="settings[section].placeholder[key]" :placeholder="settings[section].placeholder[key]"
:sharp="settings[section].sharps[key] && section === 'pass' ? settings[section].sharps[key] : ''"
) )
base-input.max-h-10.py-2.pl-3( base-input-date.input(
v-else-if="isChange && section !== 'docs'", v-else-if="isChange && section !== 'docs'",
type="date",
v-model:value="sectionInfo.issued_by_date" v-model:value="sectionInfo.issued_by_date"
:max-date="`${currentYear}-12-31`",
dateInput
) )
.copy.icon-copy.cursor-pointer( .copy.icon-copy.cursor-pointer(
v-if="item.copy", v-if="item.copy",
@@ -123,9 +121,9 @@ import TableAddingNewAdditional from "@/pages/clients/components/TableAddingNewA
import TableCreatePackageDoc from "@/pages/clients/components/TableCreatePackageDoc"; import TableCreatePackageDoc from "@/pages/clients/components/TableCreatePackageDoc";
import ClientDetailSectionAddress from "@/pages/clients/components/ClientDetailSectionAddress"; import ClientDetailSectionAddress from "@/pages/clients/components/ClientDetailSectionAddress";
import TableChoiceAddingDoc from "@/pages/clients/components/TableChoiceAddingDoc"; import TableChoiceAddingDoc from "@/pages/clients/components/TableChoiceAddingDoc";
import BaseInput from "@/components/base/BaseInput";
import BasePopup from "@/components/base/BasePopup"; import BasePopup from "@/components/base/BasePopup";
import BaseModal from "@/components/base/BaseModal"; import BaseModal from "@/components/base/BaseModal";
import BaseInputDate from "@/components/base/BaseInputDate";
import { detail } from "@/pages/clients/utils/tableConfig"; import { detail } from "@/pages/clients/utils/tableConfig";
import pdfIcon from "@/assets/icons/pdf.svg"; import pdfIcon from "@/assets/icons/pdf.svg";
import wordIcon from "@/assets/icons/word.svg"; import wordIcon from "@/assets/icons/word.svg";
@@ -134,7 +132,7 @@ export default {
name: "ClientDetailInfoSection", name: "ClientDetailInfoSection",
components: { components: {
BaseButton, BaseButton,
BaseInput, BaseInputDate,
BasePopup, BasePopup,
BaseModal, BaseModal,
ClientDetailInput, ClientDetailInput,
@@ -159,7 +157,6 @@ export default {
createDocument: Function, createDocument: Function,
addressId: String, addressId: String,
docId: String, docId: String,
currentYear: Number,
}, },
data() { data() {
return { return {
@@ -367,4 +364,7 @@ export default {
width: 38px width: 38px
z-index: 1 z-index: 1
background: var(--light-grey-bg-color) background: var(--light-grey-bg-color)
.input
border: 1.5px solid var(--border-light-grey-color)
</style> </style>

View File

@@ -7,7 +7,6 @@
:lack-data="lackData", :lack-data="lackData",
:create-document="createDocument", :create-document="createDocument",
:doc-id="docId", :doc-id="docId",
:current-year="currentYear"
) )
.flex.flex-col .flex.flex-col
client-detail-info-section( client-detail-info-section(
@@ -51,7 +50,6 @@ export default {
createDocument: Function, createDocument: Function,
addressId: String, addressId: String,
docId: String, docId: String,
currentYear: Number,
}, },
}; };
</script> </script>

View File

@@ -1,15 +1,25 @@
<template lang="pug"> <template lang="pug">
.input-wrapper.flex.gap-x-2.px-3.box-border.w-max-fit(class="py-2.5") .input-wrapper.flex.gap-x-2.px-3.box-border.w-max-fit(class="py-2.5")
textarea.place-input.w-full.outline-0.text-sm.not-italic.resize-none.font-medium( textarea.place-input.w-full.outline-0.text-sm.not-italic.resize-none.font-medium(
v-if="!sharp"
:rows="Math.ceil(value.length/heightInput)", :rows="Math.ceil(value.length/heightInput)",
:value="value", :value="value",
@input="$emit('update:value', $event.target.value)", @input="$emit('update:value', $event.target.value)",
:placeholder="placeholder", :placeholder="placeholder",
) )
input.place-input.w-full.outline-0.text-sm.not-italic.resize-none.font-medium(
v-else,
:rows="Math.ceil(value.length/heightInput)",
:value="value",
@input="$emit('update:value', $event.target.value)",
:placeholder="placeholder",
v-mask="sharp"
)
slot slot
</template> </template>
<script> <script>
import { mask } from "vue-the-mask";
export default { export default {
name: "ClientDetailInput", name: "ClientDetailInput",
props: { props: {
@@ -20,7 +30,7 @@ export default {
default: "Поиск", default: "Поиск",
}, },
}, },
directives: { mask },
computed: { computed: {
heightInput() { heightInput() {
return ((this.width / 100) * 70) / 11; return ((this.width / 100) * 70) / 11;

View File

@@ -16,7 +16,6 @@
:check="selectedCheck", :check="selectedCheck",
:client="client", :client="client",
:fetch-data-clients="fetchDataClients", :fetch-data-clients="fetchDataClients",
:current-year="currentYear",
@update-clients="updateDataClient" @update-clients="updateDataClient"
) )
client-table-pagination( client-table-pagination(
@@ -48,7 +47,6 @@ export default {
}, },
props: { props: {
openForm: Function, openForm: Function,
currentYear: Number,
isOpenForm: Boolean, isOpenForm: Boolean,
updatedClients: Boolean, updatedClients: Boolean,
}, },

View File

@@ -1,5 +1,5 @@
<template lang="pug"> <template lang="pug">
input.checkbox.cursor-pointer(type="checkbox" :id="id" :checked="isCheck" @change="(e) => check(e)") input.checkbox.cursor-pointer(type="checkbox" :id="id" :checked="isCheck" @click.stop @change="(e) => check(e)")
</template> </template>
<script> <script>

View File

@@ -85,7 +85,6 @@
:create-document="postCreateIdentityDocument" :create-document="postCreateIdentityDocument"
:address-id="addressId" :address-id="addressId"
:doc-id="docId" :doc-id="docId"
:current-year="currentYear"
) )
</template> </template>
@@ -153,7 +152,6 @@ export default {
check: Function, check: Function,
isCheck: Boolean, isCheck: Boolean,
client: Object, client: Object,
currentYear: Number,
}, },
created() { created() {
this.dataClient = { this.dataClient = {

View File

@@ -3,7 +3,6 @@
clients-table( clients-table(
:open-form="openForm", :open-form="openForm",
:is-open-form="isOpenForm", :is-open-form="isOpenForm",
:current-year="currentYear",
:updated-clients="updatedClients", :updated-clients="updatedClients",
@reset-updated-clients="transmitReset" @reset-updated-clients="transmitReset"
) )
@@ -16,7 +15,6 @@ export default {
components: { ClientsTable }, components: { ClientsTable },
props: { props: {
openForm: Function, openForm: Function,
currentYear: Number,
isOpenForm: Boolean, isOpenForm: Boolean,
updatedClients: Boolean, updatedClients: Boolean,
}, },

View File

@@ -10,18 +10,16 @@
) )
.flex.flex-col(class="gap-y-1.5") .flex.flex-col(class="gap-y-1.5")
span.text-sm Дата рождения span.text-sm Дата рождения
base-input.input-info( base-input-date.input-date(
v-model:value="basicInfo.birth_date", v-model:value="basicInfo.birth_date",
type="date", :width-input="277"
placeholder="00.00.0000",
:width-input="277",
:max-date="`${ currentYear }-12-31`"
) )
.flex.flex-col(class="gap-y-1.5") .flex.flex-col(class="gap-y-1.5")
span.text-sm Номер телефона span.text-sm Номер телефона
base-input.input-info( base-input.input-info(
v-model:value="phone.username", v-model:value="phone.username",
placeholder="+7 (915) 6449223", placeholder="+7 (915) 6449223",
v-mask="'+7 (###) ###-##-##'",
:width-input="277" :width-input="277"
) )
.flex.flex-col(class="gap-y-1.5") .flex.flex-col(class="gap-y-1.5")
@@ -53,13 +51,16 @@
<script> <script>
import BaseButton from "@/components/base/BaseButton"; import BaseButton from "@/components/base/BaseButton";
import BaseInput from "@/components/base/BaseInput"; import BaseInput from "@/components/base/BaseInput";
import BaseInputDate from "@/components/base/BaseInputDate";
import BaseAddingNetwork from "@/components/base/BaseAddingNetwork"; import BaseAddingNetwork from "@/components/base/BaseAddingNetwork";
import { column } from "@/pages/clients/utils/tableConfig"; import { column } from "@/pages/clients/utils/tableConfig";
import BaseCustomSelect from "@/components/base/BaseCustomSelect"; import BaseCustomSelect from "@/components/base/BaseCustomSelect";
import { mask } from "vue-the-mask";
export default { export default {
name: "FormCreateBasicInfo", name: "FormCreateBasicInfo",
components: { components: {
BaseInput, BaseInput,
BaseInputDate,
BaseAddingNetwork, BaseAddingNetwork,
BaseButton, BaseButton,
BaseCustomSelect, BaseCustomSelect,
@@ -74,8 +75,8 @@ export default {
basicInfo: Object, basicInfo: Object,
saveClient: Function, saveClient: Function,
addNetwork: Function, addNetwork: Function,
currentYear: Number,
}, },
directives: { mask },
data() { data() {
return { return {
networks: column.find((el) => el.name === "networks"), networks: column.find((el) => el.name === "networks"),
@@ -110,4 +111,6 @@ export default {
height: 100% height: 100%
border: 2px solid var(--border-light-grey-color) border: 2px solid var(--border-light-grey-color)
border-radius: 4px border-radius: 4px
.input-date
border: 1.5px solid var(--border-light-grey-color)
</style> </style>

View File

@@ -28,12 +28,10 @@
) )
.flex.flex-col(class="gap-y-1.5") .flex.flex-col(class="gap-y-1.5")
span.text-sm Дата выдачи span.text-sm Дата выдачи
base-input.input-info( base-input-date.input-date(
type="date",
v-model:value="identityDocument.pass.issued_by_date", v-model:value="identityDocument.pass.issued_by_date",
placeholder="Дата", placeholder="Дата",
:width-input="277", :width-input="277"
:max-date="`${currentYear}-12-31`"
) )
.flex.flex-col.gap-y-6.px-4 .flex.flex-col.gap-y-6.px-4
span.title-info.text-base.font-bold СНИЛС и ИНН span.title-info.text-base.font-bold СНИЛС и ИНН
@@ -62,14 +60,14 @@
<script> <script>
import BaseButton from "@/components/base/BaseButton"; import BaseButton from "@/components/base/BaseButton";
import BaseInput from "@/components/base/BaseInput"; import BaseInput from "@/components/base/BaseInput";
import BaseInputDate from "@/components/base/BaseInputDate";
import { mask } from "vue-the-mask"; import { mask } from "vue-the-mask";
export default { export default {
name: "FormCreateIdentityDocuments", name: "FormCreateIdentityDocuments",
components: { BaseInput, BaseButton }, components: { BaseInput, BaseInputDate, BaseButton },
props: { props: {
identityDocument: Object, identityDocument: Object,
saveClient: Function, saveClient: Function,
currentYear: Number,
}, },
directives: { mask }, directives: { mask },
}; };
@@ -93,4 +91,6 @@ export default {
color: var(--font-dark-blue-color) color: var(--font-dark-blue-color)
.title-info .title-info
color: var(--font-dark-blue-color) color: var(--font-dark-blue-color)
.input-date
border: 1.5px solid var(--border-light-grey-color)
</style> </style>

View File

@@ -115,7 +115,7 @@ export const detail = {
}, },
sharps: { sharps: {
numba: "#### ######", numba: "#### ######",
issued_by_org: "XXXXXX", issued_by_org: "",
issued_by_org_code: "###-###", issued_by_org_code: "###-###",
issued_by_date: "##.##.####", issued_by_date: "##.##.####",
}, },
@@ -157,6 +157,7 @@ export const detail = {
options: { options: {
join_adress: "Полный адрес", join_adress: "Полный адрес",
}, },
sharps: { join_adress: "" },
placeholder: { placeholder: {
join_adress: "Введите адрес целиком", join_adress: "Введите адрес целиком",
}, },