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>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
3345c86d18
commit
1bb9802d1f
@@ -3,11 +3,23 @@
|
||||
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.
|
||||
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" />
|
||||
<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>
|
||||
|
||||
Reference in New Issue
Block a user