feat: require payment method when submitting a preorder

Price depends on cash or check terms, so the customer chooses them before admin pricing.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-11-15 11:24:52 +03:30
co-authored by Cursor
parent c225a58099
commit 881e6a2c87
10 changed files with 284 additions and 20 deletions
+13 -2
View File
@@ -10,7 +10,8 @@ import IconLightbulb from '@/components/icons/IconLightbulb.vue'
import IconLayoutGrid from '@/components/icons/IconLayoutGrid.vue'
import IconDiamond from '@/components/icons/IconDiamond.vue'
import { formatMeterage, formatNumber } from '@/utils/format'
import type { CartItem } from '@/types'
import type { CartItem, SettlementType } from '@/types'
import PreorderPaymentFields from '@/components/orders/PreorderPaymentFields.vue'
defineProps<{
items: CartItem[]
@@ -27,6 +28,8 @@ defineProps<{
remainingCapacity: number
isEmpty: boolean
submitting?: boolean
settlementType: SettlementType | null
checkTermMonths: number | null
}>()
const emit = defineEmits<{
@@ -34,6 +37,8 @@ const emit = defineEmits<{
checkout: []
selectCompany: []
back: []
'update:settlementType': [value: SettlementType]
'update:checkTermMonths': [value: number]
}>()
const router = useRouter()
@@ -180,6 +185,12 @@ const quickLinks = [
</span>
</div>
</div>
<PreorderPaymentFields
:settlement-type="settlementType"
:check-term-months="checkTermMonths"
@update:settlement-type="emit('update:settlementType', $event)"
@update:check-term-months="emit('update:checkTermMonths', $event)"
/>
<button
type="button"
class="cart-summary-card__cta"
@@ -190,7 +201,7 @@ const quickLinks = [
{{ submitting ? 'در حال ثبت…' : 'ثبت پیش‌سفارش' }}
</button>
<p class="cart-summary-card__note">
پس از ثبت سفارش، مدیریت قیمت‌گذاری می‌کند و فاکتور صادر می‌شود؛ سپس روش تسویه را انتخاب می‌کنید.
روش پرداخت الان ثبت می‌شود. مدیریت بعد از آن قیمت و متراژ را اعلام می‌کند.
</p>
</div>