diff --git a/packages/app-operation/src/components/Biz/BizContainer.tsx b/packages/app-operation/src/components/Biz/BizContainer.tsx index e51553d..e1312a7 100644 --- a/packages/app-operation/src/components/Biz/BizContainer.tsx +++ b/packages/app-operation/src/components/Biz/BizContainer.tsx @@ -863,7 +863,9 @@ export default function BizContainer< orderId={purchaseOrderVO.orderId} trigger={() => ( - {purchaseOrderVO.orderSn} + + {`${purchaseOrderVO.orderVehicle?.dealerName} - 第 ${purchaseOrderVO.orderVehicle?.vehicleNo || '暂无'} 车 - ${purchaseOrderVO.orderSn || '暂无'}`} + )} /> diff --git a/packages/app-operation/src/components/Dealer/DealerList.tsx b/packages/app-operation/src/components/Dealer/DealerList.tsx index c23d00d..a7701e9 100644 --- a/packages/app-operation/src/components/Dealer/DealerList.tsx +++ b/packages/app-operation/src/components/Dealer/DealerList.tsx @@ -2,6 +2,7 @@ import { BizContainer, BizValueType, DealerPaymentAccountList, + DealerPurchaseSetting, DealerRebateCustomerList, DeliveryTemplate, ModeType, @@ -11,10 +12,7 @@ import { useIntl } from '@@/exports'; import { CheckCircleOutlined, CloseCircleOutlined } from '@ant-design/icons'; import { ProColumns, - ProFormDependency, - ProFormDigit, ProFormRadio, - ProFormSwitch, ProFormText, } from '@ant-design/pro-components'; import { ProDescriptionsItemProps } from '@ant-design/pro-descriptions'; @@ -48,6 +46,20 @@ export default function DealerList(props: IDealerListProps) { key: 'shortName', renderText: (text: string) => {text}, }, + { + title: intl.formatMessage({ id: intlPrefix + '.column.dealerType' }), + dataIndex: 'dealerType', + key: 'dealerType', + valueType: 'select', + valueEnum: { + MARKET: intl.formatMessage({ + id: intlPrefix + '.column.dealerType.enum.market', + }), + SUPERMARKET: intl.formatMessage({ + id: intlPrefix + '.column.dealerType.enum.supermarket', + }), + }, + }, { title: intl.formatMessage({ id: intlPrefix + '.column.dealerPaymentAccountVOList', @@ -170,6 +182,34 @@ export default function DealerList(props: IDealerListProps) { ), }, + { + title: ( + + + {intl.formatMessage({ + id: intlPrefix + '.column.includeFreightFlag', + })} + + + ), + dataIndex: 'includeFreightFlag', + key: 'includeFreightFlag', + valueType: 'switch', + search: false, + render: (_, record) => ( + + {record.includeFreightFlag ? ( + + ) : ( + + )} + + ), + }, // 新增字段展示 - 计提税金 { title: ( @@ -298,236 +338,6 @@ export default function DealerList(props: IDealerListProps) { }), }} />, - , - - {({ enableShare }) => { - return ( - enableShare && ( - <> - - - - ) - ); - }} - , - , - , - , - // 新增字段表单 - 计提税金 - , - - {({ enableAccrualTax }) => { - return ( - enableAccrualTax && ( - - ) - ); - }} - , - // 新增字段表单 - 公司返点 - , - - {({ enableCompanyRebate }) => { - return ( - enableCompanyRebate && ( - - ) - ); - }} - , - // 新增字段表单 - 产地损耗 - , - - {({ enableLoss }) => { - return ( - enableLoss && ( - - ) - ); - }} - , ]; const detailColumns: ProDescriptionsItemProps< @@ -611,6 +421,14 @@ export default function DealerList(props: IDealerListProps) { actionRef.current?.reload(); }} />, + { + actionRef.current?.reload(); + }} + />, ]; }, }} diff --git a/packages/app-operation/src/components/Dealer/DealerPurchaseSetting.tsx b/packages/app-operation/src/components/Dealer/DealerPurchaseSetting.tsx new file mode 100644 index 0000000..9cf42e2 --- /dev/null +++ b/packages/app-operation/src/components/Dealer/DealerPurchaseSetting.tsx @@ -0,0 +1,363 @@ +import { ButtonAccess, InsertPosition } from '@/components'; +import { business } from '@/services'; +import { useIntl } from '@@/exports'; +import { + DrawerForm, + ProFormDependency, + ProFormDigit, + ProFormSwitch, + ProFormText, + RouteContext, + RouteContextType, +} from '@ant-design/pro-components'; +import { Card, Divider, message, Space } from 'antd'; + +interface IDealerPurchaseSettingProps { + insertPosition?: InsertPosition; + dealerVO: BusinessAPI.DealerVO; + onFinish?: () => void; +} + +interface IFeatureCardProps { + title: string; + description?: string; + name: string; + children?: React.ReactNode; + checkedChildren?: string; + unCheckedChildren?: string; +} + +// 功能卡片组件 +const FeatureCard: React.FC = ({ + title, + description, + name, + children, + checkedChildren, + unCheckedChildren, +}) => { + return ( + +
+
+
+ {title} +
+ {description && ( +
+ {description} +
+ )} +
+
+ +
+
+ {children && ( + <> + +
{children}
+ + )} +
+ ); +}; + +export default function DealerPurchaseSetting( + props: IDealerPurchaseSettingProps, +) { + const { onFinish, dealerVO } = props; + const intl = useIntl(); + const intlPrefix = 'dealer'; + const commonYes = intl.formatMessage({ id: 'common.yes' }); + const commonNo = intl.formatMessage({ id: 'common.no' }); + + return ( + + {(value: RouteContextType) => { + const { isMobile } = value; + return ( + + trigger={ + + 采购设置 + + } + title="采购设置" + layout="vertical" + width={isMobile ? '100%' : '45%'} + drawerProps={{ + destroyOnHidden: true, + }} + request={async () => { + const { data } = await business.dealer.showDealer({ + dealerShowQry: { + dealerId: dealerVO.dealerId, + }, + }); + + return data!; + }} + onFinish={async (formData) => { + await business.dealer.updateDealer(formData); + + onFinish?.(); + message.success('更新经销商设置成功'); + + return true; + }} + > + + ); +} diff --git a/packages/app-operation/src/components/Dealer/index.ts b/packages/app-operation/src/components/Dealer/index.ts index 4a4486a..8811a4a 100644 --- a/packages/app-operation/src/components/Dealer/index.ts +++ b/packages/app-operation/src/components/Dealer/index.ts @@ -8,3 +8,4 @@ export { default as DealerSearch } from './DealerSearch'; export { default as DealerSelect } from './DealerSelect'; export { default as DealerWarehouseList } from './DealerWarehouseList'; export { default as DeliveryTemplate } from './DeliveryTemplate'; +export { default as DealerPurchaseSetting } from './DealerPurchaseSetting'; diff --git a/packages/app-operation/src/components/Delivery/ShipOrderList.tsx b/packages/app-operation/src/components/Delivery/ShipOrderList.tsx index 6d98e94..8f66577 100644 --- a/packages/app-operation/src/components/Delivery/ShipOrderList.tsx +++ b/packages/app-operation/src/components/Delivery/ShipOrderList.tsx @@ -45,9 +45,11 @@ export default function OrderShipList(props: IOrderShipListProps) { title: intl.formatMessage({ id: intlPrefix + '.column.vehicleNo' }), dataIndex: ['orderVehicle', 'vehicleNo'], key: 'vehicleNo', - render: (_, record) => ( - 第 {record.orderVehicle?.vehicleNo} 车 - ), + render: (_, record) => { + return record.orderVehicle?.vehicleNo + ? '第' + record.orderVehicle?.vehicleNo + '车' + : '-'; + }, }, { title: intl.formatMessage({ id: intlPrefix + '.column.shippingDate' }), diff --git a/packages/app-operation/src/components/Expense/ExpenseCostList.tsx b/packages/app-operation/src/components/Expense/ExpenseCostList.tsx new file mode 100644 index 0000000..3e08c2f --- /dev/null +++ b/packages/app-operation/src/components/Expense/ExpenseCostList.tsx @@ -0,0 +1,123 @@ +import { BizContainer, BizValueType, ModeType } from '@/components'; +import { business } from '@/services'; +import { useIntl } from '@@/exports'; +import { ProColumns, ProFormText } from '@ant-design/pro-components'; +import { ProDescriptionsItemProps } from '@ant-design/pro-descriptions'; +import React from 'react'; + +interface IExpenseCostListProps { + ghost?: boolean; + costId?: BusinessAPI.CostVO['costId']; + search?: boolean; + onValueChange?: () => void; + mode?: ModeType; + trigger?: () => React.ReactNode; +} +export default function ExpenseCostList(props: IExpenseCostListProps) { + const { + ghost = false, + costId, + search = true, + mode = 'drag', + trigger, + onValueChange, + } = props; + const intl = useIntl(); + const intlPrefix = 'expenseCost'; + + const columns: ProColumns[] = [ + { + title: intl.formatMessage({ id: intlPrefix + '.column.name' }), + dataIndex: 'name', + key: 'name', + renderText: (text: string) => {text}, + }, + ]; + + const formContext = [ +