ERPTurbo_Client/packages/app-client/src/pages/audit/result.tsx
shenyifei 817b4fe928 refactor(router): 重构采购和调货页面路由路径
- 移除采购单页面路径中的 enter 前缀
- 移除调货单页面路径中的 enter 前缀
- 更新所有相关页面跳转链接
- 调整应用配置中的页面注册路径
- 修改工作台常量中的页面路径引用
- 重命名页面文件目录结构以匹配新路由
- 更新供应商和档口页面中的跳转逻辑
- 统一采购和调货流程的页面访问路径
2025-12-20 09:33:21 +08:00

155 lines
4.8 KiB
TypeScript

import hocAuth from "@/hocs/auth";
import { CommonComponent } from "@/types/typings";
import { useEffect, useState } from "react";
import { Text, View } from "@tarojs/components";
import { Button, SafeArea, Toast } from "@nutui/nutui-react-taro";
import Taro from "@tarojs/taro";
import { business } from "@/services";
import { buildUrl } from "@/utils";
import { CopyText } from "@/components";
export default hocAuth(function Page(props: CommonComponent) {
const { router, setLoading } = props;
const orderId = router.params.orderId as string;
const [purchaseOrder, setPurchaseOrder] =
useState<BusinessAPI.PurchaseOrderVO>();
const init = async (orderId: string) => {
setLoading(true);
try {
// 获取采购单信息
const { data: purchaseData } =
await business.purchaseOrder.showPurchaseOrder({
purchaseOrderShowQry: {
orderId: orderId,
},
});
if (purchaseData.success) {
setPurchaseOrder(purchaseData.data);
}
} catch (error) {
Toast.show("toast", {
icon: "fail",
title: "提示",
content: "获取采购单信息失败",
});
} finally {
setLoading(false);
}
};
useEffect(() => {
if (orderId) {
init(orderId);
}
}, [orderId]);
// 查看采购单详情
const viewPurchaseOrderDetail = () => {
if (purchaseOrder?.orderId) {
Taro.navigateTo({
url: buildUrl("/pages/audit/audit", {
orderId: purchaseOrder.orderId,
}),
});
}
};
return (
<View className="flex flex-1 flex-col gap-2.5">
<View className="flex flex-1 flex-col items-center justify-start bg-gray-100 p-2.5">
<View className="mb-2.5 flex h-16 w-16 items-center justify-center rounded-full bg-green-100">
<Text className="text-2xl text-green-600"></Text>
</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-xs text-gray-400">
</View>
<View className="w-full rounded-lg bg-white p-2.5 shadow-md">
<View className="mb-2.5 border-b border-gray-200 pb-2">
<Text className="text-lg font-semibold"></Text>
</View>
<View className="mb-2.5 flex flex-col gap-2.5">
<View className="flex flex-row justify-between">
<Text className="text-neutral-darker text-sm">:</Text>
<CopyText copyData={purchaseOrder?.orderSn || "-"}>
<Text className="text-sm font-medium">
{purchaseOrder?.orderSn || "-"}
</Text>
</CopyText>
</View>
<View className="flex flex-row justify-between">
<Text className="text-neutral-darker text-sm">:</Text>
<Text className="text-sm font-medium">
{purchaseOrder?.orderVehicle?.vehicleNo || "-"}
</Text>
</View>
<View className="flex flex-row justify-between">
<Text className="text-neutral-darker text-sm">:</Text>
<Text className="text-sm font-medium">
{purchaseOrder?.orderVehicle?.dealerName || "-"}
</Text>
</View>
<View className="flex flex-row justify-between">
<Text className="text-neutral-darker text-sm">:</Text>
<Text className="text-sm font-medium text-green-600">
</Text>
</View>
</View>
<View className="border-t border-gray-200 pt-2.5">
<View className="mb-2">
<Text className="text-lg font-semibold"></Text>
</View>
<View className="flex flex-col gap-3">
<Button
type="primary"
size={"xlarge"}
block
onClick={viewPurchaseOrderDetail}
>
</Button>
</View>
</View>
</View>
</View>
<View className={"sticky bottom-0 z-10 bg-white"}>
<View className="flex justify-between gap-2 border-t border-gray-200 p-2.5">
<View className="flex-1">
<Button
type="default"
size={"xlarge"}
block
onClick={() =>
Taro.switchTab({
url: buildUrl("/pages/main/index/index"),
})
}
>
</Button>
</View>
</View>
<SafeArea position={"bottom"} />
</View>
</View>
);
});