|
|
|
@ -10,6 +10,8 @@ import { useProductsTypes, useProductsAuditStatesMapVal } from '@/hooks/useProdu
|
|
|
|
|
import useFormStore from '@/stores/Form';
|
|
|
|
|
import { objectMapper } from '@/utils/commons';
|
|
|
|
|
import CopyProductsFormModal from './Detail/CopyProducts';
|
|
|
|
|
import useAuthStore from '@/stores/Auth';
|
|
|
|
|
import RequireAuth from '@/components/RequireAuth';
|
|
|
|
|
|
|
|
|
|
dayjs.extend(arraySupport);
|
|
|
|
|
|
|
|
|
@ -63,11 +65,15 @@ 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 <span className={stateCls}>{stateMapVal[`${r.audit_state_id}`]?.label}</span>;
|
|
|
|
|
}, },
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{ title: t('products:AuditedBy'), key: 'audited_by', dataIndex: 'audited_by_name' },
|
|
|
|
|
{ title: t('products:AuditDate'), key: 'audit_date', dataIndex: 'audit_date' },
|
|
|
|
|
{
|
|
|
|
@ -76,9 +82,15 @@ function Index() {
|
|
|
|
|
render: (_, r) => (
|
|
|
|
|
<Space size={'large'}>
|
|
|
|
|
<Link to={`/products/${r.travel_agency_id}/${searchValues.use_year || 'all'}/${searchValues.audit_state || 'all'}/edit`}>{t('Edit')}</Link>
|
|
|
|
|
{r.audit_state_id >= 0 ? (
|
|
|
|
|
<Link to={`/products/${r.travel_agency_id}/${searchValues.use_year || 'all'}/${searchValues.audit_state || 'all'}/audit`}>{t('Audit')}</Link>
|
|
|
|
|
<Button type='link' size={'small'} onClick={() => openCopyModal(r, '#')}>{t('Copy')+'-'+t('products:#')}</Button>
|
|
|
|
|
<Button type='link' size={'small'} onClick={() => openCopyModal(r, 'o')}>{t('Copy')+'-'+t('products:Offer')}</Button>
|
|
|
|
|
) : (
|
|
|
|
|
<span className='text-muted'>{t('Audit')}</span>
|
|
|
|
|
)}
|
|
|
|
|
<Button type='link' size={'small'} onClick={() => openCopyModal(r, '#')}>
|
|
|
|
|
{t('Copy') + '-' + t('products:#')}
|
|
|
|
|
</Button>
|
|
|
|
|
{/* <Button type='link' size={'small'} onClick={() => openCopyModal(r, 'o')}>{t('Copy')+'-'+t('products:Offer')}</Button> */}
|
|
|
|
|
</Space>
|
|
|
|
|
),
|
|
|
|
|
},
|
|
|
|
@ -109,6 +121,7 @@ function Index() {
|
|
|
|
|
|
|
|
|
|
{/* 复制弹窗 */}
|
|
|
|
|
<CopyProductsFormModal
|
|
|
|
|
initialValues={{agency: {label: sourceAgency.travel_agency_name, value: sourceAgency.travel_agency_id}}}
|
|
|
|
|
open={copyModalVisible}
|
|
|
|
|
action={copyAction}
|
|
|
|
|
source={{ sourceAgency, sourceYear: useYear }}
|
|
|
|
|