feat: complete admin panel and backend admin api migration

This commit is contained in:
s.esmaeili
2026-09-13 21:02:25 +03:30
parent 03119cd655
commit 267fc7b7d1
239 changed files with 25431 additions and 935 deletions
@@ -0,0 +1,103 @@
<template>
<!--
Ported from legacy henza_admin/src/views/report/order_item.vue —
"گزارش تجمیعی سفارشات و اسناد مالی" over a Jalali date range.
Legacy's own table-model import is COMMENTED OUT, so the grid was built
inline; the same is done here.
-->
<div id="page-user-list">
<a-spin :spinning="loading">
<a-card title="گزارش تجمیعی سفارشات و اسناد مالی">
<a-form layout="vertical">
<div class="grid-4">
<DateInput v-model="filters.start_date" label="از تاریخ" />
<DateInput v-model="filters.end_date" label="تا تاریخ" />
<a-form-item label=" ">
<a-button type="primary" @click="load">اعمال</a-button>
</a-form-item>
</div>
</a-form>
<div v-if="summary" class="summary">
<a-tag color="blue">تعداد سفارش: {{ summary.order_count }}</a-tag>
<a-tag color="blue">تعداد آیتم: {{ summary.item_count }}</a-tag>
<a-tag color="green">مجموع وزن: {{ summary.total_weight }} گرم</a-tag>
</div>
<a-table
class="mt-4"
size="small"
:data-source="rows"
:columns="columns"
:pagination="{ pageSize: 20 }"
row-key="order_id"
>
<template #bodyCell="{ column, record }">
<template v-if="column.dataIndex === 'caj'">
{{ jdate(record.caj) }}
</template>
</template>
</a-table>
</a-card>
</a-spin>
</div>
</template>
<script setup lang="ts">
import { onMounted, reactive, ref } from 'vue';
import DateInput from '../../components/input/DateInput.vue';
import { jdate } from '../../utils/filters';
import api from '../../api/client';
const loading = ref(false);
const rows = ref<Record<string, any>[]>([]);
const summary = ref<Record<string, any> | undefined>(undefined);
const filters = reactive<Record<string, string | undefined>>({
start_date: undefined,
end_date: undefined,
});
const columns = [
{ title: 'شماره سفارش', dataIndex: 'order_number' },
{ title: 'مشتری', dataIndex: 'customer' },
{ title: 'محصول', dataIndex: 'product' },
{ title: 'تنوع', dataIndex: 'variant' },
{ title: 'تعداد', dataIndex: 'qty' },
{ title: 'وزن واحد', dataIndex: 'w' },
{ title: 'وزن کل', dataIndex: 'total_w' },
{ title: 'تاریخ', dataIndex: 'caj' },
];
async function load() {
try {
loading.value = true;
const { data } = await api.get('report/order-item', { params: filters });
rows.value = data.rows;
summary.value = data.summary;
} catch (e) {
console.log(e);
} finally {
loading.value = false;
}
}
onMounted(load);
</script>
<style scoped>
.grid-4 {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 1rem;
}
.summary {
display: flex;
gap: 0.5rem;
margin-top: 0.5rem;
}
.mt-4 {
margin-top: 1rem;
}
</style>
@@ -0,0 +1,87 @@
<template>
<!--
Ported from legacy henza_admin/src/views/report/product.vue — per-product
sales over a Jalali date range, heaviest first.
-->
<div id="page-user-list">
<a-spin :spinning="loading">
<a-card title="گزارش محصولات">
<a-form layout="vertical">
<div class="grid-4">
<DateInput v-model="filters.start_date" label="از تاریخ" />
<DateInput v-model="filters.end_date" label="تا تاریخ" />
<a-form-item label=" ">
<a-button type="primary" @click="load">اعمال</a-button>
</a-form-item>
</div>
</a-form>
<div v-if="summary" class="summary">
<a-tag color="blue">تعداد محصول: {{ summary.product_count }}</a-tag>
</div>
<a-table
class="mt-4"
size="small"
:data-source="rows"
:columns="columns"
:pagination="{ pageSize: 20 }"
row-key="id"
/>
</a-card>
</a-spin>
</div>
</template>
<script setup lang="ts">
import { onMounted, reactive, ref } from 'vue';
import DateInput from '../../components/input/DateInput.vue';
import api from '../../api/client';
const loading = ref(false);
const rows = ref<Record<string, any>[]>([]);
const summary = ref<Record<string, any> | undefined>(undefined);
const filters = reactive<Record<string, string | undefined>>({
start_date: undefined,
end_date: undefined,
});
const columns = [
{ title: 'نام محصول', dataIndex: 'title' },
{ title: 'تعداد فروش رفته', dataIndex: 'total' },
{ title: 'وزن فروش رفته', dataIndex: 'w' },
{ title: 'تعداد سفارش', dataIndex: 'order_count' },
];
async function load() {
try {
loading.value = true;
const { data } = await api.get('report/product', { params: filters });
rows.value = data.rows;
summary.value = data.summary;
} catch (e) {
console.log(e);
} finally {
loading.value = false;
}
}
onMounted(load);
</script>
<style scoped>
.grid-4 {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 1rem;
}
.summary {
display: flex;
gap: 0.5rem;
margin-top: 0.5rem;
}
.mt-4 {
margin-top: 1rem;
}
</style>