diff --git a/src/views/products/Audit.jsx b/src/views/products/Audit.jsx
index 69f4722..9a7333a 100644
--- a/src/views/products/Audit.jsx
+++ b/src/views/products/Audit.jsx
@@ -6,7 +6,10 @@ import SecondHeaderWrapper from '@/components/SecondHeaderWrapper';
import { useTranslation } from 'react-i18next';
import useProductsStore, { postProductsQuoteAuditAction, } from '@/stores/Products/Index';
import { isEmpty } from '@/utils/commons';
+import useAuthStore from '@/stores/Auth';
+import RequireAuth from '@/components/RequireAuth';
// import PrintContractPDF from './PrintContractPDF';
+import { PERM_PRODUCTS_OFFER_AUDIT, PERM_PRODUCTS_OFFER_PUT } from '@/config';
const Header = ({ title, agency, refresh, ...props }) => {
const { travel_agency_id, use_year, audit_state } = useParams();
@@ -35,20 +38,32 @@ const Header = ({ title, agency, refresh, ...props }) => {
return (
-
{title}{(use_year || '').replace('all', '')}
+
+ {title}
+
+ {(use_year || '').replace('all', '')}
+
{/*
*/}
{/*
*/}
-
{t('Edit')}
-
+
+
+ {t('Edit')}
+
+
+
+
+
{/*
*/}
-
+
+
+
{/* todo: export, 审核完成之后才能导出 */}
{/*
*/}
@@ -59,6 +74,7 @@ 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 isPermitted = useAuthStore(state => state.isPermitted);
const [loading, activeAgency] = useProductsStore((state) => [state.loading, state.activeAgency]);
const [setEditingProduct] = useProductsStore((state) => [state.setEditingProduct]);
const { message, notification } = App.useApp();
@@ -96,7 +112,7 @@ 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 || '';
- return
setEditingProduct(r.info)}>{title};
+ return isPermitted(PERM_PRODUCTS_OFFER_PUT) ?
setEditingProduct(r.info)}>{title} : title;
} },
// ...(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}`)}` },
@@ -119,7 +135,7 @@ const PriceTable = ({ productType, dataSource, refresh }) => {
key: 'state',
title: t('State'),
render: (_, r) => {
- const stateCls = `text-${stateMapVal[`${r.audit_state_id}`]?.color} `;
+ const stateCls = ` text-${stateMapVal[`${r.audit_state_id}`]?.color} `;
return
{stateMapVal[`${r.audit_state_id}`]?.label};
},
},
@@ -128,10 +144,12 @@ const PriceTable = ({ productType, dataSource, refresh }) => {
key: 'action',
render: (_, r) =>
r.audit_state_id <= 0 ? (
-
-
-
-
+
+
+
+
+
+
) : null,
},
];