From 1e75aadbf9db0cd67b8693e53de27a9e5cf14210 Mon Sep 17 00:00:00 2001 From: shenyifei Date: Wed, 19 Nov 2025 22:08:52 +0800 Subject: [PATCH] =?UTF-8?q?style(purchase):=20=E8=B0=83=E6=95=B4=E9=87=87?= =?UTF-8?q?=E8=B4=AD=E6=A8=A1=E5=9D=97UI=E6=A0=B7=E5=BC=8F=E5=92=8C?= =?UTF-8?q?=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../purchase/section/BasicInfoSection.tsx | 37 ++- .../purchase/section/CompanyInfoSection.tsx | 37 +-- .../purchase/section/DealerInfoSection.tsx | 59 +--- .../purchase/section/MarketPriceSection.tsx | 305 +++++++++--------- .../purchase/section/PackagingCostSection.tsx | 2 +- .../src/pages/purchase/reviewer/audit.tsx | 15 +- 6 files changed, 203 insertions(+), 252 deletions(-) diff --git a/packages/app-client/src/components/purchase/section/BasicInfoSection.tsx b/packages/app-client/src/components/purchase/section/BasicInfoSection.tsx index 382e493..bed5688 100644 --- a/packages/app-client/src/components/purchase/section/BasicInfoSection.tsx +++ b/packages/app-client/src/components/purchase/section/BasicInfoSection.tsx @@ -464,7 +464,7 @@ export default function BasicInfoSection(props: { - + {/* 本车次号 */} @@ -475,7 +475,10 @@ export default function BasicInfoSection(props: { 参考上一车:{displayReferenceVehicleNo()} - {readOnly ? ( + + + {readOnly ? ( + - ) : ( + + ) : ( + @@ -499,8 +504,8 @@ export default function BasicInfoSection(props: { onChange={(value) => updateVehicleNo(value)} /> - )} - + + )} {/* 运费信息 */} @@ -587,18 +592,16 @@ export default function BasicInfoSection(props: { {!readOnly && ( - - - + )} diff --git a/packages/app-client/src/components/purchase/section/CompanyInfoSection.tsx b/packages/app-client/src/components/purchase/section/CompanyInfoSection.tsx index 737388d..f4e88ed 100644 --- a/packages/app-client/src/components/purchase/section/CompanyInfoSection.tsx +++ b/packages/app-client/src/components/purchase/section/CompanyInfoSection.tsx @@ -49,35 +49,16 @@ export default function CompanyInfoSection(props: { onChange?.(newPurchaseOrderVO); }; - const handleRemoveCompany = () => { - if (readOnly) return; - - setOrderCompany(undefined); - // 构造新的 purchaseOrderVO 对象,其中 orderCompany 为 null - const newPurchaseOrderVO = { - ...purchaseOrderVO, - orderCompany: undefined, - }; - // 通知父组件 purchaseOrderVO 已更改 - // @ts-ignore - onChange?.(newPurchaseOrderVO); - }; - return ( - - {!readOnly && orderCompany && ( - - - - )} - - - 公司名称 - - {orderCompany?.fullName || "请先选择销售方"} + + + + + 公司名称 + + + {orderCompany?.fullName || "请先选择销售方"} + diff --git a/packages/app-client/src/components/purchase/section/DealerInfoSection.tsx b/packages/app-client/src/components/purchase/section/DealerInfoSection.tsx index 66f0c18..6c72d73 100644 --- a/packages/app-client/src/components/purchase/section/DealerInfoSection.tsx +++ b/packages/app-client/src/components/purchase/section/DealerInfoSection.tsx @@ -46,54 +46,27 @@ export default function (props: { setDealerNameOnly(undefined); }; - // 清除经销商选择 - const clearDealerSelection = () => { - if (readOnly) return; - - setOrderDealer(undefined); - onChange?.({ - ...purchaseOrderVO, - orderVehicle: { - ...purchaseOrderVO.orderVehicle, - //@ts-ignore - dealerName: undefined, - }, - //@ts-ignore - orderDealer: undefined, - }); - }; - return ( - - {!readOnly && orderDealer && ( - { - e.stopPropagation(); - clearDealerSelection(); - }} - > - + + + + + 经销商名称 + + + {orderDealer?.shortName || "请先选择经销商"} + - )} - - - 经销商名称 - - - {orderDealer?.shortName || "请先选择经销商"} - + {dealerNameOnly && ( + + 检测到当前经销商“{dealerNameOnly}”信息未创建 + • 请前往电脑端创建经销商信息后再选择 + • 或选择系统中已存在的其他经销商 + + )} - {dealerNameOnly && ( - - 检测到当前经销商“{dealerNameOnly}”信息未创建 - • 请前往电脑端创建经销商信息后再选择 - • 或选择系统中已存在的其他经销商 - - )} - {!readOnly && ( { diff --git a/packages/app-client/src/components/purchase/section/MarketPriceSection.tsx b/packages/app-client/src/components/purchase/section/MarketPriceSection.tsx index 05a3941..370e5cb 100644 --- a/packages/app-client/src/components/purchase/section/MarketPriceSection.tsx +++ b/packages/app-client/src/components/purchase/section/MarketPriceSection.tsx @@ -138,160 +138,163 @@ export default function MarketPriceSection(props: { const averagePurchasePrice = calculator.getAverageSalesPrice(); return ( - - - - 报价方式 - - - {readOnly ? ( - - {pricingMethod === "BY_GROSS_WEIGHT" - ? "按毛重报价" - : pricingMethod === "BY_NET_WEIGHT" - ? "按净重报价" - : "未选择"} - - ) : ( - - setPricingMethod( - value as BusinessAPI.PurchaseOrderVO["pricingMethod"], - ) - } - > - 按毛重报价 - 按净重报价 - - )} - - - - {/* 卡片形式展示供应商报价信息 */} - {purchaseOrderVO.orderSupplierList?.map((supplier) => { - // 获取编辑后的价格,如果没有则使用原始价格 - return ( - - - - 瓜农1 ({supplier.name}) - - - - - - {!readOnly ? ( - { - // 设置临时编辑值为当前值 - setTempEditValues((prev) => ({ - ...prev, - [supplier.orderSupplierId || ""]: { - salePrice: supplier.salePrice || 0, - }, - })); - setVisiblePopup((prev) => ({ - ...prev, - [supplier.orderSupplierId || ""]: true, - })); - }} - > - - 销售单价 - 元/斤 - - - - {supplier.salePrice?.toFixed(2) || "0.00"} - - - - ) : ( - - - 销售单价 - 元/斤 - - - - {supplier.salePrice?.toFixed(2) || "0.00"} - - - - )} - - - - - 毛重 - - {(supplier.grossWeight || 0).toFixed(2)} 斤 - - - - 净重 - - {(supplier.netWeight || 0).toFixed(2)} 斤 - - - - 箱重 - - {(supplier.grossWeight - supplier.netWeight).toFixed(2)} 斤 - - - - 采购单价 - - {supplier.purchasePrice.toFixed(2)} 元/斤 - - - - 销售金额 - - {pricingMethod - ? `${calculator.calculateSupplierAmount(supplier)} 元` - : "-"} - - - - + <> + + + + 报价方式 - ); - })} + + {readOnly ? ( + + {pricingMethod === "BY_GROSS_WEIGHT" + ? "按毛重报价" + : pricingMethod === "BY_NET_WEIGHT" + ? "按净重报价" + : "未选择"} + + ) : ( + + setPricingMethod( + value as BusinessAPI.PurchaseOrderVO["pricingMethod"], + ) + } + > + 按毛重报价 + 按净重报价 + + )} + + - - - 销售金额 + {/* 卡片形式展示供应商报价信息 */} + {purchaseOrderVO.orderSupplierList?.map((supplier) => { + // 获取编辑后的价格,如果没有则使用原始价格 + return ( + + + + 瓜农1 ({supplier.name}) + + + + + + {!readOnly ? ( + { + // 设置临时编辑值为当前值 + setTempEditValues((prev) => ({ + ...prev, + [supplier.orderSupplierId || ""]: { + salePrice: supplier.salePrice || 0, + }, + })); + setVisiblePopup((prev) => ({ + ...prev, + [supplier.orderSupplierId || ""]: true, + })); + }} + > + + 销售单价 + 元/斤 + + + + {supplier.salePrice?.toFixed(2) || "0.00"} + + + + ) : ( + + + 销售单价 + 元/斤 + + + + {supplier.salePrice?.toFixed(2) || "0.00"} + + + + )} + + + + + 毛重 + + {(supplier.grossWeight || 0).toFixed(2)} 斤 + + + + 净重 + + {(supplier.netWeight || 0).toFixed(2)} 斤 + + + + 箱重 + + {(supplier.grossWeight - supplier.netWeight).toFixed(2)}{" "} + 斤 + + + + 采购单价 + + {supplier.purchasePrice.toFixed(2)} 元/斤 + + + + 销售金额 + + {pricingMethod + ? `${calculator.calculateSupplierAmount(supplier)} 元` + : "-"} + + + + + + ); + })} + + + + 销售金额 + + + {pricingMethod ? `${saleAmount} 元` : "-"} + - - {pricingMethod ? `${saleAmount} 元` : "-"} + + + 平均单价 + + + {pricingMethod ? `${averagePurchasePrice} 元/斤` : "-"} + - - - - 平均单价 - - - {pricingMethod ? `${averagePurchasePrice} 元/斤` : "-"} - - - - - 市场报价( - {purchaseOrderVO.orderDealer?.includePackingFlag - ? "销售金额 + 包装费" - : "销售金额"} - ) - - - {pricingMethod ? `${totalAmount} 元` : "-"} + + + 市场报价( + {purchaseOrderVO.orderDealer?.includePackingFlag + ? "销售金额 + 包装费" + : "销售金额"} + ) + + + {pricingMethod ? `${totalAmount} 元` : "-"} + @@ -392,6 +395,6 @@ export default function MarketPriceSection(props: { ))} - + ); } diff --git a/packages/app-client/src/components/purchase/section/PackagingCostSection.tsx b/packages/app-client/src/components/purchase/section/PackagingCostSection.tsx index 475288a..c0f8323 100644 --- a/packages/app-client/src/components/purchase/section/PackagingCostSection.tsx +++ b/packages/app-client/src/components/purchase/section/PackagingCostSection.tsx @@ -204,7 +204,7 @@ export default function PackagingCostSection(props: { return ( <> - + {/* 固定费用 */} {fixedCosts .filter((item) => item.name !== "纸箱费" && item.name !== "空箱费") diff --git a/packages/app-client/src/pages/purchase/reviewer/audit.tsx b/packages/app-client/src/pages/purchase/reviewer/audit.tsx index bd6dea5..53aeea9 100644 --- a/packages/app-client/src/pages/purchase/reviewer/audit.tsx +++ b/packages/app-client/src/pages/purchase/reviewer/audit.tsx @@ -5,16 +5,7 @@ import { business } from "@/services"; import { useEffect, useState } from "react"; import { View } from "@tarojs/components"; import purchaseOrder from "@/constant/purchaseOrder"; -import { - ActionSheet, - Button, - Dialog, - Input, - Popup, - SafeArea, - TextArea, - Toast, -} from "@nutui/nutui-react-taro"; +import { ActionSheet, Button, Dialog, Input, Popup, SafeArea, TextArea, Toast } from "@nutui/nutui-react-taro"; import { BasicInfoSection, CompanyInfoSection, @@ -31,7 +22,7 @@ import { State, TaxProvisionSection, TaxSubsidySection, - WorkerAdvanceSection, + WorkerAdvanceSection } from "@/components"; import buildUrl from "@/utils/buildUrl"; import { PurchaseOrderCalculator } from "@/utils/PurchaseOrderCalculator"; @@ -491,7 +482,7 @@ export default hocAuth(function Page(props: CommonComponent) { <> {section.title}