Simplify counterparty profile layout

This commit is contained in:
Ruslan Bakiev
2026-04-06 21:55:20 +07:00
parent a820d1f7ee
commit 74634f9759

View File

@@ -94,7 +94,6 @@ watch(
{ immediate: true },
);
const profileUpdatedAt = computed(() => profileQuery.result.value?.myCounterpartyProfile?.updatedAt ?? null);
const profileIsComplete = computed(() => isCounterpartyProfileComplete(counterpartyForm));
function clearPartyTimer() {
@@ -254,21 +253,14 @@ onBeforeUnmount(() => {
<template>
<section class="space-y-6">
<UiBackHeader
to="/profile"
back-label="Назад в профиль"
title="Карточка контрагента"
subtitle="Заполните реквизиты компании, банка и подписанта. После этого карточку можно будет использовать в заказах без ручного добивания данных."
>
<template #actions>
<span
class="inline-flex items-center rounded-full px-3 py-1 text-xs font-bold uppercase tracking-[0.16em]"
:class="profileIsComplete ? 'bg-[#e8f6ee] text-[#0d854a]' : 'bg-[#fff3dc] text-[#b06b00]'"
>
{{ profileIsComplete ? 'Заполнено' : 'Нужно заполнить' }}
</span>
</template>
</UiBackHeader>
<NuxtLink to="/profile" class="link link-hover text-sm"> Назад в профиль</NuxtLink>
<div class="space-y-2">
<h1 class="text-3xl font-extrabold text-[#0f2f20]">Карточка контрагента</h1>
<p class="text-sm leading-6 text-[#466653]">
Заполните реквизиты компании, банка, подписанта и основания.
</p>
</div>
<div class="space-y-4">
<section class="surface-card rounded-3xl p-5 md:p-6">
@@ -352,11 +344,8 @@ onBeforeUnmount(() => {
</section>
<section class="surface-card rounded-3xl p-5 md:p-6">
<div class="mb-5 space-y-1">
<div class="mb-5">
<h2 class="text-xl font-black tracking-[-0.02em] text-[#123824]">Банковские реквизиты</h2>
<p class="text-sm leading-6 text-[#5c7b69]">
Подтяните банк по справочнику или внесите реквизиты вручную.
</p>
</div>
<div class="grid gap-4">
@@ -420,11 +409,8 @@ onBeforeUnmount(() => {
</section>
<section class="surface-card rounded-3xl p-5 md:p-6">
<div class="mb-5 space-y-1">
<div class="mb-5">
<h2 class="text-xl font-black tracking-[-0.02em] text-[#123824]">Подписанты и основания</h2>
<p class="text-sm leading-6 text-[#5c7b69]">
Укажите, кто подписывает документы и на каком основании действует.
</p>
</div>
<div class="grid gap-4">
@@ -460,22 +446,13 @@ onBeforeUnmount(() => {
</label>
</div>
<div class="mt-6 flex flex-col gap-3 border-t border-[#edf2ee] pt-5 md:flex-row md:items-center md:justify-between">
<div class="space-y-1">
<p class="text-sm font-semibold text-[#123824]">
{{ profileIsComplete ? 'Карточка готова к использованию в заказах.' : 'Заполните обязательные поля, чтобы сохранить карточку.' }}
</p>
<p v-if="profileUpdatedAt" class="text-xs text-[#6f8579]">
Обновлено: {{ new Date(profileUpdatedAt).toLocaleString() }}
</p>
</div>
<div class="mt-6 border-t border-[#edf2ee] pt-5">
<button
class="btn h-12 w-full rounded-full border-0 bg-[#123824] px-7 text-white shadow-[0_18px_34px_rgba(18,56,36,0.18)] hover:bg-[#0f2f20] disabled:border-0 disabled:bg-[#cfd8d2] disabled:text-[#6f8579] md:w-auto"
:disabled="saveCounterpartyMutation.loading.value || !profileIsComplete"
@click="saveCounterpartyProfile"
>
{{ saveCounterpartyMutation.loading.value ? 'Сохраняем' : 'Сохранить карточку' }}
{{ saveCounterpartyMutation.loading.value ? 'Сохраняем...' : 'Сохранить' }}
</button>
</div>
</section>