diff --git a/packages/app-client/config/prod.ts b/packages/app-client/config/prod.ts index 58ea81a..fad8eb8 100644 --- a/packages/app-client/config/prod.ts +++ b/packages/app-client/config/prod.ts @@ -22,10 +22,7 @@ export default { process.env.TARO_ENV === "h5" ? '"/api"' : '"https://api.erp.qilincloud168.com"', - "process.env.TARO_POSTER_DOMAIN": - process.env.TARO_ENV === "h5" - ? '""' - : '"https://poster.qilincloud168.com"', + "process.env.TARO_POSTER_DOMAIN": '"https://poster.qilincloud168.com"', }, mini: { miniCssExtractPluginOption: { diff --git a/packages/app-client/src/components/purchase/module/PurchasePreview.tsx b/packages/app-client/src/components/purchase/module/PurchasePreview.tsx index 9eda17d..d63d1e0 100644 --- a/packages/app-client/src/components/purchase/module/PurchasePreview.tsx +++ b/packages/app-client/src/components/purchase/module/PurchasePreview.tsx @@ -159,6 +159,18 @@ export default function PurchasePreview(props: IPurchasePreviewProps) { + + 空磅 + + {formatCurrency(supplier.emptyWeight || 0)} KG + + + + 总磅 + + {formatCurrency(supplier.totalWeight || 0)} KG + + 毛重 diff --git a/packages/app-client/src/components/purchase/module/Weigh.tsx b/packages/app-client/src/components/purchase/module/Weigh.tsx index 09f27c5..7368a78 100644 --- a/packages/app-client/src/components/purchase/module/Weigh.tsx +++ b/packages/app-client/src/components/purchase/module/Weigh.tsx @@ -300,6 +300,13 @@ export default forwardRef(function Weigh(props, ref) { ...prev, [id]: !isEmptyWeightValid, })); + console.log( + isEmptyWeightValid, + isTotalWeightValid, + isPurchasePriceValid, + isProductIdValid, + isPaperValid, + ); const isValid = isEmptyWeightValid && diff --git a/packages/app-client/src/constant/app.ts b/packages/app-client/src/constant/app.ts index 55b1bfc..cb324f1 100644 --- a/packages/app-client/src/constant/app.ts +++ b/packages/app-client/src/constant/app.ts @@ -1,2 +1,2 @@ // App 相关常量 -export const APP_VERSION = "v0.0.24"; +export const APP_VERSION = "v0.0.25"; diff --git a/packages/app-client/src/pages/delivery/document/delivery.tsx b/packages/app-client/src/pages/delivery/document/delivery.tsx index e110fe1..022cc68 100644 --- a/packages/app-client/src/pages/delivery/document/delivery.tsx +++ b/packages/app-client/src/pages/delivery/document/delivery.tsx @@ -15,6 +15,7 @@ import { DeliveryStep2Preview, DeliveryStep3Success, } from "@/components"; +import { PdfTemplate } from "@/utils/PdfTemplate"; // 特殊处理:其他费用要实时获取费用项目 const updateOtherFeesModule = async ( @@ -244,6 +245,7 @@ export default hocAuth(function Page(props: CommonComponent) { }, onCancel: () => { Dialog.close("dialog"); + console.log("12123"); }, }); return; @@ -285,8 +287,7 @@ export default hocAuth(function Page(props: CommonComponent) { // 截图预览内容 const capturePreview = async () => { - const template = new Template(moduleList); - console.log("generateHtmlString", template.generateHtmlString()); + const template = new PdfTemplate(moduleList); const { data } = await poster.pdf.postApiV1Pdf({ html: template.generateHtmlString(), }); diff --git a/packages/app-client/src/pages/purchase/purchaser/create.tsx b/packages/app-client/src/pages/purchase/purchaser/create.tsx index eb287b0..515343f 100644 --- a/packages/app-client/src/pages/purchase/purchaser/create.tsx +++ b/packages/app-client/src/pages/purchase/purchaser/create.tsx @@ -186,6 +186,7 @@ export default hocAuth(function Page(props: CommonComponent) { setActive(active); } } + setActive(4); const orderCostList1 = purchaseOrder.orderCostList.map( (item: CostItem) => ({ ...item, @@ -295,6 +296,8 @@ export default hocAuth(function Page(props: CommonComponent) { selected: true, isPaper: orderSupplierList[selectedIndex].isPaper, orderPackageList: [], + productId: orderSupplierList[selectedIndex]?.productId, + productName: orderSupplierList[selectedIndex]?.productName, }, ]); }; @@ -705,7 +708,6 @@ export default hocAuth(function Page(props: CommonComponent) { setOrderCostList((prev) => { const costItemVOList = productVO.costItemVOList; - console.log("prev", prev); // 将 orderCostList 中 不存在与 costItemVOList 的项 删除,剩余项保留 const orderCostList = prev?.filter((item) => { return ( diff --git a/packages/app-client/src/pages/purchase/purchaser/preview.tsx b/packages/app-client/src/pages/purchase/purchaser/preview.tsx index 93eb19e..52661ad 100644 --- a/packages/app-client/src/pages/purchase/purchaser/preview.tsx +++ b/packages/app-client/src/pages/purchase/purchaser/preview.tsx @@ -66,11 +66,12 @@ export default hocAuth(function Page(props: CommonComponent) { Taro.redirectTo({ url: buildUrl("/pages/purchase/purchaser/create", { orderId: purchaseOrder.orderId, + active: 6, }), }); }} > - 编辑 + 上一步 diff --git a/packages/app-client/src/pages/purchase/reviewer/audit/result.tsx b/packages/app-client/src/pages/purchase/reviewer/audit/result.tsx index e25f86b..66022e8 100644 --- a/packages/app-client/src/pages/purchase/reviewer/audit/result.tsx +++ b/packages/app-client/src/pages/purchase/reviewer/audit/result.tsx @@ -64,10 +64,10 @@ export default hocAuth(function Page(props: CommonComponent) { - 采购单已提交审核 + 采购单已提交审批 - 等待老板审核中 + 等待老板审批中 您可以通过以下操作继续处理 diff --git a/packages/app-client/src/utils/Template.ts b/packages/app-client/src/utils/PdfTemplate.ts similarity index 99% rename from packages/app-client/src/utils/Template.ts rename to packages/app-client/src/utils/PdfTemplate.ts index 7adb054..383ec51 100644 --- a/packages/app-client/src/utils/Template.ts +++ b/packages/app-client/src/utils/PdfTemplate.ts @@ -1,7 +1,8 @@ -class Template { +export class PdfTemplate { private moduleList: any[]; constructor(moduleList: any[]) { + console.log("moduleList",moduleList) this.moduleList = moduleList; } @@ -612,6 +613,7 @@ class Template { }); htmlString += ``; + console.log("generateHtmlString", htmlString); return htmlString; }; } diff --git a/packages/app-client/src/utils/PurchaseOrderCalculator.ts b/packages/app-client/src/utils/PurchaseOrderCalculator.ts index 903a6ae..b8cd94d 100644 --- a/packages/app-client/src/utils/PurchaseOrderCalculator.ts +++ b/packages/app-client/src/utils/PurchaseOrderCalculator.ts @@ -297,8 +297,8 @@ export class PurchaseOrderCalculator { return 0; } return new Decimal(this.getMelonNetProfit()) - .minus(this.getCostDifference()) .mul(this.purchaseOrderVO.orderDealer?.shareRatio || 0) + .minus(this.getCostDifference()) .div(100) .toNumber(); } diff --git a/packages/app-client/src/utils/SupplierWeightCalculator.ts b/packages/app-client/src/utils/SupplierWeightCalculator.ts index c085f74..31e78e2 100644 --- a/packages/app-client/src/utils/SupplierWeightCalculator.ts +++ b/packages/app-client/src/utils/SupplierWeightCalculator.ts @@ -113,12 +113,12 @@ export class SupplierWeightCalculator { .toNumber(); } else if (isLastSupplier) { // 最后一个农户(根据isLast标识判断) - // 净重 = (总磅 - 前一个总磅) * 2 + 剩余空箱子重量 - 额外纸箱重量 + // 净重 = (总磅 - 前一个总磅) * 2 + 剩余空箱子重量 - 已使用额外纸箱重量 supplier.netWeight = new Decimal(supplier.totalWeight || 0) .sub(previousTotalWeight) .mul(2) .add(remainingBoxesWeight) - .sub(extraBoxesWeight) + .sub(extraUsedBoxesWeight) .toNumber(); // 毛重 = 净重 + 本次使用纸箱重量 supplier.grossWeight = new Decimal(supplier.netWeight || 0)