From 91fff6cb3058ea89b5be1a568a1871c4e6952ca0 Mon Sep 17 00:00:00 2001 From: megavrilinvv Date: Fri, 11 Nov 2022 13:25:28 +0300 Subject: [PATCH 1/3] =?UTF-8?q?[WIP]=20=D0=94=D0=BE=D0=B1=D0=B0=D0=B2?= =?UTF-8?q?=D0=B8=D0=BB=20=D1=81=D0=BE=D1=81=D1=82=D0=BE=D1=8F=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5=20=D0=BE=D1=82=D1=81=D1=83=D1=82=D1=81=D0=B2=D1=83=D1=8E?= =?UTF-8?q?=D1=89=D0=B8=D1=85=20=D0=B4=D0=B0=D0=BD=D0=BD=D1=8B=D1=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/ClientDetailInfoSection.vue | 60 ++++++++++--------- .../components/ClientDetailInfoWrapper.vue | 4 ++ .../clients/components/ClientDetailInput.vue | 4 +- .../clients/components/ClientsTableRow.vue | 50 ++++++++++++---- 4 files changed, 76 insertions(+), 42 deletions(-) diff --git a/src/pages/clients/components/ClientDetailInfoSection.vue b/src/pages/clients/components/ClientDetailInfoSection.vue index 713bb97..a483d14 100644 --- a/src/pages/clients/components/ClientDetailInfoSection.vue +++ b/src/pages/clients/components/ClientDetailInfoSection.vue @@ -41,35 +41,37 @@ :save-additional="saveDocs" ) .section-body.w-full.flex.flex-col.px-4.pt-3.pb-4.gap-y-4 - .flex.flex-col(v-for="(item, key) in sectionInfo" class="gap-y-1.5") - span.title-section.font-semibold.text-xs(v-if="settings[section].options") {{settings[section].options[key]}} - span.title-section.font-semibold.text-xs(v-if="item.header") {{item.header}} - client-detail-input.text-sm.text-sm.w-max-fit( - v-if="section!=='docs' && isChange", - :style="{fontWeight:key === 'numba'&&600}", - v-model:value="sectionInfo[key]", - :width="settings[section].width" - :sharp="settings[section].sharps[key]" - ) - .copy.icon-copy.cursor-pointer( - v-if="item.copy", - @click="() => copyValue(item)" + .flex.flex-col(class="gap-y-1.5") + .flex.flex-col(v-for="(item, key) in sectionInfo" v-if="lackPass || lackAddress" class="gap-y-1.5") + span.title-section.font-semibold.text-xs(v-if="settings[section].options") {{settings[section].options[key]}} + span.title-section.font-semibold.text-xs(v-if="item.header") {{item.header}} + client-detail-input.text-sm.text-sm.w-max-fit( + v-if="section!=='docs' && isChange", + :style="{fontWeight:key === 'numba'&&600}", + v-model:value="sectionInfo[key]", + :width="settings[section].width" ) - .flex(v-if="settings[section].options && !isChange") - span.text-sm.w-fit(:style="{fontWeight:key === 'numba'&&600}") {{item}} - .copy.icon-copy.cursor-pointer.pl-4( - v-if="key === 'numba'", - @click="() => copyValue(item)" - ) - .flex(v-if="item.name && !isChange") - span.text-sm.w-fit {{item.title}} - .flex.items-center(v-if="item.title") - .icon-cancel.cancel.cursor-pointer.pr-3.text-xsm( - v-if="isChange", - :id="item.id", - @click="(e) => deleteDoc(e)" - ) - span.text-sm {{item.title}} + .copy.icon-copy.cursor-pointer( + v-if="item.copy", + @click="() => copyValue(item)" + ) + .flex(v-if="settings[section].options && !isChange") + span.text-sm.w-fit(:style="{fontWeight:key === 'numba'&&600}") {{item}} + .copy.icon-copy.cursor-pointer.pl-4( + v-if="key === 'numba'", + @click="() => copyValue(item)" + ) + .flex(v-if="item.name && !isChange") + span.text-sm.w-fit {{item.title}} + .flex.items-center(v-if="item.title") + .icon-cancel.cancel.cursor-pointer.pr-3.text-xsm( + v-if="isChange", + :id="item.id", + @click="(e) => deleteDoc(e)" + ) + span.text-sm {{item.title}} + .flex.justify-center.items.center(v-else) + .flex(@click="!lackPass") Добавить данные diff --git a/src/pages/clients/components/ClientDetailInput.vue b/src/pages/clients/components/ClientDetailInput.vue index 95348da..b52006e 100644 --- a/src/pages/clients/components/ClientDetailInput.vue +++ b/src/pages/clients/components/ClientDetailInput.vue @@ -1,10 +1,10 @@ diff --git a/src/pages/clients/components/ClientsTableRow.vue b/src/pages/clients/components/ClientsTableRow.vue index 55d8b0b..9798f2a 100644 --- a/src/pages/clients/components/ClientsTableRow.vue +++ b/src/pages/clients/components/ClientsTableRow.vue @@ -24,6 +24,8 @@ :delete-doc="deleteDoc" :update-document="postUpdateIdentityDocument" :update-address="postUpdateAddress" + :lack-pass="lackPass" + :lack-address="lackAddress" ) @@ -73,6 +75,8 @@ export default { dataClient: {}, docId: "", addressId: "", + lackPass: true, + lackAddress: true, }; }, props: { @@ -215,17 +219,32 @@ export default { this.saveAddress(data.address[0]); this.saveAttachments([...data.attachments]); }, + addDoc() { + this.lackPass = false; + }, + saveIdentityDocument(data) { - this.dataIdentityDocument = { - numba: - data?.series && data?.numba - ? data?.series + " " + data?.numba || "" + if ( + data?.series || + data?.numba || + data?.issued_by_org || + data?.issued_by_org_code || + data?.issued_by_date + ) { + this.dataIdentityDocument = { + numba: + data.series && data.numba ? data?.series + " " + data?.numba : "", + issued_by_org: data.issued_by_org ? data?.issued_by_org : "", + issued_by_org_code: data.issued_by_org_code + ? data?.issued_by_org_code : "", - issued_by_org: data?.issued_by_org || "", - issued_by_org_code: data?.issued_by_org_code || "", - issued_by_date: - data?.issued_by_date.split("-").reverse().join(".") || "", - }; + issued_by_date: data.issued_by_date + ? data?.issued_by_date.split("-").reverse().join(".") + : "", + }; + } else { + this.lackPass = false; + } this.docId = data?.id; }, postUpdateIdentityDocument() { @@ -243,9 +262,16 @@ export default { .then(() => this.fetchClientDetail(this.id)); }, saveAddress(data) { - this.dataAddress = { - join_adress: data?.join_adress || "", - }; + if (data?.join_adress) { + this.dataAddress = { + join_adress: data?.join_adress + ? data?.join_adress + : (this.lackAddress = false), + }; + } else { + this.lackAddress = false; + } + this.addressId = data?.id; }, postUpdateAddress() { From 7795496c2f7b709e7b51e4e216bf672d8c0a4afd Mon Sep 17 00:00:00 2001 From: megavrilinvv Date: Fri, 11 Nov 2022 18:21:08 +0300 Subject: [PATCH 2/3] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB?= =?UTF-8?q?=20=D1=84=D0=BE=D1=80=D0=BC=D1=83=20=D0=B0=D0=B4=D1=80=D0=B5?= =?UTF-8?q?=D1=81=D0=BE=D0=B2=20=D0=BA=D0=BB=D0=B8=D0=B5=D0=BD=D1=82=D0=B0?= =?UTF-8?q?,=20=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=B8=D0=BB=20=D1=81?= =?UTF-8?q?=D1=82=D0=B8=D0=BB=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/ClientDetailInfoSection.vue | 70 +++++++++++++++++-- .../clients/components/ClientDetailInput.vue | 3 - .../clients/components/ClientsTableRow.vue | 4 +- .../components/FormCreateAddresses.vue | 19 +++-- .../components/FormCreateBasicInfo.vue | 38 ++++++++-- 5 files changed, 108 insertions(+), 26 deletions(-) diff --git a/src/pages/clients/components/ClientDetailInfoSection.vue b/src/pages/clients/components/ClientDetailInfoSection.vue index a483d14..c3d40d4 100644 --- a/src/pages/clients/components/ClientDetailInfoSection.vue +++ b/src/pages/clients/components/ClientDetailInfoSection.vue @@ -4,7 +4,7 @@ ) .section-header.flex.items-center.justify-between.pl-4.pr-3(:class="{small:settings[section].rowFlex}") span.text-sm.font-semibold.whitespace-nowrap {{settings[section].title}} - .flex.items-center.gap-x-8 + .flex.items-center.gap-x-8(v-if="lackPass || lackAddress") base-button( v-if="isChange", @click="saveChange", @@ -40,16 +40,18 @@ :add-new-additional="addDocAdditional", :save-additional="saveDocs" ) - .section-body.w-full.flex.flex-col.px-4.pt-3.pb-4.gap-y-4 + .section-body.w-full.flex.flex-col.px-4.pt-3.pb-4.gap-y-4(v-if="lackPass || lackAddress") .flex.flex-col(class="gap-y-1.5") - .flex.flex-col(v-for="(item, key) in sectionInfo" v-if="lackPass || lackAddress" class="gap-y-1.5") - span.title-section.font-semibold.text-xs(v-if="settings[section].options") {{settings[section].options[key]}} + .flex.flex-col(v-for="(item, key) in sectionInfo", class="gap-y-1.5") + span.title-section.font-semibold.text-xs( + v-if="settings[section].options") {{settings[section].options[key]}} span.title-section.font-semibold.text-xs(v-if="item.header") {{item.header}} client-detail-input.text-sm.text-sm.w-max-fit( v-if="section!=='docs' && isChange", :style="{fontWeight:key === 'numba'&&600}", v-model:value="sectionInfo[key]", - :width="settings[section].width" + :width="settings[section].width", + :tokens="customTokens" ) .copy.icon-copy.cursor-pointer( v-if="item.copy", @@ -61,6 +63,32 @@ v-if="key === 'numba'", @click="() => copyValue(item)" ) + .separation.flex.items-center.justify-center.relative.mt-10px.mb( + v-if="section === 'addresses' && isChange", + class="gap-y-1.5" + ) + .line.absolute + .text-separation.span.text-sm.separator.px-2 или + .flex.flex-col.gap-y-4(v-if="section === 'addresses' && isChange") + .flex.flex-col(class="gap-y-1.5") + .text-info.text-xxs.font-semibold Город + base-select(placeholder="Выберите город") + .flex.flex-col(class="gap-y-1.5") + .text-info.text-xxs.font-semibold Область + base-input.input-info(placeholder="Введите область") + .flex.flex-col(class="gap-y-1.5") + .text-info.text-xxs.font-semibold Улица + base-input.input-info(placeholder="Введите улицу") + .flex.gap-x-4 + .flex.flex-col(class="gap-y-1.5") + .text-info.text-xxs.font-semibold Дом + base-input.input-info(placeholder="Дом") + .flex.flex-col(class="gap-y-1.5") + .text-info.text-xxs.font-semibold Квартира + base-input.input-info(placeholder="Квартира") + .flex.flex-col(class="gap-y-1.5") + .text-info.text-xxs.font-semibold Индекс + base-input.input-info(v-mask="'######'", placeholder="000000") .flex(v-if="item.name && !isChange") span.text-sm.w-fit {{item.title}} .flex.items-center(v-if="item.title") @@ -70,21 +98,26 @@ @click="(e) => deleteDoc(e)" ) span.text-sm {{item.title}} - .flex.justify-center.items.center(v-else) - .flex(@click="!lackPass") Добавить данные + .section-add-doc.flex.justify-center.items-center.cursor-pointer(v-else) + span Добавить данные diff --git a/src/pages/clients/components/FormCreateBasicInfo.vue b/src/pages/clients/components/FormCreateBasicInfo.vue index 2ce7594..860192f 100644 --- a/src/pages/clients/components/FormCreateBasicInfo.vue +++ b/src/pages/clients/components/FormCreateBasicInfo.vue @@ -3,21 +3,47 @@ .grid.grid-cols-2.gap-x-4.gap-y-6.px-4 .flex.flex-col(class="gap-y-1.5") span.text-sm Приоритет - base-select(:items="priorityList", placeholder="Приоритет клиента", v-model="basicInfo.priority") + base-select( + :items="priorityList", + placeholder="Приоритет клиента", + v-model="basicInfo.priority" + ) .flex.flex-col(class="gap-y-1.5") span.text-sm Дата рождения - base-input.input-info(v-model:value="basicInfo.birth_date" type="date" placeholder="00.00.0000" :width-input="277") + base-input.input-info( + v-model:value="basicInfo.birth_date", + type="date", + placeholder="00.00.0000", + :width-input="277" + ) .flex.flex-col(class="gap-y-1.5") span.text-sm Номер телефона - base-input.input-info(v-model:value="phone.username" placeholder="+7 (915) 644–92–23" :width-input="277") + base-input.input-info( + v-model:value="phone.username", + placeholder="+7 (915) 644–92–23", + :width-input="277" + ) .flex.flex-col(class="gap-y-1.5") span.text-sm Email - base-input.input-info(v-model:value="email.username" placeholder="user@yandex.ru" :width-input="277") + base-input.input-info( + v-model:value="email.username", + placeholder="user@yandex.ru", + :width-input="277" + ) .flex.flex-col.col-start-1.col-end-3.w-100(class="gap-y-1.5") span.text-sm Ссылки на соцсети .flex(class="gap-x-1.5" v-for="network in basicInfo.contacts" :key="network.id") - base-adding-network(:list-adding-networks="networks.settings" :selected-option="network.icon" :value="network" :choose-network="chooseOption" :save-network-id="saveNetworkId") - span.add-network.cursor-pointer(v-show="networks.settings.length !== basicInfo.contacts.length" @click="addNetwork") Добавить соцсеть + base-adding-network( + :list-adding-networks="networks.settings", + :selected-option="network.icon", + :value="network", + :choose-network="chooseOption", + :save-network-id="saveNetworkId" + ) + span.add-network.cursor-pointer( + v-show="networks.settings.length !== basicInfo.contacts.length", + @click="addNetwork" + ) Добавить соцсеть .px-4 base-button(@click="saveClient" :size="40") span.font-semibold Создать клиента From 926ef96ab6e94f5be576921c56e2c343cf558863 Mon Sep 17 00:00:00 2001 From: megavrilinvv Date: Fri, 11 Nov 2022 18:21:32 +0300 Subject: [PATCH 3/3] fix --- src/pages/clients/components/ClientDetailInfoSection.vue | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/pages/clients/components/ClientDetailInfoSection.vue b/src/pages/clients/components/ClientDetailInfoSection.vue index c3d40d4..c499114 100644 --- a/src/pages/clients/components/ClientDetailInfoSection.vue +++ b/src/pages/clients/components/ClientDetailInfoSection.vue @@ -50,8 +50,7 @@ v-if="section!=='docs' && isChange", :style="{fontWeight:key === 'numba'&&600}", v-model:value="sectionInfo[key]", - :width="settings[section].width", - :tokens="customTokens" + :width="settings[section].width" ) .copy.icon-copy.cursor-pointer( v-if="item.copy",