style(components): 统一弹窗样式并添加图标优化
- 为多个 Popup 组件添加统一的动画持续时间和最小高度样式 - 在多个表单标题和标签前添加相应功能图标提升可读性 - 引入 Icon 组件并在合适位置应用 - 调整部分组件导入顺序以符合规范 - 优化表格列渲染逻辑以支持图标显示 - 修复部分 JSX 结构以改善布局展示效果
This commit is contained in:
parent
1e75aadbf9
commit
ea3cfca7d6
@ -49,9 +49,12 @@ export default function CompanyPicker(props: ICompanyPickerProps) {
|
||||
|
||||
{/* 选择销售方 */}
|
||||
<Popup
|
||||
duration={150}
|
||||
style={{
|
||||
minHeight: "auto",
|
||||
}}
|
||||
closeable
|
||||
destroyOnClose
|
||||
duration={150}
|
||||
visible={visible}
|
||||
title="选择销售方"
|
||||
position="bottom"
|
||||
|
||||
@ -12,7 +12,9 @@ interface IDealerPaymentAccountPickerProps {
|
||||
trigger: React.ReactNode;
|
||||
}
|
||||
|
||||
export default function DealerPaymentAccountPicker(props: IDealerPaymentAccountPickerProps) {
|
||||
export default function DealerPaymentAccountPicker(
|
||||
props: IDealerPaymentAccountPickerProps,
|
||||
) {
|
||||
const { dealerId, onFinish, trigger } = props;
|
||||
|
||||
const [visible, setVisible] = useState(false);
|
||||
@ -58,16 +60,19 @@ export default function DealerPaymentAccountPicker(props: IDealerPaymentAccountP
|
||||
|
||||
{/* 选择经销商 */}
|
||||
<Popup
|
||||
duration={150}
|
||||
style={{
|
||||
minHeight: "auto",
|
||||
}}
|
||||
closeable
|
||||
destroyOnClose
|
||||
duration={150}
|
||||
visible={visible}
|
||||
title="选择经销商"
|
||||
position="bottom"
|
||||
onClose={async () => {
|
||||
if (visible) {
|
||||
setDealerPaymentAccountVO(undefined)
|
||||
setSearchText("")
|
||||
setDealerPaymentAccountVO(undefined);
|
||||
setSearchText("");
|
||||
setVisible(false);
|
||||
} else if (dealerPaymentAccountVO) {
|
||||
onFinish(dealerPaymentAccountVO);
|
||||
@ -97,7 +102,7 @@ export default function DealerPaymentAccountPicker(props: IDealerPaymentAccountP
|
||||
key={dealerPaymentAccountVO.accountId}
|
||||
onClick={async () => {
|
||||
setDealerPaymentAccountVO(dealerPaymentAccountVO);
|
||||
setSearchText("")
|
||||
setSearchText("");
|
||||
setVisible(false);
|
||||
}}
|
||||
>
|
||||
|
||||
@ -78,9 +78,12 @@ export default function DealerPicker(props: IDealerPickerProps) {
|
||||
|
||||
{/* 选择经销商 */}
|
||||
<Popup
|
||||
duration={150}
|
||||
style={{
|
||||
minHeight: "auto",
|
||||
}}
|
||||
closeable
|
||||
destroyOnClose
|
||||
duration={150}
|
||||
visible={visible}
|
||||
title="选择经销商"
|
||||
position="bottom"
|
||||
|
||||
@ -35,7 +35,7 @@ export default function DealerRebateCustomerPicker(
|
||||
dealerRebateCustomerListQry: {
|
||||
name: value || undefined,
|
||||
dealerId: dealerId,
|
||||
status: true
|
||||
status: true,
|
||||
},
|
||||
});
|
||||
|
||||
@ -56,15 +56,18 @@ export default function DealerRebateCustomerPicker(
|
||||
|
||||
{/* 选择经销商仓库 */}
|
||||
<Popup
|
||||
duration={150}
|
||||
style={{
|
||||
minHeight: "auto",
|
||||
}}
|
||||
closeable
|
||||
destroyOnClose
|
||||
duration={150}
|
||||
visible={visible}
|
||||
title="选择返点人"
|
||||
position="bottom"
|
||||
onClose={async () => {
|
||||
if (visible) {
|
||||
setDealerRebateCustomerVO(undefined)
|
||||
setDealerRebateCustomerVO(undefined);
|
||||
setSearchText("");
|
||||
setVisible(false);
|
||||
} else if (dealerRebateCustomerVO) {
|
||||
@ -95,7 +98,7 @@ export default function DealerRebateCustomerPicker(
|
||||
key={dealerRebateCustomer.customerId}
|
||||
onClick={async () => {
|
||||
setDealerRebateCustomerVO(dealerRebateCustomer);
|
||||
setSearchText("")
|
||||
setSearchText("");
|
||||
setVisible(false);
|
||||
}}
|
||||
>
|
||||
|
||||
@ -61,9 +61,12 @@ export default function DealerWarehousePicker(
|
||||
|
||||
{/* 选择经销商仓库 */}
|
||||
<Popup
|
||||
duration={150}
|
||||
style={{
|
||||
minHeight: "auto",
|
||||
}}
|
||||
closeable
|
||||
destroyOnClose
|
||||
duration={150}
|
||||
visible={visible}
|
||||
title="选择仓库"
|
||||
position="bottom"
|
||||
|
||||
@ -16,7 +16,9 @@ interface IPurchaseOrderRejectApproveProps {
|
||||
onFinish?: () => void;
|
||||
}
|
||||
|
||||
export default function PurchaseOrderRejectApprove(props: IPurchaseOrderRejectApproveProps) {
|
||||
export default function PurchaseOrderRejectApprove(
|
||||
props: IPurchaseOrderRejectApproveProps,
|
||||
) {
|
||||
const { purchaseOrderVO, size = "normal", onFinish } = props;
|
||||
// 驳回原因弹窗相关状态
|
||||
const [rejectVisible, setRejectVisible] = useState(false);
|
||||
@ -81,6 +83,10 @@ export default function PurchaseOrderRejectApprove(props: IPurchaseOrderRejectAp
|
||||
|
||||
{/* 驳回原因弹窗 */}
|
||||
<Popup
|
||||
duration={150}
|
||||
style={{
|
||||
minHeight: "auto",
|
||||
}}
|
||||
visible={rejectVisible}
|
||||
position="bottom"
|
||||
onClose={() => {
|
||||
|
||||
@ -82,6 +82,10 @@ export default function PurchaseOrderRejectFinal(
|
||||
|
||||
{/* 驳回原因弹窗 */}
|
||||
<Popup
|
||||
duration={150}
|
||||
style={{
|
||||
minHeight: "auto",
|
||||
}}
|
||||
visible={rejectVisible}
|
||||
position="bottom"
|
||||
onClose={() => {
|
||||
|
||||
@ -315,6 +315,10 @@ const Step1Form = forwardRef<Step1FormRef, Step1FormProps>((props, ref) => {
|
||||
/>
|
||||
</View>
|
||||
<Popup
|
||||
duration={150}
|
||||
style={{
|
||||
minHeight: "auto",
|
||||
}}
|
||||
visible={showAddGoodsPopup}
|
||||
position="bottom"
|
||||
title="添加商品"
|
||||
|
||||
@ -1054,6 +1054,10 @@ export default forwardRef<OrderCostRef, IOrderCostProps>(
|
||||
|
||||
return (
|
||||
<Popup
|
||||
duration={150}
|
||||
style={{
|
||||
minHeight: "auto",
|
||||
}}
|
||||
visible={showBatchModal}
|
||||
position="bottom"
|
||||
onClose={() => {
|
||||
@ -1241,6 +1245,10 @@ export default forwardRef<OrderCostRef, IOrderCostProps>(
|
||||
|
||||
return (
|
||||
<Popup
|
||||
duration={150}
|
||||
style={{
|
||||
minHeight: "auto",
|
||||
}}
|
||||
visible={showEditModal}
|
||||
position="bottom"
|
||||
onClose={() => setShowEditModal(false)}
|
||||
|
||||
@ -760,6 +760,10 @@ export default forwardRef<OrderPackageRef, IOrderPackageProps>(
|
||||
|
||||
return (
|
||||
<Popup
|
||||
duration={150}
|
||||
style={{
|
||||
minHeight: "auto",
|
||||
}}
|
||||
visible={showBatchModal}
|
||||
position="bottom"
|
||||
onClose={() => {
|
||||
@ -956,6 +960,10 @@ export default forwardRef<OrderPackageRef, IOrderPackageProps>(
|
||||
|
||||
return (
|
||||
<Popup
|
||||
duration={150}
|
||||
style={{
|
||||
minHeight: "auto",
|
||||
}}
|
||||
visible={showEditModal}
|
||||
position="bottom"
|
||||
onClose={() => setShowEditModal(false)}
|
||||
|
||||
@ -323,6 +323,10 @@ export default forwardRef<WeighRef, IWeightProps>(function Weigh(props, ref) {
|
||||
<View className="flex flex-1 flex-col gap-2.5 p-2.5">
|
||||
{/* 西瓜品种选择弹窗 */}
|
||||
<Popup
|
||||
duration={150}
|
||||
style={{
|
||||
minHeight: "auto",
|
||||
}}
|
||||
visible={productPopupVisible}
|
||||
position="bottom"
|
||||
title="请选择具体品种"
|
||||
|
||||
@ -468,7 +468,8 @@ export default function BasicInfoSection(props: {
|
||||
{/* 本车次号 */}
|
||||
<View className="flex flex-col gap-2.5">
|
||||
<View className={"flex flex-row items-center justify-between"}>
|
||||
<View className="text-neutral-darkest mb-1 text-sm font-bold">
|
||||
<View className="text-neutral-darkest mb-1 flex flex-row text-sm font-bold">
|
||||
<Icon name="truck" size={16} className="mr-1" />
|
||||
本车次号
|
||||
</View>
|
||||
<View className="text-center text-xs text-gray-500">
|
||||
@ -509,7 +510,8 @@ export default function BasicInfoSection(props: {
|
||||
|
||||
{/* 运费信息 */}
|
||||
<View className="flex flex-col gap-2.5">
|
||||
<View className="text-neutral-darkest text-sm font-bold">
|
||||
<View className="text-neutral-darkest flex flex-row text-sm font-bold">
|
||||
<Icon name="money-bill" size={16} className="mr-1" />
|
||||
运费信息
|
||||
</View>
|
||||
<View
|
||||
@ -550,7 +552,10 @@ export default function BasicInfoSection(props: {
|
||||
|
||||
{/* 草帘 */}
|
||||
<View className="flex flex-col gap-2.5">
|
||||
<View className="text-neutral-darkest text-sm font-bold">草帘</View>
|
||||
<View className="text-neutral-darkest flex flex-row text-sm font-bold">
|
||||
<Icon name="receipt" size={16} className="mr-1" />
|
||||
草帘
|
||||
</View>
|
||||
|
||||
<View
|
||||
className="flex flex-row items-center justify-between rounded-md p-2.5"
|
||||
|
||||
@ -514,6 +514,10 @@ export default function EmptyBoxInfoSection(props: {
|
||||
{/* 纸箱价格编辑弹窗 */}
|
||||
{packageData.map((pkg: BusinessAPI.OrderPackage) => (
|
||||
<Popup
|
||||
duration={150}
|
||||
style={{
|
||||
minHeight: "auto",
|
||||
}}
|
||||
key={pkg.orderPackageId}
|
||||
visible={visiblePopup[pkg.orderPackageId || ""]}
|
||||
position="bottom"
|
||||
@ -533,7 +537,8 @@ export default function EmptyBoxInfoSection(props: {
|
||||
lockScroll
|
||||
>
|
||||
<View className="flex flex-col gap-3 p-2.5">
|
||||
<View className="text-neutral-darkest text-sm font-medium">
|
||||
<View className="text-neutral-darkest flex flex-row text-sm font-medium">
|
||||
<Icon name="money-bill" size={16} className="mr-1" />
|
||||
销售单价
|
||||
</View>
|
||||
<View className="border-neutral-base flex flex-row items-center rounded-md border border-solid">
|
||||
@ -562,7 +567,8 @@ export default function EmptyBoxInfoSection(props: {
|
||||
<View className="mr-2">元</View>
|
||||
</View>
|
||||
|
||||
<View className="text-neutral-darkest text-sm font-medium">
|
||||
<View className="text-neutral-darkest flex flex-row text-sm font-medium">
|
||||
<Icon name="money-bill" size={16} className="mr-1" />
|
||||
成本单价
|
||||
</View>
|
||||
<View className="border-neutral-base flex flex-row items-center rounded-md border border-solid">
|
||||
@ -591,7 +597,8 @@ export default function EmptyBoxInfoSection(props: {
|
||||
<View className="mr-2">元</View>
|
||||
</View>
|
||||
|
||||
<View className="text-neutral-darkest text-sm font-medium">
|
||||
<View className="text-neutral-darkest flex flex-row text-sm font-medium">
|
||||
<Icon name="weight-scale" size={16} className="mr-1" />
|
||||
箱重
|
||||
</View>
|
||||
<View className="border-neutral-base flex flex-row items-center rounded-md border border-solid">
|
||||
|
||||
@ -304,6 +304,10 @@ export default function LaborInfoSection(props: {
|
||||
|
||||
{/* 新增其他人工费 */}
|
||||
<Popup
|
||||
duration={150}
|
||||
style={{
|
||||
minHeight: "auto",
|
||||
}}
|
||||
visible={showAddCostPopup}
|
||||
position="bottom"
|
||||
title="新增其他人工费"
|
||||
@ -637,6 +641,10 @@ export default function LaborInfoSection(props: {
|
||||
|
||||
return (
|
||||
<Popup
|
||||
duration={150}
|
||||
style={{
|
||||
minHeight: "auto",
|
||||
}}
|
||||
key={item.orderCostId}
|
||||
visible={visiblePopup[item.orderCostId]}
|
||||
position="bottom"
|
||||
@ -850,6 +858,10 @@ export default function LaborInfoSection(props: {
|
||||
|
||||
return (
|
||||
<Popup
|
||||
duration={150}
|
||||
style={{
|
||||
minHeight: "auto",
|
||||
}}
|
||||
key={item.orderCostId}
|
||||
visible={visiblePopup[item.orderCostId]}
|
||||
position="bottom"
|
||||
|
||||
@ -3,6 +3,7 @@ import { Text, View } from "@tarojs/components";
|
||||
import { Button, Input, Popup, Radio, SafeArea } from "@nutui/nutui-react-taro";
|
||||
import { validatePrice } from "@/utils/format";
|
||||
import { PurchaseOrderCalculator } from "@/utils/PurchaseOrderCalculator";
|
||||
import { Icon } from "@/components";
|
||||
|
||||
export default function MarketPriceSection(props: {
|
||||
purchaseOrderVO: BusinessAPI.PurchaseOrderVO;
|
||||
@ -141,7 +142,8 @@ export default function MarketPriceSection(props: {
|
||||
<>
|
||||
<View className="flex flex-col gap-2.5">
|
||||
<View className="flex !h-8 flex-row items-center justify-between">
|
||||
<View className="text-neutral-dark flex-shrink-0 text-sm">
|
||||
<View className="text-neutral-dark flex flex-shrink-0 flex-row text-sm">
|
||||
<Icon name="chart-line" size={16} className="mr-1" />
|
||||
报价方式
|
||||
</View>
|
||||
<View className="text-neutral-darkest text-sm font-medium">
|
||||
@ -204,7 +206,10 @@ export default function MarketPriceSection(props: {
|
||||
}}
|
||||
>
|
||||
<View className="mb-2 flex items-center justify-between">
|
||||
<Text className="text-sm text-gray-500">销售单价</Text>
|
||||
<Text className="flex flex-row text-sm text-gray-500">
|
||||
<Icon name="money-bill" size={14} className="mr-1" />
|
||||
销售单价
|
||||
</Text>
|
||||
<Text className="text-sm text-gray-500">元/斤</Text>
|
||||
</View>
|
||||
<View className="relative flex">
|
||||
@ -216,7 +221,10 @@ export default function MarketPriceSection(props: {
|
||||
) : (
|
||||
<View>
|
||||
<View className="mb-2 flex items-center justify-between">
|
||||
<Text className="text-sm text-gray-500">销售单价</Text>
|
||||
<Text className="flex flex-row text-sm text-gray-500">
|
||||
<Icon name="money-bill" size={14} className="mr-1" />
|
||||
销售单价
|
||||
</Text>
|
||||
<Text className="text-sm text-gray-500">元/斤</Text>
|
||||
</View>
|
||||
<View className="relative">
|
||||
@ -269,7 +277,8 @@ export default function MarketPriceSection(props: {
|
||||
})}
|
||||
|
||||
<View className="flex !h-8 flex-row items-center justify-between">
|
||||
<View className="text-neutral-dark flex-shrink-0 text-sm">
|
||||
<View className="text-neutral-dark flex flex-shrink-0 flex-row text-sm">
|
||||
<Icon name="money-bill" size={16} className="mr-1" />
|
||||
销售金额
|
||||
</View>
|
||||
<View className="text-neutral-darkest text-sm font-medium">
|
||||
@ -277,7 +286,8 @@ export default function MarketPriceSection(props: {
|
||||
</View>
|
||||
</View>
|
||||
<View className="flex !h-8 flex-row items-center justify-between">
|
||||
<View className="text-neutral-dark flex-shrink-0 text-sm">
|
||||
<View className="text-neutral-dark flex flex-shrink-0 flex-row text-sm">
|
||||
<Icon name="chart-bar" size={16} className="mr-1" />
|
||||
平均单价
|
||||
</View>
|
||||
<View className="text-neutral-darkest text-sm font-medium">
|
||||
@ -285,7 +295,8 @@ export default function MarketPriceSection(props: {
|
||||
</View>
|
||||
</View>
|
||||
<View className="flex !h-8 flex-row items-center justify-between bg-yellow-200">
|
||||
<View className="text-neutral-dark flex-shrink-0 text-sm">
|
||||
<View className="text-neutral-dark flex flex-shrink-0 flex-row text-sm">
|
||||
<Icon name="chart-line" size={16} className="mr-1" />
|
||||
市场报价(
|
||||
{purchaseOrderVO.orderDealer?.includePackingFlag
|
||||
? "销售金额 + 包装费"
|
||||
@ -301,6 +312,10 @@ export default function MarketPriceSection(props: {
|
||||
{/* 销售单价编辑弹窗 */}
|
||||
{purchaseOrderVO.orderSupplierList?.map((supplier) => (
|
||||
<Popup
|
||||
duration={150}
|
||||
style={{
|
||||
minHeight: "auto",
|
||||
}}
|
||||
key={supplier.orderSupplierId}
|
||||
visible={visiblePopup[supplier.orderSupplierId || ""]}
|
||||
position="bottom"
|
||||
@ -320,7 +335,8 @@ export default function MarketPriceSection(props: {
|
||||
lockScroll
|
||||
>
|
||||
<View className="flex flex-col gap-3 p-2.5">
|
||||
<View className="text-neutral-darkest text-sm font-medium">
|
||||
<View className="text-neutral-darkest flex flex-row text-sm font-medium">
|
||||
<Icon name="money-bill" size={16} className="mr-1" />
|
||||
销售单价
|
||||
</View>
|
||||
<View className="border-neutral-base flex flex-row items-center rounded-md border border-solid">
|
||||
|
||||
@ -311,6 +311,10 @@ export default function MaterialCostSection(props: {
|
||||
|
||||
{/* 新增其他辅料费 */}
|
||||
<Popup
|
||||
duration={150}
|
||||
style={{
|
||||
minHeight: "auto",
|
||||
}}
|
||||
visible={showAddCostPopup}
|
||||
position="bottom"
|
||||
title="新增其他辅料费用"
|
||||
@ -320,7 +324,8 @@ export default function MaterialCostSection(props: {
|
||||
>
|
||||
<View className="flex flex-col gap-3 p-2.5">
|
||||
{/* 辅料项目 */}
|
||||
<View className="text-neutral-darkest text-sm font-medium">
|
||||
<View className="text-neutral-darkest flex flex-row text-sm font-medium">
|
||||
<Icon name="clipboard-list" size={16} className="mr-1" />
|
||||
辅料项目
|
||||
</View>
|
||||
<View className="border-neutral-base relative flex h-10 w-full items-center rounded-md border border-solid">
|
||||
@ -391,7 +396,8 @@ export default function MaterialCostSection(props: {
|
||||
{/* 数量输入 */}
|
||||
{newCostData.itemId && newCostData.requireQuantityAndPrice && (
|
||||
<>
|
||||
<View className="text-neutral-darkest text-sm font-medium">
|
||||
<View className="text-neutral-darkest flex flex-row text-sm font-medium">
|
||||
<Icon name="weight-scale" size={16} className="mr-1" />
|
||||
数量
|
||||
</View>
|
||||
<View className="border-neutral-base flex flex-row items-center rounded-md border border-solid">
|
||||
@ -414,7 +420,8 @@ export default function MaterialCostSection(props: {
|
||||
</View>
|
||||
|
||||
{/* 单价输入 */}
|
||||
<View className="text-neutral-darkest text-sm font-medium">
|
||||
<View className="text-neutral-darkest flex flex-row text-sm font-medium">
|
||||
<Icon name="money-bill" size={16} className="mr-1" />
|
||||
单价
|
||||
</View>
|
||||
<View className="border-neutral-base flex flex-row items-center rounded-md border border-solid">
|
||||
@ -454,7 +461,8 @@ export default function MaterialCostSection(props: {
|
||||
|
||||
{newCostData.itemId && !newCostData.requireQuantityAndPrice && (
|
||||
<>
|
||||
<View className="text-neutral-darkest text-sm font-medium">
|
||||
<View className="text-neutral-darkest flex flex-row text-sm font-medium">
|
||||
<Icon name="money-bill" size={16} className="mr-1" />
|
||||
金额
|
||||
</View>
|
||||
<View className="border-neutral-base flex flex-row items-center rounded-md border border-solid">
|
||||
@ -599,6 +607,10 @@ export default function MaterialCostSection(props: {
|
||||
|
||||
return (
|
||||
<Popup
|
||||
duration={150}
|
||||
style={{
|
||||
minHeight: "auto",
|
||||
}}
|
||||
key={item.orderCostId}
|
||||
visible={visiblePopup[item.orderCostId]}
|
||||
position="bottom"
|
||||
@ -620,7 +632,8 @@ export default function MaterialCostSection(props: {
|
||||
<View className="flex flex-col gap-3 p-2.5">
|
||||
{requireQuantityAndPrice ? (
|
||||
<>
|
||||
<View className="text-neutral-darkest text-sm font-medium">
|
||||
<View className="text-neutral-darkest flex flex-row text-sm font-medium">
|
||||
<Icon name="weight-scale" size={16} className="mr-1" />
|
||||
数量
|
||||
</View>
|
||||
<View className="border-neutral-base flex flex-row items-center rounded-md border border-solid">
|
||||
@ -648,7 +661,8 @@ export default function MaterialCostSection(props: {
|
||||
<View className="mr-2">人</View>
|
||||
</View>
|
||||
|
||||
<View className="text-neutral-darkest text-sm font-medium">
|
||||
<View className="text-neutral-darkest flex flex-row text-sm font-medium">
|
||||
<Icon name="money-bill" size={16} className="mr-1" />
|
||||
单价
|
||||
</View>
|
||||
<View className="border-neutral-base flex flex-row items-center rounded-md border border-solid">
|
||||
@ -678,7 +692,8 @@ export default function MaterialCostSection(props: {
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<View className="text-neutral-darkest text-sm font-medium">
|
||||
<View className="text-neutral-darkest flex flex-row text-sm font-medium">
|
||||
<Icon name="money-bill" size={16} className="mr-1" />
|
||||
金额
|
||||
</View>
|
||||
<View className="border-neutral-base flex flex-row items-center rounded-md border border-solid">
|
||||
|
||||
@ -527,6 +527,10 @@ export default function PackageInfoSection(props: {
|
||||
{/* 纸箱价格编辑弹窗 */}
|
||||
{packageData.map((pkg: BusinessAPI.OrderPackage) => (
|
||||
<Popup
|
||||
duration={150}
|
||||
style={{
|
||||
minHeight: "auto",
|
||||
}}
|
||||
key={pkg.orderPackageId}
|
||||
visible={visiblePopup[pkg.orderPackageId || ""]}
|
||||
position="bottom"
|
||||
@ -546,7 +550,8 @@ export default function PackageInfoSection(props: {
|
||||
lockScroll
|
||||
>
|
||||
<View className="flex flex-col gap-3 p-2.5">
|
||||
<View className="text-neutral-darkest text-sm font-medium">
|
||||
<View className="text-neutral-darkest flex flex-row text-sm font-medium">
|
||||
<Icon name="money-bill" size={16} className="mr-1" />
|
||||
销售单价
|
||||
</View>
|
||||
<View className="border-neutral-base flex flex-row items-center rounded-md border border-solid">
|
||||
@ -575,7 +580,8 @@ export default function PackageInfoSection(props: {
|
||||
<View className="mr-2">元</View>
|
||||
</View>
|
||||
|
||||
<View className="text-neutral-darkest text-sm font-medium">
|
||||
<View className="text-neutral-darkest flex flex-row text-sm font-medium">
|
||||
<Icon name="money-bill" size={16} className="mr-1" />
|
||||
成本单价
|
||||
</View>
|
||||
<View className="border-neutral-base flex flex-row items-center rounded-md border border-solid">
|
||||
@ -604,7 +610,8 @@ export default function PackageInfoSection(props: {
|
||||
<View className="mr-2">元</View>
|
||||
</View>
|
||||
|
||||
<View className="text-neutral-darkest text-sm font-medium">
|
||||
<View className="text-neutral-darkest flex flex-row text-sm font-medium">
|
||||
<Icon name="weight-scale" size={16} className="mr-1" />
|
||||
箱重
|
||||
</View>
|
||||
<View className="border-neutral-base flex flex-row items-center rounded-md border border-solid">
|
||||
|
||||
@ -304,6 +304,10 @@ export default function PackagingCostSection(props: {
|
||||
|
||||
{/* 新增其他费用*/}
|
||||
<Popup
|
||||
duration={150}
|
||||
style={{
|
||||
minHeight: "auto",
|
||||
}}
|
||||
visible={showAddCostPopup}
|
||||
position="bottom"
|
||||
title="新增其他费用"
|
||||
@ -626,6 +630,10 @@ export default function PackagingCostSection(props: {
|
||||
{/* 固定费用编辑弹窗 */}
|
||||
{fixedCosts.map((item) => (
|
||||
<Popup
|
||||
duration={150}
|
||||
style={{
|
||||
minHeight: "auto",
|
||||
}}
|
||||
key={item.orderCostId}
|
||||
visible={visiblePopup[item.orderCostId]}
|
||||
position="bottom"
|
||||
@ -752,6 +760,10 @@ export default function PackagingCostSection(props: {
|
||||
{/* 其他费用编辑弹窗 */}
|
||||
{otherCosts.map((item) => (
|
||||
<Popup
|
||||
duration={150}
|
||||
style={{
|
||||
minHeight: "auto",
|
||||
}}
|
||||
key={item.orderCostId}
|
||||
visible={visiblePopup[item.orderCostId]}
|
||||
position="bottom"
|
||||
|
||||
@ -221,6 +221,10 @@ export default function ProductionAdvanceSection(props: {
|
||||
|
||||
{/* 新增其他产地垫付费用 */}
|
||||
<Popup
|
||||
duration={150}
|
||||
style={{
|
||||
minHeight: "auto",
|
||||
}}
|
||||
visible={showAddCostPopup}
|
||||
position="bottom"
|
||||
title="新增其他产地垫付费用"
|
||||
@ -515,6 +519,10 @@ export default function ProductionAdvanceSection(props: {
|
||||
{productionAdvanceCosts.map((item) => {
|
||||
return (
|
||||
<Popup
|
||||
duration={150}
|
||||
style={{
|
||||
minHeight: "auto",
|
||||
}}
|
||||
key={item.orderCostId}
|
||||
visible={visiblePopup[item.orderCostId]}
|
||||
position="bottom"
|
||||
|
||||
@ -2,7 +2,7 @@ import { formatCurrency, validatePrice } from "@/utils/format";
|
||||
import { useEffect, useState } from "react";
|
||||
import { Button, Input, Popup, SafeArea, Table } from "@nutui/nutui-react-taro";
|
||||
import { Icon } from "@/components";
|
||||
import { View } from "@tarojs/components";
|
||||
import { Text, View } from "@tarojs/components";
|
||||
|
||||
export default function PurchaseCostInfoSection(props: {
|
||||
purchaseOrderVO: BusinessAPI.PurchaseOrderVO;
|
||||
@ -153,6 +153,16 @@ export default function PurchaseCostInfoSection(props: {
|
||||
{
|
||||
title: "项目",
|
||||
key: "project",
|
||||
render: (record: any) => {
|
||||
return (
|
||||
<View className="flex flex-row items-center">
|
||||
{record.icon && (
|
||||
<Icon name={record.icon} size={16} className="mr-1" />
|
||||
)}
|
||||
<Text>{record.project}</Text>
|
||||
</View>
|
||||
);
|
||||
},
|
||||
},
|
||||
...(purchaseOrderVO?.orderSupplierList.length > 0
|
||||
? purchaseOrderVO?.orderSupplierList.map((item) => {
|
||||
@ -196,6 +206,7 @@ export default function PurchaseCostInfoSection(props: {
|
||||
data={[
|
||||
{
|
||||
project: "毛重(斤)",
|
||||
icon: "weight-scale",
|
||||
...(purchaseOrderVO?.orderSupplierList.length > 0
|
||||
? purchaseOrderVO?.orderSupplierList.reduce((acc, item) => {
|
||||
acc[item.orderSupplierId] = item.grossWeight;
|
||||
@ -211,6 +222,7 @@ export default function PurchaseCostInfoSection(props: {
|
||||
},
|
||||
{
|
||||
project: "箱重(斤)",
|
||||
icon: "weight-scale",
|
||||
...(purchaseOrderVO?.orderSupplierList.length > 0
|
||||
? purchaseOrderVO?.orderSupplierList.reduce((acc, item) => {
|
||||
acc[item.orderSupplierId] = calculateBoxWeight(item);
|
||||
@ -226,6 +238,7 @@ export default function PurchaseCostInfoSection(props: {
|
||||
},
|
||||
{
|
||||
project: "净重(斤)",
|
||||
icon: "weight-scale",
|
||||
...(purchaseOrderVO?.orderSupplierList.length > 0
|
||||
? purchaseOrderVO?.orderSupplierList.reduce((acc, item) => {
|
||||
acc[item.orderSupplierId] = calculateNetWeight(item);
|
||||
@ -241,6 +254,7 @@ export default function PurchaseCostInfoSection(props: {
|
||||
},
|
||||
{
|
||||
project: "单价(元/斤)",
|
||||
icon: "money-bill",
|
||||
...(purchaseOrderVO?.orderSupplierList.length > 0
|
||||
? purchaseOrderVO?.orderSupplierList.reduce((acc, item) => {
|
||||
const purchasePrice =
|
||||
@ -267,6 +281,7 @@ export default function PurchaseCostInfoSection(props: {
|
||||
},
|
||||
{
|
||||
project: "合计(元)",
|
||||
icon: "money-bill",
|
||||
...(purchaseOrderVO?.orderSupplierList.length > 0
|
||||
? purchaseOrderVO?.orderSupplierList.reduce((acc, item) => {
|
||||
acc[item.orderSupplierId] = formatCurrency(
|
||||
@ -287,6 +302,10 @@ export default function PurchaseCostInfoSection(props: {
|
||||
|
||||
{/* 采购单价编辑弹窗 */}
|
||||
<Popup
|
||||
duration={150}
|
||||
style={{
|
||||
minHeight: "auto",
|
||||
}}
|
||||
visible={visiblePopup["单价(元/斤)"] || false}
|
||||
position="bottom"
|
||||
title="编辑采购单价"
|
||||
|
||||
@ -178,9 +178,12 @@ export default function RebateCalcSection(props: {
|
||||
</View>
|
||||
|
||||
<Popup
|
||||
duration={150}
|
||||
style={{
|
||||
minHeight: "auto",
|
||||
}}
|
||||
closeable
|
||||
destroyOnClose
|
||||
duration={150}
|
||||
visible={visible}
|
||||
title="返点信息"
|
||||
position="bottom"
|
||||
|
||||
@ -10,6 +10,7 @@ import { View } from "@tarojs/components";
|
||||
import { useState } from "react";
|
||||
import Taro from "@tarojs/taro";
|
||||
import { uploadFile } from "@/utils/uploader";
|
||||
import { Icon } from "@/components";
|
||||
|
||||
export default function SupplierInfoSection(props: {
|
||||
purchaseOrderVO: BusinessAPI.PurchaseOrderVO;
|
||||
@ -77,7 +78,7 @@ export default function SupplierInfoSection(props: {
|
||||
// 构造图片 URL 数组
|
||||
const imageUrls: string[] = [];
|
||||
|
||||
console.log("supplier", supplier, type)
|
||||
console.log("supplier", supplier, type);
|
||||
if (type === "emptyWeightImg" && supplier.emptyWeightImg) {
|
||||
imageUrls.push(supplier.emptyWeightImg);
|
||||
} else if (type === "totalWeightImg" && supplier.totalWeightImg) {
|
||||
@ -88,7 +89,7 @@ export default function SupplierInfoSection(props: {
|
||||
imageUrls.push(file);
|
||||
}
|
||||
});
|
||||
} else if (type === "invoiceImg" && supplier.invoiceUpload) {
|
||||
} else if (type === "invoiceImg" && supplier.invoiceUpload) {
|
||||
supplier.invoiceImg?.forEach((file) => {
|
||||
if (file) {
|
||||
imageUrls.push(file);
|
||||
@ -109,25 +110,31 @@ export default function SupplierInfoSection(props: {
|
||||
if (!currentSupplier || !currentUploadType) return;
|
||||
|
||||
// 获取当前上传的文件列表
|
||||
const uploadedFiles = uploadStates[currentSupplier.orderSupplierId]?.[currentUploadType];
|
||||
const uploadedFiles =
|
||||
uploadStates[currentSupplier.orderSupplierId]?.[currentUploadType];
|
||||
|
||||
if (!uploadedFiles) return;
|
||||
|
||||
// 创建新的 purchaseOrderVO 副本
|
||||
const updatedPurchaseOrderVO = { ...purchaseOrderVO };
|
||||
if (updatedPurchaseOrderVO.orderSupplierList) {
|
||||
updatedPurchaseOrderVO.orderSupplierList = [...updatedPurchaseOrderVO.orderSupplierList];
|
||||
updatedPurchaseOrderVO.orderSupplierList = [
|
||||
...updatedPurchaseOrderVO.orderSupplierList,
|
||||
];
|
||||
}
|
||||
|
||||
// 找到当前供应商在列表中的索引
|
||||
const supplierIndex = updatedPurchaseOrderVO.orderSupplierList?.findIndex(
|
||||
(supplier) => supplier.orderSupplierId === currentSupplier.orderSupplierId
|
||||
(supplier) =>
|
||||
supplier.orderSupplierId === currentSupplier.orderSupplierId,
|
||||
);
|
||||
|
||||
if (supplierIndex === undefined || supplierIndex === -1) return;
|
||||
|
||||
// 更新对应的供应商字段
|
||||
const updatedSupplier = { ...updatedPurchaseOrderVO.orderSupplierList[supplierIndex] };
|
||||
const updatedSupplier = {
|
||||
...updatedPurchaseOrderVO.orderSupplierList[supplierIndex],
|
||||
};
|
||||
|
||||
switch (currentUploadType) {
|
||||
case "emptyWeightImg":
|
||||
@ -141,15 +148,15 @@ export default function SupplierInfoSection(props: {
|
||||
case "contractImg":
|
||||
// 合同图片可以有多张,保存所有 URL
|
||||
updatedSupplier.contractImg = uploadedFiles
|
||||
.filter(file => file.url)
|
||||
.map(file => file.url!);
|
||||
.filter((file) => file.url)
|
||||
.map((file) => file.url!);
|
||||
updatedSupplier.contractUpload = uploadedFiles.length > 0;
|
||||
break;
|
||||
case "invoiceImg":
|
||||
// 发票图片可以有多张,保存所有 URL
|
||||
updatedSupplier.invoiceImg = uploadedFiles
|
||||
.filter(file => file.url)
|
||||
.map(file => file.url!);
|
||||
.filter((file) => file.url)
|
||||
.map((file) => file.url!);
|
||||
updatedSupplier.invoiceUpload = uploadedFiles.length > 0;
|
||||
break;
|
||||
}
|
||||
@ -187,7 +194,8 @@ export default function SupplierInfoSection(props: {
|
||||
{/* 瓜农凭证信息 */}
|
||||
<View className="flex w-full flex-col gap-2.5">
|
||||
<View className="flex !h-8 flex-row items-center justify-between">
|
||||
<View className="text-neutral-dark flex-shrink-0 text-sm">
|
||||
<View className="text-neutral-dark flex flex-shrink-0 flex-row text-sm">
|
||||
<Icon name="camera" size={16} className="mr-1" />
|
||||
空磅照片
|
||||
</View>
|
||||
<View className="text-neutral-darkest text-sm font-medium">
|
||||
@ -217,7 +225,8 @@ export default function SupplierInfoSection(props: {
|
||||
</View>
|
||||
</View>
|
||||
<View className="flex !h-8 flex-row items-center justify-between">
|
||||
<View className="text-neutral-dark flex-shrink-0 text-sm">
|
||||
<View className="text-neutral-dark flex flex-shrink-0 flex-row text-sm">
|
||||
<Icon name="camera" size={16} className="mr-1" />
|
||||
总磅照片
|
||||
</View>
|
||||
<View className="text-neutral-darkest text-sm font-medium">
|
||||
@ -247,7 +256,8 @@ export default function SupplierInfoSection(props: {
|
||||
</View>
|
||||
</View>
|
||||
<View className="flex !h-8 flex-row items-center justify-between">
|
||||
<View className="text-neutral-dark flex-shrink-0 text-sm">
|
||||
<View className="text-neutral-dark flex flex-shrink-0 flex-row text-sm">
|
||||
<Icon name="file-invoice" size={16} className="mr-1" />
|
||||
合同
|
||||
</View>
|
||||
<View className="text-neutral-darkest text-sm font-medium">
|
||||
@ -277,7 +287,8 @@ export default function SupplierInfoSection(props: {
|
||||
</View>
|
||||
</View>
|
||||
<View className="flex !h-8 flex-row items-center justify-between">
|
||||
<View className="text-neutral-dark flex-shrink-0 text-sm">
|
||||
<View className="text-neutral-dark flex flex-shrink-0 flex-row text-sm">
|
||||
<Icon name="receipt" size={16} className="mr-1" />
|
||||
发票
|
||||
</View>
|
||||
<View className="text-neutral-darkest text-sm font-medium">
|
||||
@ -313,6 +324,10 @@ export default function SupplierInfoSection(props: {
|
||||
|
||||
{/* 未上传弹窗 */}
|
||||
<Popup
|
||||
duration={150}
|
||||
style={{
|
||||
minHeight: "auto",
|
||||
}}
|
||||
visible={popupVisible && !readOnly}
|
||||
position="bottom"
|
||||
onClose={() => setPopupVisible(false)}
|
||||
@ -335,7 +350,9 @@ export default function SupplierInfoSection(props: {
|
||||
upload={uploadFile}
|
||||
defaultValue={
|
||||
currentSupplier
|
||||
? uploadStates[currentSupplier.orderSupplierId]?.[currentUploadType] || []
|
||||
? uploadStates[currentSupplier.orderSupplierId]?.[
|
||||
currentUploadType
|
||||
] || []
|
||||
: []
|
||||
}
|
||||
onChange={(fileList) => {
|
||||
|
||||
@ -243,6 +243,10 @@ export default function WorkerAdvanceSection(props: {
|
||||
|
||||
{/* 新增其他工头垫付费用 */}
|
||||
<Popup
|
||||
duration={150}
|
||||
style={{
|
||||
minHeight: "auto",
|
||||
}}
|
||||
visible={showAddCostPopup}
|
||||
position="bottom"
|
||||
title="新增其他工头垫付费用"
|
||||
@ -536,6 +540,10 @@ export default function WorkerAdvanceSection(props: {
|
||||
{workerAdvanceCosts.map((item) => {
|
||||
return (
|
||||
<Popup
|
||||
duration={150}
|
||||
style={{
|
||||
minHeight: "auto",
|
||||
}}
|
||||
key={item.orderCostId}
|
||||
visible={visiblePopup[item.orderCostId]}
|
||||
position="bottom"
|
||||
|
||||
@ -48,9 +48,12 @@ export default function SupplierPicker(props: ISupplierPickerProps) {
|
||||
|
||||
{/* 选择瓜农 */}
|
||||
<Popup
|
||||
duration={150}
|
||||
style={{
|
||||
minHeight: "auto",
|
||||
}}
|
||||
closeable
|
||||
destroyOnClose
|
||||
duration={150}
|
||||
visible={visible}
|
||||
title="选择瓜农"
|
||||
position="bottom"
|
||||
|
||||
@ -331,10 +331,13 @@ export default hocAuth(function Page(props: CommonComponent) {
|
||||
|
||||
{/* 选择身份 */}
|
||||
<Popup
|
||||
duration={150}
|
||||
style={{
|
||||
minHeight: "auto",
|
||||
}}
|
||||
className={"w-full"}
|
||||
closeable
|
||||
destroyOnClose
|
||||
duration={150}
|
||||
visible={visible}
|
||||
title="选择身份"
|
||||
onClose={async () => {
|
||||
|
||||
@ -40,13 +40,14 @@ export default base(function Page() {
|
||||
}}
|
||||
>
|
||||
<Popup
|
||||
duration={150}
|
||||
style={{
|
||||
minHeight: "auto",
|
||||
}}
|
||||
visible={showBasic}
|
||||
onClose={() => {
|
||||
setShowBasic(false);
|
||||
}}
|
||||
style={{
|
||||
maxWidth: "100%",
|
||||
}}
|
||||
>
|
||||
<Captcha
|
||||
handleClick={async (token: string) => {
|
||||
@ -72,7 +73,7 @@ export default base(function Page() {
|
||||
{/* Logo展示区域 */}
|
||||
<View className="mb-4 flex justify-center">
|
||||
{channel?.logo && (
|
||||
<Image src={channel.logo} className="w-16 h-16" />
|
||||
<Image src={channel.logo} className="h-16 w-16" />
|
||||
)}
|
||||
</View>
|
||||
<View className="mb-4 text-xl font-bold text-gray-900">
|
||||
|
||||
@ -5,7 +5,16 @@ 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,
|
||||
@ -22,7 +31,7 @@ import {
|
||||
State,
|
||||
TaxProvisionSection,
|
||||
TaxSubsidySection,
|
||||
WorkerAdvanceSection
|
||||
WorkerAdvanceSection,
|
||||
} from "@/components";
|
||||
import buildUrl from "@/utils/buildUrl";
|
||||
import { PurchaseOrderCalculator } from "@/utils/PurchaseOrderCalculator";
|
||||
@ -482,7 +491,7 @@ export default hocAuth(function Page(props: CommonComponent) {
|
||||
<>
|
||||
<View className="text-sm font-bold">{section.title}</View>
|
||||
<View
|
||||
className={`overflow-x-auto rounded-md rounded-b-lg bg-white p-2.5 shadow-sm `}
|
||||
className={`overflow-x-auto rounded-md rounded-b-lg bg-white p-2.5 shadow-sm`}
|
||||
>
|
||||
<section.component
|
||||
readOnly={purchaseOrderVO.state !== "WAITING_AUDIT"}
|
||||
@ -619,6 +628,10 @@ export default hocAuth(function Page(props: CommonComponent) {
|
||||
|
||||
{/* 驳回原因弹窗 */}
|
||||
<Popup
|
||||
duration={150}
|
||||
style={{
|
||||
minHeight: "auto",
|
||||
}}
|
||||
visible={rejectVisible}
|
||||
position="bottom"
|
||||
onClose={() => {
|
||||
|
||||
@ -1,10 +1,4 @@
|
||||
import {
|
||||
ActionType,
|
||||
Icon,
|
||||
PageList,
|
||||
SupplierPicker,
|
||||
ToolBar,
|
||||
} from "@/components";
|
||||
import { ActionType, Icon, PageList, SupplierPicker, ToolBar } from "@/components";
|
||||
import { useShareAppMessage } from "@tarojs/taro";
|
||||
import { useRef, useState } from "react";
|
||||
import { business } from "@/services";
|
||||
@ -12,14 +6,7 @@ import hocAuth from "@/hocs/auth";
|
||||
import { CommonComponent } from "@/types/typings";
|
||||
import { View } from "@tarojs/components";
|
||||
import dayjs from "dayjs";
|
||||
import {
|
||||
Button,
|
||||
Popup,
|
||||
SafeArea,
|
||||
Toast,
|
||||
Uploader,
|
||||
UploaderFileItem,
|
||||
} from "@nutui/nutui-react-taro";
|
||||
import { Button, Popup, SafeArea, Toast, Uploader, UploaderFileItem } from "@nutui/nutui-react-taro";
|
||||
import { uploadFile } from "@/utils/uploader";
|
||||
|
||||
export default hocAuth(function Page(props: CommonComponent) {
|
||||
@ -104,6 +91,10 @@ export default hocAuth(function Page(props: CommonComponent) {
|
||||
<>
|
||||
{/* Popup 弹窗 */}
|
||||
<Popup
|
||||
duration={150}
|
||||
style={{
|
||||
minHeight: "auto",
|
||||
}}
|
||||
visible={popupVisible}
|
||||
position="bottom"
|
||||
onClose={() => setPopupVisible(false)}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user