|
|
|
@ -58,7 +58,9 @@ const Header = ({ title, agency, refresh, ...props }) => {
|
|
|
|
|
|
|
|
|
|
const PriceTable = ({ productType, dataSource, refresh }) => {
|
|
|
|
|
const { t } = useTranslation('products');
|
|
|
|
|
const { travel_agency_id, use_year, audit_state } = useParams();
|
|
|
|
|
const [loading, activeAgency] = useProductsStore((state) => [state.loading, state.activeAgency]);
|
|
|
|
|
const [setEditingProduct] = useProductsStore((state) => [state.setEditingProduct]);
|
|
|
|
|
const { message, notification } = App.useApp();
|
|
|
|
|
const stateMapVal = useProductsAuditStatesMapVal();
|
|
|
|
|
|
|
|
|
@ -92,7 +94,10 @@ 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) => text || r.lgc_details?.['2']?.title || r.lgc_details?.['1']?.title || '' },
|
|
|
|
|
{ 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 || '';
|
|
|
|
|
return <Link to={`/products/${travel_agency_id}/${use_year}/${audit_state}/edit`} onClick={() => setEditingProduct(r.info)}>{title}</Link>;
|
|
|
|
|
} },
|
|
|
|
|
...(productType === 'B' ? [{ key: 'km', dataIndex: ['info', 'km'], title: t('KM')}] : []),
|
|
|
|
|
{ key: 'adult', title: t('AgeType.Adult'), render: (_, { adult_cost, currency, unit_id, unit_name }) => `${adult_cost} ${currency} / ${t(`PriceUnit.${unit_id}`)}` },
|
|
|
|
|
{ key: 'child', title: t('AgeType.Child'), render: (_, { child_cost, currency, unit_id, unit_name }) => `${child_cost} ${currency} / ${t(`PriceUnit.${unit_id}`)}` },
|
|
|
|
@ -114,11 +119,12 @@ const PriceTable = ({ productType, dataSource, refresh }) => {
|
|
|
|
|
key: 'state',
|
|
|
|
|
title: t('State'),
|
|
|
|
|
render: (_, r) => {
|
|
|
|
|
return <span className={`text-${stateMapVal[`${r.audit_state_id}`]?.color}`}>{stateMapVal[`${r.audit_state_id}`]?.label}</span>;
|
|
|
|
|
const stateCls = `text-${stateMapVal[`${r.audit_state_id}`]?.color} `;
|
|
|
|
|
return <span className={stateCls}>{stateMapVal[`${r.audit_state_id}`]?.label}</span>;
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '价格审核',
|
|
|
|
|
title: '',
|
|
|
|
|
key: 'action',
|
|
|
|
|
render: (_, r) =>
|
|
|
|
|
r.audit_state_id <= 0 ? (
|
|
|
|
|