From 01521fc8c5e623f8bd6febae8c9a905945b34b2b Mon Sep 17 00:00:00 2001 From: shenyifei Date: Wed, 17 Dec 2025 18:03:22 +0800 Subject: [PATCH] =?UTF-8?q?feat(order):=20=E6=96=B0=E5=A2=9E=E9=87=87?= =?UTF-8?q?=E8=B4=AD=E5=8D=95=E7=9B=B8=E5=85=B3=E7=BB=84=E4=BB=B6=E5=8F=8A?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 PurchaseOrderFormItem、PurchaseOrderModal 等采购单表单项组件 - 在 OrderCostList 和 OrderSupplierList 中集成采购单选择功能 - 新增 OrderRebateList 返利列表组件 - 实现采购单数据的展示与选择逻辑 - 添加采购单相关的搜索和筛选字段 - 支持采购单详情查看及关联数据显示 - 优化订单成本列表的创建表单结构 - 增加表格行选择和批量操作功能 - 完善采购单状态标签显示及样式处理 --- .../src/components/Biz/BizContainer.tsx | 28 +- .../src/components/Biz/typing.ts | 3 +- .../src/components/Order/OrderCostList.tsx | 198 ++++++++- .../src/components/Order/OrderRebateList.tsx | 263 ++++++++++++ .../components/Order/OrderSupplierList.tsx | 391 ++++++++++++++---- .../Order/PurchaseOrderFormItem.tsx | 62 +++ .../components/Order/PurchaseOrderList.tsx | 6 + .../components/Order/PurchaseOrderModal.tsx | 342 +++++++++++++++ .../components/Order/PurchaseOrderSearch.tsx | 66 +++ .../components/Order/PurchaseOrderSelect.tsx | 57 +++ .../src/components/Order/index.ts | 6 + packages/app-operation/src/locales/zh-CN.ts | 126 +++++- .../app-operation/src/pages/PaymentRebate.tsx | 4 +- .../src/services/business/index.ts | 2 + .../src/services/business/orderCost.ts | 18 + .../src/services/business/orderRebate.ts | 23 ++ .../src/services/business/typings.d.ts | 186 +++++++-- swagger/business.json | 2 +- 18 files changed, 1630 insertions(+), 153 deletions(-) create mode 100644 packages/app-operation/src/components/Order/OrderRebateList.tsx create mode 100644 packages/app-operation/src/components/Order/PurchaseOrderFormItem.tsx create mode 100644 packages/app-operation/src/components/Order/PurchaseOrderModal.tsx create mode 100644 packages/app-operation/src/components/Order/PurchaseOrderSearch.tsx create mode 100644 packages/app-operation/src/components/Order/PurchaseOrderSelect.tsx create mode 100644 packages/app-operation/src/services/business/orderRebate.ts diff --git a/packages/app-operation/src/components/Biz/BizContainer.tsx b/packages/app-operation/src/components/Biz/BizContainer.tsx index 837c083..e51553d 100644 --- a/packages/app-operation/src/components/Biz/BizContainer.tsx +++ b/packages/app-operation/src/components/Biz/BizContainer.tsx @@ -16,6 +16,8 @@ import { DealerFormItem, DealerList, PageContainer, + PurchaseOrderFormItem, + PurchaseOrderList, Remark, RemarkFormItem, SmartActionBar, @@ -37,7 +39,7 @@ import { } from '@ant-design/pro-components'; import { Avatar, Button, message, Space, Switch, Tour, TourProps } from 'antd'; import { Dayjs } from 'dayjs'; -import React, { +import { useContext, useEffect, useImperativeHandle, @@ -845,6 +847,30 @@ export default function BizContainer< ); }, }, + purchaseOrder: { + renderFormItem: (_, props) => { + return ( + + ); + }, + render: (purchaseOrderVO: BusinessAPI.PurchaseOrderVO) => { + console.log('purchaseOrderVO', purchaseOrderVO); + return ( + purchaseOrderVO && ( + ( + + {purchaseOrderVO.orderSn} + + )} + /> + ) + ); + }, + }, user: { renderFormItem: (_, props) => { return ; diff --git a/packages/app-operation/src/components/Biz/typing.ts b/packages/app-operation/src/components/Biz/typing.ts index d2b9b9d..20ac284 100644 --- a/packages/app-operation/src/components/Biz/typing.ts +++ b/packages/app-operation/src/components/Biz/typing.ts @@ -20,6 +20,7 @@ export type BizValueType = | 'customField' | 'status' | 'remark' + | 'purchaseOrder' | 'dealer'; export type FormType = 'modal' | 'drawer' | 'step'; export type ModeType = @@ -156,7 +157,7 @@ export interface BizDragProps< ) => React.ReactNode; fieldProps?: DragTableProps; trigger?: () => React.ReactNode; - mode?: ModeType + mode?: ModeType; } export interface BizCalenderProps< diff --git a/packages/app-operation/src/components/Order/OrderCostList.tsx b/packages/app-operation/src/components/Order/OrderCostList.tsx index 9757c74..c8ed331 100644 --- a/packages/app-operation/src/components/Order/OrderCostList.tsx +++ b/packages/app-operation/src/components/Order/OrderCostList.tsx @@ -2,15 +2,24 @@ import { BizContainer, BizValueType, CompanyList, + CostList, ModeType, - PurchaseOrderList, + PurchaseOrderSelect, } from '@/components'; import { business } from '@/services'; -import { useIntl } from '@@/exports'; -import { ProColumns } from '@ant-design/pro-components'; -import { ProDescriptionsItemProps } from '@ant-design/pro-descriptions'; -import React, { useState } from 'react'; import groupby from '@/utils/groupby'; +import { useIntl } from '@@/exports'; +import { + ProColumns, + ProFormDependency, + ProFormMoney, + ProFormText, +} from '@ant-design/pro-components'; +import { ProDescriptionsItemProps } from '@ant-design/pro-descriptions'; +import { ProFormBizSelect } from '@chageable/components'; +import { ProFormBizSelectHandles } from '@chageable/components/src'; +import React, { useRef, useState } from 'react'; +import { Button, Space } from 'antd'; interface IOrderCostListProps { ghost?: boolean; @@ -32,6 +41,7 @@ export default function OrderCostList(props: IOrderCostListProps) { } = props; const intl = useIntl(); const intlPrefix = 'orderCost'; + const costRef = useRef(null); const [activeKey, setActiveKey] = useState('ALL'); @@ -109,17 +119,8 @@ export default function OrderCostList(props: IOrderCostListProps) { { title: intl.formatMessage({ id: intlPrefix + '.column.purchaseOrder' }), dataIndex: 'purchaseOrderVO', - key: 'poOrderSn', - render: (_, record) => { - return ( - {record.purchaseOrderVO.orderSn}} - /> - ); - }, + key: 'orderId', + valueType: 'purchaseOrder', }, { title: intl.formatMessage({ id: intlPrefix + '.column.orderVehicle' }), @@ -186,6 +187,144 @@ export default function OrderCostList(props: IOrderCostListProps) { }, ]; + const formContext = [ + { + const { data } = await business.cost.listCost({ + costListQry: { + type: 'LOGISTICS_TYPE', + }, + }); + + const costGroup = groupby( + data?.filter( + (item) => + item.type === 'LOGISTICS_TYPE' && + item.name !== '主运费' && + item.name !== '短驳费' && + item.name !== '草帘费', + ) || [], + (item) => item.type, + ); + + const options = Object.keys(costGroup).map((key) => ({ + label: intl.formatMessage({ + id: + 'cost.column.type.enum.' + + key + .toLowerCase() + .replace(/_([a-z])/g, (_, char) => char.toUpperCase()), + }), + title: key, + options: costGroup[key].map((item) => ({ + label: item.name, + value: item.costId, + })), + })); + + return options || []; + }} + fieldProps={{ + fetchDataOnSearch: false, + showSearch: true, + autoClearSearchValue: true, + }} + addonAfter={ + costRef.current?.reload()} + /> + } + />, + , + + {({ purchaseOrderVO }, form) => { + form.setFieldsValue({ + principal: purchaseOrderVO?.orderVehicle.driver, + }); + return ( + <> + {purchaseOrderVO && ( + + )} + {purchaseOrderVO && ( + + )} + + ); + }} + , +