diff --git a/packages/app-client/src/components/purchase/section/MarketPriceSection.tsx b/packages/app-client/src/components/purchase/section/MarketPriceSection.tsx index a8b5098..2308109 100644 --- a/packages/app-client/src/components/purchase/section/MarketPriceSection.tsx +++ b/packages/app-client/src/components/purchase/section/MarketPriceSection.tsx @@ -1,4 +1,3 @@ -import { useEffect, useState } from "react"; import { Text, View } from "@tarojs/components"; import { Radio } from "@nutui/nutui-react-taro"; import { OrderCalculator } from "@/utils"; @@ -13,15 +12,6 @@ export default function MarketPriceSection(props: { }) { const { orderVO, onChange, readOnly, calculator } = props; - const [pricingMethod, setPricingMethod] = - useState(); - - useEffect(() => { - if (orderVO.pricingMethod) { - setPricingMethod(orderVO.pricingMethod); - } - }, [orderVO.pricingMethod]); - // 销售金额 const saleAmount = calculator.getSalesAmount(); @@ -42,9 +32,9 @@ export default function MarketPriceSection(props: { {readOnly ? ( - {pricingMethod === "BY_GROSS_WEIGHT" + {orderVO.pricingMethod === "BY_GROSS_WEIGHT" ? "按毛重报价" - : pricingMethod === "BY_NET_WEIGHT" + : orderVO.pricingMethod === "BY_NET_WEIGHT" ? "按净重报价" : "未选择"} @@ -52,11 +42,13 @@ export default function MarketPriceSection(props: { - setPricingMethod( - value as BusinessAPI.OrderVO["pricingMethod"], - ) + onChange?.({ + ...orderVO, + pricingMethod: + value as BusinessAPI.OrderVO["pricingMethod"], + }) } > 按毛重报价 @@ -189,7 +181,7 @@ export default function MarketPriceSection(props: { 销售金额 - {pricingMethod + {orderVO.pricingMethod ? `${calculator.calculateSupplierAmount(supplier)} 元` : "-"} @@ -206,7 +198,7 @@ export default function MarketPriceSection(props: { 销售金额 - {pricingMethod ? `${saleAmount} 元` : "-"} + {orderVO.pricingMethod ? `${saleAmount} 元` : "-"} @@ -215,7 +207,7 @@ export default function MarketPriceSection(props: { 平均单价 - {pricingMethod ? `${averagePurchasePrice} 元/斤` : "-"} + {orderVO.pricingMethod ? `${averagePurchasePrice} 元/斤` : "-"} @@ -228,7 +220,7 @@ export default function MarketPriceSection(props: { ) - {pricingMethod ? `${marketPrice} 元` : "-"} + {orderVO.pricingMethod ? `${marketPrice} 元` : "-"} diff --git a/packages/app-client/src/components/purchase/section/TaxProvisionSection.tsx b/packages/app-client/src/components/purchase/section/TaxProvisionSection.tsx index 6955f1d..8f78751 100644 --- a/packages/app-client/src/components/purchase/section/TaxProvisionSection.tsx +++ b/packages/app-client/src/components/purchase/section/TaxProvisionSection.tsx @@ -11,7 +11,6 @@ export default function TaxProvisionSection(props: { const { orderVO, onChange, calculator, readOnly } = props; const orderDealer = orderVO.orderDealer; - console.log("orderDealer.taxProvision", orderDealer.taxProvision); return ( {/* 卡片形式展示计提税金信息 */} diff --git a/packages/app-client/src/components/purchase/section/TaxSubsidySection.tsx b/packages/app-client/src/components/purchase/section/TaxSubsidySection.tsx index 01cfb9b..54336f6 100644 --- a/packages/app-client/src/components/purchase/section/TaxSubsidySection.tsx +++ b/packages/app-client/src/components/purchase/section/TaxSubsidySection.tsx @@ -11,7 +11,6 @@ export default function TaxSubsidySection(props: { const { orderVO, onChange, calculator, readOnly } = props; const orderDealer = orderVO.orderDealer; - console.log("orderDealer.taxSubsidy", orderDealer.taxSubsidy); return ( {/* 卡片形式展示返点信息 */}