Files
tehran_taj/apps/admin-panel/src/views/promotion/promotion_add_edit.vue
T
s.esmaeiliandClaude Sonnet 5 1bb9802d1f admin-panel: convert promotion add/edit forms into modals
PromotionForm.vue (shared by the omde and tak variants) gains open/id modal
support; both thin wrappers (promotion_add_edit.vue, promotion_tak_add_edit.vue)
pass the props/emits through unchanged. promotion_list.vue gets two
ListPageHeader buttons (offers.create / offers.create.tak, matching the two
routes' rids) and picks which variant's modal to open based on the edited
row's type_customer, exactly as the old toEdit() picked which route to
navigate to.

Verified: pnpm build passes.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-14 16:56:30 +03:30

26 lines
895 B
Vue

<template>
<!--
Ported from legacy henza_admin/src/views/promotion/promotion_add_edit.vue.
Verified by diff against promotion_tak_add_edit.vue: the two files differ
only in the card title and whether the "مشتری" scope is offered, so both are
thin wrappers over PromotionForm. Props/emits pass through unchanged so this
wrapper works both as the /major/promotion/add(/edit/:id) route and as a
modal opened from promotion_list.vue.
-->
<PromotionForm
title="تعریف تخفیف"
:allow-customer-scope="true"
:open="open"
:id="id"
@update:open="$emit('update:open', $event)"
@success="$emit('success')"
/>
</template>
<script setup lang="ts">
import PromotionForm from './PromotionForm.vue';
defineProps<{ open?: boolean; id?: string }>();
defineEmits<{ (e: 'update:open', value: boolean): void; (e: 'success'): void }>();
</script>