diff --git a/src/hooks/useProductsSets.js b/src/hooks/useProductsSets.js index 6f7fbe5..8c3ea2b 100644 --- a/src/hooks/useProductsSets.js +++ b/src/hooks/useProductsSets.js @@ -52,7 +52,7 @@ export const useProductsTypes = (showAll = false) => { { label: t('products:type.UltraService'), value: 'B', key: 'B' }, { label: t('products:type.Car'), value: 'J', key: 'J' }, { label: t('products:type.Guide'), value: 'Q', key: 'Q' }, - { label: t('products:type.Attractions'), value: '7', key: '7' }, + { label: t('products:type.Attractions'), value: '7', key: '7' }, // landscape { label: t('products:type.Meals'), value: 'R', key: 'R' }, { label: t('products:type.Extras'), value: '8', key: '8' }, { label: t('products:type.Package'), value: 'D', key: 'D' }, diff --git a/src/views/products/Manage.jsx b/src/views/products/Manage.jsx index 1aa105c..69dbe57 100644 --- a/src/views/products/Manage.jsx +++ b/src/views/products/Manage.jsx @@ -6,6 +6,7 @@ import dayjs from 'dayjs'; import arraySupport from 'dayjs/plugin/arraySupport'; import { useTranslation } from 'react-i18next'; import useProductsStore, { copyAgencyDataAction } from '@/stores/Products/Index'; +import { useProductsTypes, useProductsAuditStatesMapVal } from '@/hooks/useProductsSets'; import useFormStore from '@/stores/Form'; import { objectMapper } from '@/utils/commons'; import CopyProductsFormModal from './Detail/CopyProducts'; @@ -20,6 +21,8 @@ function Index() { const [searchValues, setSearchValues] = useProductsStore((state) => [state.searchValues, state.setSearchValues]); const formValuesToSub = useFormStore(state => state.formValuesToSub); + const stateMapVal = useProductsAuditStatesMapVal(); + const useYear = formValuesToSub.year; const handleSearchAgency = (formVal = undefined) => { @@ -60,7 +63,12 @@ function Index() { { title: t('products:Vendor'), key: 'vendor', dataIndex: 'travel_agency_name' }, { title: t('products:CreatedBy'), key: 'poster_by', dataIndex: 'poster_name' }, { title: t('products:CreateDate'), key: 'poster_date', dataIndex: 'poster_date' }, - { title: t('products:AuState'), key: 'audit_state', dataIndex: 'audit_state' }, + { title: t('products:AuState'), key: 'audit_state', dataIndex: 'audit_state', + render: (_, r) => { + + const stateCls = ` text-${stateMapVal[`${r.audit_state_id}`]?.color} `; + return {stateMapVal[`${r.audit_state_id}`]?.label}; + }, }, { title: t('products:AuditedBy'), key: 'audited_by', dataIndex: 'audited_by_name' }, { title: t('products:AuditDate'), key: 'audit_date', dataIndex: 'audit_date' }, {