feat(dealer): 更新经销商信息显示和设置功能

- 优化经销商信息模块的显示逻辑,支持单独显示经销商名称和西瓜等级
- 添加初始车次号功能设置,包括开关和数值输入
- 更新经销商采购设置中的默认配置和数据处理逻辑
- 添加经销商设置中的初始车次号字段支持
- 更新费用项目列表接口调用,统一使用cost相关API
- 添加费用列表中是否默认显示的开关配置
- 新增档口订单列表组件,支持档口相关的订单管理功能
- 更新订单状态枚举,将WAITING_AUDIT改为AUDITING,REJECTED改为CLOSED
- 修复订单供应商列表中剩余金额的计算逻辑
- 更新相关类型定义中的ID字段类型为string
- 调整订单审批相关API的响应类型定义
This commit is contained in:
shenyifei 2025-12-31 16:14:20 +08:00
parent 124e3b179b
commit d8920e9c37
17 changed files with 995 additions and 253 deletions

View File

@ -80,6 +80,24 @@ const FeatureCard: React.FC<IFeatureCardProps> = ({
); );
}; };
const defaultDealerSetting = {
shareRatio: 50,
enableShare: false,
shareAdjusted: false,
accrualTaxRatio: null,
freightCostFlag: false,
enableAccrualTax: false,
strawMatCostFlag: false,
companyRebateRatio: null,
includeFreightFlag: false,
includePackingFlag: false,
enableCompanyRebate: false,
enableLoss: false,
lossAmount: null,
enableInitialTrainNo: false,
initialTrainNo: null,
};
export default function DealerPurchaseSetting( export default function DealerPurchaseSetting(
props: IDealerPurchaseSettingProps, props: IDealerPurchaseSettingProps,
) { ) {
@ -113,10 +131,54 @@ export default function DealerPurchaseSetting(
}, },
}); });
return data!; return {
...data!,
};
}} }}
onFinish={async (formData) => { onFinish={async (formData) => {
await business.dealer.updateDealer(formData); await business.dealer.updateDealer({
dealerId: formData.dealerId!,
enableLoss:
formData?.enableLoss || defaultDealerSetting.enableLoss,
lossAmount:
formData?.lossAmount || defaultDealerSetting.lossAmount,
shareRatio:
formData?.shareRatio || defaultDealerSetting.shareRatio,
enableShare:
formData?.enableShare || defaultDealerSetting.enableShare,
shareAdjusted:
formData?.shareAdjusted || defaultDealerSetting.shareAdjusted,
initialTrainNo:
formData?.initialTrainNo ||
defaultDealerSetting.initialTrainNo,
accrualTaxRatio:
formData?.accrualTaxRatio ||
defaultDealerSetting.accrualTaxRatio,
freightCostFlag:
formData?.freightCostFlag ||
defaultDealerSetting.freightCostFlag,
enableAccrualTax:
formData?.enableAccrualTax ||
defaultDealerSetting.enableAccrualTax,
strawMatCostFlag:
formData?.strawMatCostFlag ||
defaultDealerSetting.strawMatCostFlag,
companyRebateRatio:
formData?.companyRebateRatio ||
defaultDealerSetting.companyRebateRatio,
includeFreightFlag:
formData?.includeFreightFlag ||
defaultDealerSetting.includeFreightFlag,
includePackingFlag:
formData?.includePackingFlag ||
defaultDealerSetting.includePackingFlag,
enableCompanyRebate:
formData?.enableCompanyRebate ||
defaultDealerSetting.enableCompanyRebate,
enableInitialTrainNo:
formData?.enableInitialTrainNo ||
defaultDealerSetting.enableInitialTrainNo,
} as any);
onFinish?.(); onFinish?.();
message.success('更新经销商设置成功'); message.success('更新经销商设置成功');
@ -355,6 +417,48 @@ export default function DealerPurchaseSetting(
}} }}
</ProFormDependency> </ProFormDependency>
</FeatureCard> </FeatureCard>
{/* 初始车次号功能卡片 */}
<FeatureCard
title={intl.formatMessage({
id: intlPrefix + '.form.enableInitialTrainNo.label',
})}
description="是否开启初始车次号设置"
name="enableInitialTrainNo"
checkedChildren={commonYes}
unCheckedChildren={commonNo}
>
<ProFormDependency name={['enableInitialTrainNo']}>
{({ enableInitialTrainNo }) => {
return enableInitialTrainNo ? (
<ProFormDigit
name={'initialTrainNo'}
label={intl.formatMessage({
id: intlPrefix + '.form.initialTrainNo.label',
})}
placeholder={intl.formatMessage({
id: intlPrefix + '.form.initialTrainNo.placeholder',
})}
fieldProps={{
step: 1,
min: 0,
max: 9999,
suffix: '号',
}}
dependencies={['enableInitialTrainNo']}
rules={[
{
required: true,
message: intl.formatMessage({
id: intlPrefix + '.form.initialTrainNo.required',
}),
},
]}
/>
) : null;
}}
</ProFormDependency>
</FeatureCard>
</DrawerForm> </DrawerForm>
); );
}} }}

