perf: 产品审核: 价格历史: 地接查看 权限

main
Lei OT 2 months ago
parent aea6b4ee55
commit a8fb0bbded

@ -109,21 +109,23 @@ const PriceTable = ({ productType, dataSource, refresh }) => {
key: 'action', key: 'action',
render: (_, r, ri) => render: (_, r, ri) =>
[-1, 0, 3].includes(Number(r.audit_state_id)) ? ( [-1, 0, 3].includes(Number(r.audit_state_id)) ? (
<RequireAuth subject={PERM_PRODUCTS_OFFER_AUDIT}> <>
<Space className='w-full [&>*:last-child]:ms-auto'> <Space className='w-full [&>*:last-child]:ms-auto'>
{Number(r.audit_state_id) === 0 && ( <RequireAuth subject={PERM_PRODUCTS_OFFER_AUDIT}>
<> {Number(r.audit_state_id) === 0 && (
<Button onClick={() => handleAuditPriceItem('2', r, ri)}></Button> <div className='flex gap-2'>
<Button onClick={() => handleAuditPriceItem('3', r, ri)}></Button> <Button onClick={() => handleAuditPriceItem('2', r, ri)}></Button>
</> <Button onClick={() => handleAuditPriceItem('3', r, ri)}></Button>
)} </div>
)}
</RequireAuth>
<ProductQuotationLogPopover <ProductQuotationLogPopover
method={'history'} method={'history'}
{...{ travel_agency_id, product_id: r.info.id, price_id: r.id, use_year }} {...{ travel_agency_id, product_id: r.info.id, price_id: r.id, use_year }}
onOpenChange={(open) => setLogOpenPriceRow(open ? r.id : null)} onOpenChange={(open) => setLogOpenPriceRow(open ? r.id : null)}
/> />
</Space> </Space>
</RequireAuth> </>
) : null, ) : null,
}, },
// { // {
@ -183,11 +185,11 @@ const TypesPanels = (props) => {
r.concat( r.concat(
c.quotation.map((q, i) => ({ c.quotation.map((q, i) => ({
...q, ...q,
weekdays: q.weekdays // weekdays: q.weekdays
.split(',') // .split(',')
.filter(Boolean) // .filter(Boolean)
.map((w) => t(`weekdaysShort.${w}`)) // .map((w) => t(`weekdaysShort.${w}`))
.join(', '), // .join(', '),
info: c.info, info: c.info,
lgc_details: c.lgc_details.reduce((rlgc, clgc) => ({...rlgc, [clgc.lgc]: clgc}), {}), lgc_details: c.lgc_details.reduce((rlgc, clgc) => ({...rlgc, [clgc.lgc]: clgc}), {}),
rowSpan: i === 0 ? c.quotation.length : 0, rowSpan: i === 0 ? c.quotation.length : 0,

@ -141,10 +141,15 @@ export const columnsSets = (t, colorize = true) => [
: ''; : '';
const preValue = ifCompare && ifData ? <div className='text-muted line-through '>{_weekdays}</div> : null; const preValue = ifCompare && ifData ? <div className='text-muted line-through '>{_weekdays}</div> : null;
const editCls = ifCompare && ifData ? 'text-danger' : ''; const editCls = ifCompare && ifData ? 'text-danger' : '';
const weekdaysTxt = weekdays
.split(',')
.filter(Boolean)
.map((w) => t(`common:weekdaysShort.${w}`))
.join(', ');
return ( return (
<div> <div>
{preValue} {preValue}
<span className={editCls}>{text || t('Unlimited')}</span> <span className={editCls}>{weekdaysTxt || t('Unlimited')}</span>
</div> </div>
); );
}, },

Loading…
Cancel
Save