fix pargar mande
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import type { BaseTableColumn } from '@core/type/baseTable'
|
||||
import { toJalaliNoTime, toTime } from '@core/utils/useDataTime'
|
||||
import { toJalali } from '@core/utils/useDataTime'
|
||||
import CustomTag from '@/components/CustomTag.vue'
|
||||
/*import BudgetSelect from '@/components/BudgetSelect.vue'
|
||||
import { useStaticApiListsStore } from '@/store/staticApisStore'
|
||||
@@ -138,7 +138,7 @@ export const cols: BaseTableColumn[] = [
|
||||
key: 'created_at',
|
||||
type: 'DateTime',
|
||||
customRender: (record: any) => {
|
||||
return toJalaliNoTime(record.record.created_at)
|
||||
return toJalali(record.record.created_at)
|
||||
}
|
||||
},*/
|
||||
{
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<p class="pargar-wallet-sync__hint">
|
||||
{{
|
||||
canSync
|
||||
? 'موجودی را با ماندهٔ پرگار یکی میکند — تاریخچهٔ اسناد روی کیف replay نمیشود'
|
||||
? 'ریال و طلای کیف اصلی را با ماندهٔ پرگار یکی میکند — فقط وقتی همهٔ اسناد در پرگار ثبت شده باشند'
|
||||
: 'ابتدا کد حسابداری پرگار را برای این مشتری ثبت کنید'
|
||||
}}
|
||||
</p>
|
||||
@@ -22,10 +22,28 @@
|
||||
class="pargar-wallet-sync__btn"
|
||||
:loading="loading"
|
||||
:disabled="!canSync || loading"
|
||||
@click="$emit('sync')"
|
||||
@click="$emit('sync', false)"
|
||||
>
|
||||
همگامسازی مانده از پرگار
|
||||
</a-button>
|
||||
<a-popconfirm
|
||||
title="ماندهٔ پرگار بدون بررسی اعتبار روی کیف مشتری نوشته شود؟"
|
||||
ok-text="بله، اعمال کن"
|
||||
cancel-text="انصراف"
|
||||
:disabled="!canSync || loading"
|
||||
@confirm="$emit('sync', true)"
|
||||
>
|
||||
<a-button
|
||||
type="link"
|
||||
size="small"
|
||||
block
|
||||
danger
|
||||
class="pargar-wallet-sync__force"
|
||||
:disabled="!canSync || loading"
|
||||
>
|
||||
اعمال اجباری مانده
|
||||
</a-button>
|
||||
</a-popconfirm>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -38,7 +56,7 @@ defineProps<{
|
||||
}>()
|
||||
|
||||
defineEmits<{
|
||||
(e: 'sync'): void
|
||||
(e: 'sync', force: boolean): void
|
||||
}>()
|
||||
</script>
|
||||
|
||||
@@ -69,4 +87,8 @@ defineEmits<{
|
||||
.pargar-wallet-sync__btn {
|
||||
@apply font-600;
|
||||
}
|
||||
|
||||
.pargar-wallet-sync__force {
|
||||
@apply mt-1 text-xs;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { BaseTableColumn } from '@core/type/baseTable'
|
||||
import { toJalaliNoTime, toTime } from '@core/utils/useDataTime'
|
||||
import { toJalali } from '@core/utils/useDataTime'
|
||||
import CustomTag from '@/components/CustomTag.vue'
|
||||
import { usePrice } from '@core/utils/usePrice'
|
||||
/*import BudgetSelect from '@/components/BudgetSelect.vue'
|
||||
@@ -157,7 +157,7 @@ export const cols: BaseTableColumn[] = [
|
||||
key: 'created_at',
|
||||
type: 'DateTime',
|
||||
customRender: (record: any) => {
|
||||
return toJalaliNoTime(record.record.created_at)
|
||||
return toJalali(record.record.created_at)
|
||||
}
|
||||
},*/
|
||||
]
|
||||
|
||||
@@ -659,11 +659,11 @@ async function refreshWalletPanels() {
|
||||
])
|
||||
}
|
||||
|
||||
async function syncPargarWallet() {
|
||||
async function syncPargarWallet(force = false) {
|
||||
if (!userInfo.value?.id || !pargarWalletCanSync.value || pargarSyncLoading.value) return
|
||||
pargarSyncLoading.value = true
|
||||
try {
|
||||
const res = await syncCustomerWalletFromPargar(userInfo.value.id)
|
||||
const res = await syncCustomerWalletFromPargar(userInfo.value.id, force)
|
||||
const applied =
|
||||
res.ok ||
|
||||
(res.result?.documents?.acknowledged ?? 0) > 0 ||
|
||||
|
||||
Reference in New Issue
Block a user