diff --git a/src/stores/Products/Index.js b/src/stores/Products/Index.js index add4d20..33e128a 100644 --- a/src/stores/Products/Index.js +++ b/src/stores/Products/Index.js @@ -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; +}; + /** * 供应商提交审核 */ diff --git a/src/views/products/Detail/Header.jsx b/src/views/products/Detail/Header.jsx index debeba0..42d7f27 100644 --- a/src/views/products/Detail/Header.jsx +++ b/src/views/products/Detail/Header.jsx @@ -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 }) => { )} - - {/* */} -