diff --git a/src/views/products/Audit.jsx b/src/views/products/Audit.jsx
index 0aa9f85..15988f2 100644
--- a/src/views/products/Audit.jsx
+++ b/src/views/products/Audit.jsx
@@ -102,7 +102,7 @@ const PriceTable = ({ productType, dataSource, refresh }) => {
onCell: (r, index) => ({ rowSpan: r.rowSpan, }),
render: (_, r) => {
const showPublicBtn = null; // r.pendingQuotation ? : null;
- const btn2 = r.pendingQuotation ? (
+ const btn2 = r.showPublicBtn ? (
{
lgc_details: c.lgc_details.reduce((rlgc, clgc) => ({...rlgc, [clgc.lgc]: clgc}), {}),
rowSpan: i === 0 ? c.quotation.length : 0,
rowSpanI: [ri, i],
- pendingQuotation: c.quotation.findIndex(q2 => q2.audit_state_id===0) !== -1 ,
+ showPublicBtn: c.quotation.some(q2 => [0, 3].includes(q2.audit_state_id)),
}))
),
[]
diff --git a/src/views/products/Detail/ProductQuotationLogPopover.jsx b/src/views/products/Detail/ProductQuotationLogPopover.jsx
index 8e24801..c1ed6be 100644
--- a/src/views/products/Detail/ProductQuotationLogPopover.jsx
+++ b/src/views/products/Detail/ProductQuotationLogPopover.jsx
@@ -147,14 +147,16 @@ const useLogMethod = (method) => {
const { t } = useTranslation('products');
const methodMap = {
'history': {
- title: t('versionHistory'),
+ title: '📑' + t('versionHistory'),
+ btnText: t('versionHistory'),
fetchData: async (params) => {
const data = await getPPLogAction(params);
return data;
},
},
'published': {
- title: t('versionPublished'),
+ title: '✅' + t('versionPublished'),
+ btnText: t('versionPublished'),
fetchData: async (params) => {
const { travel_agency_id, product_id, price_id, use_year } = params;
const data = await getPPRunningAction({ travel_agency_id, product_id_list: product_id, use_year });
@@ -189,13 +191,17 @@ const ProductQuotationLogPopover = ({ method, triggerProps = {}, onOpenChange, .
const [open, setOpen] = useState(false);
const [logData, setLogData] = useState([]);
- const { title, fetchData } = useLogMethod(method);
+ const { title, btnText: methodBtnText, fetchData } = useLogMethod(method);
const tablePagination = useMemo(() => method === 'history' ? { pageSize: 5, position: ['bottomLeft']} : { pageSize: 10, position: ['bottomLeft']}, [method]);
+
+ const [loading, setLoading] = useState(false);
const getData = async () => {
+ setLoading(true);
const data = await fetchData({ travel_agency_id, product_id, price_id, use_year });
setLogData(data);
invokeOpenChange(true);
+ setLoading(false);
};
const invokeOpenChange = (_open) => {
@@ -226,7 +232,7 @@ const ProductQuotationLogPopover = ({ method, triggerProps = {}, onOpenChange, .
}
content={
<>
-
+
>
}
trigger={['click']}
@@ -236,7 +242,7 @@ const ProductQuotationLogPopover = ({ method, triggerProps = {}, onOpenChange, .
invokeOpenChange(v);
}}>
);