style(components): 统一弹窗样式并添加图标优化

- 为多个 Popup 组件添加统一的动画持续时间和最小高度样式
- 在多个表单标题和标签前添加相应功能图标提升可读性
- 引入 Icon 组件并在合适位置应用
- 调整部分组件导入顺序以符合规范
- 优化表格列渲染逻辑以支持图标显示
- 修复部分 JSX 结构以改善布局展示效果
This commit is contained in:
shenyifei 2025-11-19 22:23:46 +08:00
parent 1e75aadbf9
commit ea3cfca7d6
28 changed files with 268 additions and 77 deletions

View File

@ -49,9 +49,12 @@ export default function CompanyPicker(props: ICompanyPickerProps) {
{/* 选择销售方 */} {/* 选择销售方 */}
<Popup <Popup
duration={150}
style={{
minHeight: "auto",
}}
closeable closeable
destroyOnClose destroyOnClose
duration={150}
visible={visible} visible={visible}
title="选择销售方" title="选择销售方"
position="bottom" position="bottom"

View File

@ -12,7 +12,9 @@ interface IDealerPaymentAccountPickerProps {
trigger: React.ReactNode; trigger: React.ReactNode;
} }
export default function DealerPaymentAccountPicker(props: IDealerPaymentAccountPickerProps) { export default function DealerPaymentAccountPicker(
props: IDealerPaymentAccountPickerProps,
) {
const { dealerId, onFinish, trigger } = props; const { dealerId, onFinish, trigger } = props;
const [visible, setVisible] = useState(false); const [visible, setVisible] = useState(false);
@ -58,16 +60,19 @@ export default function DealerPaymentAccountPicker(props: IDealerPaymentAccountP
{/* 选择经销商 */} {/* 选择经销商 */}
<Popup <Popup
duration={150}
style={{
minHeight: "auto",
}}
closeable closeable
destroyOnClose destroyOnClose
duration={150}
visible={visible} visible={visible}
title="选择经销商" title="选择经销商"
position="bottom" position="bottom"
onClose={async () => { onClose={async () => {
if (visible) { if (visible) {
setDealerPaymentAccountVO(undefined) setDealerPaymentAccountVO(undefined);
setSearchText("") setSearchText("");
setVisible(false); setVisible(false);
} else if (dealerPaymentAccountVO) { } else if (dealerPaymentAccountVO) {
onFinish(dealerPaymentAccountVO); onFinish(dealerPaymentAccountVO);
@ -97,7 +102,7 @@ export default function DealerPaymentAccountPicker(props: IDealerPaymentAccountP
key={dealerPaymentAccountVO.accountId} key={dealerPaymentAccountVO.accountId}
onClick={async () => { onClick={async () => {
setDealerPaymentAccountVO(dealerPaymentAccountVO); setDealerPaymentAccountVO(dealerPaymentAccountVO);
setSearchText("") setSearchText("");
setVisible(false); setVisible(false);
}} }}
> >

View File

@ -78,9 +78,12 @@ export default function DealerPicker(props: IDealerPickerProps) {
{/* 选择经销商 */} {/* 选择经销商 */}
<Popup <Popup
duration={150}
style={{
minHeight: "auto",
}}
closeable closeable
destroyOnClose destroyOnClose
duration={150}
visible={visible} visible={visible}
title="选择经销商" title="选择经销商"
position="bottom" position="bottom"

View File

@ -35,7 +35,7 @@ export default function DealerRebateCustomerPicker(
dealerRebateCustomerListQry: { dealerRebateCustomerListQry: {
name: value || undefined, name: value || undefined,
dealerId: dealerId, dealerId: dealerId,
status: true status: true,
}, },
}); });
@ -56,15 +56,18 @@ export default function DealerRebateCustomerPicker(
{/* 选择经销商仓库 */} {/* 选择经销商仓库 */}
<Popup <Popup
duration={150}
style={{
minHeight: "auto",
}}
closeable closeable
destroyOnClose destroyOnClose
duration={150}
visible={visible} visible={visible}
title="选择返点人" title="选择返点人"
position="bottom" position="bottom"
onClose={async () => { onClose={async () => {
if (visible) { if (visible) {
setDealerRebateCustomerVO(undefined) setDealerRebateCustomerVO(undefined);
setSearchText(""); setSearchText("");
setVisible(false); setVisible(false);
} else if (dealerRebateCustomerVO) { } else if (dealerRebateCustomerVO) {
@ -95,7 +98,7 @@ export default function DealerRebateCustomerPicker(
key={dealerRebateCustomer.customerId} key={dealerRebateCustomer.customerId}
onClick={async () => { onClick={async () => {
setDealerRebateCustomerVO(dealerRebateCustomer); setDealerRebateCustomerVO(dealerRebateCustomer);
setSearchText("") setSearchText("");
setVisible(false); setVisible(false);
}} }}
> >

View File

@ -61,9 +61,12 @@ export default function DealerWarehousePicker(
{/* 选择经销商仓库 */} {/* 选择经销商仓库 */}
<Popup <Popup
duration={150}
style={{
minHeight: "auto",
}}
closeable closeable
destroyOnClose destroyOnClose
duration={150}
visible={visible} visible={visible}
title="选择仓库" title="选择仓库"
position="bottom" position="bottom"

View File

@ -16,7 +16,9 @@ interface IPurchaseOrderRejectApproveProps {
onFinish?: () => void; onFinish?: () => void;
} }
export default function PurchaseOrderRejectApprove(props: IPurchaseOrderRejectApproveProps) { export default function PurchaseOrderRejectApprove(
props: IPurchaseOrderRejectApproveProps,
) {
const { purchaseOrderVO, size = "normal", onFinish } = props; const { purchaseOrderVO, size = "normal", onFinish } = props;
// 驳回原因弹窗相关状态 // 驳回原因弹窗相关状态
const [rejectVisible, setRejectVisible] = useState(false); const [rejectVisible, setRejectVisible] = useState(false);
@ -81,6 +83,10 @@ export default function PurchaseOrderRejectApprove(props: IPurchaseOrderRejectAp
{/* 驳回原因弹窗 */} {/* 驳回原因弹窗 */}
<Popup <Popup
duration={150}
style={{
minHeight: "auto",
}}
visible={rejectVisible} visible={rejectVisible}
position="bottom" position="bottom"
onClose={() => { onClose={() => {

View File

@ -82,6 +82,10 @@ export default function PurchaseOrderRejectFinal(
{/* 驳回原因弹窗 */} {/* 驳回原因弹窗 */}
<Popup <Popup
duration={150}
style={{
minHeight: "auto",
}}
visible={rejectVisible} visible={rejectVisible}
position="bottom" position="bottom"
onClose={() => { onClose={() => {

View File

@ -315,6 +315,10 @@ const Step1Form = forwardRef<Step1FormRef, Step1FormProps>((props, ref) => {
/> />
</View> </View>
<Popup <Popup
duration={150}
style={{
minHeight: "auto",
}}
visible={showAddGoodsPopup} visible={showAddGoodsPopup}
position="bottom" position="bottom"
title="添加商品" title="添加商品"

View File

@ -1054,6 +1054,10 @@ export default forwardRef<OrderCostRef, IOrderCostProps>(
return ( return (
<Popup <Popup
duration={150}
style={{
minHeight: "auto",
}}
visible={showBatchModal} visible={showBatchModal}
position="bottom" position="bottom"
onClose={() => { onClose={() => {
@ -1241,6 +1245,10 @@ export default forwardRef<OrderCostRef, IOrderCostProps>(
return ( return (
<Popup <Popup
duration={150}
style={{
minHeight: "auto",
}}
visible={showEditModal} visible={showEditModal}
position="bottom" position="bottom"
onClose={() => setShowEditModal(false)} onClose={() => setShowEditModal(false)}

View File

@ -760,6 +760,10 @@ export default forwardRef<OrderPackageRef, IOrderPackageProps>(
return ( return (
<Popup <Popup
duration={150}
style={{
minHeight: "auto",
}}
visible={showBatchModal} visible={showBatchModal}
position="bottom" position="bottom"
onClose={() => { onClose={() => {
@ -956,6 +960,10 @@ export default forwardRef<OrderPackageRef, IOrderPackageProps>(
return ( return (
<Popup <Popup
duration={150}
style={{
minHeight: "auto",
}}
visible={showEditModal} visible={showEditModal}
position="bottom" position="bottom"
onClose={() => setShowEditModal(false)} onClose={() => setShowEditModal(false)}

View File

@ -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"> <View className="flex flex-1 flex-col gap-2.5 p-2.5">
{/* 西瓜品种选择弹窗 */} {/* 西瓜品种选择弹窗 */}
<Popup <Popup
duration={150}
style={{
minHeight: "auto",
}}
visible={productPopupVisible} visible={productPopupVisible}
position="bottom" position="bottom"
title="请选择具体品种" title="请选择具体品种"

View File

@ -468,7 +468,8 @@ export default function BasicInfoSection(props: {
{/* 本车次号 */} {/* 本车次号 */}
<View className="flex flex-col gap-2.5"> <View className="flex flex-col gap-2.5">
<View className={"flex flex-row items-center justify-between"}> <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>
<View className="text-center text-xs text-gray-500"> <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="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>
<View <View
@ -550,7 +552,10 @@ export default function BasicInfoSection(props: {
{/* 草帘 */} {/* 草帘 */}
<View className="flex flex-col gap-2.5"> <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 <View
className="flex flex-row items-center justify-between rounded-md p-2.5" className="flex flex-row items-center justify-between rounded-md p-2.5"

View File

@ -514,6 +514,10 @@ export default function EmptyBoxInfoSection(props: {
{/* 纸箱价格编辑弹窗 */} {/* 纸箱价格编辑弹窗 */}
{packageData.map((pkg: BusinessAPI.OrderPackage) => ( {packageData.map((pkg: BusinessAPI.OrderPackage) => (
<Popup <Popup
duration={150}
style={{
minHeight: "auto",
}}
key={pkg.orderPackageId} key={pkg.orderPackageId}
visible={visiblePopup[pkg.orderPackageId || ""]} visible={visiblePopup[pkg.orderPackageId || ""]}
position="bottom" position="bottom"
@ -533,7 +537,8 @@ export default function EmptyBoxInfoSection(props: {
lockScroll lockScroll
> >
<View className="flex flex-col gap-3 p-2.5"> <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>
<View className="border-neutral-base flex flex-row items-center rounded-md border border-solid"> <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 className="mr-2"></View>
</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>
<View className="border-neutral-base flex flex-row items-center rounded-md border border-solid"> <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 className="mr-2"></View>
</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>
<View className="border-neutral-base flex flex-row items-center rounded-md border border-solid"> <View className="border-neutral-base flex flex-row items-center rounded-md border border-solid">

View File

@ -304,6 +304,10 @@ export default function LaborInfoSection(props: {
{/* 新增其他人工费 */} {/* 新增其他人工费 */}
<Popup <Popup
duration={150}
style={{
minHeight: "auto",
}}
visible={showAddCostPopup} visible={showAddCostPopup}
position="bottom" position="bottom"
title="新增其他人工费" title="新增其他人工费"
@ -637,6 +641,10 @@ export default function LaborInfoSection(props: {
return ( return (
<Popup <Popup
duration={150}
style={{
minHeight: "auto",
}}
key={item.orderCostId} key={item.orderCostId}
visible={visiblePopup[item.orderCostId]} visible={visiblePopup[item.orderCostId]}
position="bottom" position="bottom"
@ -850,6 +858,10 @@ export default function LaborInfoSection(props: {
return ( return (
<Popup <Popup
duration={150}
style={{
minHeight: "auto",
}}
key={item.orderCostId} key={item.orderCostId}
visible={visiblePopup[item.orderCostId]} visible={visiblePopup[item.orderCostId]}
position="bottom" position="bottom"

View File

@ -3,6 +3,7 @@ import { Text, View } from "@tarojs/components";
import { Button, Input, Popup, Radio, SafeArea } from "@nutui/nutui-react-taro"; import { Button, Input, Popup, Radio, SafeArea } from "@nutui/nutui-react-taro";
import { validatePrice } from "@/utils/format"; import { validatePrice } from "@/utils/format";
import { PurchaseOrderCalculator } from "@/utils/PurchaseOrderCalculator"; import { PurchaseOrderCalculator } from "@/utils/PurchaseOrderCalculator";
import { Icon } from "@/components";
export default function MarketPriceSection(props: { export default function MarketPriceSection(props: {
purchaseOrderVO: BusinessAPI.PurchaseOrderVO; purchaseOrderVO: BusinessAPI.PurchaseOrderVO;
@ -141,7 +142,8 @@ export default function MarketPriceSection(props: {
<> <>
<View className="flex flex-col gap-2.5"> <View className="flex flex-col gap-2.5">
<View className="flex !h-8 flex-row items-center justify-between"> <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>
<View className="text-neutral-darkest text-sm font-medium"> <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"> <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> <Text className="text-sm text-gray-500">/</Text>
</View> </View>
<View className="relative flex"> <View className="relative flex">
@ -216,7 +221,10 @@ export default function MarketPriceSection(props: {
) : ( ) : (
<View> <View>
<View className="mb-2 flex items-center justify-between"> <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> <Text className="text-sm text-gray-500">/</Text>
</View> </View>
<View className="relative"> <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="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>
<View className="text-neutral-darkest text-sm font-medium"> <View className="text-neutral-darkest text-sm font-medium">
@ -277,7 +286,8 @@ export default function MarketPriceSection(props: {
</View> </View>
</View> </View>
<View className="flex !h-8 flex-row items-center justify-between"> <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>
<View className="text-neutral-darkest text-sm font-medium"> <View className="text-neutral-darkest text-sm font-medium">
@ -285,7 +295,8 @@ export default function MarketPriceSection(props: {
</View> </View>
</View> </View>
<View className="flex !h-8 flex-row items-center justify-between bg-yellow-200"> <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 {purchaseOrderVO.orderDealer?.includePackingFlag
? "销售金额 + 包装费" ? "销售金额 + 包装费"
@ -301,6 +312,10 @@ export default function MarketPriceSection(props: {
{/* 销售单价编辑弹窗 */} {/* 销售单价编辑弹窗 */}
{purchaseOrderVO.orderSupplierList?.map((supplier) => ( {purchaseOrderVO.orderSupplierList?.map((supplier) => (
<Popup <Popup
duration={150}
style={{
minHeight: "auto",
}}
key={supplier.orderSupplierId} key={supplier.orderSupplierId}
visible={visiblePopup[supplier.orderSupplierId || ""]} visible={visiblePopup[supplier.orderSupplierId || ""]}
position="bottom" position="bottom"
@ -320,7 +335,8 @@ export default function MarketPriceSection(props: {
lockScroll lockScroll
> >
<View className="flex flex-col gap-3 p-2.5"> <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>
<View className="border-neutral-base flex flex-row items-center rounded-md border border-solid"> <View className="border-neutral-base flex flex-row items-center rounded-md border border-solid">

View File

@ -311,6 +311,10 @@ export default function MaterialCostSection(props: {
{/* 新增其他辅料费 */} {/* 新增其他辅料费 */}
<Popup <Popup
duration={150}
style={{
minHeight: "auto",
}}
visible={showAddCostPopup} visible={showAddCostPopup}
position="bottom" position="bottom"
title="新增其他辅料费用" title="新增其他辅料费用"
@ -320,7 +324,8 @@ export default function MaterialCostSection(props: {
> >
<View className="flex flex-col gap-3 p-2.5"> <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>
<View className="border-neutral-base relative flex h-10 w-full items-center rounded-md border border-solid"> <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 && ( {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>
<View className="border-neutral-base flex flex-row items-center rounded-md border border-solid"> <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>
{/* 单价输入 */} {/* 单价输入 */}
<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>
<View className="border-neutral-base flex flex-row items-center rounded-md border border-solid"> <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 && ( {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>
<View className="border-neutral-base flex flex-row items-center rounded-md border border-solid"> <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 ( return (
<Popup <Popup
duration={150}
style={{
minHeight: "auto",
}}
key={item.orderCostId} key={item.orderCostId}
visible={visiblePopup[item.orderCostId]} visible={visiblePopup[item.orderCostId]}
position="bottom" position="bottom"
@ -620,7 +632,8 @@ export default function MaterialCostSection(props: {
<View className="flex flex-col gap-3 p-2.5"> <View className="flex flex-col gap-3 p-2.5">
{requireQuantityAndPrice ? ( {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>
<View className="border-neutral-base flex flex-row items-center rounded-md border border-solid"> <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 className="mr-2"></View>
</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>
<View className="border-neutral-base flex flex-row items-center rounded-md border border-solid"> <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>
<View className="border-neutral-base flex flex-row items-center rounded-md border border-solid"> <View className="border-neutral-base flex flex-row items-center rounded-md border border-solid">

View File

@ -527,6 +527,10 @@ export default function PackageInfoSection(props: {
{/* 纸箱价格编辑弹窗 */} {/* 纸箱价格编辑弹窗 */}
{packageData.map((pkg: BusinessAPI.OrderPackage) => ( {packageData.map((pkg: BusinessAPI.OrderPackage) => (
<Popup <Popup
duration={150}
style={{
minHeight: "auto",
}}
key={pkg.orderPackageId} key={pkg.orderPackageId}
visible={visiblePopup[pkg.orderPackageId || ""]} visible={visiblePopup[pkg.orderPackageId || ""]}
position="bottom" position="bottom"
@ -546,7 +550,8 @@ export default function PackageInfoSection(props: {
lockScroll lockScroll
> >
<View className="flex flex-col gap-3 p-2.5"> <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>
<View className="border-neutral-base flex flex-row items-center rounded-md border border-solid"> <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 className="mr-2"></View>
</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>
<View className="border-neutral-base flex flex-row items-center rounded-md border border-solid"> <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 className="mr-2"></View>
</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>
<View className="border-neutral-base flex flex-row items-center rounded-md border border-solid"> <View className="border-neutral-base flex flex-row items-center rounded-md border border-solid">

View File

@ -304,6 +304,10 @@ export default function PackagingCostSection(props: {
{/* 新增其他费用*/} {/* 新增其他费用*/}
<Popup <Popup
duration={150}
style={{
minHeight: "auto",
}}
visible={showAddCostPopup} visible={showAddCostPopup}
position="bottom" position="bottom"
title="新增其他费用" title="新增其他费用"
@ -626,6 +630,10 @@ export default function PackagingCostSection(props: {
{/* 固定费用编辑弹窗 */} {/* 固定费用编辑弹窗 */}
{fixedCosts.map((item) => ( {fixedCosts.map((item) => (
<Popup <Popup
duration={150}
style={{
minHeight: "auto",
}}
key={item.orderCostId} key={item.orderCostId}
visible={visiblePopup[item.orderCostId]} visible={visiblePopup[item.orderCostId]}
position="bottom" position="bottom"
@ -752,6 +760,10 @@ export default function PackagingCostSection(props: {
{/* 其他费用编辑弹窗 */} {/* 其他费用编辑弹窗 */}
{otherCosts.map((item) => ( {otherCosts.map((item) => (
<Popup <Popup
duration={150}
style={{
minHeight: "auto",
}}
key={item.orderCostId} key={item.orderCostId}
visible={visiblePopup[item.orderCostId]} visible={visiblePopup[item.orderCostId]}
position="bottom" position="bottom"

View File

@ -221,6 +221,10 @@ export default function ProductionAdvanceSection(props: {
{/* 新增其他产地垫付费用 */} {/* 新增其他产地垫付费用 */}
<Popup <Popup
duration={150}
style={{
minHeight: "auto",
}}
visible={showAddCostPopup} visible={showAddCostPopup}
position="bottom" position="bottom"
title="新增其他产地垫付费用" title="新增其他产地垫付费用"
@ -515,6 +519,10 @@ export default function ProductionAdvanceSection(props: {
{productionAdvanceCosts.map((item) => { {productionAdvanceCosts.map((item) => {
return ( return (
<Popup <Popup
duration={150}
style={{
minHeight: "auto",
}}
key={item.orderCostId} key={item.orderCostId}
visible={visiblePopup[item.orderCostId]} visible={visiblePopup[item.orderCostId]}
position="bottom" position="bottom"

View File

@ -2,7 +2,7 @@ import { formatCurrency, validatePrice } from "@/utils/format";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { Button, Input, Popup, SafeArea, Table } from "@nutui/nutui-react-taro"; import { Button, Input, Popup, SafeArea, Table } from "@nutui/nutui-react-taro";
import { Icon } from "@/components"; import { Icon } from "@/components";
import { View } from "@tarojs/components"; import { Text, View } from "@tarojs/components";
export default function PurchaseCostInfoSection(props: { export default function PurchaseCostInfoSection(props: {
purchaseOrderVO: BusinessAPI.PurchaseOrderVO; purchaseOrderVO: BusinessAPI.PurchaseOrderVO;
@ -153,6 +153,16 @@ export default function PurchaseCostInfoSection(props: {
{ {
title: "项目", title: "项目",
key: "project", 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.length > 0
? purchaseOrderVO?.orderSupplierList.map((item) => { ? purchaseOrderVO?.orderSupplierList.map((item) => {
@ -196,6 +206,7 @@ export default function PurchaseCostInfoSection(props: {
data={[ data={[
{ {
project: "毛重(斤)", project: "毛重(斤)",
icon: "weight-scale",
...(purchaseOrderVO?.orderSupplierList.length > 0 ...(purchaseOrderVO?.orderSupplierList.length > 0
? purchaseOrderVO?.orderSupplierList.reduce((acc, item) => { ? purchaseOrderVO?.orderSupplierList.reduce((acc, item) => {
acc[item.orderSupplierId] = item.grossWeight; acc[item.orderSupplierId] = item.grossWeight;
@ -211,6 +222,7 @@ export default function PurchaseCostInfoSection(props: {
}, },
{ {
project: "箱重(斤)", project: "箱重(斤)",
icon: "weight-scale",
...(purchaseOrderVO?.orderSupplierList.length > 0 ...(purchaseOrderVO?.orderSupplierList.length > 0
? purchaseOrderVO?.orderSupplierList.reduce((acc, item) => { ? purchaseOrderVO?.orderSupplierList.reduce((acc, item) => {
acc[item.orderSupplierId] = calculateBoxWeight(item); acc[item.orderSupplierId] = calculateBoxWeight(item);
@ -226,6 +238,7 @@ export default function PurchaseCostInfoSection(props: {
}, },
{ {
project: "净重(斤)", project: "净重(斤)",
icon: "weight-scale",
...(purchaseOrderVO?.orderSupplierList.length > 0 ...(purchaseOrderVO?.orderSupplierList.length > 0
? purchaseOrderVO?.orderSupplierList.reduce((acc, item) => { ? purchaseOrderVO?.orderSupplierList.reduce((acc, item) => {
acc[item.orderSupplierId] = calculateNetWeight(item); acc[item.orderSupplierId] = calculateNetWeight(item);
@ -241,6 +254,7 @@ export default function PurchaseCostInfoSection(props: {
}, },
{ {
project: "单价(元/斤)", project: "单价(元/斤)",
icon: "money-bill",
...(purchaseOrderVO?.orderSupplierList.length > 0 ...(purchaseOrderVO?.orderSupplierList.length > 0
? purchaseOrderVO?.orderSupplierList.reduce((acc, item) => { ? purchaseOrderVO?.orderSupplierList.reduce((acc, item) => {
const purchasePrice = const purchasePrice =
@ -267,6 +281,7 @@ export default function PurchaseCostInfoSection(props: {
}, },
{ {
project: "合计(元)", project: "合计(元)",
icon: "money-bill",
...(purchaseOrderVO?.orderSupplierList.length > 0 ...(purchaseOrderVO?.orderSupplierList.length > 0
? purchaseOrderVO?.orderSupplierList.reduce((acc, item) => { ? purchaseOrderVO?.orderSupplierList.reduce((acc, item) => {
acc[item.orderSupplierId] = formatCurrency( acc[item.orderSupplierId] = formatCurrency(
@ -287,6 +302,10 @@ export default function PurchaseCostInfoSection(props: {
{/* 采购单价编辑弹窗 */} {/* 采购单价编辑弹窗 */}
<Popup <Popup
duration={150}
style={{
minHeight: "auto",
}}
visible={visiblePopup["单价(元/斤)"] || false} visible={visiblePopup["单价(元/斤)"] || false}
position="bottom" position="bottom"
title="编辑采购单价" title="编辑采购单价"

View File

@ -178,9 +178,12 @@ export default function RebateCalcSection(props: {
</View> </View>
<Popup <Popup
duration={150}
style={{
minHeight: "auto",
}}
closeable closeable
destroyOnClose destroyOnClose
duration={150}
visible={visible} visible={visible}
title="返点信息" title="返点信息"
position="bottom" position="bottom"

View File

@ -10,6 +10,7 @@ import { View } from "@tarojs/components";
import { useState } from "react"; import { useState } from "react";
import Taro from "@tarojs/taro"; import Taro from "@tarojs/taro";
import { uploadFile } from "@/utils/uploader"; import { uploadFile } from "@/utils/uploader";
import { Icon } from "@/components";
export default function SupplierInfoSection(props: { export default function SupplierInfoSection(props: {
purchaseOrderVO: BusinessAPI.PurchaseOrderVO; purchaseOrderVO: BusinessAPI.PurchaseOrderVO;
@ -77,7 +78,7 @@ export default function SupplierInfoSection(props: {
// 构造图片 URL 数组 // 构造图片 URL 数组
const imageUrls: string[] = []; const imageUrls: string[] = [];
console.log("supplier", supplier, type) console.log("supplier", supplier, type);
if (type === "emptyWeightImg" && supplier.emptyWeightImg) { if (type === "emptyWeightImg" && supplier.emptyWeightImg) {
imageUrls.push(supplier.emptyWeightImg); imageUrls.push(supplier.emptyWeightImg);
} else if (type === "totalWeightImg" && supplier.totalWeightImg) { } else if (type === "totalWeightImg" && supplier.totalWeightImg) {
@ -88,7 +89,7 @@ export default function SupplierInfoSection(props: {
imageUrls.push(file); imageUrls.push(file);
} }
}); });
} else if (type === "invoiceImg" && supplier.invoiceUpload) { } else if (type === "invoiceImg" && supplier.invoiceUpload) {
supplier.invoiceImg?.forEach((file) => { supplier.invoiceImg?.forEach((file) => {
if (file) { if (file) {
imageUrls.push(file); imageUrls.push(file);
@ -109,25 +110,31 @@ export default function SupplierInfoSection(props: {
if (!currentSupplier || !currentUploadType) return; if (!currentSupplier || !currentUploadType) return;
// 获取当前上传的文件列表 // 获取当前上传的文件列表
const uploadedFiles = uploadStates[currentSupplier.orderSupplierId]?.[currentUploadType]; const uploadedFiles =
uploadStates[currentSupplier.orderSupplierId]?.[currentUploadType];
if (!uploadedFiles) return; if (!uploadedFiles) return;
// 创建新的 purchaseOrderVO 副本 // 创建新的 purchaseOrderVO 副本
const updatedPurchaseOrderVO = { ...purchaseOrderVO }; const updatedPurchaseOrderVO = { ...purchaseOrderVO };
if (updatedPurchaseOrderVO.orderSupplierList) { if (updatedPurchaseOrderVO.orderSupplierList) {
updatedPurchaseOrderVO.orderSupplierList = [...updatedPurchaseOrderVO.orderSupplierList]; updatedPurchaseOrderVO.orderSupplierList = [
...updatedPurchaseOrderVO.orderSupplierList,
];
} }
// 找到当前供应商在列表中的索引 // 找到当前供应商在列表中的索引
const supplierIndex = updatedPurchaseOrderVO.orderSupplierList?.findIndex( const supplierIndex = updatedPurchaseOrderVO.orderSupplierList?.findIndex(
(supplier) => supplier.orderSupplierId === currentSupplier.orderSupplierId (supplier) =>
supplier.orderSupplierId === currentSupplier.orderSupplierId,
); );
if (supplierIndex === undefined || supplierIndex === -1) return; if (supplierIndex === undefined || supplierIndex === -1) return;
// 更新对应的供应商字段 // 更新对应的供应商字段
const updatedSupplier = { ...updatedPurchaseOrderVO.orderSupplierList[supplierIndex] }; const updatedSupplier = {
...updatedPurchaseOrderVO.orderSupplierList[supplierIndex],
};
switch (currentUploadType) { switch (currentUploadType) {
case "emptyWeightImg": case "emptyWeightImg":
@ -141,15 +148,15 @@ export default function SupplierInfoSection(props: {
case "contractImg": case "contractImg":
// 合同图片可以有多张,保存所有 URL // 合同图片可以有多张,保存所有 URL
updatedSupplier.contractImg = uploadedFiles updatedSupplier.contractImg = uploadedFiles
.filter(file => file.url) .filter((file) => file.url)
.map(file => file.url!); .map((file) => file.url!);
updatedSupplier.contractUpload = uploadedFiles.length > 0; updatedSupplier.contractUpload = uploadedFiles.length > 0;
break; break;
case "invoiceImg": case "invoiceImg":
// 发票图片可以有多张,保存所有 URL // 发票图片可以有多张,保存所有 URL
updatedSupplier.invoiceImg = uploadedFiles updatedSupplier.invoiceImg = uploadedFiles
.filter(file => file.url) .filter((file) => file.url)
.map(file => file.url!); .map((file) => file.url!);
updatedSupplier.invoiceUpload = uploadedFiles.length > 0; updatedSupplier.invoiceUpload = uploadedFiles.length > 0;
break; break;
} }
@ -187,7 +194,8 @@ export default function SupplierInfoSection(props: {
{/* 瓜农凭证信息 */} {/* 瓜农凭证信息 */}
<View className="flex w-full flex-col gap-2.5"> <View className="flex w-full flex-col gap-2.5">
<View className="flex !h-8 flex-row items-center justify-between"> <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>
<View className="text-neutral-darkest text-sm font-medium"> <View className="text-neutral-darkest text-sm font-medium">
@ -217,7 +225,8 @@ export default function SupplierInfoSection(props: {
</View> </View>
</View> </View>
<View className="flex !h-8 flex-row items-center justify-between"> <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>
<View className="text-neutral-darkest text-sm font-medium"> <View className="text-neutral-darkest text-sm font-medium">
@ -247,7 +256,8 @@ export default function SupplierInfoSection(props: {
</View> </View>
</View> </View>
<View className="flex !h-8 flex-row items-center justify-between"> <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>
<View className="text-neutral-darkest text-sm font-medium"> <View className="text-neutral-darkest text-sm font-medium">
@ -277,7 +287,8 @@ export default function SupplierInfoSection(props: {
</View> </View>
</View> </View>
<View className="flex !h-8 flex-row items-center justify-between"> <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>
<View className="text-neutral-darkest text-sm font-medium"> <View className="text-neutral-darkest text-sm font-medium">
@ -313,6 +324,10 @@ export default function SupplierInfoSection(props: {
{/* 未上传弹窗 */} {/* 未上传弹窗 */}
<Popup <Popup
duration={150}
style={{
minHeight: "auto",
}}
visible={popupVisible && !readOnly} visible={popupVisible && !readOnly}
position="bottom" position="bottom"
onClose={() => setPopupVisible(false)} onClose={() => setPopupVisible(false)}
@ -335,7 +350,9 @@ export default function SupplierInfoSection(props: {
upload={uploadFile} upload={uploadFile}
defaultValue={ defaultValue={
currentSupplier currentSupplier
? uploadStates[currentSupplier.orderSupplierId]?.[currentUploadType] || [] ? uploadStates[currentSupplier.orderSupplierId]?.[
currentUploadType
] || []
: [] : []
} }
onChange={(fileList) => { onChange={(fileList) => {

View File

@ -243,6 +243,10 @@ export default function WorkerAdvanceSection(props: {
{/* 新增其他工头垫付费用 */} {/* 新增其他工头垫付费用 */}
<Popup <Popup
duration={150}
style={{
minHeight: "auto",
}}
visible={showAddCostPopup} visible={showAddCostPopup}
position="bottom" position="bottom"
title="新增其他工头垫付费用" title="新增其他工头垫付费用"
@ -536,6 +540,10 @@ export default function WorkerAdvanceSection(props: {
{workerAdvanceCosts.map((item) => { {workerAdvanceCosts.map((item) => {
return ( return (
<Popup <Popup
duration={150}
style={{
minHeight: "auto",
}}
key={item.orderCostId} key={item.orderCostId}
visible={visiblePopup[item.orderCostId]} visible={visiblePopup[item.orderCostId]}
position="bottom" position="bottom"

View File

@ -48,9 +48,12 @@ export default function SupplierPicker(props: ISupplierPickerProps) {
{/* 选择瓜农 */} {/* 选择瓜农 */}
<Popup <Popup
duration={150}
style={{
minHeight: "auto",
}}
closeable closeable
destroyOnClose destroyOnClose
duration={150}
visible={visible} visible={visible}
title="选择瓜农" title="选择瓜农"
position="bottom" position="bottom"

View File

@ -331,10 +331,13 @@ export default hocAuth(function Page(props: CommonComponent) {
{/* 选择身份 */} {/* 选择身份 */}
<Popup <Popup
duration={150}
style={{
minHeight: "auto",
}}
className={"w-full"} className={"w-full"}
closeable closeable
destroyOnClose destroyOnClose
duration={150}
visible={visible} visible={visible}
title="选择身份" title="选择身份"
onClose={async () => { onClose={async () => {

View File

@ -40,13 +40,14 @@ export default base(function Page() {
}} }}
> >
<Popup <Popup
duration={150}
style={{
minHeight: "auto",
}}
visible={showBasic} visible={showBasic}
onClose={() => { onClose={() => {
setShowBasic(false); setShowBasic(false);
}} }}
style={{
maxWidth: "100%",
}}
> >
<Captcha <Captcha
handleClick={async (token: string) => { handleClick={async (token: string) => {
@ -72,7 +73,7 @@ export default base(function Page() {
{/* Logo展示区域 */} {/* Logo展示区域 */}
<View className="mb-4 flex justify-center"> <View className="mb-4 flex justify-center">
{channel?.logo && ( {channel?.logo && (
<Image src={channel.logo} className="w-16 h-16" /> <Image src={channel.logo} className="h-16 w-16" />
)} )}
</View> </View>
<View className="mb-4 text-xl font-bold text-gray-900"> <View className="mb-4 text-xl font-bold text-gray-900">

View File

@ -5,7 +5,16 @@ import { business } from "@/services";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { View } from "@tarojs/components"; import { View } from "@tarojs/components";
import purchaseOrder from "@/constant/purchaseOrder"; 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 { import {
BasicInfoSection, BasicInfoSection,
CompanyInfoSection, CompanyInfoSection,
@ -22,7 +31,7 @@ import {
State, State,
TaxProvisionSection, TaxProvisionSection,
TaxSubsidySection, TaxSubsidySection,
WorkerAdvanceSection WorkerAdvanceSection,
} from "@/components"; } from "@/components";
import buildUrl from "@/utils/buildUrl"; import buildUrl from "@/utils/buildUrl";
import { PurchaseOrderCalculator } from "@/utils/PurchaseOrderCalculator"; 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="text-sm font-bold">{section.title}</View>
<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 <section.component
readOnly={purchaseOrderVO.state !== "WAITING_AUDIT"} readOnly={purchaseOrderVO.state !== "WAITING_AUDIT"}
@ -619,6 +628,10 @@ export default hocAuth(function Page(props: CommonComponent) {
{/* 驳回原因弹窗 */} {/* 驳回原因弹窗 */}
<Popup <Popup
duration={150}
style={{
minHeight: "auto",
}}
visible={rejectVisible} visible={rejectVisible}
position="bottom" position="bottom"
onClose={() => { onClose={() => {

View File

@ -1,10 +1,4 @@
import { import { ActionType, Icon, PageList, SupplierPicker, ToolBar } from "@/components";
ActionType,
Icon,
PageList,
SupplierPicker,
ToolBar,
} from "@/components";
import { useShareAppMessage } from "@tarojs/taro"; import { useShareAppMessage } from "@tarojs/taro";
import { useRef, useState } from "react"; import { useRef, useState } from "react";
import { business } from "@/services"; import { business } from "@/services";
@ -12,14 +6,7 @@ import hocAuth from "@/hocs/auth";
import { CommonComponent } from "@/types/typings"; import { CommonComponent } from "@/types/typings";
import { View } from "@tarojs/components"; import { View } from "@tarojs/components";
import dayjs from "dayjs"; import dayjs from "dayjs";
import { import { Button, Popup, SafeArea, Toast, Uploader, UploaderFileItem } from "@nutui/nutui-react-taro";
Button,
Popup,
SafeArea,
Toast,
Uploader,
UploaderFileItem,
} from "@nutui/nutui-react-taro";
import { uploadFile } from "@/utils/uploader"; import { uploadFile } from "@/utils/uploader";
export default hocAuth(function Page(props: CommonComponent) { export default hocAuth(function Page(props: CommonComponent) {
@ -104,6 +91,10 @@ export default hocAuth(function Page(props: CommonComponent) {
<> <>
{/* Popup 弹窗 */} {/* Popup 弹窗 */}
<Popup <Popup
duration={150}
style={{
minHeight: "auto",
}}
visible={popupVisible} visible={popupVisible}
position="bottom" position="bottom"
onClose={() => setPopupVisible(false)} onClose={() => setPopupVisible(false)}