View File

@ -31,21 +31,21 @@ type DealerIdAndTemplate = Pick<
// 特殊处理:其他费用要实时获取费用项目 // 特殊处理:其他费用要实时获取费用项目
const updateOtherFeesModule = async (module: any) => { const updateOtherFeesModule = async (module: any) => {
const { data } = await business.costItem.listCostItem({ const { data: costList } = await business.cost.listCost({
costItemListQry: { costListQry: {
status: true, status: true,
}, },
}); });
const costItems =
data?.filter((item) => item.costType !== 'HUMAN_COST') || []; const showCostList = costList;//?.filter((item) => item.type !== 'EXPENSE_TYPE');
return { return {
...module, ...module,
config: { config: {
...module.config, ...module.config,
feeItems: costItems.map((item) => item.itemId), feeItems: showCostList?.map((item) => item.costId),
feeLabels: costItems.reduce((acc: any, item: any) => { feeLabels: showCostList?.reduce((acc: any, item: any) => {
acc[item.itemId] = item.name; acc[item.costId] = item.name;
return acc; return acc;
}, {}), }, {}),
}, },
@ -58,8 +58,8 @@ const updateOtherFeesModule = async (module: any) => {
dataIndex: 'feeItems', dataIndex: 'feeItems',
title: '显示费用项目', title: '显示费用项目',
valueType: 'checkbox', valueType: 'checkbox',
valueEnum: costItems.reduce((acc: any, item: any) => { valueEnum: showCostList?.reduce((acc: any, item: any) => {
acc[item.itemId] = item.name; acc[item.costId] = item.name;
return acc; return acc;
}, {}), }, {}),
}, },

View File

@ -92,17 +92,17 @@ const DealerInfoModule: React.FC<ModuleProps> = ({
<div className="col-span-1"></div> <div className="col-span-1"></div>
{config.showDealerName || config.showWatermelonGrade ? ( {config.showDealerName || config.showWatermelonGrade ? (
<div className="col-span-3 border-b border-black flex items-end justify-center"> <div className="col-span-3 border-b border-black flex items-end justify-center">
{config.showWatermelonGrade {config.showDealerName ? config.dealerName : ''}
? `${config.dealerName}-${config.watermelonGrade}` {config.showDealerName && config.showWatermelonGrade ? '- ' : ''}
: config.dealerName} {config.showWatermelonGrade ? config.watermelonGrade : ''}
</div> </div>
) : ( ) : (
<div className="col-span-3"></div> <div className="col-span-3"></div>
)} )}
{config.showDestination || config.showVehicleNumber ? ( {config.showDestination || config.showVehicleNumber ? (
<div className="col-span-3 border-b border-black flex items-end justify-center"> <div className="col-span-3 border-b border-black flex items-end justify-center">
{config.destination} {config.showDestination ? config.destination : ''}
{config.vehicleNumber} {config.showVehicleNumber ? config.vehicleNumber : ''}
</div> </div>
) : ( ) : (
<div className="col-span-3"></div> <div className="col-span-3"></div>

View File

@ -1,7 +1,11 @@
import { BizContainer, BizValueType, ModeType } from '@/components'; import { BizContainer, BizValueType, ModeType } from '@/components';
import { business } from '@/services'; import { business } from '@/services';
import { useIntl } from '@@/exports'; import { useIntl } from '@@/exports';
import { ProColumns, ProFormText } from '@ant-design/pro-components'; import {
ProColumns,
ProFormSwitch,
ProFormText,
} from '@ant-design/pro-components';
import { ProDescriptionsItemProps } from '@ant-design/pro-descriptions'; import { ProDescriptionsItemProps } from '@ant-design/pro-descriptions';
import React from 'react'; import React from 'react';
@ -32,6 +36,21 @@ export default function ExpenseCostList(props: IExpenseCostListProps) {
key: 'name', key: 'name',
renderText: (text: string) => <span className="font-medium">{text}</span>, renderText: (text: string) => <span className="font-medium">{text}</span>,
}, },
{
title: intl.formatMessage({ id: intlPrefix + '.column.isDefault' }),
dataIndex: 'isDefault',
key: 'isDefault',
valueType: 'switch',
search: false,
fieldProps: {
checkedChildren: intl.formatMessage({
id: intlPrefix + '.column.isDefault.enum.checkedChildren',
}),
unCheckedChildren: intl.formatMessage({
id: intlPrefix + '.column.isDefault.enum.unCheckedChildren',
}),
},
},
]; ];
const formContext = [ const formContext = [
@ -55,6 +74,18 @@ export default function ExpenseCostList(props: IExpenseCostListProps) {
}, },
]} ]}
/>, />,
// 是否默认
<ProFormSwitch
key={'isDefault'}
name={'isDefault'}
label={intl.formatMessage({ id: intlPrefix + '.form.isDefault.label' })}
checkedChildren={intl.formatMessage({
id: intlPrefix + '.form.isDefault.enum.checkedChildren',
})}
unCheckedChildren={intl.formatMessage({
id: intlPrefix + '.form.isDefault.enum.unCheckedChildren',
})}
/>
]; ];
const detailColumns: ProDescriptionsItemProps< const detailColumns: ProDescriptionsItemProps<

View File

@ -65,6 +65,12 @@ export default function OrderList(props: IOrderListProps) {
); );
}, },
}, },
{
title: intl.formatMessage({ id: intlPrefix + '.column.dealer' }),
valueType: 'dealer',
key: 'dealerId',
hideInTable: true,
},
{ {
title: intl.formatMessage({ id: intlPrefix + '.column.origin' }), title: intl.formatMessage({ id: intlPrefix + '.column.origin' }),
dataIndex: ['orderVehicle', 'origin'], dataIndex: ['orderVehicle', 'origin'],
@ -105,13 +111,13 @@ export default function OrderList(props: IOrderListProps) {
case 'DRAFT': case 'DRAFT':
color = 'default'; color = 'default';
break; break;
case 'WAITING_AUDIT': case 'AUDITING':
color = 'processing'; color = 'processing';
break; break;
case 'COMPLETED': case 'COMPLETED':
color = 'success'; color = 'success';
break; break;
case 'REJECTED': case 'CLOSED':
color = 'error'; color = 'error';
break; break;
default: default:
@ -189,9 +195,9 @@ export default function OrderList(props: IOrderListProps) {
}), }),
}, },
{ {
key: 'WAITING_AUDIT', key: 'AUDITING',
label: intl.formatMessage({ label: intl.formatMessage({
id: intlPrefix + '.tab.waitingAudit', id: intlPrefix + '.tab.auditing',
}), }),
}, },
{ {
@ -200,12 +206,6 @@ export default function OrderList(props: IOrderListProps) {
id: intlPrefix + '.tab.completed', id: intlPrefix + '.tab.completed',
}), }),
}, },
{
key: 'REJECTED',
label: intl.formatMessage({
id: intlPrefix + '.tab.rejected',
}),
},
{ {
key: 'CLOSED', key: 'CLOSED',
label: intl.formatMessage({ label: intl.formatMessage({

View File

@ -124,15 +124,12 @@ export default function OrderModal(props: IOrderModalProps) {
case 'DRAFT': case 'DRAFT':
color = 'default'; color = 'default';
break; break;
case 'WAITING_AUDIT': case 'AUDITING':
color = 'processing'; color = 'processing';
break; break;
case 'COMPLETED': case 'COMPLETED':
color = 'success'; color = 'success';
break; break;
case 'REJECTED':
color = 'error';
break;
default: default:
color = 'default'; color = 'default';
} }
@ -311,15 +308,12 @@ export default function OrderModal(props: IOrderModalProps) {
DRAFT: intl.formatMessage({ DRAFT: intl.formatMessage({
id: intlPrefix + '.column.state.draft', id: intlPrefix + '.column.state.draft',
}), }),
WAITING_AUDIT: intl.formatMessage({ AUDITING: intl.formatMessage({
id: intlPrefix + '.column.state.waiting_audit', id: intlPrefix + '.column.state.auditing',
}), }),
COMPLETED: intl.formatMessage({ COMPLETED: intl.formatMessage({
id: intlPrefix + '.column.state.completed', id: intlPrefix + '.column.state.completed',
}), }),
REJECTED: intl.formatMessage({
id: intlPrefix + '.column.state.rejected',
}),
CLOSED: intl.formatMessage({ CLOSED: intl.formatMessage({
id: intlPrefix + '.column.state.closed', id: intlPrefix + '.column.state.closed',
}), }),

View File

@ -0,0 +1,499 @@
import {
BizContainer,
BizValueType,
ButtonAccess,
CompanyList,
ModeType,
} from '@/components';
import { business } from '@/services';
import { formatBankCard, formatIdCard, formatPhone } from '@/utils/format';
import { useIntl } from '@@/exports';
import { EyeInvisibleOutlined, EyeTwoTone } from '@ant-design/icons';
import { ProColumns } from '@ant-design/pro-components';
import { ProDescriptionsItemProps } from '@ant-design/pro-descriptions';
import { Button, Image, Modal, Space } from 'antd';
import React, { useState } from 'react';
interface IOrderSupplierListProps {
ghost?: boolean;
orderId?: BusinessAPI.OrderVO['orderId'];
search?: boolean;
onValueChange?: () => void;
mode?: ModeType;
trigger?: () => React.ReactNode;
}
export default function OrderSupplierList(props: IOrderSupplierListProps) {
const {
ghost = false,
orderId,
search = true,
mode = 'page',
trigger,
onValueChange,
} = props;
const intl = useIntl();
const intlPrefix = 'orderStall';
const [showIdCard, setShowIdCard] = useState<Record<string, boolean>>({});
const [showBankCard, setShowBankCard] = useState<Record<string, boolean>>({});
const [showPhone, setShowPhone] = useState<Record<string, boolean>>({});
const [activeKey, setActiveKey] = useState<string>('ALL');
// 发票预览相关状态
const [invoiceVisible, setInvoiceVisible] = useState(false);
const [contractVisible, setContractVisible] = useState(false);
const [wechatQrVisible, setWechatQrVisible] = useState(false);
const [paymentVoucherVisible, setPaymentVoucherVisible] = useState(false);
const [currentRecord, setCurrentRecord] =
useState<BusinessAPI.OrderSupplierVO | null>(null);
const columns: ProColumns<BusinessAPI.OrderSupplierVO, BizValueType>[] = [
{
title: intl.formatMessage({ id: intlPrefix + '.column.order' }),
dataIndex: 'orderVO',
key: 'orderId',
valueType: 'order',
},
{
title: intl.formatMessage({ id: intlPrefix + '.column.name' }),
dataIndex: 'name',
key: 'name',
},
{
title: intl.formatMessage({
id: intlPrefix + '.column.invoiceAmount',
}),
dataIndex: 'invoiceAmount',
key: 'invoiceAmount',
valueType: 'money',
search: false,
},
{
title: intl.formatMessage({
id: intlPrefix + '.column.remainingAmount',
}),
dataIndex: 'remainingAmount',
key: 'remainingAmount',
valueType: 'money',
search: false,
renderText: (_, record) => {
return record.invoiceAmount;
},
},
{
title: intl.formatMessage({
id: intlPrefix + '.column.idCard',
}),
dataIndex: 'idCard',
key: 'idCard',
search: false,
render: (_, record) => (
<div className="flex items-center">
<span>
{formatIdCard(record.idCard, showIdCard[record.orderSupplierId])}
</span>
<span
className="ml-2 cursor-pointer"
onClick={() => {
setShowIdCard((prev) => ({
...prev,
[record.orderSupplierId]: !prev[record.orderSupplierId],
}));
}}
>
{showIdCard[record.orderSupplierId] ? (
<EyeTwoTone />
) : (
<EyeInvisibleOutlined />
)}
</span>
</div>
),
},
{
title: intl.formatMessage({ id: intlPrefix + '.column.phone' }),
dataIndex: 'phone',
key: 'phone',
search: false,
render: (_, record) => (
<div className="flex items-center">
<span>
{formatPhone(record.phone, showPhone[record.orderSupplierId])}
</span>
<span
className="ml-2 cursor-pointer"
onClick={() => {
setShowPhone((prev) => ({
...prev,
[record.orderSupplierId]: !prev[record.orderSupplierId],
}));
}}
>
{showPhone[record.orderSupplierId] ? (
<EyeTwoTone />
) : (
<EyeInvisibleOutlined />
)}
</span>
</div>
),
},
{
title: intl.formatMessage({ id: intlPrefix + '.column.bankCard' }),
dataIndex: 'bankCard',
key: 'bankCard',
search: false,
render: (_, record) => (
<div className="flex items-center">
<span>
{formatBankCard(
record?.bankCard || '',
showBankCard[record.orderSupplierId],
)}
</span>
<span
className="ml-2 cursor-pointer"
onClick={() => {
setShowBankCard((prev) => ({
...prev,
[record.orderSupplierId]: !prev[record.orderSupplierId],
}));
}}
>
{showBankCard[record.orderSupplierId] ? (
<EyeTwoTone />
) : (
<EyeInvisibleOutlined />
)}
</span>
</div>
),
},
{
title: intl.formatMessage({ id: intlPrefix + '.column.orderCompany' }),
dataIndex: 'orderCompany',
valueType: 'select',
request: async (params) => {
const { data } = await business.company.listCompany({
companyListQry: {
...params,
},
});
return (
data?.map((item) => {
return {
label: item.fullName,
value: item.companyId,
};
}) || []
);
},
render: (_, record) => {
return (
<CompanyList
ghost={true}
mode={'detail'}
companyId={record.orderCompany.companyId}
trigger={() => <a href={'#'}>{record.orderCompany.fullName}</a>}
/>
);
},
},
{
title: intl.formatMessage({ id: intlPrefix + '.column.isPaid' }),
dataIndex: 'isPaid',
key: 'isPaid',
valueType: 'select',
valueEnum: {
true: {
text: intl.formatMessage({
id: intlPrefix + '.column.isPaid.paid',
}),
status: 'success',
},
false: {
text: intl.formatMessage({
id: intlPrefix + '.column.isPaid.unpaid',
}),
status: 'processing',
},
},
},
];
const [selectedRows, setSelectedRows] = useState<
BusinessAPI.OrderSupplierVO[]
>([]);
const detailColumns: ProDescriptionsItemProps<
BusinessAPI.OrderSupplierVO,
BizValueType
>[] = columns as ProDescriptionsItemProps<
BusinessAPI.OrderSupplierVO,
BizValueType
>[];
return (
<>
<BizContainer<
typeof business.orderSupplier,
BusinessAPI.OrderSupplierVO,
BusinessAPI.OrderSupplierPageQry
>
rowKey={'orderSupplierId'}
permission={'operation-order-supplier'}
func={business.orderSupplier}
method={'orderSupplier'}
methodUpper={'OrderSupplier'}
intlPrefix={intlPrefix}
modeType={mode}
onValueChange={onValueChange}
container={{
ghost,
}}
status={false}
page={{
fieldProps: {
bordered: true,
ghost,
//@ts-ignore
search,
params: {
...(activeKey !== 'ALL' && {
isPaid: activeKey! as any,
}),
poStates: ['COMPLETED'],
type: 'OTHER_STALL'
},
rowSelection: {
onChange: (_, selectedRows) => setSelectedRows(selectedRows),
},
tableAlertOptionRender: (props) => {
return (
<Space>
<Button
key={'cancel'}
type={'link'}
onClick={() => props.onCleanSelected()}
size={'middle'}
>
</Button>
</Space>
);
},
toolbar: {
menu: {
type: 'tab',
activeKey: activeKey,
items: [
// 全部
{
key: 'ALL',
label: intl.formatMessage({
id: intlPrefix + '.tab.all',
}),
},
// 已支付
{
key: 'true',
label: intl.formatMessage({
id: intlPrefix + '.tab.paid',
}),
},
// 未支付
{
key: 'false',
label: intl.formatMessage({
id: intlPrefix + '.tab.unpaid',
}),
},
],
onChange: (key) => {
setActiveKey(key as string);
},
},
},
},
columns,
options: (orderSupplierVO) => {
let btn = [];
if (orderSupplierVO.invoiceUpload) {
btn.push(
<ButtonAccess
permission="operation-order-supplier-view-invoice"
key="view-invoice"
type="link"
onClick={() => {
setCurrentRecord(orderSupplierVO);
setInvoiceVisible(true);
}}
>
</ButtonAccess>,
);
}
if (orderSupplierVO.wechatQr) {
btn.push(
<ButtonAccess
permission="operation-order-supplier-view-wechat-qr-code"
key="wechat-qr-code"
type="link"
onClick={() => {
setCurrentRecord(orderSupplierVO);
setWechatQrVisible(true);
}}
>
</ButtonAccess>,
);
}
if (orderSupplierVO.contractUpload) {
btn.push(
<ButtonAccess
permission="operation-order-supplier-view-contract"
key="view-contract"
type="link"
onClick={() => {
setCurrentRecord(orderSupplierVO);
setContractVisible(true);
}}
>
</ButtonAccess>,
);
}
if (orderSupplierVO.isPaid) {
btn.push(
<ButtonAccess
permission="operation-order-supplier-view-payment-voucher"
key="payment-voucher"
type="link"
onClick={() => {
setCurrentRecord(orderSupplierVO);
setPaymentVoucherVisible(true);
}}
>
</ButtonAccess>,
);
}
return btn;
},
}}
create={false}
update={false}
destroy={false}
detail={{
rowId: orderId,
formType: 'drawer',
columns: detailColumns,
trigger,
}}
/>
{/* 发票预览Modal */}
<Modal
title="查看发票"
open={invoiceVisible}
onCancel={() => setInvoiceVisible(false)}
footer={null}
width={800}
centered
>
{currentRecord?.invoiceImg && currentRecord.invoiceImg.length > 0 ? (
<div className="space-y-4">
{currentRecord.invoiceImg.map((item, index) => (
<div key={index} className="text-center">
<p className="mb-2"> {index + 1}</p>
<Image
width="100%"
height={400}
src={item.filePath}
alt={item.fileName || `发票${index + 1}`}
placeholder={<div className="text-gray-400">...</div>}
/>
<p className="text-sm text-gray-500 mt-2">
{item.fileName || `发票${index + 1}`}
</p>
</div>
))}
</div>
) : (
<div className="text-center py-8 text-gray-500"></div>
)}
</Modal>
{/* 合同预览Modal */}
<Modal
title="查看合同"
open={contractVisible}
onCancel={() => setContractVisible(false)}
footer={null}
width={800}
centered
>
{currentRecord?.contractImg && currentRecord.contractImg.length > 0 ? (
<div className="space-y-4">
{currentRecord.contractImg.map((item, index) => (
<div key={index} className="text-center">
<p className="mb-2"> {index + 1}</p>
<Image
width="100%"
height={400}
src={item.filePath}
alt={item.fileName || `合同${index + 1}`}
placeholder={<div className="text-gray-400">...</div>}
/>
<p className="text-sm text-gray-500 mt-2">
{item.fileName || `合同${index + 1}`}
</p>
</div>
))}
</div>
) : (
<div className="text-center py-8 text-gray-500"></div>
)}
</Modal>
{/* 微信收款码预览Modal */}
<Modal
title="查看微信收款码"
open={wechatQrVisible}
onCancel={() => setWechatQrVisible(false)}
footer={null}
width={400}
centered
>
{currentRecord?.wechatQr ? (
<div className="text-center">
<Image
width="100%"
src={currentRecord.wechatQr}
alt="微信收款码"
placeholder={<div className="text-gray-400">...</div>}
/>
</div>
) : (
<div className="text-center py-8 text-gray-500"></div>
)}
</Modal>
{/* 付款凭证预览Modal */}
<Modal
title="查看付款凭证"
open={paymentVoucherVisible}
onCancel={() => setPaymentVoucherVisible(false)}
footer={null}
width={800}
centered
>
<div className="text-center py-8 text-gray-500"></div>
</Modal>
</>
);
}

View File

@ -83,6 +83,9 @@ export default function OrderSupplierList(props: IOrderSupplierListProps) {
key: 'remainingAmount', key: 'remainingAmount',
valueType: 'money', valueType: 'money',
search: false, search: false,
renderText: (_, record) => {
return record.invoiceAmount - record.depositAmount || 0;
},
}, },
{ {
title: intl.formatMessage({ title: intl.formatMessage({
@ -267,6 +270,7 @@ export default function OrderSupplierList(props: IOrderSupplierListProps) {
isPaid: activeKey! as any, isPaid: activeKey! as any,
}), }),
poStates: ['COMPLETED'], poStates: ['COMPLETED'],
type: 'FARMER',
}, },
rowSelection: { rowSelection: {
onChange: (_, selectedRows) => setSelectedRows(selectedRows), onChange: (_, selectedRows) => setSelectedRows(selectedRows),

View File

@ -1,5 +1,6 @@
export { default as OrderList } from './OrderList'; export { default as OrderList } from './OrderList';
export { default as OrderSupplierList } from './OrderSupplierList'; export { default as OrderSupplierList } from './OrderSupplierList';
export { default as OrderStallList } from './OrderStallList';
export { default as OrderCostList } from './OrderCostList'; export { default as OrderCostList } from './OrderCostList';
export { default as OrderRebateList } from './OrderRebateList'; export { default as OrderRebateList } from './OrderRebateList';
export { default as OrderModal } from './OrderModal'; export { default as OrderModal } from './OrderModal';

View File

@ -782,6 +782,13 @@ export default {
label: '产地损耗金额', label: '产地损耗金额',
placeholder: '请输入产地损耗金额', placeholder: '请输入产地损耗金额',
}, },
enableInitialTrainNo: {
label: '是否开启初始车次号',
},
initialTrainNo: {
label: '初始车次号',
placeholder: '请输入初始车次号',
},
remark: { remark: {
label: '备注', label: '备注',
placeholder: '请输入备注', placeholder: '请输入备注',
@ -1798,6 +1805,7 @@ export default {
productionType: '产地类型', productionType: '产地类型',
otherType: '其他类型', otherType: '其他类型',
logisticsType: '运输类型', logisticsType: '运输类型',
expenseType: '花销类型',
}, },
column: { column: {
name: '费用名称', name: '费用名称',
@ -1809,6 +1817,7 @@ export default {
'type.enum.productionType': '产地类型', 'type.enum.productionType': '产地类型',
'type.enum.otherType': '其他类型', 'type.enum.otherType': '其他类型',
'type.enum.logisticsType': '运输类型', 'type.enum.logisticsType': '运输类型',
'type.enum.expenseType': '花销类型',
belong: '费用归属', belong: '费用归属',
'belong.enum.noneType': '无归属', 'belong.enum.noneType': '无归属',
'belong.enum.workerType': '工头垫付', 'belong.enum.workerType': '工头垫付',
@ -2126,13 +2135,13 @@ export default {
tab: { tab: {
all: '全部', all: '全部',
draft: '草稿', draft: '草稿',
waitingAudit: '审核中', auditing: '审核中',
completed: '已完成', completed: '已完成',
rejected: '已驳回',
closed: '已关闭', closed: '已关闭',
}, },
column: { column: {
order: '采购单', order: '采购单',
dealer: '经销商',
plate: '车牌号', plate: '车牌号',
deliveryTime: '采购日期', deliveryTime: '采购日期',
frameInfo: '瓜农信息', frameInfo: '瓜农信息',
@ -2142,9 +2151,8 @@ export default {
phone: '联系电话', phone: '联系电话',
state: '状态', state: '状态',
'state.draft': '草稿', 'state.draft': '草稿',
'state.waiting_audit': '审核中', 'state.auditing': '审核中',
'state.completed': '已完成', 'state.completed': '已完成',
'state.rejected': '已驳回',
'state.closed': '已关闭', 'state.closed': '已关闭',
createdAt: '创建时间', createdAt: '创建时间',
option: '操作', option: '操作',
@ -2238,17 +2246,65 @@ export default {
}, },
column: { column: {
name: '瓜农姓名', name: '瓜农姓名',
idCard: '瓜农身份证', idCard: '身份证',
phone: '瓜农手机号', phone: '手机号',
bankCard: '瓜农银行卡号', bankName: '银行名称',
invoiceAmount: '应开发票金额(元)', bankCard: '银行卡号',
invoiceAmount: '应付货款金额(元)',
depositAmount: '已付定金(元)', depositAmount: '已付定金(元)',
remainingAmount: '剩余付款金额(元)', remainingAmount: '剩余货款金额(元)',
order: '采购单',
orderCompany: '销售公司',
isPaid: '是否付款',
'isPaid.paid': '已付款',
'isPaid.unpaid': '待付款',
paidAt: '付款时间',
createdAt: '创建时间',
option: '操作',
},
modal: {
create: {
title: '创建发货单',
button: '创建发货单',
success: '创建发货单成功',
},
update: {
title: '更新发货单',
button: '编辑',
success: '更新发货单成功',
},
delete: {
success: '删除发货单成功',
button: '删除',
confirm: {
title: '确认删除',
content: '您确定要删除该发货单吗?',
okText: '确定',
cancelText: '取消',
},
},
view: {
title: '查看发货单',
button: '详情',
},
},
},
orderStall: {
tab: {
all: '全部',
paid: '已付款',
unpaid: '待付款',
},
column: {
name: '档口名称',
payeeName: '收款姓名',
idCard: '身份证',
phone: '手机号',
bankName: '银行名称',
bankCard: '银行卡号',
invoiceAmount: '应付货款金额(元)',
remainingAmount: '剩余货款金额(元)',
order: '采购单', order: '采购单',
deliveryTime: '采购日期',
dealerName: '经销商名称',
vehicleNo: '车次号',
orderVehicle: '运输路线',
orderCompany: '销售公司', orderCompany: '销售公司',
isPaid: '是否付款', isPaid: '是否付款',
'isPaid.paid': '已付款', 'isPaid.paid': '已付款',
@ -2409,6 +2465,9 @@ export default {
expenseCost: { expenseCost: {
column: { column: {
name: '费用名称', name: '费用名称',
isDefault: '是否默认展示',
'isDefault.enum.unCheckedChildren': '默认隐藏',
'isDefault.enum.checkedChildren': '默认展示',
remark: '备注', remark: '备注',
status: '状态', status: '状态',
'status.enum.enabled': '正常', 'status.enum.enabled': '正常',
@ -2423,7 +2482,15 @@ export default {
placeholder: '请输入费用名称', placeholder: '请输入费用名称',
required: '费用名称为必填项', required: '费用名称为必填项',
}, },
isDefault: {
label: '是否默认展示',
placeholder: '请选择是否默认展示',
required: '是否默认展示为必填项',
enum: {
unCheckedChildren: '默认隐藏',
checkedChildren: '默认展示',
},
},
remark: { remark: {
label: '备注', label: '备注',
placeholder: '请输入备注', placeholder: '请输入备注',

View File

@ -0,0 +1,5 @@
import { OrderStallList } from '@/components';
export default function Page() {
return <OrderStallList />;
}

View File

@ -100,7 +100,7 @@ declare namespace AuthAPI {
/** 用户ID */ /** 用户ID */
userId: string; userId: string;
/** 角色ID */ /** 角色ID */
roleIdList: number[]; roleIdList: string[];
/** 角色信息 */ /** 角色信息 */
userRoleList?: UserRoleVO[]; userRoleList?: UserRoleVO[];
}; };
@ -195,7 +195,7 @@ declare namespace AuthAPI {
type RoleMenuTreeQry = { type RoleMenuTreeQry = {
/** 角色权限 */ /** 角色权限 */
roleId?: number[]; roleId?: string[];
/** 平台ID */ /** 平台ID */
platformId: string; platformId: string;
}; };
@ -329,7 +329,7 @@ declare namespace AuthAPI {
/** 备注 */ /** 备注 */
remark?: string; remark?: string;
/** 客户标签 */ /** 客户标签 */
labelId?: number[]; labelId?: string[];
/** 用户ID */ /** 用户ID */
userId: string; userId: string;
}; };

View File

@ -7,14 +7,17 @@ export async function approveOrder(
body: BusinessAPI.OrderApproveCmd, body: BusinessAPI.OrderApproveCmd,
options?: { [key: string]: any }, options?: { [key: string]: any },
) { ) {
return request<BusinessAPI.Response>('/operation/approveOrder', { return request<BusinessAPI.SingleResponseAuditVO>(
method: 'POST', '/operation/approveOrder',
headers: { {
'Content-Type': 'application/json', method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
}, },
data: body, );
...(options || {}),
});
} }
/** 获取某个状态的数量 GET /operation/countOrderByState */ /** 获取某个状态的数量 GET /operation/countOrderByState */
@ -75,14 +78,17 @@ export async function finalApproveOrder(
body: BusinessAPI.OrderFinalApproveCmd, body: BusinessAPI.OrderFinalApproveCmd,
options?: { [key: string]: any }, options?: { [key: string]: any },
) { ) {
return request<BusinessAPI.Response>('/operation/finalApproveOrder', { return request<BusinessAPI.SingleResponseAuditVO>(
method: 'POST', '/operation/finalApproveOrder',
headers: { {
'Content-Type': 'application/json', method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
}, },
data: body, );
...(options || {}),
});
} }
/** 获取上一车车次号 GET /operation/getLastVehicleNo */ /** 获取上一车车次号 GET /operation/getLastVehicleNo */
@ -144,14 +150,17 @@ export async function rejectApproveOrder(
body: BusinessAPI.OrderRejectApproveCmd, body: BusinessAPI.OrderRejectApproveCmd,
options?: { [key: string]: any }, options?: { [key: string]: any },
) { ) {
return request<BusinessAPI.Response>('/operation/rejectApproveOrder', { return request<BusinessAPI.SingleResponseAuditVO>(
method: 'POST', '/operation/rejectApproveOrder',
headers: { {
'Content-Type': 'application/json', method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
}, },
data: body, );
...(options || {}),
});
} }
/** 采购订单驳回审批(老板驳回审批) POST /operation/rejectFinalOrder */ /** 采购订单驳回审批(老板驳回审批) POST /operation/rejectFinalOrder */
@ -159,14 +168,17 @@ export async function rejectFinalOrder(
body: BusinessAPI.OrderRejectFinalCmd, body: BusinessAPI.OrderRejectFinalCmd,
options?: { [key: string]: any }, options?: { [key: string]: any },
) { ) {
return request<BusinessAPI.Response>('/operation/rejectFinalOrder', { return request<BusinessAPI.SingleResponseAuditVO>(
method: 'POST', '/operation/rejectFinalOrder',
headers: { {
'Content-Type': 'application/json', method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
}, },
data: body, );
...(options || {}),
});
} }
/** 采购订单第一步:车辆信息和经销商信息保存 POST /operation/saveOrderStep1 */ /** 采购订单第一步:车辆信息和经销商信息保存 POST /operation/saveOrderStep1 */
@ -239,14 +251,17 @@ export async function submitReviewOrder(
body: BusinessAPI.OrderSubmitReviewCmd, body: BusinessAPI.OrderSubmitReviewCmd,
options?: { [key: string]: any }, options?: { [key: string]: any },
) { ) {
return request<BusinessAPI.Response>('/operation/submitReviewOrder', { return request<BusinessAPI.SingleResponseAuditVO>(
method: 'POST', '/operation/submitReviewOrder',
headers: { {
'Content-Type': 'application/json', method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
}, },
data: body, );
...(options || {}),
});
} }
/** 采购订单更新 PUT /operation/updateOrder */ /** 采购订单更新 PUT /operation/updateOrder */
@ -290,12 +305,15 @@ export async function withdrawReviewOrder(
body: BusinessAPI.OrderWithdrawReviewCmd, body: BusinessAPI.OrderWithdrawReviewCmd,
options?: { [key: string]: any }, options?: { [key: string]: any },
) { ) {
return request<BusinessAPI.Response>('/operation/withdrawReviewOrder', { return request<BusinessAPI.SingleResponseAuditVO>(
method: 'POST', '/operation/withdrawReviewOrder',
headers: { {
'Content-Type': 'application/json', method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
}, },
data: body, );
...(options || {}),
});
} }

File diff suppressed because it is too large Load Diff

View File

@ -6,18 +6,21 @@ export const formatCurrency = (value: number) => {
export const formatIdCard = (idCard: string, showFull: boolean = false) => { export const formatIdCard = (idCard: string, showFull: boolean = false) => {
if (showFull) return idCard; if (showFull) return idCard;
if (!idCard) return '';
if (idCard.length < 8) return idCard; if (idCard.length < 8) return idCard;
return `${idCard.substring(0, 4)}********${idCard.substring(idCard.length - 4)}`; return `${idCard.substring(0, 4)}********${idCard.substring(idCard.length - 4)}`;
}; };
export const formatBankCard = (bankCard: string, showFull: boolean = false) => { export const formatBankCard = (bankCard: string, showFull: boolean = false) => {
if (showFull) return bankCard; if (showFull) return bankCard;
if (!bankCard) return '';
if (bankCard.length < 4) return bankCard; if (bankCard.length < 4) return bankCard;
return `**** **** **** ${bankCard.substring(bankCard.length - 4)}`; return `**** **** **** ${bankCard.substring(bankCard.length - 4)}`;
}; };
export const formatPhone = (phone: string, showFull: boolean = false) => { export const formatPhone = (phone: string, showFull: boolean = false) => {
if (showFull) return phone; if (showFull) return phone;
if (!phone) return '';
if (phone.length < 4) return phone; if (phone.length < 4) return phone;
return `${phone.substring(0, 3)}****${phone.substring(phone.length - 4)}`; return `${phone.substring(0, 3)}****${phone.substring(phone.length - 4)}`;
}; };

View File

@ -6,7 +6,7 @@ export function pagination(): TablePaginationConfig {
showQuickJumper: true, showQuickJumper: true,
showTotal: (total: number) => `${total}`, showTotal: (total: number) => `${total}`,
pageSizeOptions: ['10', '20', '50', '100'], pageSizeOptions: ['10', '20', '50', '100'],
defaultPageSize: 10, defaultPageSize: 20,
hideOnSinglePage: true, hideOnSinglePage: true,
}; };
} }

File diff suppressed because one or more lines are too long