|
|
|
@ -68,11 +68,33 @@ const PriceTable = ({ productType, dataSource, refresh }) => {
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const columns = [
|
|
|
|
|
{ key: 'title', dataIndex: ['info', 'title'], width: '16rem', title: t('Title'), onCell: (r, index) => ({ rowSpan: r.rowSpan, }), className: 'bg-white', render: (text, r) => {
|
|
|
|
|
const title = text || r.lgc_details?.['2']?.title || r.lgc_details?.['1']?.title || '';
|
|
|
|
|
const itemLink = isPermitted(PERM_PRODUCTS_OFFER_AUDIT) ? `/products/${travel_agency_id}/${use_year}/${audit_state}/edit` : isPermitted(PERM_PRODUCTS_OFFER_PUT) ? `/products/edit` : '';
|
|
|
|
|
return <div className=''>{isNotEmpty(itemLink) ? <div className='' onClick={() => setEditingProduct({info: r.info})}><Link to={itemLink} >{title}</Link></div> : title}</div> ;
|
|
|
|
|
} },
|
|
|
|
|
{
|
|
|
|
|
key: 'title',
|
|
|
|
|
dataIndex: ['info', 'title'],
|
|
|
|
|
width: '16rem',
|
|
|
|
|
title: t('Title'),
|
|
|
|
|
onCell: (r, index) => ({ rowSpan: r.rowSpan }),
|
|
|
|
|
className: 'bg-white',
|
|
|
|
|
render: (text, r) => {
|
|
|
|
|
const title = text || r.lgc_details?.['2']?.title || r.lgc_details?.['1']?.title || '';
|
|
|
|
|
const itemLink = isPermitted(PERM_PRODUCTS_OFFER_AUDIT)
|
|
|
|
|
? `/products/${travel_agency_id}/${use_year}/${audit_state}/edit`
|
|
|
|
|
: isPermitted(PERM_PRODUCTS_OFFER_PUT)
|
|
|
|
|
? `/products/edit`
|
|
|
|
|
: '';
|
|
|
|
|
return (
|
|
|
|
|
<div className=''>
|
|
|
|
|
{isNotEmpty(itemLink) ? (
|
|
|
|
|
<div className='' onClick={() => setEditingProduct({ info: r.info })}>
|
|
|
|
|
<Link to={itemLink}>{title}</Link>
|
|
|
|
|
</div>
|
|
|
|
|
) : (
|
|
|
|
|
title
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
...columnsSets(t),
|
|
|
|
|
{
|
|
|
|
|
key: 'state',
|
|
|
|
@ -86,20 +108,30 @@ const PriceTable = ({ productType, dataSource, refresh }) => {
|
|
|
|
|
title: '',
|
|
|
|
|
key: 'action',
|
|
|
|
|
render: (_, r, ri) =>
|
|
|
|
|
(Number(r.audit_state_id)) === 0 ? (
|
|
|
|
|
[0, 3].includes(Number(r.audit_state_id)) ? (
|
|
|
|
|
<RequireAuth subject={PERM_PRODUCTS_OFFER_AUDIT}>
|
|
|
|
|
<Space className='w-full [&>*:last-child]:ms-auto' >
|
|
|
|
|
<Button onClick={() => handleAuditPriceItem('2', r, ri)}>✔</Button>
|
|
|
|
|
<Button onClick={() => handleAuditPriceItem('3', r, ri)}>✖</Button>
|
|
|
|
|
<ProductQuotationLogPopover method={'history'} {...{ travel_agency_id, product_id: r.info.id, price_id: r.id, use_year }} onOpenChange={open => setLogOpenPriceRow(open ? r.id : null)} />
|
|
|
|
|
<Space className='w-full [&>*:last-child]:ms-auto'>
|
|
|
|
|
{Number(r.audit_state_id) === 0 && (
|
|
|
|
|
<>
|
|
|
|
|
<Button onClick={() => handleAuditPriceItem('2', r, ri)}>✔</Button>
|
|
|
|
|
<Button onClick={() => handleAuditPriceItem('3', r, ri)}>✖</Button>
|
|
|
|
|
</>
|
|
|
|
|
)}
|
|
|
|
|
<ProductQuotationLogPopover
|
|
|
|
|
method={'history'}
|
|
|
|
|
{...{ travel_agency_id, product_id: r.info.id, price_id: r.id, use_year }}
|
|
|
|
|
onOpenChange={(open) => setLogOpenPriceRow(open ? r.id : null)}
|
|
|
|
|
/>
|
|
|
|
|
</Space>
|
|
|
|
|
</RequireAuth>
|
|
|
|
|
) : null,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '',
|
|
|
|
|
key: 'action2', width: '6rem', className: 'bg-white',
|
|
|
|
|
onCell: (r, index) => ({ rowSpan: r.rowSpan, }),
|
|
|
|
|
key: 'action2',
|
|
|
|
|
width: '6rem',
|
|
|
|
|
className: 'bg-white',
|
|
|
|
|
onCell: (r, index) => ({ rowSpan: r.rowSpan }),
|
|
|
|
|
render: (_, r) => {
|
|
|
|
|
const showPublicBtn = null; // r.pendingQuotation ? <Popover title='查看已发布的价格' trigger={['click']}> <Button size='small' className='ml-2' onClick={() => { }}>✈</Button></Popover> : null;
|
|
|
|
|
const btn2 = r.showPublicBtn ? (
|
|
|
|
@ -113,7 +145,7 @@ const PriceTable = ({ productType, dataSource, refresh }) => {
|
|
|
|
|
) : null;
|
|
|
|
|
return <div className='absolute bottom-2 right-1'>{btn2}</div>;
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
return (
|
|
|
|
|
<Table
|
|
|
|
|