Add Didar gap features: lost-reason reports, audit logs, tags, card assignees, and saved-views API.
Ignore Graphify local artifacts and expose new modules in superadmin.
This commit is contained in:
@@ -160,6 +160,12 @@ function exportReport() {
|
||||
'منبع,تعداد,درصد',
|
||||
...d.sources.map((s) => `${s.label},${s.count},${s.percent}`),
|
||||
'',
|
||||
'دلایل شکست معاملات',
|
||||
'دلیل,تعداد,درصد,مبلغ',
|
||||
...(d.lostReasons ?? []).map(
|
||||
(s) => `${s.label},${s.count},${s.percent},${s.amount ?? ''}`,
|
||||
),
|
||||
'',
|
||||
'پرفروشها',
|
||||
'نام,تعداد,مبلغ',
|
||||
...d.topProducts.map((p) => `${p.name},${p.quantity},${p.amount}`),
|
||||
@@ -267,6 +273,39 @@ const sourcesOption = computed<UiChartOption>(() => {
|
||||
};
|
||||
});
|
||||
|
||||
const lostReasonsOption = computed<UiChartOption>(() => {
|
||||
const rows = data.value?.lostReasons ?? [];
|
||||
return {
|
||||
tooltip: {
|
||||
trigger: 'item',
|
||||
formatter: (p: any) => {
|
||||
const row = rows.find((r) => r.label === p.name);
|
||||
const amountPart =
|
||||
row?.amount != null ? `<br/>مبلغ: <strong>${money(row.amount)}</strong>` : '';
|
||||
return `${p.name}: <strong>${num(p.value)}</strong> (${toFaDigits(p.percent)}٪)${amountPart}`;
|
||||
},
|
||||
},
|
||||
legend: {
|
||||
bottom: '0%',
|
||||
left: 'center',
|
||||
textStyle: { fontFamily: 'IRANSans', fontSize: 11, color: '#475569' },
|
||||
},
|
||||
color: CHART_PALETTE,
|
||||
series: [
|
||||
{
|
||||
name: 'دلایل شکست',
|
||||
type: 'pie',
|
||||
radius: ['45%', '70%'],
|
||||
center: ['50%', '42%'],
|
||||
avoidLabelOverlap: true,
|
||||
itemStyle: { borderRadius: 6, borderColor: '#fff', borderWidth: 2 },
|
||||
label: { show: false },
|
||||
data: rows.map((s) => ({ name: s.label, value: s.count })),
|
||||
},
|
||||
],
|
||||
};
|
||||
});
|
||||
|
||||
const monthlyOption = computed<UiChartOption>(() => {
|
||||
const rows = data.value?.monthlyComparison ?? [];
|
||||
return {
|
||||
@@ -563,6 +602,16 @@ onMounted(() => {
|
||||
<p v-else class="empty-msg">منبعی ثبت نشده است.</p>
|
||||
</UiCard>
|
||||
|
||||
<!-- Lost reasons -->
|
||||
<UiCard class="chart-card" title="دلایل عدم موفقیت فروش">
|
||||
<UiChart
|
||||
v-if="data.lostReasons?.length"
|
||||
:option="lostReasonsOption"
|
||||
height="260px"
|
||||
/>
|
||||
<p v-else class="empty-msg">معامله شکستخوردهای در این بازه نیست.</p>
|
||||
</UiCard>
|
||||
|
||||
<!-- Monthly comparison -->
|
||||
<UiCard class="chart-card" title="مقایسه فروش ماههای اخیر">
|
||||
<UiChart
|
||||
|
||||
Reference in New Issue
Block a user