From be31765e447622795d9c9263f712612de4cab712 Mon Sep 17 00:00:00 2001 From: Lei OT Date: Thu, 15 Aug 2024 14:01:53 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BA=A7=E5=93=81=E7=AE=A1=E7=90=86:=20?= =?UTF-8?q?=E5=A4=B4=E9=83=A8,=20=E5=AE=A1=E6=A0=B8=E5=8F=91=E5=B8=83/?= =?UTF-8?q?=E6=8B=92=E7=BB=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/stores/Products/Index.js | 14 ++++++++++++++ src/views/products/Detail/Header.jsx | 12 ++++++------ 2 files changed, 20 insertions(+), 6 deletions(-) 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 }) => { )} - - {/* */} -