Initialize the user app and load home banners from the API.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,320 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, ref, watch } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { useOrderStore } from '@/stores/order'
|
||||
import { useCatalogStore } from '@/stores/catalog'
|
||||
import PageHeader from '@/components/layout/PageHeader.vue'
|
||||
import BaseButton from '@/components/ui/BaseButton.vue'
|
||||
import IconSuccessCircle from '@/components/icons/IconSuccessCircle.vue'
|
||||
import { formatCurrency, formatDateTime } from '@/utils/format'
|
||||
import { useRequirePricedOrder } from '@/composables/useRequirePricedOrder'
|
||||
import type { BankAccount } from '@/types'
|
||||
|
||||
const router = useRouter()
|
||||
const orderStore = useOrderStore()
|
||||
const catalogStore = useCatalogStore()
|
||||
const bankAccounts = ref<BankAccount[]>([])
|
||||
|
||||
const { orderId, order } = useRequirePricedOrder()
|
||||
const companyName = computed(() => order.value?.companyName ?? '')
|
||||
|
||||
watch(
|
||||
orderId,
|
||||
async (id) => {
|
||||
if (id && !orderStore.getOrderById(id)) await orderStore.fetchOrder(id)
|
||||
},
|
||||
{ immediate: true },
|
||||
)
|
||||
|
||||
watch(
|
||||
() => order.value?.id,
|
||||
async (id) => {
|
||||
if (!id || !order.value) {
|
||||
bankAccounts.value = []
|
||||
return
|
||||
}
|
||||
if (!catalogStore.companies.length) await catalogStore.loadCompanies()
|
||||
bankAccounts.value = await orderStore.getBankAccountsForOrder(order.value)
|
||||
},
|
||||
{ immediate: true },
|
||||
)
|
||||
|
||||
const invoiceLabel = computed(() =>
|
||||
order.value?.finalAmount ? formatCurrency(order.value.finalAmount) : '—',
|
||||
)
|
||||
|
||||
const expiryMessage = computed(() => {
|
||||
const expiry = order.value?.cashInvoiceExpiresAt
|
||||
if (!expiry) return 'مبلغ فاکتور را به یکی از حسابهای زیر واریز و رسید را ثبت کنید.'
|
||||
return `مهلت پرداخت این فاکتور تا ${formatDateTime(expiry)} است.`
|
||||
})
|
||||
|
||||
const accountsSectionTitle = computed(() => {
|
||||
const name = companyName.value.replace(/^شرکت\s+/u, '')
|
||||
return name
|
||||
? `شماره حسابهای واریز — ${name}`
|
||||
: 'شماره حسابهای واریز'
|
||||
})
|
||||
|
||||
function formatCardNumber(value: string) {
|
||||
const digits = value.replace(/\D/g, '')
|
||||
return digits.replace(/(\d{4})(?=\d)/g, '$1 ').trim()
|
||||
}
|
||||
|
||||
function formatIban(value: string) {
|
||||
const clean = value.replace(/\s/g, '').toUpperCase()
|
||||
return clean.replace(/(.{4})/g, '$1 ').trim()
|
||||
}
|
||||
|
||||
function viewOrder() {
|
||||
router.replace(`/orders/${orderId.value}?track=1`)
|
||||
}
|
||||
|
||||
function registerReceipt() {
|
||||
router.replace(`/orders/${orderId.value}?track=1&receipt=1`)
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<!-- Mobile -->
|
||||
<div class="page cash-mobile-page mobile-only">
|
||||
<PageHeader
|
||||
title="تسویه نقدی"
|
||||
show-back
|
||||
centered
|
||||
@back="router.push(`/orders/${orderId}`)"
|
||||
/>
|
||||
|
||||
<div class="cash-page__scroll page__scroll">
|
||||
<div class="cash-page__success cash-page__success--done">
|
||||
<IconSuccessCircle :size="56" />
|
||||
<p class="cash-page__success-title">مبلغ قابل پرداخت {{ invoiceLabel }}</p>
|
||||
<p class="cash-page__success-subtitle">{{ expiryMessage }}</p>
|
||||
</div>
|
||||
|
||||
<section class="accounts-panel">
|
||||
<h2 class="accounts-panel__title">{{ accountsSectionTitle }}</h2>
|
||||
|
||||
<article v-for="account in bankAccounts" :key="account.id" class="bank-card">
|
||||
<div class="bank-card__head">
|
||||
<span class="bank-card__name">{{ account.bankName }}</span>
|
||||
<span class="bank-card__icon" aria-hidden="true">
|
||||
{{ account.bankName.charAt(0) }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="bank-card__field">
|
||||
<span class="bank-card__label">شماره کارت</span>
|
||||
<strong class="bank-card__value" dir="ltr">{{ formatCardNumber(account.cardNumber) }}</strong>
|
||||
</div>
|
||||
|
||||
<div class="bank-card__field">
|
||||
<span class="bank-card__label">شماره شبا</span>
|
||||
<strong class="bank-card__value" dir="ltr">{{ formatIban(account.iban) }}</strong>
|
||||
</div>
|
||||
</article>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<div class="cash-page__footer">
|
||||
<BaseButton variant="outline" block @click="viewOrder">مشاهده سفارش</BaseButton>
|
||||
<BaseButton block class="cash-page__submit" @click="registerReceipt">
|
||||
ثبت رسید پرداخت
|
||||
</BaseButton>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Desktop -->
|
||||
<div class="desktop-checkout-shell cash-desktop-page desktop-only">
|
||||
<header class="desktop-page__head">
|
||||
<h1 class="desktop-page__title">تسویه نقدی</h1>
|
||||
<p class="desktop-page__subtitle">{{ expiryMessage }}</p>
|
||||
</header>
|
||||
|
||||
<div class="cash-page__success cash-page__success--done">
|
||||
<IconSuccessCircle :size="56" />
|
||||
<p class="cash-page__success-title">مبلغ قابل پرداخت {{ invoiceLabel }}</p>
|
||||
</div>
|
||||
|
||||
<section class="accounts-panel">
|
||||
<h2 class="accounts-panel__title">{{ accountsSectionTitle }}</h2>
|
||||
<div class="desktop-grid-2">
|
||||
<article v-for="account in bankAccounts" :key="account.id" class="bank-card">
|
||||
<div class="bank-card__head">
|
||||
<span class="bank-card__name">{{ account.bankName }}</span>
|
||||
<span class="bank-card__icon" aria-hidden="true">{{ account.bankName.charAt(0) }}</span>
|
||||
</div>
|
||||
<div class="bank-card__field">
|
||||
<span class="bank-card__label">شماره کارت</span>
|
||||
<strong class="bank-card__value" dir="ltr">{{ formatCardNumber(account.cardNumber) }}</strong>
|
||||
</div>
|
||||
<div class="bank-card__field">
|
||||
<span class="bank-card__label">شماره شبا</span>
|
||||
<strong class="bank-card__value" dir="ltr">{{ formatIban(account.iban) }}</strong>
|
||||
</div>
|
||||
</article>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="cash-desktop-page__actions">
|
||||
<BaseButton variant="outline" class="desktop-btn-compact" @click="viewOrder">
|
||||
مشاهده سفارش
|
||||
</BaseButton>
|
||||
<BaseButton class="desktop-btn-compact" @click="registerReceipt">
|
||||
ثبت رسید پرداخت
|
||||
</BaseButton>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.cash-mobile-page {
|
||||
overflow: hidden;
|
||||
background: var(--color-bg);
|
||||
padding: 12px 0 0;
|
||||
}
|
||||
|
||||
.cash-desktop-page__actions {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
gap: 12px;
|
||||
margin-top: 24px;
|
||||
}
|
||||
|
||||
.cash-page__scroll {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
padding-bottom: 12px;
|
||||
}
|
||||
|
||||
.cash-page__success {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
gap: 8px;
|
||||
margin-bottom: 24px;
|
||||
padding-top: 8px;
|
||||
}
|
||||
|
||||
.cash-page__success-title {
|
||||
margin: 0;
|
||||
font-size: 1rem;
|
||||
font-weight: 700;
|
||||
color: var(--color-text);
|
||||
}
|
||||
|
||||
.cash-page__success--done .cash-page__success-title {
|
||||
color: var(--color-success);
|
||||
}
|
||||
|
||||
.cash-page__success-subtitle {
|
||||
margin: 0;
|
||||
font-size: 0.8125rem;
|
||||
color: var(--color-text-muted);
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.accounts-panel {
|
||||
padding: 16px;
|
||||
border-radius: 16px;
|
||||
background: var(--color-surface);
|
||||
border: 1px solid var(--color-border);
|
||||
}
|
||||
|
||||
.accounts-panel__title {
|
||||
margin: 0 0 14px;
|
||||
font-size: 0.9375rem;
|
||||
font-weight: 700;
|
||||
color: var(--color-text);
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.bank-card {
|
||||
padding: 14px 16px;
|
||||
border-radius: 14px;
|
||||
background: var(--color-elevated);
|
||||
color: var(--color-text);
|
||||
box-shadow: var(--shadow-sm);
|
||||
}
|
||||
|
||||
.bank-card + .bank-card {
|
||||
margin-top: 12px;
|
||||
}
|
||||
|
||||
.cash-mobile-page .bank-card + .bank-card {
|
||||
margin-top: 12px;
|
||||
}
|
||||
|
||||
.cash-desktop-page .bank-card + .bank-card {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.bank-card__head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
margin-bottom: 14px;
|
||||
}
|
||||
|
||||
.bank-card__icon {
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
border-radius: 10px;
|
||||
background: var(--color-primary-light);
|
||||
color: var(--color-primary);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 0.875rem;
|
||||
font-weight: 700;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.bank-card__name {
|
||||
flex: 1;
|
||||
font-size: 0.875rem;
|
||||
color: var(--color-text-muted);
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.bank-card__field {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.bank-card__field + .bank-card__field {
|
||||
margin-top: 12px;
|
||||
padding-top: 12px;
|
||||
border-top: 1px solid var(--color-border);
|
||||
}
|
||||
|
||||
.bank-card__label {
|
||||
font-size: 0.75rem;
|
||||
color: var(--color-text-muted);
|
||||
}
|
||||
|
||||
.bank-card__value {
|
||||
font-size: 0.9375rem;
|
||||
font-weight: 700;
|
||||
color: var(--color-text);
|
||||
letter-spacing: 0.02em;
|
||||
}
|
||||
|
||||
.cash-page__footer {
|
||||
flex-shrink: 0;
|
||||
padding: 12px 0 calc(12px + env(safe-area-inset-bottom, 0));
|
||||
background: var(--color-bg);
|
||||
border-top: 1px solid var(--color-border);
|
||||
margin: 0 calc(-1 * var(--page-padding));
|
||||
padding-left: var(--page-padding);
|
||||
padding-right: var(--page-padding);
|
||||
}
|
||||
|
||||
.cash-page__submit {
|
||||
margin-top: 10px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,470 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, computed, watch } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { useOrderStore } from '@/stores/order'
|
||||
import PageHeader from '@/components/layout/PageHeader.vue'
|
||||
import BaseInput from '@/components/ui/BaseInput.vue'
|
||||
import CurrencyInput from '@/components/ui/CurrencyInput.vue'
|
||||
import PersianDateInput from '@/components/ui/PersianDateInput.vue'
|
||||
import FormErrorBanner from '@/components/ui/FormErrorBanner.vue'
|
||||
import BaseButton from '@/components/ui/BaseButton.vue'
|
||||
import IconCash from '@/components/icons/IconCash.vue'
|
||||
import IconCheckBook from '@/components/icons/IconCheckBook.vue'
|
||||
import { formatCurrency, formatNumber, parseFormattedNumber } from '@/utils/format'
|
||||
import {
|
||||
FORM_VALIDATION_SUMMARY,
|
||||
clearFieldError,
|
||||
hasFieldErrors,
|
||||
type FieldErrors,
|
||||
} from '@/utils/formErrors'
|
||||
import {
|
||||
validateNationalId,
|
||||
validateSayadId,
|
||||
validateImageFile,
|
||||
fileToBase64,
|
||||
} from '@/utils/validation'
|
||||
import { useRequirePricedOrder } from '@/composables/useRequirePricedOrder'
|
||||
|
||||
const router = useRouter()
|
||||
const orderStore = useOrderStore()
|
||||
|
||||
const { orderId, order } = useRequirePricedOrder()
|
||||
const isFull = computed(() => orderStore.draftCheckMode === 'full')
|
||||
|
||||
const amount = ref('')
|
||||
const dueDate = ref('')
|
||||
const sayadId = ref('')
|
||||
const checkNumber = ref('')
|
||||
const ownerNationalId = ref('')
|
||||
const ownerFirstName = ref('')
|
||||
const ownerLastName = ref('')
|
||||
const bankName = ref('')
|
||||
const branchName = ref('')
|
||||
const frontImage = ref('')
|
||||
const backImage = ref('')
|
||||
const notes = ref('')
|
||||
const fieldErrors = ref<FieldErrors>({})
|
||||
const formError = ref('')
|
||||
const suggestedAmountApplied = ref(false)
|
||||
|
||||
const invoiceAmount = computed(() => order.value?.finalAmount ?? 0)
|
||||
const previousChecksTotal = computed(() =>
|
||||
orderStore.draftChecks.reduce((sum, check) => sum + check.amount, 0),
|
||||
)
|
||||
const currentCheckAmount = computed(() => parseFormattedNumber(amount.value) || 0)
|
||||
const remainingBeforeCurrent = computed(() =>
|
||||
Math.max(0, invoiceAmount.value - previousChecksTotal.value),
|
||||
)
|
||||
const remainingAfterCurrent = computed(() =>
|
||||
Math.max(0, invoiceAmount.value - previousChecksTotal.value - currentCheckAmount.value),
|
||||
)
|
||||
const isCovered = computed(
|
||||
() =>
|
||||
invoiceAmount.value > 0 &&
|
||||
previousChecksTotal.value + currentCheckAmount.value >= invoiceAmount.value,
|
||||
)
|
||||
const isOverInvoice = computed(
|
||||
() =>
|
||||
invoiceAmount.value > 0 &&
|
||||
previousChecksTotal.value + currentCheckAmount.value > invoiceAmount.value,
|
||||
)
|
||||
|
||||
watch(
|
||||
[invoiceAmount, remainingBeforeCurrent],
|
||||
() => {
|
||||
if (suggestedAmountApplied.value || amount.value) return
|
||||
if (remainingBeforeCurrent.value <= 0) return
|
||||
amount.value = String(remainingBeforeCurrent.value)
|
||||
suggestedAmountApplied.value = true
|
||||
},
|
||||
{ immediate: true },
|
||||
)
|
||||
|
||||
watch(amount, () => {
|
||||
fieldErrors.value = clearFieldError(fieldErrors.value, 'amount')
|
||||
if (!hasFieldErrors(fieldErrors.value)) formError.value = ''
|
||||
})
|
||||
watch(dueDate, () => {
|
||||
fieldErrors.value = clearFieldError(fieldErrors.value, 'dueDate')
|
||||
if (!hasFieldErrors(fieldErrors.value)) formError.value = ''
|
||||
})
|
||||
watch(sayadId, () => {
|
||||
fieldErrors.value = clearFieldError(fieldErrors.value, 'sayadId')
|
||||
if (!hasFieldErrors(fieldErrors.value)) formError.value = ''
|
||||
})
|
||||
watch(ownerNationalId, () => {
|
||||
fieldErrors.value = clearFieldError(fieldErrors.value, 'ownerNationalId')
|
||||
if (!hasFieldErrors(fieldErrors.value)) formError.value = ''
|
||||
})
|
||||
watch(frontImage, () => {
|
||||
fieldErrors.value = clearFieldError(fieldErrors.value, 'frontImage')
|
||||
if (!hasFieldErrors(fieldErrors.value)) formError.value = ''
|
||||
})
|
||||
|
||||
async function handleImageUpload(event: Event, target: 'front' | 'back') {
|
||||
const file = (event.target as HTMLInputElement).files?.[0]
|
||||
if (!file) return
|
||||
const validation = validateImageFile(file)
|
||||
if (!validation.valid) {
|
||||
if (target === 'front') {
|
||||
fieldErrors.value = { ...fieldErrors.value, frontImage: validation.message ?? 'خطا' }
|
||||
}
|
||||
return
|
||||
}
|
||||
const base64 = await fileToBase64(file)
|
||||
if (target === 'front') frontImage.value = base64
|
||||
else backImage.value = base64
|
||||
}
|
||||
|
||||
function fillRemainingAmount() {
|
||||
if (remainingBeforeCurrent.value <= 0) return
|
||||
amount.value = String(remainingBeforeCurrent.value)
|
||||
}
|
||||
|
||||
function validateForm(): boolean {
|
||||
fieldErrors.value = {}
|
||||
formError.value = ''
|
||||
|
||||
const errors: FieldErrors = {}
|
||||
const amountNum = parseFormattedNumber(amount.value)
|
||||
|
||||
if (!amountNum || amountNum <= 0) {
|
||||
errors.amount = 'مبلغ چک باید بزرگتر از صفر باشد.'
|
||||
}
|
||||
if (!dueDate.value) {
|
||||
errors.dueDate = 'تاریخ سررسید الزامی است.'
|
||||
}
|
||||
if (!frontImage.value) {
|
||||
errors.frontImage = 'تصویر روی چک الزامی است.'
|
||||
}
|
||||
if (isFull.value) {
|
||||
if (!validateSayadId(sayadId.value)) {
|
||||
errors.sayadId = 'شناسه صیادی باید ۱۶ رقم باشد.'
|
||||
}
|
||||
if (!validateNationalId(ownerNationalId.value)) {
|
||||
errors.ownerNationalId = 'کد ملی صاحب چک معتبر نیست.'
|
||||
}
|
||||
const existingSayad = orderStore.draftChecks.some(
|
||||
(c) => c.sayadId === sayadId.value.replace(/\s/g, ''),
|
||||
)
|
||||
if (existingSayad) {
|
||||
errors.sayadId = 'شناسه صیادی تکراری است.'
|
||||
}
|
||||
}
|
||||
|
||||
fieldErrors.value = errors
|
||||
if (hasFieldErrors(errors)) {
|
||||
formError.value = FORM_VALIDATION_SUMMARY
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
function saveCheck() {
|
||||
if (!validateForm()) return
|
||||
|
||||
orderStore.addDraftCheck({
|
||||
amount: parseFormattedNumber(amount.value),
|
||||
dueDate: dueDate.value,
|
||||
sayadId: isFull.value ? sayadId.value.replace(/\s/g, '') : undefined,
|
||||
checkNumber: isFull.value ? checkNumber.value : undefined,
|
||||
ownerNationalId: isFull.value ? ownerNationalId.value : undefined,
|
||||
ownerFirstName: isFull.value ? ownerFirstName.value : undefined,
|
||||
ownerLastName: isFull.value ? ownerLastName.value : undefined,
|
||||
bankName: isFull.value ? bankName.value : undefined,
|
||||
branchName: isFull.value ? branchName.value : undefined,
|
||||
frontImage: frontImage.value,
|
||||
backImage: backImage.value || undefined,
|
||||
notes: notes.value || undefined,
|
||||
mode: orderStore.draftCheckMode ?? 'brief',
|
||||
})
|
||||
|
||||
resetForm()
|
||||
router.push(`/orders/${orderId.value}/check-list`)
|
||||
}
|
||||
|
||||
function resetForm() {
|
||||
amount.value = ''
|
||||
dueDate.value = ''
|
||||
sayadId.value = ''
|
||||
checkNumber.value = ''
|
||||
ownerNationalId.value = ''
|
||||
ownerFirstName.value = ''
|
||||
ownerLastName.value = ''
|
||||
bankName.value = ''
|
||||
branchName.value = ''
|
||||
frontImage.value = ''
|
||||
backImage.value = ''
|
||||
notes.value = ''
|
||||
fieldErrors.value = {}
|
||||
formError.value = ''
|
||||
suggestedAmountApplied.value = false
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="page">
|
||||
<PageHeader
|
||||
:title="isFull ? 'ثبت چک - حالت کامل' : 'ثبت چک - حالت مختصر'"
|
||||
show-back
|
||||
@back="router.push(`/orders/${orderId}/check-mode`)"
|
||||
/>
|
||||
|
||||
<div class="page__scroll checkout-page__scroll">
|
||||
<FormErrorBanner :message="formError" />
|
||||
|
||||
<div
|
||||
v-if="invoiceAmount > 0"
|
||||
class="check-balance mb-4 rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface)] p-4"
|
||||
:class="{
|
||||
'check-balance--ok': isCovered && !isOverInvoice,
|
||||
'check-balance--warn': isOverInvoice,
|
||||
}"
|
||||
>
|
||||
<div class="mb-3 flex items-start gap-3">
|
||||
<span
|
||||
class="flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-[var(--color-primary-soft)] text-[var(--color-primary)]"
|
||||
aria-hidden="true"
|
||||
>
|
||||
<IconCash :size="22" />
|
||||
</span>
|
||||
<div class="min-w-0 flex-1">
|
||||
<p class="m-0 text-sm font-semibold text-[var(--color-text)]">مانده فاکتور</p>
|
||||
<p class="m-0 mt-1 text-xs leading-relaxed text-[var(--color-text-muted)]">
|
||||
با هر چک، مبلغ باقیمانده بهروز میشود تا پوشش کامل فاکتور را از دست ندهید.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-col gap-2">
|
||||
<div class="flex items-center justify-between gap-3 text-sm">
|
||||
<span class="text-[var(--color-text-muted)]">مبلغ فاکتور</span>
|
||||
<strong class="font-tabular text-[var(--color-text)]">{{ formatCurrency(invoiceAmount) }}</strong>
|
||||
</div>
|
||||
<div class="flex items-center justify-between gap-3 text-sm">
|
||||
<span class="inline-flex items-center gap-1.5 text-[var(--color-text-muted)]">
|
||||
<IconCheckBook :size="14" />
|
||||
چکهای ثبتشده
|
||||
<span v-if="orderStore.draftChecks.length" class="text-xs">
|
||||
({{ formatNumber(orderStore.draftChecks.length) }})
|
||||
</span>
|
||||
</span>
|
||||
<strong class="font-tabular text-[var(--color-text)]">
|
||||
{{ formatCurrency(previousChecksTotal) }}
|
||||
</strong>
|
||||
</div>
|
||||
<div
|
||||
class="mt-1 flex items-center justify-between gap-3 border-t border-[var(--color-border)] pt-3"
|
||||
>
|
||||
<span class="text-sm font-semibold text-[var(--color-text)]">باقیمانده</span>
|
||||
<strong
|
||||
class="font-tabular text-base"
|
||||
:class="
|
||||
isCovered && !isOverInvoice
|
||||
? 'text-[var(--color-success)]'
|
||||
: isOverInvoice
|
||||
? 'text-[var(--color-danger)]'
|
||||
: 'text-[var(--color-primary)]'
|
||||
"
|
||||
>
|
||||
{{
|
||||
isOverInvoice
|
||||
? `${formatCurrency(previousChecksTotal + currentCheckAmount - invoiceAmount)} بیش از فاکتور`
|
||||
: isCovered
|
||||
? 'پوشش کامل شد'
|
||||
: formatCurrency(remainingAfterCurrent)
|
||||
}}
|
||||
</strong>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="steps">
|
||||
<span class="step active">۱. اطلاعات چک</span>
|
||||
<span class="step">۲. چک بعدی</span>
|
||||
<span class="step">۳. خلاصه</span>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<CurrencyInput
|
||||
v-model="amount"
|
||||
label="مبلغ چک (تومان)"
|
||||
placeholder="مبلغ"
|
||||
:error="fieldErrors.amount"
|
||||
/>
|
||||
<button
|
||||
v-if="remainingBeforeCurrent > 0 && currentCheckAmount !== remainingBeforeCurrent"
|
||||
type="button"
|
||||
class="check-fill-remaining mb-3 text-sm font-medium text-[var(--color-primary)]"
|
||||
@click="fillRemainingAmount"
|
||||
>
|
||||
پر کردن با باقیمانده ({{ formatCurrency(remainingBeforeCurrent) }})
|
||||
</button>
|
||||
<PersianDateInput v-model="dueDate" label="تاریخ سررسید" :error="fieldErrors.dueDate" />
|
||||
|
||||
<template v-if="isFull">
|
||||
<BaseInput
|
||||
v-model="sayadId"
|
||||
label="شناسه صیادی"
|
||||
placeholder="۱۶ رقم"
|
||||
maxlength="16"
|
||||
inputmode="numeric"
|
||||
dir="ltr"
|
||||
:error="fieldErrors.sayadId"
|
||||
/>
|
||||
<BaseInput
|
||||
v-model="checkNumber"
|
||||
label="شماره چک"
|
||||
inputmode="numeric"
|
||||
dir="ltr"
|
||||
/>
|
||||
<BaseInput
|
||||
v-model="ownerNationalId"
|
||||
label="کد ملی صاحب چک"
|
||||
maxlength="10"
|
||||
inputmode="numeric"
|
||||
dir="ltr"
|
||||
:error="fieldErrors.ownerNationalId"
|
||||
/>
|
||||
<BaseInput v-model="ownerFirstName" label="نام صاحب چک" />
|
||||
<BaseInput v-model="ownerLastName" label="نام خانوادگی صاحب چک" />
|
||||
<BaseInput v-model="bankName" label="نام بانک" />
|
||||
<BaseInput v-model="branchName" label="نام شعبه" />
|
||||
</template>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-label">تصویر روی چک *</label>
|
||||
<label class="upload-box" :class="{ 'upload-box--error': fieldErrors.frontImage }">
|
||||
<input
|
||||
type="file"
|
||||
accept="image/*"
|
||||
class="upload-box__input"
|
||||
@change="handleImageUpload($event, 'front')"
|
||||
/>
|
||||
<img v-if="frontImage" :src="frontImage" class="upload-box__preview" alt="روی چک" />
|
||||
<template v-else>
|
||||
<span class="upload-box__placeholder">بارگذاری تصویر چک</span>
|
||||
</template>
|
||||
</label>
|
||||
<p v-if="fieldErrors.frontImage" class="input-error-text">{{ fieldErrors.frontImage }}</p>
|
||||
</div>
|
||||
|
||||
<div v-if="isFull" class="form-group">
|
||||
<label class="form-label">تصویر پشت چک</label>
|
||||
<label class="upload-box">
|
||||
<input
|
||||
type="file"
|
||||
accept="image/*"
|
||||
class="upload-box__input"
|
||||
@change="handleImageUpload($event, 'back')"
|
||||
/>
|
||||
<img v-if="backImage" :src="backImage" class="upload-box__preview" alt="پشت چک" />
|
||||
<template v-else>
|
||||
<span class="upload-box__placeholder">بارگذاری تصویر</span>
|
||||
</template>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<BaseInput v-model="notes" label="توضیحات" />
|
||||
|
||||
<BaseButton block class="mt-4" @click="saveCheck">ذخیره چک</BaseButton>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.checkout-page__scroll {
|
||||
padding-bottom: 24px;
|
||||
}
|
||||
|
||||
.check-balance--ok {
|
||||
border-color: color-mix(in srgb, var(--color-success) 35%, var(--color-border));
|
||||
background: var(--color-success-soft);
|
||||
}
|
||||
|
||||
.check-balance--warn {
|
||||
border-color: color-mix(in srgb, var(--color-danger) 35%, var(--color-border));
|
||||
background: var(--color-danger-light);
|
||||
}
|
||||
|
||||
.check-fill-remaining {
|
||||
background: transparent;
|
||||
border: 0;
|
||||
padding: 0;
|
||||
cursor: pointer;
|
||||
text-align: start;
|
||||
}
|
||||
|
||||
.check-fill-remaining:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.font-tabular {
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
|
||||
.steps {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
margin-bottom: 16px;
|
||||
font-size: 0.6875rem;
|
||||
}
|
||||
|
||||
.step {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
padding: 10px 6px;
|
||||
background: var(--color-tab-inactive-bg);
|
||||
border-radius: var(--radius-sm);
|
||||
color: var(--color-text-muted);
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.step.active {
|
||||
background: var(--color-primary-light);
|
||||
color: var(--color-primary);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.upload-box {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-height: 120px;
|
||||
border: 1.5px dashed var(--color-border);
|
||||
border-radius: var(--radius-md);
|
||||
background: var(--color-surface);
|
||||
cursor: pointer;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.upload-box--error {
|
||||
border-color: var(--color-danger);
|
||||
}
|
||||
|
||||
.upload-box__input {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
opacity: 0;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.upload-box__placeholder {
|
||||
font-size: 0.875rem;
|
||||
color: var(--color-text-muted);
|
||||
}
|
||||
|
||||
.upload-box__preview {
|
||||
max-width: 100%;
|
||||
max-height: 140px;
|
||||
object-fit: contain;
|
||||
}
|
||||
|
||||
.input-error-text {
|
||||
color: var(--color-danger);
|
||||
font-size: 0.8125rem;
|
||||
margin: 4px 0 0;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,714 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, ref, watch } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { useOrderStore } from '@/stores/order'
|
||||
import { useAuthStore } from '@/stores/auth'
|
||||
import BaseButton from '@/components/ui/BaseButton.vue'
|
||||
import FormErrorBanner from '@/components/ui/FormErrorBanner.vue'
|
||||
import EmptyState from '@/components/ui/EmptyState.vue'
|
||||
import IconChevronBack from '@/components/icons/IconChevronBack.vue'
|
||||
import { formatCurrency, formatDate, formatNumber, toPersianDigits } from '@/utils/format'
|
||||
import { calculateCheckRass } from '@/utils/checkRass'
|
||||
import { confirm } from '@/composables/useConfirm'
|
||||
import { useRequirePricedOrder } from '@/composables/useRequirePricedOrder'
|
||||
import type { CheckData } from '@/types'
|
||||
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
const orderStore = useOrderStore()
|
||||
const authStore = useAuthStore()
|
||||
const formError = ref('')
|
||||
const submitting = ref(false)
|
||||
|
||||
const isCheckout = computed(() => route.name === 'check-list')
|
||||
const { orderId } = useRequirePricedOrder()
|
||||
const order = computed(() =>
|
||||
orderId.value ? orderStore.getOrderById(orderId.value) : undefined,
|
||||
)
|
||||
|
||||
watch(
|
||||
orderId,
|
||||
async (id) => {
|
||||
if (!id || !isCheckout.value) return
|
||||
const current = orderStore.getOrderById(id) ?? (await orderStore.fetchOrder(id))
|
||||
if (!current) return
|
||||
// در مسیر اصلاح، چکهای ثبتشده به فرم برمیگردند تا مشتری ویرایش کند
|
||||
if (orderStore.draftChecks.length === 0 && (current.checks?.length ?? 0) > 0) {
|
||||
orderStore.loadChecksIntoDraft(current)
|
||||
} else if (orderStore.draftOrderId !== id) {
|
||||
orderStore.startCheckDraft(id, current.checkMode ?? undefined)
|
||||
}
|
||||
},
|
||||
{ immediate: true },
|
||||
)
|
||||
|
||||
const checks = computed<CheckData[]>(() => {
|
||||
if (orderStore.draftChecks.length > 0) return orderStore.draftChecks
|
||||
if (isCheckout.value) return order.value?.checks ?? []
|
||||
if (!authStore.user) return []
|
||||
|
||||
return orderStore
|
||||
.userOrders(authStore.user.id)
|
||||
.filter((o) => o.settlementType === 'check' && o.checks?.length)
|
||||
.flatMap((o) => o.checks ?? [])
|
||||
})
|
||||
|
||||
const rass = computed(() => {
|
||||
if (orderStore.draftChecks.length > 0) return orderStore.getDraftRass()
|
||||
return calculateCheckRass(checks.value, new Date())
|
||||
})
|
||||
|
||||
const invoiceAmount = computed(() => order.value?.finalAmount ?? 0)
|
||||
|
||||
const remainingAmount = computed(() =>
|
||||
Math.max(0, invoiceAmount.value - rass.value.totalAmount),
|
||||
)
|
||||
|
||||
const isAmountComplete = computed(
|
||||
() => invoiceAmount.value > 0 && rass.value.totalAmount >= invoiceAmount.value,
|
||||
)
|
||||
|
||||
const isOverInvoice = computed(
|
||||
() => invoiceAmount.value > 0 && rass.value.totalAmount > invoiceAmount.value,
|
||||
)
|
||||
|
||||
const openMenuId = computed({
|
||||
get: () => (route.query.menu as string) ?? '',
|
||||
set: (id: string) => {
|
||||
router.replace({ query: id ? { menu: id } : {} })
|
||||
},
|
||||
})
|
||||
|
||||
function goBack() {
|
||||
router.push(isCheckout.value ? `/orders/${orderId.value}` : '/profile')
|
||||
}
|
||||
|
||||
function addAnother() {
|
||||
router.push(`/orders/${orderId.value}/check-form`)
|
||||
}
|
||||
|
||||
async function removeCheck(id: string) {
|
||||
openMenuId.value = ''
|
||||
const ok = await confirm({
|
||||
title: 'حذف چک',
|
||||
message: 'آیا از حذف این چک مطمئن هستید؟',
|
||||
confirmLabel: 'حذف',
|
||||
cancelLabel: 'انصراف',
|
||||
tone: 'danger',
|
||||
})
|
||||
if (!ok) return
|
||||
orderStore.removeDraftCheck(id)
|
||||
}
|
||||
|
||||
function toggleMenu(id: string) {
|
||||
openMenuId.value = openMenuId.value === id ? '' : id
|
||||
}
|
||||
|
||||
async function submitChecks() {
|
||||
if (!orderId.value || orderStore.draftChecks.length === 0 || submitting.value) return
|
||||
formError.value = ''
|
||||
submitting.value = true
|
||||
|
||||
try {
|
||||
await orderStore.updateOrderChecks(
|
||||
orderId.value,
|
||||
[...orderStore.draftChecks],
|
||||
orderStore.draftCheckMode ?? 'brief',
|
||||
)
|
||||
router.replace(`/orders/${orderId.value}?track=1`)
|
||||
} catch (e) {
|
||||
formError.value = e instanceof Error ? e.message : 'ثبت چکها ناموفق بود.'
|
||||
} finally {
|
||||
submitting.value = false
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<!-- Mobile -->
|
||||
<div class="check-list-page mobile-only">
|
||||
<header class="check-list-page__nav">
|
||||
<button type="button" class="nav-btn" aria-label="بازگشت" @click="goBack">
|
||||
<IconChevronBack :size="20" />
|
||||
</button>
|
||||
<h1 class="check-list-page__title">چکهای ثبت شده</h1>
|
||||
<button type="button" class="nav-btn nav-btn--ghost" aria-hidden="true" tabindex="-1">
|
||||
<IconChevronBack :size="18" class="nav-btn__flip" />
|
||||
</button>
|
||||
</header>
|
||||
|
||||
<div v-if="checks.length === 0" class="check-list-page__empty page__scroll page__scroll--with-nav">
|
||||
<EmptyState variant="checks" message="برای ادامه، حداقل یک چک ثبت کنید">
|
||||
<BaseButton v-if="isCheckout" @click="addAnother">ثبت چک جدید</BaseButton>
|
||||
<BaseButton v-else variant="outline" @click="router.push('/companies')">ثبت سفارش جدید</BaseButton>
|
||||
</EmptyState>
|
||||
</div>
|
||||
|
||||
<template v-else>
|
||||
<div class="check-list-page__scroll page__scroll">
|
||||
<FormErrorBanner :message="formError" />
|
||||
|
||||
<div class="summary-cards">
|
||||
<div class="summary-card">
|
||||
<span class="summary-card__label">مجموع مبلغ چکها</span>
|
||||
<strong class="summary-card__value">{{ formatNumber(rass.totalAmount) }}</strong>
|
||||
<span class="summary-card__unit">تومان</span>
|
||||
</div>
|
||||
<div class="summary-card">
|
||||
<span class="summary-card__label">مبلغ فاکتور</span>
|
||||
<strong class="summary-card__value">{{ formatNumber(invoiceAmount) }}</strong>
|
||||
<span class="summary-card__unit">تومان</span>
|
||||
<p v-if="isAmountComplete && !isOverInvoice" class="summary-card__status">
|
||||
<span class="summary-card__status-icon">✓</span>
|
||||
مبلغ کامل است
|
||||
</p>
|
||||
<p v-else-if="isOverInvoice" class="summary-card__status summary-card__status--warn">
|
||||
بیش از مبلغ فاکتور
|
||||
</p>
|
||||
</div>
|
||||
<div
|
||||
class="summary-card summary-card--remain"
|
||||
:class="{
|
||||
'summary-card--remain-ok': isAmountComplete && !isOverInvoice,
|
||||
'summary-card--remain-warn': isOverInvoice,
|
||||
}"
|
||||
>
|
||||
<span class="summary-card__label">باقیمانده</span>
|
||||
<strong class="summary-card__value">
|
||||
{{
|
||||
isOverInvoice
|
||||
? formatNumber(rass.totalAmount - invoiceAmount)
|
||||
: formatNumber(remainingAmount)
|
||||
}}
|
||||
</strong>
|
||||
<span class="summary-card__unit">تومان</span>
|
||||
<p v-if="!isAmountComplete" class="summary-card__hint">
|
||||
هنوز باید چک ثبت کنید
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="checks-list">
|
||||
<article v-for="(check, index) in checks" :key="check.id" class="check-card">
|
||||
<div class="check-card__menu-wrap">
|
||||
<button
|
||||
v-if="isCheckout && orderStore.draftChecks.length > 0"
|
||||
type="button"
|
||||
class="check-card__menu-btn"
|
||||
aria-label="گزینهها"
|
||||
@click="toggleMenu(check.id)"
|
||||
>
|
||||
⋮
|
||||
</button>
|
||||
<div v-if="openMenuId === check.id" class="check-card__menu">
|
||||
<button type="button" @click="removeCheck(check.id)">حذف</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="check-card__body">
|
||||
<h3 class="check-card__title">چک {{ toPersianDigits(String(index + 1)) }}</h3>
|
||||
<p class="check-card__amount">{{ formatCurrency(check.amount) }}</p>
|
||||
<p class="check-card__date">تاریخ: {{ formatDate(check.dueDate) }}</p>
|
||||
</div>
|
||||
|
||||
<div class="check-card__thumb-wrap">
|
||||
<img
|
||||
v-if="check.frontImage"
|
||||
:src="check.frontImage"
|
||||
class="check-card__thumb"
|
||||
alt="تصویر چک"
|
||||
/>
|
||||
<div v-else class="check-card__thumb check-card__thumb--empty">چک</div>
|
||||
</div>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
<div class="rass-panel">
|
||||
<h3 class="rass-panel__title">رأس چکها</h3>
|
||||
<div class="rass-panel__days">{{ toPersianDigits(String(rass.rassDays)) }} روز</div>
|
||||
<p v-if="rass.rassDate" class="rass-panel__date">
|
||||
تاریخ رأس تقریبی: {{ formatDate(rass.rassDate) }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="isCheckout && orderStore.draftChecks.length > 0" class="check-list-page__footer">
|
||||
<BaseButton block variant="outline" :disabled="submitting" @click="addAnother">
|
||||
افزودن چک جدید
|
||||
</BaseButton>
|
||||
<BaseButton
|
||||
block
|
||||
:disabled="checks.length === 0"
|
||||
:loading="submitting"
|
||||
@click="submitChecks"
|
||||
>
|
||||
ارسال برای بررسی
|
||||
</BaseButton>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
<!-- Desktop -->
|
||||
<div v-if="checks.length > 0" class="desktop-checkout-shell check-list-desktop desktop-only">
|
||||
<header class="desktop-page__head">
|
||||
<h1 class="desktop-page__title">چکهای ثبت شده</h1>
|
||||
<p class="desktop-page__subtitle">خلاصه و فهرست چکهای ثبتشده</p>
|
||||
</header>
|
||||
|
||||
<div class="desktop-two-col">
|
||||
<div class="desktop-two-col__main">
|
||||
<div class="desktop-table-wrap">
|
||||
<div class="desktop-table-scroll">
|
||||
<table class="desktop-table check-list-desktop__table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">تصویر</th>
|
||||
<th scope="col">مبلغ (تومان)</th>
|
||||
<th scope="col">تاریخ سررسید</th>
|
||||
<th scope="col">شناسه</th>
|
||||
<th v-if="isCheckout" scope="col">عملیات</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(check, index) in checks" :key="check.id">
|
||||
<td>
|
||||
<img
|
||||
v-if="check.frontImage"
|
||||
:src="check.frontImage"
|
||||
class="check-list-desktop__thumb"
|
||||
alt="تصویر چک"
|
||||
/>
|
||||
<span v-else>—</span>
|
||||
</td>
|
||||
<td class="check-list-desktop__amount">{{ formatNumber(check.amount) }}</td>
|
||||
<td>{{ formatDate(check.dueDate) }}</td>
|
||||
<td>چک {{ toPersianDigits(String(index + 1)) }}</td>
|
||||
<td v-if="isCheckout && orderStore.draftChecks.length > 0">
|
||||
<button type="button" class="orders-table__action" @click="removeCheck(check.id)">
|
||||
حذف
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<BaseButton
|
||||
v-if="isCheckout"
|
||||
variant="outline"
|
||||
class="desktop-btn-compact check-list-desktop__add"
|
||||
@click="addAnother"
|
||||
>
|
||||
ثبت چک دیگر
|
||||
</BaseButton>
|
||||
</div>
|
||||
|
||||
<aside class="desktop-summary-panel">
|
||||
<h2 class="desktop-summary-panel__title">خلاصه مالی</h2>
|
||||
<div class="desktop-summary-panel__row">
|
||||
<span>مجموع چکها</span>
|
||||
<strong>{{ formatNumber(rass.totalAmount) }} تومان</strong>
|
||||
</div>
|
||||
<div class="desktop-summary-panel__row">
|
||||
<span>مبلغ فاکتور</span>
|
||||
<strong>{{ formatNumber(invoiceAmount) }} تومان</strong>
|
||||
</div>
|
||||
<div
|
||||
class="desktop-summary-panel__row desktop-summary-panel__row--remain"
|
||||
:class="{
|
||||
'desktop-summary-panel__row--ok': isAmountComplete && !isOverInvoice,
|
||||
'desktop-summary-panel__row--warn': isOverInvoice,
|
||||
}"
|
||||
>
|
||||
<span>باقیمانده</span>
|
||||
<strong>
|
||||
{{
|
||||
isOverInvoice
|
||||
? `${formatNumber(rass.totalAmount - invoiceAmount)} بیش از فاکتور`
|
||||
: isAmountComplete
|
||||
? 'پوشش کامل'
|
||||
: `${formatNumber(remainingAmount)} تومان`
|
||||
}}
|
||||
</strong>
|
||||
</div>
|
||||
<div class="desktop-summary-panel__row">
|
||||
<span>رأس چکها</span>
|
||||
<strong>{{ toPersianDigits(String(rass.rassDays)) }} روز</strong>
|
||||
</div>
|
||||
<div v-if="isCheckout && orderStore.draftChecks.length > 0" class="desktop-summary-panel__action">
|
||||
<BaseButton block variant="outline" :disabled="submitting" @click="addAnother">
|
||||
افزودن چک جدید
|
||||
</BaseButton>
|
||||
<BaseButton
|
||||
block
|
||||
:disabled="checks.length === 0"
|
||||
:loading="submitting"
|
||||
@click="submitChecks"
|
||||
>
|
||||
ارسال برای بررسی
|
||||
</BaseButton>
|
||||
</div>
|
||||
</aside>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-else class="desktop-checkout-shell desktop-only">
|
||||
<EmptyState variant="checks" message="برای ادامه، حداقل یک چک ثبت کنید">
|
||||
<BaseButton v-if="isCheckout" @click="addAnother">ثبت چک جدید</BaseButton>
|
||||
</EmptyState>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.check-list-desktop__thumb {
|
||||
width: 48px;
|
||||
height: 32px;
|
||||
object-fit: cover;
|
||||
border-radius: 4px;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.check-list-desktop__amount {
|
||||
font-variant-numeric: tabular-nums;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.check-list-desktop__table {
|
||||
min-width: 560px;
|
||||
}
|
||||
|
||||
.check-list-desktop__add {
|
||||
margin-top: 16px;
|
||||
}
|
||||
|
||||
@media (min-width: 768px) and (max-width: 1099px) {
|
||||
.check-list-desktop :deep(.desktop-two-col) {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.check-list-desktop :deep(.desktop-summary-panel) {
|
||||
position: static;
|
||||
}
|
||||
}
|
||||
|
||||
.desktop-summary-panel__action {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.desktop-summary-panel__row--remain strong {
|
||||
color: var(--color-primary);
|
||||
}
|
||||
|
||||
.desktop-summary-panel__row--ok strong {
|
||||
color: var(--color-success);
|
||||
}
|
||||
|
||||
.desktop-summary-panel__row--warn strong {
|
||||
color: var(--color-danger);
|
||||
}
|
||||
|
||||
.check-list-page {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-height: 0;
|
||||
height: 100%;
|
||||
padding: 12px var(--page-padding) 0;
|
||||
background: var(--color-bg);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.check-list-page__nav {
|
||||
flex-shrink: 0;
|
||||
display: grid;
|
||||
grid-template-columns: 40px 1fr 40px;
|
||||
align-items: center;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.check-list-page__title {
|
||||
margin: 0;
|
||||
font-size: 1.0625rem;
|
||||
font-weight: 700;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.nav-btn {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
border: none;
|
||||
background: none;
|
||||
color: var(--color-text);
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.nav-btn--ghost {
|
||||
visibility: hidden;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.nav-btn__flip {
|
||||
transform: scaleX(-1);
|
||||
}
|
||||
|
||||
.check-list-page__scroll {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
padding-bottom: 12px;
|
||||
}
|
||||
|
||||
.check-list-page__empty {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 16px;
|
||||
color: var(--color-text-muted);
|
||||
}
|
||||
|
||||
.summary-cards {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 10px;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.summary-card {
|
||||
padding: 14px 12px;
|
||||
border-radius: 14px;
|
||||
background: var(--color-summary-bg);
|
||||
border: 1px solid var(--color-border);
|
||||
text-align: center;
|
||||
color: var(--color-text);
|
||||
}
|
||||
|
||||
.summary-card--remain {
|
||||
grid-column: 1 / -1;
|
||||
border-color: color-mix(in srgb, var(--color-primary) 30%, var(--color-border));
|
||||
background: var(--color-primary-soft);
|
||||
}
|
||||
|
||||
.summary-card--remain-ok {
|
||||
border-color: color-mix(in srgb, var(--color-success) 35%, var(--color-border));
|
||||
background: var(--color-success-soft);
|
||||
}
|
||||
|
||||
.summary-card--remain-warn {
|
||||
border-color: color-mix(in srgb, var(--color-danger) 35%, var(--color-border));
|
||||
background: var(--color-danger-light);
|
||||
}
|
||||
|
||||
.summary-card__label {
|
||||
display: block;
|
||||
font-size: 0.75rem;
|
||||
color: var(--color-text-muted);
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.summary-card__value {
|
||||
display: block;
|
||||
font-size: 1rem;
|
||||
font-weight: 700;
|
||||
color: var(--color-text);
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
.summary-card__unit {
|
||||
display: block;
|
||||
margin-top: 2px;
|
||||
font-size: 0.75rem;
|
||||
color: var(--color-text-muted);
|
||||
}
|
||||
|
||||
.summary-card__status {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 4px;
|
||||
margin: 8px 0 0;
|
||||
font-size: 0.6875rem;
|
||||
font-weight: 600;
|
||||
color: var(--color-success);
|
||||
}
|
||||
|
||||
.summary-card__status--warn {
|
||||
color: var(--color-danger);
|
||||
}
|
||||
|
||||
.summary-card__hint {
|
||||
margin: 8px 0 0;
|
||||
font-size: 0.6875rem;
|
||||
font-weight: 500;
|
||||
color: var(--color-primary);
|
||||
}
|
||||
|
||||
.summary-card__status-icon {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
border-radius: 50%;
|
||||
background: var(--color-success-light);
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 0.625rem;
|
||||
}
|
||||
|
||||
.checks-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.check-card {
|
||||
display: grid;
|
||||
grid-template-columns: 28px 1fr 72px;
|
||||
gap: 10px;
|
||||
align-items: center;
|
||||
padding: 12px;
|
||||
border-radius: 14px;
|
||||
background: var(--color-elevated);
|
||||
border: 1px solid var(--color-border);
|
||||
color: var(--color-text);
|
||||
}
|
||||
|
||||
.check-card__menu-wrap {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.check-card__menu-btn {
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
border: none;
|
||||
background: none;
|
||||
color: var(--color-text-muted);
|
||||
font-size: 1.125rem;
|
||||
line-height: 1;
|
||||
cursor: pointer;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.check-card__menu {
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
right: 0;
|
||||
z-index: 10;
|
||||
min-width: 88px;
|
||||
padding: 4px;
|
||||
border-radius: var(--radius-sm);
|
||||
background: var(--color-elevated);
|
||||
border: 1px solid var(--color-border);
|
||||
box-shadow: var(--shadow-md);
|
||||
}
|
||||
|
||||
.check-card__menu button {
|
||||
width: 100%;
|
||||
border: none;
|
||||
background: none;
|
||||
padding: 8px 10px;
|
||||
text-align: right;
|
||||
font-size: 0.8125rem;
|
||||
color: var(--color-danger);
|
||||
cursor: pointer;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
.check-card__menu button:hover {
|
||||
background: var(--color-danger-light);
|
||||
}
|
||||
|
||||
.check-card__body {
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.check-card__title {
|
||||
margin: 0 0 4px;
|
||||
font-size: 0.875rem;
|
||||
font-weight: 700;
|
||||
color: var(--color-text);
|
||||
}
|
||||
|
||||
.check-card__amount {
|
||||
margin: 0 0 4px;
|
||||
font-size: 0.8125rem;
|
||||
font-weight: 600;
|
||||
color: var(--color-text);
|
||||
}
|
||||
|
||||
.check-card__date {
|
||||
margin: 0;
|
||||
font-size: 0.75rem;
|
||||
color: var(--color-text-muted);
|
||||
}
|
||||
|
||||
.check-card__thumb-wrap {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.check-card__thumb {
|
||||
width: 72px;
|
||||
height: 48px;
|
||||
border-radius: 8px;
|
||||
object-fit: cover;
|
||||
border: 1px solid var(--color-border);
|
||||
background: var(--color-surface);
|
||||
}
|
||||
|
||||
.check-card__thumb--empty {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 0.6875rem;
|
||||
color: var(--color-text-muted);
|
||||
}
|
||||
|
||||
.rass-panel {
|
||||
padding: 16px;
|
||||
border-radius: 14px;
|
||||
background: var(--color-success-light);
|
||||
border: 1px solid var(--color-success);
|
||||
margin-bottom: 12px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.rass-panel__title {
|
||||
margin: 0 0 6px;
|
||||
font-size: 0.875rem;
|
||||
font-weight: 600;
|
||||
color: var(--color-success);
|
||||
}
|
||||
|
||||
.rass-panel__days {
|
||||
font-size: 1.75rem;
|
||||
font-weight: 700;
|
||||
color: var(--color-success);
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
.rass-panel__date {
|
||||
margin: 6px 0 0;
|
||||
font-size: 0.8125rem;
|
||||
color: var(--color-success);
|
||||
}
|
||||
|
||||
.check-list-page__footer {
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
padding: 12px 0 calc(12px + env(safe-area-inset-bottom, 0));
|
||||
background: var(--color-bg);
|
||||
border-top: 1px solid var(--color-border);
|
||||
box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.06);
|
||||
margin: 0 calc(-1 * var(--page-padding));
|
||||
padding-left: var(--page-padding);
|
||||
padding-right: var(--page-padding);
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,163 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, watch } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { useOrderStore } from '@/stores/order'
|
||||
import PageHeader from '@/components/layout/PageHeader.vue'
|
||||
import IconCheckBook from '@/components/icons/IconCheckBook.vue'
|
||||
import IconEditPen from '@/components/icons/IconEditPen.vue'
|
||||
import { useRequirePricedOrder } from '@/composables/useRequirePricedOrder'
|
||||
import { formatCurrency } from '@/utils/format'
|
||||
|
||||
const router = useRouter()
|
||||
const orderStore = useOrderStore()
|
||||
|
||||
const { orderId, order } = useRequirePricedOrder()
|
||||
|
||||
const invoiceLabel = computed(() =>
|
||||
order.value?.finalAmount ? formatCurrency(order.value.finalAmount) : '—',
|
||||
)
|
||||
|
||||
watch(
|
||||
orderId,
|
||||
async (id) => {
|
||||
if (!id) return
|
||||
if (!orderStore.getOrderById(id)) await orderStore.fetchOrder(id)
|
||||
if (orderStore.draftOrderId !== id) orderStore.startCheckDraft(id)
|
||||
},
|
||||
{ immediate: true },
|
||||
)
|
||||
|
||||
function selectMode(mode: 'full' | 'brief') {
|
||||
orderStore.setCheckMode(mode)
|
||||
router.push(`/orders/${orderId.value}/check-form`)
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="page check-mode-page">
|
||||
<PageHeader
|
||||
title="تسویه چکی"
|
||||
subtitle="بر اساس مبلغ فاکتور، نحوه ثبت چک را انتخاب کنید"
|
||||
show-back
|
||||
centered
|
||||
@back="router.push(`/orders/${orderId}`)"
|
||||
/>
|
||||
|
||||
<div class="page__scroll check-mode-page__scroll">
|
||||
<div class="check-mode-invoice">
|
||||
<span class="check-mode-invoice__label">مبلغ فاکتور</span>
|
||||
<strong class="check-mode-invoice__value">{{ invoiceLabel }}</strong>
|
||||
</div>
|
||||
|
||||
<div class="mode-options">
|
||||
<button type="button" class="mode-card" @click="selectMode('full')">
|
||||
<span class="mode-card__icon">
|
||||
<IconCheckBook :size="36" />
|
||||
</span>
|
||||
<h3 class="mode-card__title">ثبت کامل (پیشنهادی)</h3>
|
||||
<p class="mode-card__desc">وارد کردن همه اطلاعات چک</p>
|
||||
</button>
|
||||
|
||||
<button type="button" class="mode-card" @click="selectMode('brief')">
|
||||
<span class="mode-card__icon">
|
||||
<IconEditPen :size="36" />
|
||||
</span>
|
||||
<h3 class="mode-card__title">ثبت مختصر</h3>
|
||||
<p class="mode-card__desc">وارد کردن حداقل اطلاعات</p>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.check-mode-page {
|
||||
background: var(--color-bg);
|
||||
}
|
||||
|
||||
.check-mode-page__scroll {
|
||||
padding-bottom: 24px;
|
||||
}
|
||||
|
||||
.check-mode-invoice {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
padding: 16px;
|
||||
margin-bottom: 8px;
|
||||
border-radius: 16px;
|
||||
background: var(--color-primary-light);
|
||||
border: 1px solid var(--color-primary);
|
||||
}
|
||||
|
||||
.check-mode-invoice__label {
|
||||
font-size: 0.8125rem;
|
||||
color: var(--color-primary);
|
||||
}
|
||||
|
||||
.check-mode-invoice__value {
|
||||
font-size: 1.125rem;
|
||||
font-weight: 700;
|
||||
color: var(--color-primary);
|
||||
}
|
||||
|
||||
.mode-options {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16px;
|
||||
padding-top: 8px;
|
||||
}
|
||||
|
||||
.mode-card {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
padding: 32px 24px;
|
||||
border: none;
|
||||
border-radius: 16px;
|
||||
background: var(--color-elevated);
|
||||
color: var(--color-text);
|
||||
box-shadow: var(--shadow-sm);
|
||||
cursor: pointer;
|
||||
transition:
|
||||
box-shadow 0.15s,
|
||||
transform 0.15s;
|
||||
}
|
||||
|
||||
.mode-card:hover {
|
||||
box-shadow: var(--shadow-md);
|
||||
}
|
||||
|
||||
.mode-card:active {
|
||||
transform: scale(0.99);
|
||||
}
|
||||
|
||||
.mode-card__icon {
|
||||
width: 64px;
|
||||
height: 64px;
|
||||
border-radius: 50%;
|
||||
background: var(--color-primary-light);
|
||||
color: var(--color-primary);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.mode-card__title {
|
||||
margin: 0 0 8px;
|
||||
font-size: 1.0625rem;
|
||||
font-weight: 700;
|
||||
color: var(--color-primary);
|
||||
}
|
||||
|
||||
.mode-card__desc {
|
||||
margin: 0;
|
||||
font-size: 0.875rem;
|
||||
color: var(--color-text-muted);
|
||||
line-height: 1.5;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,305 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, ref, watch } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { useOrderStore } from '@/stores/order'
|
||||
import PageHeader from '@/components/layout/PageHeader.vue'
|
||||
import CheckoutStepper from '@/components/layout/CheckoutStepper.vue'
|
||||
import FormErrorBanner from '@/components/ui/FormErrorBanner.vue'
|
||||
import BaseButton from '@/components/ui/BaseButton.vue'
|
||||
import IconCashSettlement from '@/components/icons/IconCashSettlement.vue'
|
||||
import IconCheckBook from '@/components/icons/IconCheckBook.vue'
|
||||
import { formatCurrency } from '@/utils/format'
|
||||
import { isInvoicePriced } from '@/utils/orderInvoice'
|
||||
import { useRequirePricedOrder } from '@/composables/useRequirePricedOrder'
|
||||
|
||||
const router = useRouter()
|
||||
const orderStore = useOrderStore()
|
||||
|
||||
const { orderId, order, invoiceReady } = useRequirePricedOrder()
|
||||
const submitting = ref(false)
|
||||
const formError = ref('')
|
||||
|
||||
watch(
|
||||
orderId,
|
||||
async (id) => {
|
||||
if (id && !orderStore.getOrderById(id)) await orderStore.fetchOrder(id)
|
||||
},
|
||||
{ immediate: true },
|
||||
)
|
||||
|
||||
const invoiceLabel = computed(() =>
|
||||
order.value?.finalAmount ? formatCurrency(order.value.finalAmount) : '—',
|
||||
)
|
||||
|
||||
async function selectType(type: 'cash' | 'check') {
|
||||
if (submitting.value || !isInvoicePriced(order.value)) {
|
||||
formError.value = 'تا قبل از قیمتگذاری مدیریت، امکان انتخاب روش تسویه وجود ندارد.'
|
||||
return
|
||||
}
|
||||
submitting.value = true
|
||||
formError.value = ''
|
||||
try {
|
||||
await orderStore.chooseSettlement(orderId.value, type)
|
||||
if (type === 'cash') {
|
||||
router.replace(`/orders/${orderId.value}/cash`)
|
||||
} else {
|
||||
orderStore.startCheckDraft(orderId.value)
|
||||
router.replace(`/orders/${orderId.value}/check-mode`)
|
||||
}
|
||||
} catch (e) {
|
||||
formError.value = e instanceof Error ? e.message : 'ثبت روش تسویه ناموفق بود.'
|
||||
} finally {
|
||||
submitting.value = false
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<!-- Mobile -->
|
||||
<div class="page settlement-mobile-page mobile-only">
|
||||
<PageHeader
|
||||
title="انتخاب نوع تسویه"
|
||||
subtitle="پس از صدور فاکتور، نوع تسویه را انتخاب کنید"
|
||||
show-back
|
||||
centered
|
||||
@back="router.push(`/orders/${orderId}`)"
|
||||
/>
|
||||
<div class="page__scroll">
|
||||
<FormErrorBanner :message="formError" />
|
||||
|
||||
<div v-if="!invoiceReady" class="settlement-waiting">
|
||||
<h3 class="settlement-waiting__title">در انتظار قیمتگذاری</h3>
|
||||
<p class="settlement-waiting__text">
|
||||
پیشسفارش ثبت شده است. پس از تعیین قیمت توسط مدیریت و صدور فاکتور، از این صفحه روش
|
||||
تسویه (نقد یا چک) را انتخاب کنید.
|
||||
</p>
|
||||
<BaseButton block variant="outline" @click="router.push(`/orders/${orderId}`)">
|
||||
بازگشت به جزئیات سفارش
|
||||
</BaseButton>
|
||||
</div>
|
||||
|
||||
<template v-else>
|
||||
<div class="settlement-invoice">
|
||||
<span class="settlement-invoice__label">مبلغ فاکتور</span>
|
||||
<strong class="settlement-invoice__value">{{ invoiceLabel }}</strong>
|
||||
<span v-if="order" class="settlement-invoice__meta">سفارش {{ order.orderNumber }}</span>
|
||||
</div>
|
||||
|
||||
<div class="settlement-mobile-options">
|
||||
<button
|
||||
type="button"
|
||||
class="settlement-card"
|
||||
:disabled="submitting"
|
||||
@click="selectType('cash')"
|
||||
>
|
||||
<span class="settlement-card__icon settlement-card__icon--cash">
|
||||
<IconCashSettlement :size="36" />
|
||||
</span>
|
||||
<h3>تسویه نقدی</h3>
|
||||
<p>پرداخت از طریق واریز به حساب شرکت</p>
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="settlement-card"
|
||||
:disabled="submitting"
|
||||
@click="selectType('check')"
|
||||
>
|
||||
<span class="settlement-card__icon settlement-card__icon--check">
|
||||
<IconCheckBook :size="36" />
|
||||
</span>
|
||||
<h3>تسویه چکی</h3>
|
||||
<p>پرداخت بر اساس مبلغ فاکتور با ثبت چک</p>
|
||||
</button>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Desktop -->
|
||||
<div class="desktop-checkout-shell desktop-only">
|
||||
<CheckoutStepper :current-step="4" />
|
||||
<header class="desktop-page__head">
|
||||
<h1 class="desktop-page__title">انتخاب نوع تسویه</h1>
|
||||
<p class="desktop-page__subtitle">
|
||||
<template v-if="invoiceReady">
|
||||
مبلغ فاکتور {{ invoiceLabel }}{{ order ? ` · سفارش ${order.orderNumber}` : '' }}
|
||||
</template>
|
||||
<template v-else>پس از قیمتگذاری مدیریت فعال میشود</template>
|
||||
</p>
|
||||
</header>
|
||||
|
||||
<FormErrorBanner :message="formError" />
|
||||
|
||||
<div v-if="!invoiceReady" class="settlement-waiting settlement-waiting--desktop">
|
||||
<h3 class="settlement-waiting__title">در انتظار قیمتگذاری</h3>
|
||||
<p class="settlement-waiting__text">
|
||||
پیشسفارش ثبت شده است. پس از صدور فاکتور میتوانید روش تسویه را انتخاب کنید.
|
||||
</p>
|
||||
<BaseButton variant="outline" @click="router.push(`/orders/${orderId}`)">
|
||||
بازگشت به جزئیات سفارش
|
||||
</BaseButton>
|
||||
</div>
|
||||
|
||||
<div v-else class="desktop-settlement-grid">
|
||||
<button
|
||||
type="button"
|
||||
class="settlement-card settlement-card--desktop"
|
||||
:disabled="submitting"
|
||||
@click="selectType('cash')"
|
||||
>
|
||||
<span class="settlement-card__icon settlement-card__icon--cash">
|
||||
<IconCashSettlement :size="40" />
|
||||
</span>
|
||||
<h3>تسویه نقدی</h3>
|
||||
<p>پرداخت از طریق واریز به حساب شرکت</p>
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="settlement-card settlement-card--desktop"
|
||||
:disabled="submitting"
|
||||
@click="selectType('check')"
|
||||
>
|
||||
<span class="settlement-card__icon settlement-card__icon--check">
|
||||
<IconCheckBook :size="40" />
|
||||
</span>
|
||||
<h3>تسویه چکی</h3>
|
||||
<p>پرداخت بر اساس مبلغ فاکتور با ثبت چک</p>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.settlement-mobile-page {
|
||||
background: var(--color-bg);
|
||||
padding: 12px 0 0;
|
||||
}
|
||||
|
||||
.settlement-waiting {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
padding: 28px 20px;
|
||||
text-align: center;
|
||||
border-radius: 16px;
|
||||
background: var(--color-elevated);
|
||||
border: 1px solid var(--color-border);
|
||||
}
|
||||
|
||||
.settlement-waiting--desktop {
|
||||
max-width: 480px;
|
||||
margin-inline: auto;
|
||||
}
|
||||
|
||||
.settlement-waiting__title {
|
||||
margin: 0;
|
||||
font-size: 1.0625rem;
|
||||
font-weight: 700;
|
||||
color: var(--color-text);
|
||||
}
|
||||
|
||||
.settlement-waiting__text {
|
||||
margin: 0;
|
||||
font-size: 0.875rem;
|
||||
line-height: 1.7;
|
||||
color: var(--color-text-muted);
|
||||
}
|
||||
|
||||
.settlement-mobile-options {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16px;
|
||||
padding-top: 8px;
|
||||
}
|
||||
|
||||
.settlement-card {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
padding: 32px 24px;
|
||||
border: none;
|
||||
border-radius: 16px;
|
||||
background: var(--color-elevated);
|
||||
box-shadow: var(--shadow-sm);
|
||||
cursor: pointer;
|
||||
color: var(--color-text);
|
||||
}
|
||||
|
||||
.settlement-card:disabled {
|
||||
opacity: 0.6;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.settlement-invoice {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
padding: 18px;
|
||||
margin-bottom: 8px;
|
||||
border-radius: 16px;
|
||||
background: var(--color-primary-light);
|
||||
border: 1px solid var(--color-primary);
|
||||
}
|
||||
|
||||
.settlement-invoice__label {
|
||||
font-size: 0.8125rem;
|
||||
color: var(--color-primary);
|
||||
}
|
||||
|
||||
.settlement-invoice__value {
|
||||
font-size: 1.25rem;
|
||||
font-weight: 700;
|
||||
color: var(--color-primary);
|
||||
}
|
||||
|
||||
.settlement-invoice__meta {
|
||||
font-size: 0.75rem;
|
||||
color: var(--color-text-muted);
|
||||
}
|
||||
|
||||
.settlement-card--desktop {
|
||||
min-height: 220px;
|
||||
border: 1px solid var(--color-border);
|
||||
transition:
|
||||
border-color 0.15s,
|
||||
box-shadow 0.15s;
|
||||
}
|
||||
|
||||
.settlement-card--desktop:hover:not(:disabled) {
|
||||
border-color: var(--color-primary);
|
||||
box-shadow: var(--shadow-md);
|
||||
}
|
||||
|
||||
.settlement-card__icon {
|
||||
width: 64px;
|
||||
height: 64px;
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.settlement-card__icon--cash {
|
||||
background: var(--color-success-light);
|
||||
}
|
||||
|
||||
.settlement-card__icon--check {
|
||||
background: var(--color-primary-light);
|
||||
}
|
||||
|
||||
.settlement-card h3 {
|
||||
margin: 0 0 8px;
|
||||
font-size: 1.0625rem;
|
||||
}
|
||||
|
||||
.settlement-card p {
|
||||
margin: 0;
|
||||
font-size: 0.875rem;
|
||||
color: var(--color-text-muted);
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user