1404/11/04- first

This commit is contained in:
2026-01-24 17:45:54 +03:30
commit edf1824229
554 changed files with 59581 additions and 0 deletions
@@ -0,0 +1,203 @@
import type {BaseTableColumn} from '@core/type/baseTable'
import {toJalaliNoTime, toTime} from '@core/utils/useDataTime'
import CustomTag from '@/components/CustomTag.vue'
import {usePrice} from '@core/utils/usePrice'
/*import BudgetSelect from '@/components/BudgetSelect.vue'
import { useStaticApiListsStore } from '@/store/staticApisStore'
import type { FilterSelect } from '@/model/filterSelect'
import type { DocItem } from '@/model/docType'*/
//define store
//const store = useStaticApiListsStore()
//document types
/*let docTypes: DocItem[]*/
/*onMounted(async () => {
docTypes = await store.readyDocTypeList()
})
const filteredDocTypes: FilterSelect = docTypes?.map((x: DocItem) => {
return {
label: x.title,
value: x.id
}
})*/
export const cols: BaseTableColumn[] = [
{
title: 'ردیف',
dataIndex: 'id',
key: 'id',
filterable: false,
sortable: false,
customRender: (record: any) => {
return record.index + 1
}
},
{
title: 'کد تراکنش',
dataIndex: 'id',
key: 'id',
type: 'Number'
// className: 'column-money'
},
{
title: 'نام تراکنش',
dataIndex: 'type_str',
key: 'type_str',
type: 'Text'
// className: 'column-money'
},
{
title: 'علت تراکنش',
dataIndex: 'note',
key: 'note',
type: 'Text',
// className: 'column-money'
},
{
title: 'نوع تراکنش',
dataIndex: 'active',
key: 'active',
filterable: false,
sortable: false,
customRender: ({record}) => {
return record.type === 4 || record.type === 3 ? (
<div class="flex justify-center">
<CustomTag textColor="#25855A" bgColor="#E3F4E9" class={'font-bold px-6'}>
پول
</CustomTag>
</div>
) : (
<div class="flex justify-center">
{/*<CustomTag textColor="rgb(255 120 0)" bgColor="rgb(255 221 0)">*/}
<CustomTag textColor="#ca8a04" bgColor="#fef3c7" class={'font-bold px-6'}>
طلا
</CustomTag>
</div>
)
}
},
{
title: 'نام مشتری',
dataIndex: 'customer.name',
key: 'customer.name',
type: 'Text'
},
{
title: 'مقدار طلا طی تراکنش (گرم)',
dataIndex: 'gold',
key: 'gold',
type: 'Number',
customRender: ({record}) => {
return record.gold > 0 ? (
<div class="flex justify-center">
<div class={'font-bold px-6 text-green'}>{record.gold}</div>
</div>
) : (
<div class="flex justify-center">
{/*<CustomTag textColor="rgb(255 120 0)" bgColor="rgb(255 221 0)">*/}
<div class={'font-bold px-6 text-red'}>{record.gold}</div>
</div>
)
}
},
{
title: 'مقدار پول طی تراکنش (ریال)',
dataIndex: 'cash',
key: 'cash',
type: 'Number',
customRender: ({record}) => {
return record.cash > 0 ? (
<div class="flex justify-center">
<div class={'font-bold px-6 text-green'}>{usePrice(record?.cash ?? 0, true, '')}</div>
</div>
) : (
<div class="flex justify-center">
{/*<CustomTag textColor="rgb(255 120 0)" bgColor="rgb(255 221 0)">*/}
<div class={'font-bold px-6 text-red'}>{usePrice(record?.cash ?? 0, true, '')}</div>
</div>
)
}
},
/* {
title: 'شماره سفارش',
dataIndex: 'order_id',
key: 'order_id',
type: 'Text'
},*/
/* {
title: 'شماره موبایل',
dataIndex: 'mobile',
key: 'mobile',
type: 'Number'
},*/
/* {
title: 'نام فروشگاه',
dataIndex: 'shop_name',
key: 'shop_name',
type: 'Text'
},*/
{
title: 'تاریخ تراکنش',
dataIndex: 'created_at',
key: 'created_at',
type: 'DateTime',
customRender: (record: any) => {
return toJalaliNoTime(record.record.created_at)
}
}
/*{
title: 'نقش',
dataIndex: 'user_type_record',
key: 'user_type_record',
type: 'Select',
filterable: false,
sortable: false,
filterComponentProps: {
multiple: true
},
filterField: 'user_type_obj.id',
filterComponent: ReadyUserTypeSelect,
/!* customRender: (record: any) => {
return record.record.user_type_record?.value
}*!/
customRender: ({ record }) => {
const items = record.is_admin ? (
<CustomTag textColor="#25855A" bgColor="#E3F4E9">
ادمین
</CustomTag>
) : (
record.user_type_obj.map((item: { title: any }, index: any) => {
if (item) {
return (
<CustomTag textColor="#25855A" bgColor="#E3F4E9">
{item?.title}
</CustomTag>
)
}
})
)
return <div class="flex justify-center items-center gap-2">{items}</div>
}
},
{
title: 'حوزه',
dataIndex: 'section',
key: 'section'
},
{
title: 'شماره موبایل',
dataIndex: 'mobile',
type: 'Number',
key: 'mobile'
},*/
/* {
title: 'عملیات',
dataIndex: 'action',
key: 'action',
slot: 'action',
fixed: 'right',
filterable: false
}*/
]