From d01925756652630af3e9db3a10aa834b4af98b7a Mon Sep 17 00:00:00 2001 From: shenyifei Date: Sat, 27 Dec 2025 19:56:20 +0800 Subject: [PATCH] =?UTF-8?q?feat(components):=20=E4=B8=BA=E8=BE=93=E5=85=A5?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E6=B7=BB=E5=8A=A0=E6=B8=85=E9=99=A4=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E5=B9=B6=E4=BC=98=E5=8C=96=E7=B1=BB=E5=9E=8B=E5=AE=9A?= =?UTF-8?q?=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 为多个 Input 组件添加 clearable 属性提升用户体验 - 将部分 number 类型输入改为 digit 类型以适配移动端 - 调整布局样式类名如 flex-1 和 flex-shrink-0 的应用 - 修正 API 类型定义中 roleId、costItemIds 等字段从 number[] 到 string[] - 优化档口重量计算器中的方法参数和计算逻辑 - 新增采购报价重量计算方法支持毛重/净重切换 --- .../src/components/dealer/DealerPicker.tsx | 1 + .../src/components/delivery/Step1Form.tsx | 7 +- .../components/expenses/ExpenseCostCreate.tsx | 1 + .../expenses/ExpenseProvisionCreate.tsx | 1 + .../components/purchase/cost/CostCreate.tsx | 5 +- .../purchase/document/Step1Form.tsx | 5 ++ .../components/purchase/module/OrderCost.tsx | 3 +- .../purchase/module/OrderCostItem.tsx | 5 +- .../purchase/module/OrderVehicle.tsx | 7 ++ .../components/purchase/module/StallInfo.tsx | 5 ++ .../components/purchase/module/StallWeigh.tsx | 3 + .../purchase/module/SupplierInfo.tsx | 5 ++ .../purchase/module/SupplierWeigh.tsx | 5 ++ .../purchase/section/BasicInfoSection.tsx | 8 ++ .../purchase/section/EmptyBoxInfoSection.tsx | 1 + .../purchase/section/MarketPriceSection.tsx | 16 ++++ .../section/PurchaseCostInfoSection.tsx | 1 + .../purchase/section/RebateCalcSection.tsx | 2 + packages/app-client/src/pages/audit/audit.tsx | 1 + .../src/pages/public/login/index.tsx | 2 + .../app-client/src/pages/stall/create.tsx | 5 ++ .../app-client/src/pages/supplier/create.tsx | 5 ++ .../app-client/src/services/auth/typings.d.ts | 6 +- .../src/services/business/typings.d.ts | 58 ++++++------ .../modules/StallWeightCalculator.ts | 90 +++++++++++++------ 25 files changed, 183 insertions(+), 65 deletions(-) diff --git a/packages/app-client/src/components/dealer/DealerPicker.tsx b/packages/app-client/src/components/dealer/DealerPicker.tsx index 3c80349..19fa398 100644 --- a/packages/app-client/src/components/dealer/DealerPicker.tsx +++ b/packages/app-client/src/components/dealer/DealerPicker.tsx @@ -158,6 +158,7 @@ export default function DealerPicker(props: IDealerPickerProps) { className={`flex h-10 w-full items-center rounded-md border-4 border-gray-300`} > ((props, ref) => { className={`flex h-10 w-full items-center rounded-md ${formErrors.watermelonGrade ? "border-4 border-red-500" : "border-4 border-gray-300"}`} > { @@ -159,6 +160,7 @@ const Step1Form = forwardRef((props, ref) => { className={`flex h-10 w-full items-center rounded-md ${formErrors.shippingAddress ? "border-4 border-red-500" : "border-4 border-gray-300"}`} > { @@ -351,14 +353,15 @@ const Step1Form = forwardRef((props, ref) => { key={orderShipItem.orderShipItemId} className={"flex flex-row gap-2.5"} > - + 单价:{orderShipItem.unitPrice} 元/斤 { diff --git a/packages/app-client/src/components/expenses/ExpenseCostCreate.tsx b/packages/app-client/src/components/expenses/ExpenseCostCreate.tsx index 9030b03..51b8aeb 100644 --- a/packages/app-client/src/components/expenses/ExpenseCostCreate.tsx +++ b/packages/app-client/src/components/expenses/ExpenseCostCreate.tsx @@ -186,6 +186,7 @@ export default function ExpenseCostCreate(props: IExpenseCostCreateProps) { className={`border-neutral-base flex flex-row items-center rounded-md ${formErrors.expenseAmount ? "border-4 border-red-500" : "border-4 border-gray-300"}`} > ((props, ref) => { ((props, ref) => { ((props, ref) => { ((props, ref) => { ((props, ref) => { ( className={`flex h-12 w-full shrink items-center border-4 ${countError[orderCostId] && selected ? "border-red-500" : "border-gray-200"} bg-white`} > ( className={`flex h-12 w-full shrink items-center border-4 border-gray-200`} > ( className={`flex h-12 w-full shrink items-center border-4 ${countError[orderCostItemId] && selected ? "border-red-500" : "border-gray-200"} bg-white`} > ( className={`flex h-12 items-center rounded-md ${foremanError ? "border-2 border-red-500 bg-red-100" : "border-2 border-gray-300 bg-white"}`} > ( className={`flex h-10 w-full items-center rounded-md ${plateError ? "border-4 border-red-500" : "border-4 border-gray-300"}`} > ( className={`flex h-10 w-full items-center rounded-md ${driverError ? "border-4 border-red-500" : "border-4 border-gray-300"}`} > ( className={`flex h-10 w-full items-center rounded-md ${phoneError ? "border-4 border-red-500" : "border-4 border-gray-300"}`} > ( className={`flex h-10 w-full items-center rounded-md ${originError ? "border-4 border-red-500" : "border-4 border-gray-300"}`} > ( className={`flex h-10 w-full items-center rounded-md ${destinationError ? "border-4 border-red-500" : "border-4 border-gray-300"}`} > ( className={`flex h-10 w-full items-center rounded-md ${priceError ? "border-4 border-red-500" : "border-4 border-gray-300"}`} > ( className={`flex h-10 w-full items-center rounded-md ${strawCurtainPriceError ? "border-4 border-red-500" : "border-4 border-gray-300"}`} > ( > ( > ( className="mx-2" /> ( className="mx-2" /> ( > ( className={`flex h-10 w-full items-center rounded-md ${selectedProduct === "其他(请注明)" && customProduct ? "border-primary border-4" : "border-4 border-gray-300"}`} > ( className={`flex h-10 w-full items-center rounded-md ${priceError[supplierVO.orderSupplierId] ? "border-4 border-red-500" : "border-4 border-yellow-300"}`} > ( className={`flex h-10 w-full items-center rounded-md ${grossWeightError[supplierVO.orderSupplierId] ? "border-4 border-red-500" : "border-4 border-blue-300"}`} > ( > ( > ( > ( className="mx-2" /> ( > ( className={`flex h-10 w-full items-center rounded-md ${selectedProduct === "其他(请注明)" && customProduct ? "border-primary border-4" : "border-4 border-gray-300"}`} > ( className={`flex h-10 w-full items-center rounded-md ${depositError[supplierVO.orderSupplierId] ? "border-4 border-red-500" : "border-4 border-gray-300"}`} > ( className={`flex h-10 w-full items-center rounded-md ${priceError[supplierVO.orderSupplierId] ? "border-4 border-red-500" : "border-4 border-yellow-300"}`} > ( className={`flex h-10 w-full items-center rounded-md ${emptyWeightError[supplierVO.orderSupplierId] ? "border-4 border-red-500" : "border-4 border-blue-300"}`} > ( className={`flex h-10 w-full items-center rounded-md ${totalWeightError[supplierVO.orderSupplierId] ? "border-4 border-red-500" : "border-4 border-green-300"}`} > )} + {supplier.type === "STALL" && ( + + 采购报价 + + {supplier.pricingMethod === "BY_GROSS_WEIGHT" + ? "毛重" + : "净重"} + + + )} + + 采购成本 + + {supplier.invoiceAmount} 元 + + 采购单价 diff --git a/packages/app-client/src/components/purchase/section/PurchaseCostInfoSection.tsx b/packages/app-client/src/components/purchase/section/PurchaseCostInfoSection.tsx index bed2165..b866994 100644 --- a/packages/app-client/src/components/purchase/section/PurchaseCostInfoSection.tsx +++ b/packages/app-client/src/components/purchase/section/PurchaseCostInfoSection.tsx @@ -351,6 +351,7 @@ export default function PurchaseCostInfoSection(props: { pkg.boxType === boxType) + ? packages.filter((pkg) => pkg.boxType === boxType) : packages; return filteredPackages.reduce((total, pkg) => { const weight = DecimalUtils.multiply( pkg.boxCount || 0, - pkg.boxProductWeight || 0 + pkg.boxProductWeight || 0, ); return DecimalUtils.add(total, weight); }, 0); @@ -186,7 +220,7 @@ export class StallWeightCalculator { * 获取指定供应商的净重 */ getSupplierNetWeight(supplierId: string | number): number { - const supplier = this.suppliers.find(s => s.supplierId === supplierId); + const supplier = this.suppliers.find((s) => s.supplierId === supplierId); return supplier?.netWeight || 0; } @@ -194,7 +228,7 @@ export class StallWeightCalculator { * 获取指定供应商的毛重 */ getSupplierGrossWeight(supplierId: string | number): number { - const supplier = this.suppliers.find(s => s.supplierId === supplierId); + const supplier = this.suppliers.find((s) => s.supplierId === supplierId); return supplier?.grossWeight || 0; } @@ -245,7 +279,7 @@ export class StallWeightCalculator { return { isValid: errors.length === 0, - errors + errors, }; } }