|
|
|
@ -4,7 +4,7 @@ import { App, Button, Divider, Popconfirm, Select } from 'antd';
|
|
|
|
|
import { ReloadOutlined } from '@ant-design/icons';
|
|
|
|
|
import { useProductsAuditStatesMapVal } from '@/hooks/useProductsSets';
|
|
|
|
|
import { useTranslation } from 'react-i18next';
|
|
|
|
|
import useProductsStore, { postProductsQuoteAuditAction, postAgencyAuditAction } from '@/stores/Products/Index';
|
|
|
|
|
import useProductsStore, { postAgencyProductsAuditAction, postAgencyAuditAction } from '@/stores/Products/Index';
|
|
|
|
|
import { isEmpty, objectMapper } from '@/utils/commons';
|
|
|
|
|
import useAuthStore from '@/stores/Auth';
|
|
|
|
|
import RequireAuth from '@/components/RequireAuth';
|
|
|
|
@ -74,8 +74,8 @@ const Header = ({ refresh, ...props }) => {
|
|
|
|
|
setParam((pre) => ({ ...pre, ...{ pick_agency: value } }));
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const handleAuditItem = (state, row) => {
|
|
|
|
|
postProductsQuoteAuditAction(state, { id: row.id, travel_agency_id: activeAgency.travel_agency_id })
|
|
|
|
|
const handleAuditAgency = (state) => {
|
|
|
|
|
postAgencyProductsAuditAction(state, { travel_agency_id: activeAgency.travel_agency_id, use_year: switchParams.use_year })
|
|
|
|
|
.then((json) => {
|
|
|
|
|
if (json.errcode === 0) {
|
|
|
|
|
message.success(json.errmsg);
|
|
|
|
@ -157,15 +157,15 @@ const Header = ({ refresh, ...props }) => {
|
|
|
|
|
</Link>
|
|
|
|
|
)}
|
|
|
|
|
<RequireAuth subject={PERM_PRODUCTS_OFFER_AUDIT}>
|
|
|
|
|
<Button size='small' type={'primary'} onClick={() => handleAuditItem('2', activeAgency)}>
|
|
|
|
|
<Button size='small' type={'primary'} onClick={() => handleAuditAgency('1')}>
|
|
|
|
|
{t('products:auditStateAction.Published')}
|
|
|
|
|
</Button>
|
|
|
|
|
</RequireAuth>
|
|
|
|
|
{/* <Button size='small' type={'primary'} ghost onClick={() => handleAuditItem('2', agency)}>
|
|
|
|
|
{/* <Button size='small' type={'primary'} ghost onClick={() => handleAuditAgency('2')}>
|
|
|
|
|
{t('products:auditStateAction.Approved')}
|
|
|
|
|
</Button> */}
|
|
|
|
|
<RequireAuth subject={PERM_PRODUCTS_OFFER_AUDIT}>
|
|
|
|
|
<Button size='small' type={'primary'} danger ghost onClick={() => handleAuditItem('3', activeAgency)}>
|
|
|
|
|
<Button size='small' type={'primary'} danger ghost onClick={() => handleAuditAgency('3')}>
|
|
|
|
|
{t('products:auditStateAction.Rejected')}
|
|
|
|
|
</Button>
|
|
|
|
|
</RequireAuth>
|
|
|
|
|