fixed ui and some bugs
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
<span class="text-gray-500">{{ item.label }}</span>
|
||||
<span class="text-left break-all">{{ item.value ?? '-' }}</span>
|
||||
</div>
|
||||
<div v-if="detail?.res" class="rounded-lg bg-gray-100 p-3 text-xs font-mono text-gray-700 whitespace-pre-wrap">{{ detail.res }}</div>
|
||||
<div v-if="logText" class="rounded-lg bg-red-50 p-3 text-red-700 whitespace-pre-wrap">{{ logText }}</div>
|
||||
</div>
|
||||
</BasicModal>
|
||||
@@ -23,6 +24,7 @@ import { computed, ref, watch } from 'vue'
|
||||
import BasicModal from '@/components/BasicModal.vue'
|
||||
import { message } from 'ant-design-vue/es'
|
||||
import { getTahesabDetail, retryTahesabSanad, registerCustomerInTahesab, type TahesabRecord } from '@/api/tahesab'
|
||||
import { tahesabStatusLabel } from '@/pages/menuPages/accounting/utils/tahesabStatus'
|
||||
|
||||
const props = defineProps<{
|
||||
modelValue: boolean
|
||||
@@ -49,7 +51,9 @@ const title = computed(() =>
|
||||
props.mode === 'register-customer' ? 'ثبت مشتری در تهحساب' : 'ارسال مجدد سند به تهحساب'
|
||||
)
|
||||
|
||||
const confirmText = computed(() => (props.mode === 'register-customer' ? 'ثبت در تهحساب' : 'ارسال به تهحساب'))
|
||||
const confirmText = computed(() =>
|
||||
props.mode === 'register-customer' ? 'ثبت در تهحساب' : 'ارسال مجدد'
|
||||
)
|
||||
|
||||
const logText = computed(() => detail.value?.sync_log || '')
|
||||
|
||||
@@ -69,17 +73,11 @@ const items = computed(() => {
|
||||
{ label: 'نوع', value: detail.value?.type },
|
||||
{ label: 'مقدار', value: detail.value?.amount },
|
||||
{ label: 'شرح', value: detail.value?.desc },
|
||||
{ label: 'وضعیت', value: statusLabel(detail.value?.sync_status) },
|
||||
{ label: 'وضعیت', value: tahesabStatusLabel(detail.value?.sync_status, detail.value?.tahesab_id) },
|
||||
{ label: 'کد تهحساب', value: detail.value?.tahesab_id }
|
||||
]
|
||||
})
|
||||
|
||||
function statusLabel(status?: string) {
|
||||
if (status === 'success') return 'موفق'
|
||||
if (status === 'failed') return 'ناموفق'
|
||||
return 'در انتظار'
|
||||
}
|
||||
|
||||
watch(
|
||||
() => [props.modelValue, props.tahesabId] as const,
|
||||
async ([open, id]) => {
|
||||
|
||||
Reference in New Issue
Block a user