feat(app-client): 更新生产环境配置并优化采购模块显示
- 修改 TARO_POSTER_DOMAIN 环境变量,移除 H5 环境特殊处理逻辑 - 在 PurchasePreview 组件中新增“空磅”与“总磅”字段展示 - Weigh 组件中增加表单验证状态的日志输出 - 更新应用版本号从 v0.0.24 到 v0.0.25 - delivery 页面引入 PdfTemplate 并替换原有 Template 类 - create 页面调整 setActive 调用位置并在订单创建流程中设置默认值 - preview 页面将按钮文案由“编辑”改为“上一步” - audit result 页面文案从“审核”统一为“审批” - 重构 SupplierWeightCalculator 计算逻辑,修正额外纸箱重量使用字段 - 修复 PurchaseOrderCalculator 中利润计算公式的运算顺序错误 - 移除部分无用 console 日志,保留关键调试信息
This commit is contained in:
parent
5eefd62d85
commit
0cb0bab898
@ -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: {
|
||||
|
||||
@ -159,6 +159,18 @@ export default function PurchasePreview(props: IPurchasePreviewProps) {
|
||||
</View>
|
||||
</View>
|
||||
<View className="mb-3 flex flex-col gap-2 border-b pb-3">
|
||||
<View className="flex items-center justify-between">
|
||||
<View className="text-sm text-gray-600">空磅</View>
|
||||
<View className="text-sm font-medium">
|
||||
{formatCurrency(supplier.emptyWeight || 0)} KG
|
||||
</View>
|
||||
</View>
|
||||
<View className="flex items-center justify-between">
|
||||
<View className="text-sm text-gray-600">总磅</View>
|
||||
<View className="text-sm font-medium">
|
||||
{formatCurrency(supplier.totalWeight || 0)} KG
|
||||
</View>
|
||||
</View>
|
||||
<View className="flex items-center justify-between">
|
||||
<View className="text-sm text-gray-600">毛重</View>
|
||||
<View className="text-sm font-medium">
|
||||
|
||||
@ -300,6 +300,13 @@ export default forwardRef<WeighRef, IWeightProps>(function Weigh(props, ref) {
|
||||
...prev,
|
||||
[id]: !isEmptyWeightValid,
|
||||
}));
|
||||
console.log(
|
||||
isEmptyWeightValid,
|
||||
isTotalWeightValid,
|
||||
isPurchasePriceValid,
|
||||
isProductIdValid,
|
||||
isPaperValid,
|
||||
);
|
||||
|
||||
const isValid =
|
||||
isEmptyWeightValid &&
|
||||
|
||||
@ -1,2 +1,2 @@
|
||||
// App 相关常量
|
||||
export const APP_VERSION = "v0.0.24";
|
||||
export const APP_VERSION = "v0.0.25";
|
||||
|
||||
@ -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(),
|
||||
});
|
||||
|
||||
@ -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 (
|
||||
|
||||
@ -66,11 +66,12 @@ export default hocAuth(function Page(props: CommonComponent) {
|
||||
Taro.redirectTo({
|
||||
url: buildUrl("/pages/purchase/purchaser/create", {
|
||||
orderId: purchaseOrder.orderId,
|
||||
active: 6,
|
||||
}),
|
||||
});
|
||||
}}
|
||||
>
|
||||
编辑
|
||||
上一步
|
||||
</Button>
|
||||
</View>
|
||||
<View className={"flex-1"}>
|
||||
|
||||
@ -64,10 +64,10 @@ export default hocAuth(function Page(props: CommonComponent) {
|
||||
</View>
|
||||
|
||||
<View className="mb-2.5 text-xl font-bold text-gray-800">
|
||||
采购单已提交审核
|
||||
采购单已提交审批
|
||||
</View>
|
||||
|
||||
<View className="mb-2.5 text-sm text-gray-600">等待老板审核中</View>
|
||||
<View className="mb-2.5 text-sm text-gray-600">等待老板审批中</View>
|
||||
|
||||
<View className="mb-2.5 text-xs text-gray-400">
|
||||
您可以通过以下操作继续处理
|
||||
|
||||
@ -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 += `</div></div>`;
|
||||
console.log("generateHtmlString", htmlString);
|
||||
return htmlString;
|
||||
};
|
||||
}
|
||||
@ -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();
|
||||
}
|
||||
|
||||
@ -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)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user