update importWorkflow plugin
This commit is contained in:
parent
663f5f7173
commit
6d3832f682
|
|
@ -144,7 +144,7 @@
|
||||||
<v-row>
|
<v-row>
|
||||||
<v-col cols="12">
|
<v-col cols="12">
|
||||||
<v-card class="mb-4">
|
<v-card class="mb-4">
|
||||||
<v-card-title>روند ماهانه مبالغ ارزی</v-card-title>
|
<v-card-title>روند ماهانه مبالغ (ریالی)</v-card-title>
|
||||||
<v-card-text>
|
<v-card-text>
|
||||||
<canvas v-if="workflows && workflows.length > 0" ref="trendChart" width="800" height="300"></canvas>
|
<canvas v-if="workflows && workflows.length > 0" ref="trendChart" width="800" height="300"></canvas>
|
||||||
<div v-if="!workflows || workflows.length === 0" class="text-center pa-4">
|
<div v-if="!workflows || workflows.length === 0" class="text-center pa-4">
|
||||||
|
|
@ -388,7 +388,7 @@ const createTrendChart = () => {
|
||||||
const persianYear = persianDate.year()
|
const persianYear = persianDate.year()
|
||||||
const persianMonth = String(persianDate.month() + 1).padStart(2, '0')
|
const persianMonth = String(persianDate.month() + 1).padStart(2, '0')
|
||||||
const monthKey = `${persianYear}-${persianMonth}`
|
const monthKey = `${persianYear}-${persianMonth}`
|
||||||
monthlyData[monthKey] = (monthlyData[monthKey] || 0) + workflow.totalAmount
|
monthlyData[monthKey] = (monthlyData[monthKey] || 0) + (workflow.totalAmount * workflow.exchangeRate)
|
||||||
})
|
})
|
||||||
|
|
||||||
const sortedMonths = Object.keys(monthlyData).sort()
|
const sortedMonths = Object.keys(monthlyData).sort()
|
||||||
|
|
@ -405,7 +405,7 @@ const createTrendChart = () => {
|
||||||
data: {
|
data: {
|
||||||
labels,
|
labels,
|
||||||
datasets: [{
|
datasets: [{
|
||||||
label: 'مبلغ کل (ارزی)',
|
label: 'مبلغ کل (ریالی)',
|
||||||
data: sortedMonths.map(month => monthlyData[month]),
|
data: sortedMonths.map(month => monthlyData[month]),
|
||||||
borderColor: '#36A2EB',
|
borderColor: '#36A2EB',
|
||||||
backgroundColor: 'rgba(54, 162, 235, 0.1)',
|
backgroundColor: 'rgba(54, 162, 235, 0.1)',
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue