fix: 产品管理: 头部, 审核发布/拒绝

perf/export-docx
Lei OT 11 months ago
parent 6e9faa39f1
commit be31765e44

@ -82,6 +82,20 @@ export const postProductsQuoteAuditAction = async (auditState, quoteRow) => {
// return errcode !== 0 ? {} : result;
};
export const postAgencyProductsAuditAction = async (auditState, agency) => {
const postbody = {
audit_state: auditState,
travel_agency_id: agency.travel_agency_id,
use_year: agency.use_year,
};
const formData = new FormData();
Object.keys(postbody).forEach((key) => {
formData.append(key, postbody[key]);
});
const json = await postForm(`${HT_HOST}/Service_BaseInfoWeb/agency_products_audit`, formData);
return json;
};
/**
* 供应商提交审核
*/

@ -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>

Loading…
Cancel
Save