import type { BaseTableColumn } from '@core/type/baseTable' import { toJalali, toJalaliNoTime, toTime } from '@core/utils/useDataTime' import CustomTag from '@/components/CustomTag.vue' import WithdrawStatus from "@/pages/menuPages/withdraw/components/WithdrawStatus.vue"; import { formatWithdrawAmountDisplay, isMoneyWithdraw, withdrawAmountColorClass, withdrawTypeLabel } from '@/pages/menuPages/withdraw/utils/withdrawDisplay' /*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 WITHDRAW_NOTE_OPTIONS = [ { label: 'برداشت ریالی', value: 'برداشت ریالی' }, { label: 'کارت هدیه', value: 'کارت هدیه' }, { label: 'واریز آنلاین', value: 'واریز آنلاین' }, { label: 'واریز ریالی', value: 'واریز ریالی' }, { label: 'واریز درگاه', value: 'واریز درگاه' }, { label: 'واریز نقدی (فیش بانکی)', value: 'واریز نقدی (فیش بانکی)' }, { label: 'واریز نقدی', value: 'واریز نقدی' }, { label: 'شارژ حساب (فیش بانکی)', value: 'شارژ حساب (فیش بانکی)' }, { label: 'درخواست واریز نقدی (فیش بانکی)', value: 'درخواست واریز نقدی (فیش بانکی)' }, { label: 'شارژ کیف پول', value: 'شارژ کیف پول' }, { label: 'کسر از کیف پول', value: 'کسر از کیف پول' }, { label: 'برداشت فیزیکی', value: 'برداشت فیزیکی' }, { label: 'خرید اقساطی', value: 'خرید اقساطی' }, { label: 'پاداش بابت ثبت نام', value: 'پاداش بابت ثبت نام' }, { label: 'پاداش اولین سفارش', value: 'پاداش اولین سفارش' }, { label: 'پاداش اولین سفارش زیرمجموعه', value: 'پاداش اولین سفارش زیرمجموعه' }, { label: 'پاداش خرید اول زیرمجموعه', value: 'پاداش خرید اول زیرمجموعه' }, { label: 'کارمزد ثبت سفارش شرطی', value: 'کارمزد ثبت سفارش شرطی' }, { label: 'انتقال به کیف اصلی', value: 'انتقال به کیف اصلی' }, { label: 'انتقال از کیف محصول', value: 'انتقال از کیف محصول' } ] export function getWithdrawColumns(): BaseTableColumn[] { return [ { title: 'ردیف', dataIndex: 'id', key: 'id', filterable: false, sortable: false, customRender: (record: any) => { return record.index + 1 } }, { title: 'علت تراکنش', dataIndex: 'note', key: 'note', type: 'Select', filterComponentProps: { placeholder: 'انتخاب علت تراکنش', allowClear: true, showSearch: true, options: WITHDRAW_NOTE_OPTIONS, filterOption: (input: string, option: any) => (option?.label ?? '').toLowerCase().includes(input.toLowerCase()) } }, { title: 'شماره پیگیری', dataIndex: 'tracked_number', key: 'tracked_number', type: 'Number', slot: 'tracked', customRender: (record: any) => record.record.tracked_number ?? '__' // className: 'column-money' }, { title: 'کد سفارش', dataIndex: 'id', key: 'id', type: 'Number' // className: 'column-money' }, { title: 'کد کاربر', dataIndex: 'customer_id', key: 'customer_id', type: 'Number' }, { title: 'نام و نام خانوادگی', dataIndex: 'customer.name', key: 'customer.name', type: 'Text' }, { title: 'شناسه واریز', dataIndex: 'deposit_identifier', key: 'deposit_identifier', type: 'Text', customRender: ({ record }: any) => { const val = record?.deposit_identifier || record?.customer?.n_code return val ? {val} : '-' } }, { title: 'فیش واریزی', dataIndex: 'receipt_url', key: 'receipt_url', slot: 'receipt', filterable: false, sortable: false }, { title: 'نوع', dataIndex: 'asset_type', key: 'asset_type', filterable: false, sortable: false, customRender: ({ record }) => { const label = withdrawTypeLabel(record) if (label === '-') { return