feat(dealer): 添加经销商分成比例调整功能
- 在经销商列表中显示分成比例是否可调整 - 新增开关控制分成比例是否允许调整 - 更新相关表单和字段定义以支持新功能 - 调整国际化文案以匹配新的业务逻辑 - 优化部分组件代码结构和依赖引用
This commit is contained in:
parent
42cbb0d7fc
commit
35fd2e8138
@ -141,7 +141,7 @@ export async function getInitialState(): Promise<InitialStateProps> {
|
|||||||
let current: any;
|
let current: any;
|
||||||
|
|
||||||
const { data: channel } = await auth.channel.selectChannelByDomain({
|
const { data: channel } = await auth.channel.selectChannelByDomain({
|
||||||
domain: window.location.host,
|
domain: "operation.erp.qilincloud168.com",
|
||||||
});
|
});
|
||||||
|
|
||||||
const { data: userAuthVO } = await auth.user.userInfo();
|
const { data: userAuthVO } = await auth.user.userInfo();
|
||||||
@ -346,7 +346,6 @@ export const request: RequestConfig = {
|
|||||||
'X-Requested-With': 'XMLHttpRequest',
|
'X-Requested-With': 'XMLHttpRequest',
|
||||||
'Xh-Platform-Id': '1769220738064285698',
|
'Xh-Platform-Id': '1769220738064285698',
|
||||||
},
|
},
|
||||||
|
|
||||||
// 错误处理: umi@3 的错误处理方案。
|
// 错误处理: umi@3 的错误处理方案。
|
||||||
errorConfig: {
|
errorConfig: {
|
||||||
// 错误抛出
|
// 错误抛出
|
||||||
@ -433,6 +432,12 @@ export const request: RequestConfig = {
|
|||||||
headers: any;
|
headers: any;
|
||||||
},
|
},
|
||||||
) => {
|
) => {
|
||||||
|
|
||||||
|
options.headers = {
|
||||||
|
...options.headers,
|
||||||
|
'Xh-Role-Slug': "operation",
|
||||||
|
};
|
||||||
|
|
||||||
console.debug('请求拦截器', url, options);
|
console.debug('请求拦截器', url, options);
|
||||||
const apiUrl = '/api' + url;
|
const apiUrl = '/api' + url;
|
||||||
|
|
||||||
|
|||||||
@ -80,6 +80,7 @@ export default function DealerList(props: IDealerListProps) {
|
|||||||
<>
|
<>
|
||||||
<CheckCircleOutlined style={{ color: '#52c41a' }} />
|
<CheckCircleOutlined style={{ color: '#52c41a' }} />
|
||||||
{record.shareRatio ? ` ${record.shareRatio}%` : ''}
|
{record.shareRatio ? ` ${record.shareRatio}%` : ''}
|
||||||
|
{record.shareAdjusted ? '可调整' : '不可调整'}
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<CloseCircleOutlined style={{ color: '#ff4d4f' }} />
|
<CloseCircleOutlined style={{ color: '#ff4d4f' }} />
|
||||||
@ -178,7 +179,9 @@ export default function DealerList(props: IDealerListProps) {
|
|||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
<span>
|
<span>
|
||||||
{intl.formatMessage({ id: intlPrefix + '.column.enableAccrualTax' })}
|
{intl.formatMessage({
|
||||||
|
id: intlPrefix + '.column.enableAccrualTax',
|
||||||
|
})}
|
||||||
</span>
|
</span>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
),
|
),
|
||||||
@ -277,6 +280,7 @@ export default function DealerList(props: IDealerListProps) {
|
|||||||
{({ enableShare }) => {
|
{({ enableShare }) => {
|
||||||
return (
|
return (
|
||||||
enableShare && (
|
enableShare && (
|
||||||
|
<>
|
||||||
<ProFormDigit
|
<ProFormDigit
|
||||||
key={'shareRatio'}
|
key={'shareRatio'}
|
||||||
name={'shareRatio'}
|
name={'shareRatio'}
|
||||||
@ -303,6 +307,18 @@ export default function DealerList(props: IDealerListProps) {
|
|||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
|
<ProFormSwitch
|
||||||
|
key={'shareAdjusted'}
|
||||||
|
name={'shareAdjusted'}
|
||||||
|
label={intl.formatMessage({
|
||||||
|
id: intlPrefix + '.form.shareAdjusted.label',
|
||||||
|
})}
|
||||||
|
fieldProps={{
|
||||||
|
checkedChildren: intl.formatMessage({ id: 'common.yes' }),
|
||||||
|
unCheckedChildren: intl.formatMessage({ id: 'common.no' }),
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
|
|||||||
@ -25,10 +25,10 @@ export default function DealerSelect(props: IUserSelectProps) {
|
|||||||
label={intl.formatMessage({
|
label={intl.formatMessage({
|
||||||
id: 'form.dealerId.label',
|
id: 'form.dealerId.label',
|
||||||
})}
|
})}
|
||||||
transform={(userVO) => {
|
transform={(dealerVO) => {
|
||||||
return {
|
return {
|
||||||
userVO: userVO,
|
dealerVO: dealerVO,
|
||||||
userId: userVO.userId,
|
dealerId: dealerVO.dealerId,
|
||||||
};
|
};
|
||||||
}}
|
}}
|
||||||
name={'dealerVO'}
|
name={'dealerVO'}
|
||||||
|
|||||||
277
packages/app-operation/src/components/Delivery/ShipOrderList.tsx
Normal file
277
packages/app-operation/src/components/Delivery/ShipOrderList.tsx
Normal file
@ -0,0 +1,277 @@
|
|||||||
|
import { BizContainer, BizValueType, ModeType } from '@/components';
|
||||||
|
import { business } from '@/services';
|
||||||
|
import { useIntl } from '@@/exports';
|
||||||
|
import {
|
||||||
|
ProColumns,
|
||||||
|
ProFormDatePicker,
|
||||||
|
ProFormDigit,
|
||||||
|
ProFormSelect,
|
||||||
|
ProFormText,
|
||||||
|
ProFormTextArea,
|
||||||
|
} from '@ant-design/pro-components';
|
||||||
|
import { ProDescriptionsItemProps } from '@ant-design/pro-descriptions';
|
||||||
|
import { Tag } from 'antd';
|
||||||
|
import React from 'react';
|
||||||
|
|
||||||
|
interface IShipOrderListProps {
|
||||||
|
ghost?: boolean;
|
||||||
|
shipOrderId?: BusinessAPI.ShipOrderVO['shipOrderId'];
|
||||||
|
search?: boolean;
|
||||||
|
onValueChange?: () => void;
|
||||||
|
mode?: ModeType;
|
||||||
|
trigger?: () => React.ReactNode;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function ShipOrderList(props: IShipOrderListProps) {
|
||||||
|
const {
|
||||||
|
ghost = false,
|
||||||
|
shipOrderId,
|
||||||
|
search = true,
|
||||||
|
mode = 'page',
|
||||||
|
trigger,
|
||||||
|
onValueChange,
|
||||||
|
} = props;
|
||||||
|
const intl = useIntl();
|
||||||
|
const intlPrefix = 'shipOrder';
|
||||||
|
|
||||||
|
const columns: ProColumns<BusinessAPI.ShipOrderVO, BizValueType>[] = [
|
||||||
|
{
|
||||||
|
title: intl.formatMessage({ id: intlPrefix + '.column.orderSn' }),
|
||||||
|
dataIndex: 'orderSn',
|
||||||
|
key: 'orderSn',
|
||||||
|
renderText: (text: string) => <span className="font-medium">{text}</span>,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: intl.formatMessage({ id: intlPrefix + '.column.dealerName' }),
|
||||||
|
dataIndex: 'dealerName',
|
||||||
|
key: 'dealerName',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: intl.formatMessage({ id: intlPrefix + '.column.vehicleNo' }),
|
||||||
|
dataIndex: 'vehicleNo',
|
||||||
|
key: 'vehicleNo',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: intl.formatMessage({ id: intlPrefix + '.column.shippingDate' }),
|
||||||
|
dataIndex: 'shippingDate',
|
||||||
|
key: 'shippingDate',
|
||||||
|
valueType: 'date',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: intl.formatMessage({ id: intlPrefix + '.column.state' }),
|
||||||
|
dataIndex: 'state',
|
||||||
|
key: 'state',
|
||||||
|
valueType: 'select',
|
||||||
|
valueEnum: {
|
||||||
|
WAIT_PAYMENT: {
|
||||||
|
text: intl.formatMessage({
|
||||||
|
id: intlPrefix + '.column.state.waitPayment',
|
||||||
|
}),
|
||||||
|
status: 'Default',
|
||||||
|
},
|
||||||
|
PARTIAL_PAYMENT: {
|
||||||
|
text: intl.formatMessage({
|
||||||
|
id: intlPrefix + '.column.state.partialPayment',
|
||||||
|
}),
|
||||||
|
status: 'Processing',
|
||||||
|
},
|
||||||
|
FULL_PAYMENT: {
|
||||||
|
text: intl.formatMessage({
|
||||||
|
id: intlPrefix + '.column.state.fullPayment',
|
||||||
|
}),
|
||||||
|
status: 'Success',
|
||||||
|
},
|
||||||
|
REJECT_FINISH: {
|
||||||
|
text: intl.formatMessage({
|
||||||
|
id: intlPrefix + '.column.state.rejectFinish',
|
||||||
|
}),
|
||||||
|
status: 'Error',
|
||||||
|
},
|
||||||
|
FINISH: {
|
||||||
|
text: intl.formatMessage({ id: intlPrefix + '.column.state.finish' }),
|
||||||
|
status: 'Success',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
render: (_, record) => {
|
||||||
|
const stateText = intl.formatMessage({
|
||||||
|
id: `${intlPrefix}.column.state.${record.state?.toLowerCase() || 'unknown'}`,
|
||||||
|
});
|
||||||
|
|
||||||
|
let color = 'default';
|
||||||
|
switch (record.state) {
|
||||||
|
case 'WAIT_PAYMENT':
|
||||||
|
color = 'default';
|
||||||
|
break;
|
||||||
|
case 'PARTIAL_PAYMENT':
|
||||||
|
color = 'processing';
|
||||||
|
break;
|
||||||
|
case 'FULL_PAYMENT':
|
||||||
|
color = 'success';
|
||||||
|
break;
|
||||||
|
case 'REJECT_FINISH':
|
||||||
|
color = 'error';
|
||||||
|
break;
|
||||||
|
case 'FINISH':
|
||||||
|
color = 'success';
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
color = 'default';
|
||||||
|
}
|
||||||
|
|
||||||
|
return <Tag color={color}>{stateText}</Tag>;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: intl.formatMessage({ id: intlPrefix + '.column.totalAmount' }),
|
||||||
|
dataIndex: 'totalAmount',
|
||||||
|
key: 'totalAmount',
|
||||||
|
valueType: 'money',
|
||||||
|
search: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: intl.formatMessage({ id: intlPrefix + '.column.createdAt' }),
|
||||||
|
dataIndex: 'createdAt',
|
||||||
|
key: 'createdAt',
|
||||||
|
valueType: 'dateTime',
|
||||||
|
search: false,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
const formContext = [
|
||||||
|
<ProFormText
|
||||||
|
key={'orderSn'}
|
||||||
|
name={'orderSn'}
|
||||||
|
label={intl.formatMessage({ id: intlPrefix + '.form.orderSn.label' })}
|
||||||
|
placeholder={intl.formatMessage({
|
||||||
|
id: intlPrefix + '.form.orderSn.placeholder',
|
||||||
|
})}
|
||||||
|
/>,
|
||||||
|
<ProFormText
|
||||||
|
key={'dealerName'}
|
||||||
|
name={'dealerName'}
|
||||||
|
label={intl.formatMessage({ id: intlPrefix + '.form.dealerName.label' })}
|
||||||
|
placeholder={intl.formatMessage({
|
||||||
|
id: intlPrefix + '.form.dealerName.placeholder',
|
||||||
|
})}
|
||||||
|
/>,
|
||||||
|
<ProFormDatePicker
|
||||||
|
key={'shippingDate'}
|
||||||
|
name={'shippingDate'}
|
||||||
|
label={intl.formatMessage({
|
||||||
|
id: intlPrefix + '.form.shippingDate.label',
|
||||||
|
})}
|
||||||
|
placeholder={intl.formatMessage({
|
||||||
|
id: intlPrefix + '.form.shippingDate.placeholder',
|
||||||
|
})}
|
||||||
|
/>,
|
||||||
|
<ProFormText
|
||||||
|
key={'vehicleNo'}
|
||||||
|
name={'vehicleNo'}
|
||||||
|
label={intl.formatMessage({ id: intlPrefix + '.form.vehicleNo.label' })}
|
||||||
|
placeholder={intl.formatMessage({
|
||||||
|
id: intlPrefix + '.form.vehicleNo.placeholder',
|
||||||
|
})}
|
||||||
|
/>,
|
||||||
|
<ProFormSelect
|
||||||
|
key={'state'}
|
||||||
|
name={'state'}
|
||||||
|
label={intl.formatMessage({ id: intlPrefix + '.form.state.label' })}
|
||||||
|
valueEnum={{
|
||||||
|
WAIT_PAYMENT: intl.formatMessage({
|
||||||
|
id: intlPrefix + '.column.state.waitPayment',
|
||||||
|
}),
|
||||||
|
PARTIAL_PAYMENT: intl.formatMessage({
|
||||||
|
id: intlPrefix + '.column.state.partialPayment',
|
||||||
|
}),
|
||||||
|
FULL_PAYMENT: intl.formatMessage({
|
||||||
|
id: intlPrefix + '.column.state.fullPayment',
|
||||||
|
}),
|
||||||
|
REJECT_FINISH: intl.formatMessage({
|
||||||
|
id: intlPrefix + '.column.state.rejectFinish',
|
||||||
|
}),
|
||||||
|
FINISH: intl.formatMessage({ id: intlPrefix + '.column.state.finish' }),
|
||||||
|
}}
|
||||||
|
placeholder={intl.formatMessage({
|
||||||
|
id: intlPrefix + '.form.state.placeholder',
|
||||||
|
})}
|
||||||
|
/>,
|
||||||
|
<ProFormDigit
|
||||||
|
key={'totalAmount'}
|
||||||
|
name={'totalAmount'}
|
||||||
|
label={intl.formatMessage({ id: intlPrefix + '.form.totalAmount.label' })}
|
||||||
|
fieldProps={{
|
||||||
|
precision: 2,
|
||||||
|
step: 0.01,
|
||||||
|
}}
|
||||||
|
placeholder={intl.formatMessage({
|
||||||
|
id: intlPrefix + '.form.totalAmount.placeholder',
|
||||||
|
})}
|
||||||
|
/>,
|
||||||
|
<ProFormTextArea
|
||||||
|
key={'remark'}
|
||||||
|
name={'remark'}
|
||||||
|
label={intl.formatMessage({ id: intlPrefix + '.form.remark.label' })}
|
||||||
|
placeholder={intl.formatMessage({
|
||||||
|
id: intlPrefix + '.form.remark.placeholder',
|
||||||
|
})}
|
||||||
|
/>,
|
||||||
|
];
|
||||||
|
|
||||||
|
const detailColumns: ProDescriptionsItemProps<
|
||||||
|
BusinessAPI.ShipOrderVO,
|
||||||
|
BizValueType
|
||||||
|
>[] = columns as ProDescriptionsItemProps<
|
||||||
|
BusinessAPI.ShipOrderVO,
|
||||||
|
BizValueType
|
||||||
|
>[];
|
||||||
|
|
||||||
|
return (
|
||||||
|
<BizContainer<
|
||||||
|
typeof business.shipOrder,
|
||||||
|
BusinessAPI.ShipOrderVO,
|
||||||
|
BusinessAPI.ShipOrderPageQry,
|
||||||
|
BusinessAPI.ShipOrderCreateCmd,
|
||||||
|
BusinessAPI.ShipOrderUpdateCmd
|
||||||
|
>
|
||||||
|
rowKey={'shipOrderId'}
|
||||||
|
permission={'operation-ship-order'}
|
||||||
|
func={business.shipOrder}
|
||||||
|
method={'shipOrder'}
|
||||||
|
methodUpper={'ShipOrder'}
|
||||||
|
intlPrefix={intlPrefix}
|
||||||
|
modeType={mode}
|
||||||
|
onValueChange={onValueChange}
|
||||||
|
container={{
|
||||||
|
ghost,
|
||||||
|
}}
|
||||||
|
status={false}
|
||||||
|
page={{
|
||||||
|
fieldProps: {
|
||||||
|
bordered: true,
|
||||||
|
ghost,
|
||||||
|
//@ts-ignore
|
||||||
|
search,
|
||||||
|
},
|
||||||
|
columns,
|
||||||
|
}}
|
||||||
|
create={{
|
||||||
|
formType: 'drawer',
|
||||||
|
formContext,
|
||||||
|
initValues: {
|
||||||
|
status: true,
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
update={{
|
||||||
|
formType: 'drawer',
|
||||||
|
formContext,
|
||||||
|
}}
|
||||||
|
destroy={{}}
|
||||||
|
detail={{
|
||||||
|
rowId: shipOrderId,
|
||||||
|
formType: 'drawer',
|
||||||
|
columns: detailColumns,
|
||||||
|
trigger,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
1
packages/app-operation/src/components/Delivery/index.ts
Normal file
1
packages/app-operation/src/components/Delivery/index.ts
Normal file
@ -0,0 +1 @@
|
|||||||
|
export { default as ShipOrderList } from './ShipOrderList';
|
||||||
@ -7,7 +7,6 @@ import {
|
|||||||
ModeType,
|
ModeType,
|
||||||
RestPassword,
|
RestPassword,
|
||||||
} from '@/components';
|
} from '@/components';
|
||||||
import { PERMISSION } from '@/constants';
|
|
||||||
import { business } from '@/services';
|
import { business } from '@/services';
|
||||||
import { aesEncrypt } from '@/utils/aes';
|
import { aesEncrypt } from '@/utils/aes';
|
||||||
import { formatParam } from '@/utils/formatParam';
|
import { formatParam } from '@/utils/formatParam';
|
||||||
@ -45,6 +44,7 @@ const EmployeeList: React.FC = (props: IEmployeeListProps) => {
|
|||||||
title: intl.formatMessage({ id: intlPrefix + '.column.avatar' }),
|
title: intl.formatMessage({ id: intlPrefix + '.column.avatar' }),
|
||||||
dataIndex: 'avatar',
|
dataIndex: 'avatar',
|
||||||
valueType: 'avatar',
|
valueType: 'avatar',
|
||||||
|
search: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: intl.formatMessage({ id: intlPrefix + '.column.name' }),
|
title: intl.formatMessage({ id: intlPrefix + '.column.name' }),
|
||||||
@ -76,7 +76,7 @@ const EmployeeList: React.FC = (props: IEmployeeListProps) => {
|
|||||||
});
|
});
|
||||||
return (
|
return (
|
||||||
data?.data?.map((item: BusinessAPI.RoleVO) => ({
|
data?.data?.map((item: BusinessAPI.RoleVO) => ({
|
||||||
label: item.name,
|
label: item.platformVO?.platformName + '-' + item.name,
|
||||||
value: item.roleId,
|
value: item.roleId,
|
||||||
})) ?? []
|
})) ?? []
|
||||||
);
|
);
|
||||||
@ -301,7 +301,7 @@ const EmployeeList: React.FC = (props: IEmployeeListProps) => {
|
|||||||
});
|
});
|
||||||
return (
|
return (
|
||||||
data?.data?.map((item: BusinessAPI.RoleVO) => ({
|
data?.data?.map((item: BusinessAPI.RoleVO) => ({
|
||||||
label: item.name,
|
label: item.platformVO?.platformName + '-' + item.name,
|
||||||
value: item.roleId,
|
value: item.roleId,
|
||||||
})) ?? []
|
})) ?? []
|
||||||
);
|
);
|
||||||
@ -478,24 +478,24 @@ const EmployeeList: React.FC = (props: IEmployeeListProps) => {
|
|||||||
columns,
|
columns,
|
||||||
options: (record, actionRef) => [
|
options: (record, actionRef) => [
|
||||||
<RestPassword
|
<RestPassword
|
||||||
key={PERMISSION.MDB_BUSINESS_EMPLOYEE_REST_PASSWORD}
|
key={'RestPassword'}
|
||||||
permission={PERMISSION.MDB_BUSINESS_EMPLOYEE_REST_PASSWORD}
|
permission={''}
|
||||||
onFinish={async () => {
|
onFinish={async () => {
|
||||||
await actionRef.current?.reload();
|
await actionRef.current?.reload();
|
||||||
}}
|
}}
|
||||||
employeeId={record.employeeId}
|
employeeId={record.employeeId}
|
||||||
/>,
|
/>,
|
||||||
<EmployeeRoleUpdate
|
<EmployeeRoleUpdate
|
||||||
key={PERMISSION.MDB_BUSINESS_EMPLOYEE_ROLE_UPDATE}
|
key={'EmployeeRoleUpdate'}
|
||||||
permission={PERMISSION.MDB_BUSINESS_EMPLOYEE_ROLE_UPDATE}
|
permission={''}
|
||||||
onFinish={async () => {
|
onFinish={async () => {
|
||||||
await actionRef.current?.reload();
|
await actionRef.current?.reload();
|
||||||
}}
|
}}
|
||||||
employeeId={record.employeeId}
|
employeeId={record.employeeId}
|
||||||
/>,
|
/>,
|
||||||
<EmployeeDisable
|
<EmployeeDisable
|
||||||
key={PERMISSION.MDB_BUSINESS_EMPLOYEE_ROLE_UPDATE + 1}
|
key={'EmployeeDisable'}
|
||||||
permission={PERMISSION.MDB_BUSINESS_EMPLOYEE_ROLE_UPDATE}
|
permission={''}
|
||||||
onFinish={async () => {
|
onFinish={async () => {
|
||||||
await actionRef.current?.reload();
|
await actionRef.current?.reload();
|
||||||
}}
|
}}
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { ButtonAccess } from '@/components';
|
import { ButtonAccess, SafeModal } from '@/components';
|
||||||
import { business } from '@/services';
|
import { business } from '@/services';
|
||||||
import { formLayout } from '@/utils/formLayout';
|
import { formLayout } from '@/utils/formLayout';
|
||||||
import {
|
import {
|
||||||
@ -7,7 +7,7 @@ import {
|
|||||||
ProFormText,
|
ProFormText,
|
||||||
} from '@ant-design/pro-components';
|
} from '@ant-design/pro-components';
|
||||||
import { message } from 'antd';
|
import { message } from 'antd';
|
||||||
import React from 'react';
|
import React, { useState } from 'react';
|
||||||
|
|
||||||
interface IEmployeeUpdateProps {
|
interface IEmployeeUpdateProps {
|
||||||
onFinish: () => void;
|
onFinish: () => void;
|
||||||
@ -17,7 +17,14 @@ interface IEmployeeUpdateProps {
|
|||||||
|
|
||||||
const EmployeeRoleUpdate: React.FC<IEmployeeUpdateProps> = (props) => {
|
const EmployeeRoleUpdate: React.FC<IEmployeeUpdateProps> = (props) => {
|
||||||
const { onFinish, employeeId, permission } = props;
|
const { onFinish, employeeId, permission } = props;
|
||||||
|
const [openSafeModal, setOpenSafeModal] = useState<boolean>(false);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
<>
|
||||||
|
<SafeModal
|
||||||
|
open={openSafeModal}
|
||||||
|
onVisibleChange={(openSafeModal) => setOpenSafeModal(openSafeModal)}
|
||||||
|
/>
|
||||||
<ModalForm<BusinessAPI.UserRoleUpdateCmd>
|
<ModalForm<BusinessAPI.UserRoleUpdateCmd>
|
||||||
title="更新员工"
|
title="更新员工"
|
||||||
{...formLayout()}
|
{...formLayout()}
|
||||||
@ -43,8 +50,16 @@ const EmployeeRoleUpdate: React.FC<IEmployeeUpdateProps> = (props) => {
|
|||||||
};
|
};
|
||||||
}}
|
}}
|
||||||
onFinish={async (values) => {
|
onFinish={async (values) => {
|
||||||
const { success } = await business.employee.updateEmployeeRole(values);
|
const { success, errCode } =
|
||||||
|
await business.employee.updateEmployeeRole({
|
||||||
|
...values,
|
||||||
|
cover: true,
|
||||||
|
});
|
||||||
if (success) {
|
if (success) {
|
||||||
|
if (success && errCode === '401') {
|
||||||
|
setOpenSafeModal(true);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
message.success('更新员工角色成功');
|
message.success('更新员工角色成功');
|
||||||
onFinish();
|
onFinish();
|
||||||
return true;
|
return true;
|
||||||
@ -52,8 +67,9 @@ const EmployeeRoleUpdate: React.FC<IEmployeeUpdateProps> = (props) => {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<ProFormText hidden={true} name={'userId'} />
|
<ProFormText hidden={true} name={'userId'} />
|
||||||
|
|
||||||
<ProFormSelect
|
<ProFormSelect
|
||||||
name={'roleId'}
|
name={'roleIdList'}
|
||||||
label={'角色'}
|
label={'角色'}
|
||||||
placeholder="请选择角色"
|
placeholder="请选择角色"
|
||||||
required={true}
|
required={true}
|
||||||
@ -66,21 +82,24 @@ const EmployeeRoleUpdate: React.FC<IEmployeeUpdateProps> = (props) => {
|
|||||||
showSearch={true}
|
showSearch={true}
|
||||||
fieldProps={{
|
fieldProps={{
|
||||||
mode: 'multiple',
|
mode: 'multiple',
|
||||||
autoFocus: true,
|
|
||||||
}}
|
}}
|
||||||
request={async (params) => {
|
request={async (params) => {
|
||||||
const data = await business.role.listRole({
|
const data = await business.role.listRole({
|
||||||
roleListQry: params,
|
roleListQry: {
|
||||||
|
...params,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
data?.data?.map((item) => ({
|
data?.data?.map((item) => ({
|
||||||
label: item.name,
|
label: item.platformVO?.platformName + '-' + item.name,
|
||||||
value: item.roleId,
|
value: item.roleId,
|
||||||
})) ?? []
|
})) ?? []
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</ModalForm>
|
</ModalForm>
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -10,16 +10,18 @@ import { useIntl } from '@@/exports';
|
|||||||
import {
|
import {
|
||||||
ProColumns,
|
ProColumns,
|
||||||
ProFormDependency,
|
ProFormDependency,
|
||||||
ProFormDigit,
|
|
||||||
ProFormRadio,
|
ProFormRadio,
|
||||||
ProFormSelect,
|
ProFormSelect,
|
||||||
ProFormText,
|
ProFormText,
|
||||||
ProFormTreeSelect,
|
ProFormTreeSelect,
|
||||||
} from '@ant-design/pro-components';
|
} from '@ant-design/pro-components';
|
||||||
import { ProDescriptionsItemProps } from '@ant-design/pro-descriptions';
|
import { ProDescriptionsItemProps } from '@ant-design/pro-descriptions';
|
||||||
import { ProFormBizSelect, ProFormBizSelectHandles } from '@chageable/components';
|
import {
|
||||||
|
ProFormBizSelect,
|
||||||
|
ProFormBizSelectHandles,
|
||||||
|
} from '@chageable/components';
|
||||||
import { TreeSelect } from 'antd';
|
import { TreeSelect } from 'antd';
|
||||||
import React, { useRef } from 'react';
|
import React, { useEffect, useRef, useState } from 'react';
|
||||||
|
|
||||||
export interface IMenuListProps {
|
export interface IMenuListProps {
|
||||||
ghost?: boolean;
|
ghost?: boolean;
|
||||||
@ -125,7 +127,7 @@ export default function MenuList(props: IMenuListProps) {
|
|||||||
})}
|
})}
|
||||||
required={false}
|
required={false}
|
||||||
name={'pid'}
|
name={'pid'}
|
||||||
dependencies={['appId']}
|
dependencies={['platformId']}
|
||||||
request={async (params) => {
|
request={async (params) => {
|
||||||
const response = await business.menu.treeMenu(params);
|
const response = await business.menu.treeMenu(params);
|
||||||
return response.data || [];
|
return response.data || [];
|
||||||
@ -214,7 +216,7 @@ export default function MenuList(props: IMenuListProps) {
|
|||||||
})}
|
})}
|
||||||
required={false}
|
required={false}
|
||||||
name={'pid'}
|
name={'pid'}
|
||||||
dependencies={['appId']}
|
dependencies={['platformId']}
|
||||||
request={async (params) => {
|
request={async (params) => {
|
||||||
const response = await business.menu.treeMenu(params);
|
const response = await business.menu.treeMenu(params);
|
||||||
return response.data || [];
|
return response.data || [];
|
||||||
@ -320,7 +322,7 @@ export default function MenuList(props: IMenuListProps) {
|
|||||||
})}
|
})}
|
||||||
required={false}
|
required={false}
|
||||||
name={'pid'}
|
name={'pid'}
|
||||||
dependencies={['appId']}
|
dependencies={['platformId']}
|
||||||
request={async (params) => {
|
request={async (params) => {
|
||||||
const response = await business.menu.treeMenu(params);
|
const response = await business.menu.treeMenu(params);
|
||||||
return response.data || [];
|
return response.data || [];
|
||||||
@ -460,23 +462,6 @@ export default function MenuList(props: IMenuListProps) {
|
|||||||
}),
|
}),
|
||||||
dataIndex: 'path',
|
dataIndex: 'path',
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: intl.formatMessage({
|
|
||||||
id: intlPrefix + '.column.platformId',
|
|
||||||
}),
|
|
||||||
dataIndex: 'platformId',
|
|
||||||
valueType: 'select',
|
|
||||||
request: async (params) => await getPlatformList(params),
|
|
||||||
fieldProps: {
|
|
||||||
fetchDataOnSearch: false,
|
|
||||||
showSearch: true,
|
|
||||||
autoClearSearchValue: true,
|
|
||||||
fieldNames: {
|
|
||||||
label: 'platformName',
|
|
||||||
value: 'platformId',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: intl.formatMessage({
|
title: intl.formatMessage({
|
||||||
id: intlPrefix + '.column.type',
|
id: intlPrefix + '.column.type',
|
||||||
@ -519,6 +504,30 @@ export default function MenuList(props: IMenuListProps) {
|
|||||||
BizValueType
|
BizValueType
|
||||||
>[] = columns as ProDescriptionsItemProps<BusinessAPI.MenuVO, BizValueType>[];
|
>[] = columns as ProDescriptionsItemProps<BusinessAPI.MenuVO, BizValueType>[];
|
||||||
|
|
||||||
|
const [platformList, setPlatformList] = useState<BusinessAPI.PlatformVO[]>();
|
||||||
|
|
||||||
|
const [platformId, setPlatformId] =
|
||||||
|
useState<BusinessAPI.PlatformVO['platformId']>('');
|
||||||
|
|
||||||
|
const initPlatform = async () => {
|
||||||
|
const { data: platformList } = await business.platform.listPlatform({
|
||||||
|
platformListQry: {},
|
||||||
|
});
|
||||||
|
|
||||||
|
setPlatformList(platformList);
|
||||||
|
if (platformList) {
|
||||||
|
setPlatformId(platformList[0].platformId);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
initPlatform().then();
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
if (!platformList) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const detailContext = (
|
const detailContext = (
|
||||||
menuVO: BusinessAPI.MenuVO,
|
menuVO: BusinessAPI.MenuVO,
|
||||||
onValueChange: () => void,
|
onValueChange: () => void,
|
||||||
@ -557,6 +566,18 @@ export default function MenuList(props: IMenuListProps) {
|
|||||||
onValueChange={onValueChange}
|
onValueChange={onValueChange}
|
||||||
container={{
|
container={{
|
||||||
ghost,
|
ghost,
|
||||||
|
fieldProps: {
|
||||||
|
tabActiveKey: platformId,
|
||||||
|
onTabChange: (platformId) => {
|
||||||
|
setPlatformId(platformId as BusinessAPI.PlatformVO['platformId']);
|
||||||
|
},
|
||||||
|
tabList: [
|
||||||
|
...platformList.map((platformVO) => ({
|
||||||
|
key: platformVO.platformId,
|
||||||
|
tab: platformVO.platformName,
|
||||||
|
})),
|
||||||
|
],
|
||||||
|
},
|
||||||
}}
|
}}
|
||||||
page={{
|
page={{
|
||||||
fieldProps: {
|
fieldProps: {
|
||||||
@ -564,8 +585,10 @@ export default function MenuList(props: IMenuListProps) {
|
|||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
search,
|
search,
|
||||||
params: {
|
params: {
|
||||||
|
platformId: platformId,
|
||||||
...(menuVO && {
|
...(menuVO && {
|
||||||
pid: menuVO.menuId,
|
pid: menuVO.menuId,
|
||||||
|
platformId: menuVO.platformId,
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -580,8 +603,10 @@ export default function MenuList(props: IMenuListProps) {
|
|||||||
childrenColumnName: 'routes',
|
childrenColumnName: 'routes',
|
||||||
},
|
},
|
||||||
params: {
|
params: {
|
||||||
|
platformId: platformId,
|
||||||
...(menuVO && {
|
...(menuVO && {
|
||||||
pid: menuVO.menuId,
|
pid: menuVO.menuId,
|
||||||
|
platformId: menuVO.platformId,
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -594,8 +619,10 @@ export default function MenuList(props: IMenuListProps) {
|
|||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
search,
|
search,
|
||||||
params: {
|
params: {
|
||||||
|
platformId: platformId,
|
||||||
...(menuVO && {
|
...(menuVO && {
|
||||||
pid: menuVO.menuId,
|
pid: menuVO.menuId,
|
||||||
|
platformId: menuVO.platformId,
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -606,6 +633,7 @@ export default function MenuList(props: IMenuListProps) {
|
|||||||
formContext,
|
formContext,
|
||||||
trigger,
|
trigger,
|
||||||
initValues: {
|
initValues: {
|
||||||
|
platformId: platformId,
|
||||||
...(menuVO && {
|
...(menuVO && {
|
||||||
pid: menuVO.menuId,
|
pid: menuVO.menuId,
|
||||||
platformId: menuVO.platformId,
|
platformId: menuVO.platformId,
|
||||||
|
|||||||
@ -12,7 +12,7 @@ import {
|
|||||||
} from '@ant-design/pro-components';
|
} from '@ant-design/pro-components';
|
||||||
import { ProDescriptionsItemProps } from '@ant-design/pro-descriptions';
|
import { ProDescriptionsItemProps } from '@ant-design/pro-descriptions';
|
||||||
import { TreeSelect } from 'antd';
|
import { TreeSelect } from 'antd';
|
||||||
import React, { useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
|
|
||||||
export interface IRoleListProps {
|
export interface IRoleListProps {
|
||||||
ghost?: boolean;
|
ghost?: boolean;
|
||||||
@ -36,6 +36,30 @@ export default function RoleList(props: IRoleListProps) {
|
|||||||
const { getPlatformList } = useSearch();
|
const { getPlatformList } = useSearch();
|
||||||
const [menuTree, setMenuTree] = useState<BusinessAPI.TreeLong[]>();
|
const [menuTree, setMenuTree] = useState<BusinessAPI.TreeLong[]>();
|
||||||
|
|
||||||
|
const [platformList, setPlatformList] = useState<BusinessAPI.PlatformVO[]>();
|
||||||
|
|
||||||
|
const [platformId, setPlatformId] =
|
||||||
|
useState<BusinessAPI.PlatformVO['platformId']>('');
|
||||||
|
|
||||||
|
const initPlatform = async () => {
|
||||||
|
const { data: platformList } = await business.platform.listPlatform({
|
||||||
|
platformListQry: {},
|
||||||
|
});
|
||||||
|
|
||||||
|
setPlatformList(platformList);
|
||||||
|
if (platformList) {
|
||||||
|
setPlatformId(platformList[0].platformId);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
initPlatform().then();
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
if (!platformList) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const formContext = [
|
const formContext = [
|
||||||
<ProFormSelect
|
<ProFormSelect
|
||||||
key={'platformId'}
|
key={'platformId'}
|
||||||
@ -192,23 +216,6 @@ export default function RoleList(props: IRoleListProps) {
|
|||||||
dataIndex: 'description',
|
dataIndex: 'description',
|
||||||
search: false,
|
search: false,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: intl.formatMessage({
|
|
||||||
id: intlPrefix + '.column.platformId',
|
|
||||||
}),
|
|
||||||
dataIndex: 'platformId',
|
|
||||||
valueType: 'select',
|
|
||||||
request: async (params) => await getPlatformList(params),
|
|
||||||
fieldProps: {
|
|
||||||
fetchDataOnSearch: false,
|
|
||||||
showSearch: true,
|
|
||||||
autoClearSearchValue: true,
|
|
||||||
fieldNames: {
|
|
||||||
label: 'platformName',
|
|
||||||
value: 'platformId',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: intl.formatMessage({
|
title: intl.formatMessage({
|
||||||
id: intlPrefix + '.column.createdAt',
|
id: intlPrefix + '.column.createdAt',
|
||||||
@ -241,19 +248,35 @@ export default function RoleList(props: IRoleListProps) {
|
|||||||
onValueChange={onValueChange}
|
onValueChange={onValueChange}
|
||||||
container={{
|
container={{
|
||||||
ghost,
|
ghost,
|
||||||
|
fieldProps: {
|
||||||
|
tabActiveKey: platformId,
|
||||||
|
onTabChange: (platformId) => {
|
||||||
|
setPlatformId(platformId as BusinessAPI.PlatformVO['platformId']);
|
||||||
|
},
|
||||||
|
tabList: [
|
||||||
|
...platformList.map((platformVO) => ({
|
||||||
|
key: platformVO.platformId,
|
||||||
|
tab: platformVO.platformName,
|
||||||
|
})),
|
||||||
|
],
|
||||||
|
},
|
||||||
}}
|
}}
|
||||||
page={{
|
page={{
|
||||||
fieldProps: {
|
fieldProps: {
|
||||||
ghost,
|
ghost,
|
||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
search,
|
search,
|
||||||
params: {},
|
params: {
|
||||||
|
platformId: platformId,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
columns,
|
columns,
|
||||||
}}
|
}}
|
||||||
create={{
|
create={{
|
||||||
formType: 'drawer',
|
formType: 'drawer',
|
||||||
initValues: {},
|
initValues: {
|
||||||
|
platformId: platformId,
|
||||||
|
},
|
||||||
formContext,
|
formContext,
|
||||||
trigger,
|
trigger,
|
||||||
request: async (formData) => {
|
request: async (formData) => {
|
||||||
|
|||||||
@ -0,0 +1,47 @@
|
|||||||
|
import { business } from '@/services';
|
||||||
|
import { formLayout } from '@/utils/formLayout';
|
||||||
|
import { ProForm, ProFormTextArea } from '@ant-design/pro-components';
|
||||||
|
import { Col, message, Row, Space } from 'antd';
|
||||||
|
|
||||||
|
export default function SmartRecognitionPromptConfig() {
|
||||||
|
return (
|
||||||
|
<ProForm
|
||||||
|
{...formLayout()}
|
||||||
|
request={async () => {
|
||||||
|
const { data } = await business.setting.showSetting({
|
||||||
|
settingShowQry: {
|
||||||
|
settingKey: 'SMART_RECOGNITION_PROMPT',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
return {
|
||||||
|
...data?.settingValue,
|
||||||
|
};
|
||||||
|
}}
|
||||||
|
onFinish={async (values) => {
|
||||||
|
await business.setting.updateSetting({
|
||||||
|
settingKey: 'SMART_RECOGNITION_PROMPT',
|
||||||
|
settingValue: {
|
||||||
|
...values,
|
||||||
|
settingKey: 'SMART_RECOGNITION_PROMPT',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
message.success('智能识别提示词');
|
||||||
|
}}
|
||||||
|
submitter={{
|
||||||
|
render: (_, dom) => {
|
||||||
|
return (
|
||||||
|
<Row>
|
||||||
|
<Col span={14} offset={4}>
|
||||||
|
<Space>{dom}</Space>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<ProFormTextArea name="prompt" label="智能识别提示词" />
|
||||||
|
</ProForm>
|
||||||
|
);
|
||||||
|
}
|
||||||
@ -9,3 +9,4 @@ export { default as WxMaSubscribeMessageConfig } from './WxMaSubscribeMessageCon
|
|||||||
export { default as WxMpConfig } from './WxMpConfig';
|
export { default as WxMpConfig } from './WxMpConfig';
|
||||||
export { default as WxMpMessagePushConfig } from './WxMpMessagePushConfig';
|
export { default as WxMpMessagePushConfig } from './WxMpMessagePushConfig';
|
||||||
export { default as WxPayConfig } from './WxPayConfig';
|
export { default as WxPayConfig } from './WxPayConfig';
|
||||||
|
export { default as SmartRecognitionPromptConfig } from './SmartRecognitionPromptConfig';
|
||||||
|
|||||||
@ -18,3 +18,4 @@ export * from './Role';
|
|||||||
export * from './Setting';
|
export * from './Setting';
|
||||||
export * from './User';
|
export * from './User';
|
||||||
export * from './Purchase';
|
export * from './Purchase';
|
||||||
|
export * from './Delivery';
|
||||||
|
|||||||
@ -730,6 +730,9 @@ export default {
|
|||||||
placeholder: '请输入诚信志远分成比例',
|
placeholder: '请输入诚信志远分成比例',
|
||||||
required: '请输入诚信志远分成比例',
|
required: '请输入诚信志远分成比例',
|
||||||
},
|
},
|
||||||
|
shareAdjusted: {
|
||||||
|
label: '是否开启调整诚信志远分成比例',
|
||||||
|
},
|
||||||
freightCostFlag: {
|
freightCostFlag: {
|
||||||
label: '运费是否作为成本',
|
label: '运费是否作为成本',
|
||||||
placeholder: '请选择运费是否作为成本',
|
placeholder: '请选择运费是否作为成本',
|
||||||
@ -2315,4 +2318,77 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
shipOrder: {
|
||||||
|
column: {
|
||||||
|
orderSn: '发货单编号',
|
||||||
|
dealerName: '经销商名称',
|
||||||
|
vehicleNo: '车次号',
|
||||||
|
shippingDate: '发货日期',
|
||||||
|
state: '状态',
|
||||||
|
'state.waitPayment': '待回款',
|
||||||
|
'state.partialPayment': '部分回款',
|
||||||
|
'state.fullPayment': '已回款',
|
||||||
|
'state.rejectFinish': '拒收完结',
|
||||||
|
'state.finish': '已完结',
|
||||||
|
totalAmount: '合计金额(元)',
|
||||||
|
createdAt: '创建时间',
|
||||||
|
option: '操作',
|
||||||
|
},
|
||||||
|
form: {
|
||||||
|
orderSn: {
|
||||||
|
label: '发货单编号',
|
||||||
|
placeholder: '请输入发货单编号',
|
||||||
|
},
|
||||||
|
dealerName: {
|
||||||
|
label: '经销商名称',
|
||||||
|
placeholder: '请输入经销商名称',
|
||||||
|
},
|
||||||
|
shippingDate: {
|
||||||
|
label: '发货日期',
|
||||||
|
placeholder: '请选择发货日期',
|
||||||
|
},
|
||||||
|
vehicleNo: {
|
||||||
|
label: '车次号',
|
||||||
|
placeholder: '请输入车次号',
|
||||||
|
},
|
||||||
|
state: {
|
||||||
|
label: '状态',
|
||||||
|
placeholder: '请选择状态',
|
||||||
|
},
|
||||||
|
totalAmount: {
|
||||||
|
label: '合计金额(元)',
|
||||||
|
placeholder: '请输入合计金额',
|
||||||
|
},
|
||||||
|
remark: {
|
||||||
|
label: '备注',
|
||||||
|
placeholder: '请输入备注',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
modal: {
|
||||||
|
create: {
|
||||||
|
title: '创建发货单',
|
||||||
|
button: '创建发货单',
|
||||||
|
success: '创建发货单成功',
|
||||||
|
},
|
||||||
|
update: {
|
||||||
|
title: '更新发货单',
|
||||||
|
button: '编辑',
|
||||||
|
success: '更新发货单成功',
|
||||||
|
},
|
||||||
|
delete: {
|
||||||
|
success: '删除发货单成功',
|
||||||
|
button: '删除',
|
||||||
|
confirm: {
|
||||||
|
title: '确认删除',
|
||||||
|
content: '您确定要删除该发货单吗?',
|
||||||
|
okText: '确定',
|
||||||
|
cancelText: '取消',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
view: {
|
||||||
|
title: '查看发货单',
|
||||||
|
button: '详情',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@ -19,7 +19,6 @@ const useUser = () => {
|
|||||||
return initialState?.currentAdmin;
|
return initialState?.currentAdmin;
|
||||||
} else {
|
} else {
|
||||||
window.localStorage.removeItem('user-data');
|
window.localStorage.removeItem('user-data');
|
||||||
window.localStorage.removeItem('merchant-app-id');
|
|
||||||
|
|
||||||
window.location.href =
|
window.location.href =
|
||||||
process.env.UMI_APP_SSO_LOGIN_URL +
|
process.env.UMI_APP_SSO_LOGIN_URL +
|
||||||
@ -35,7 +34,6 @@ const useUser = () => {
|
|||||||
|
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
window.localStorage.removeItem('user-data');
|
window.localStorage.removeItem('user-data');
|
||||||
window.localStorage.removeItem('merchant-app-id');
|
|
||||||
|
|
||||||
window.location.href =
|
window.location.href =
|
||||||
process.env.UMI_APP_SSO_LOGIN_URL +
|
process.env.UMI_APP_SSO_LOGIN_URL +
|
||||||
|
|||||||
5
packages/app-operation/src/pages/ShipOrder.tsx
Normal file
5
packages/app-operation/src/pages/ShipOrder.tsx
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
import { ShipOrderList } from '@/components';
|
||||||
|
|
||||||
|
export default function Page() {
|
||||||
|
return <ShipOrderList />;
|
||||||
|
}
|
||||||
@ -1,12 +1,12 @@
|
|||||||
import {
|
import {
|
||||||
PageContainer,
|
PageContainer,
|
||||||
WxMaCodeUploadConfig,
|
|
||||||
WxMaMessagePushConfig,
|
WxMaMessagePushConfig,
|
||||||
WxMaSubscribeMessageConfig,
|
WxMaSubscribeMessageConfig,
|
||||||
} from '@/components';
|
} from '@/components';
|
||||||
import { WxMaConfig } from '@/components/Setting';
|
import { WxMaConfig } from '@/components/Setting';
|
||||||
import { ProCard } from '@ant-design/pro-components';
|
import { ProCard } from '@ant-design/pro-components';
|
||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
|
import SmartRecognitionPromptConfig from '../components/Setting/SmartRecognitionPromptConfig';
|
||||||
|
|
||||||
export default function Page() {
|
export default function Page() {
|
||||||
const [activeKey, setActiveKey] = useState<string>('1');
|
const [activeKey, setActiveKey] = useState<string>('1');
|
||||||
@ -34,7 +34,7 @@ export default function Page() {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: '4',
|
key: '4',
|
||||||
tab: '小程序上传',
|
tab: '智能识别',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
}}
|
}}
|
||||||
@ -59,7 +59,7 @@ export default function Page() {
|
|||||||
|
|
||||||
{activeKey === '4' && (
|
{activeKey === '4' && (
|
||||||
<ProCard>
|
<ProCard>
|
||||||
<WxMaCodeUploadConfig />
|
<SmartRecognitionPromptConfig />
|
||||||
</ProCard>
|
</ProCard>
|
||||||
)}
|
)}
|
||||||
</PageContainer>
|
</PageContainer>
|
||||||
|
|||||||
@ -1097,6 +1097,8 @@ declare namespace BusinessAPI {
|
|||||||
enableCompanyRebate?: boolean;
|
enableCompanyRebate?: boolean;
|
||||||
/** 公司返点比例 */
|
/** 公司返点比例 */
|
||||||
companyRebateRatio?: number;
|
companyRebateRatio?: number;
|
||||||
|
/** 是否可调整比例 */
|
||||||
|
shareAdjusted?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
type DealerDestroyCmd = {
|
type DealerDestroyCmd = {
|
||||||
@ -1413,6 +1415,8 @@ declare namespace BusinessAPI {
|
|||||||
enableCompanyRebate?: boolean;
|
enableCompanyRebate?: boolean;
|
||||||
/** 公司返点比例 */
|
/** 公司返点比例 */
|
||||||
companyRebateRatio?: number;
|
companyRebateRatio?: number;
|
||||||
|
/** 是否可调整比例 */
|
||||||
|
shareAdjusted?: boolean;
|
||||||
/** 发货单模板 */
|
/** 发货单模板 */
|
||||||
deliveryTemplate?: string;
|
deliveryTemplate?: string;
|
||||||
};
|
};
|
||||||
@ -1456,6 +1460,8 @@ declare namespace BusinessAPI {
|
|||||||
enableCompanyRebate?: boolean;
|
enableCompanyRebate?: boolean;
|
||||||
/** 公司返点比例 */
|
/** 公司返点比例 */
|
||||||
companyRebateRatio?: number;
|
companyRebateRatio?: number;
|
||||||
|
/** 是否可调整比例 */
|
||||||
|
shareAdjusted?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
type DealerWarehouseCreateCmd = {
|
type DealerWarehouseCreateCmd = {
|
||||||
@ -2528,6 +2534,8 @@ declare namespace BusinessAPI {
|
|||||||
enableCompanyRebate?: boolean;
|
enableCompanyRebate?: boolean;
|
||||||
/** 公司返点比例 */
|
/** 公司返点比例 */
|
||||||
companyRebateRatio?: number;
|
companyRebateRatio?: number;
|
||||||
|
/** 是否可调整比例 */
|
||||||
|
shareAdjusted?: boolean;
|
||||||
/** 税费补贴 */
|
/** 税费补贴 */
|
||||||
taxSubsidy?: number;
|
taxSubsidy?: number;
|
||||||
/** 计提税金 */
|
/** 计提税金 */
|
||||||
@ -3424,6 +3432,8 @@ declare namespace BusinessAPI {
|
|||||||
active?: number;
|
active?: number;
|
||||||
/** 产地负责人 */
|
/** 产地负责人 */
|
||||||
originPrincipal?: string;
|
originPrincipal?: string;
|
||||||
|
/** 工头 */
|
||||||
|
foreman?: string;
|
||||||
/** 备注 */
|
/** 备注 */
|
||||||
remark?: string;
|
remark?: string;
|
||||||
/** 车辆信息 */
|
/** 车辆信息 */
|
||||||
@ -3438,6 +3448,7 @@ declare namespace BusinessAPI {
|
|||||||
orderPackageList: OrderPackage[];
|
orderPackageList: OrderPackage[];
|
||||||
/** 是否是暂存 */
|
/** 是否是暂存 */
|
||||||
draft: boolean;
|
draft: boolean;
|
||||||
|
/** 报价方式:1_按毛重报价;2_按净重报价; */
|
||||||
pricingMethod?: 'BY_GROSS_WEIGHT' | 'BY_NET_WEIGHT';
|
pricingMethod?: 'BY_GROSS_WEIGHT' | 'BY_NET_WEIGHT';
|
||||||
/** 公司信息 */
|
/** 公司信息 */
|
||||||
orderCompany: OrderCompany;
|
orderCompany: OrderCompany;
|
||||||
@ -3448,14 +3459,16 @@ declare namespace BusinessAPI {
|
|||||||
type PurchaseOrderCountQry = {
|
type PurchaseOrderCountQry = {
|
||||||
/** 状态:1_启用;0_禁用; */
|
/** 状态:1_启用;0_禁用; */
|
||||||
status?: boolean;
|
status?: boolean;
|
||||||
/** 订单状态: 0-草稿, 1-待审核, 2-待老板审核, 3-已发货(待付款), 4-已付款, 5-已完结 */
|
/** 采购订单状态: 0_草稿;1_审核中;2_审批中;3_待发货;4_已发货;5_已驳回;6_已撤回;7_已关闭;8_已完结 */
|
||||||
state?:
|
state?:
|
||||||
| 'DRAFT'
|
| 'DRAFT'
|
||||||
| 'WAITING_AUDIT'
|
| 'WAITING_AUDIT'
|
||||||
| 'WAITING_BOSS_APPROVE'
|
| 'WAITING_APPROVE'
|
||||||
| 'SHIPPING'
|
| 'WAITING_SHIPMENT'
|
||||||
|
| 'SHIPPED'
|
||||||
| 'PAID'
|
| 'PAID'
|
||||||
| 'COMPLETED';
|
| 'COMPLETED'
|
||||||
|
| 'REJECTED';
|
||||||
};
|
};
|
||||||
|
|
||||||
type PurchaseOrderCreateCmd = {
|
type PurchaseOrderCreateCmd = {
|
||||||
@ -3465,6 +3478,8 @@ declare namespace BusinessAPI {
|
|||||||
active?: number;
|
active?: number;
|
||||||
/** 产地负责人 */
|
/** 产地负责人 */
|
||||||
originPrincipal?: string;
|
originPrincipal?: string;
|
||||||
|
/** 工头 */
|
||||||
|
foreman?: string;
|
||||||
/** 备注 */
|
/** 备注 */
|
||||||
remark?: string;
|
remark?: string;
|
||||||
/** 车辆信息 */
|
/** 车辆信息 */
|
||||||
@ -3517,14 +3532,16 @@ declare namespace BusinessAPI {
|
|||||||
vehicleNo?: string;
|
vehicleNo?: string;
|
||||||
/** 采购订单编号 */
|
/** 采购订单编号 */
|
||||||
orderSn?: string;
|
orderSn?: string;
|
||||||
/** 订单状态: 0-草稿, 1-待审核, 2-待老板审核, 3-已发货(待付款), 4-已付款, 5-已完结 */
|
/** 采购订单状态: 0_草稿;1_审核中;2_审批中;3_待发货;4_已发货;5_已驳回;6_已撤回;7_已关闭;8_已完结 */
|
||||||
state?:
|
state?:
|
||||||
| 'DRAFT'
|
| 'DRAFT'
|
||||||
| 'WAITING_AUDIT'
|
| 'WAITING_AUDIT'
|
||||||
| 'WAITING_BOSS_APPROVE'
|
| 'WAITING_APPROVE'
|
||||||
| 'SHIPPING'
|
| 'WAITING_SHIPMENT'
|
||||||
|
| 'SHIPPED'
|
||||||
| 'PAID'
|
| 'PAID'
|
||||||
| 'COMPLETED';
|
| 'COMPLETED'
|
||||||
|
| 'REJECTED';
|
||||||
/** 供应商名称 */
|
/** 供应商名称 */
|
||||||
supplierName?: string;
|
supplierName?: string;
|
||||||
/** 经销商ID */
|
/** 经销商ID */
|
||||||
@ -3535,13 +3552,15 @@ declare namespace BusinessAPI {
|
|||||||
type PurchaseOrderRejectApproveCmd = {
|
type PurchaseOrderRejectApproveCmd = {
|
||||||
/** 采购订单ID */
|
/** 采购订单ID */
|
||||||
orderId: string;
|
orderId: string;
|
||||||
/** 驳回原因 */
|
/** 审核原因 */
|
||||||
rejectReason: string;
|
rejectReason: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
type PurchaseOrderRejectFinalCmd = {
|
type PurchaseOrderRejectFinalCmd = {
|
||||||
/** 采购订单ID */
|
/** 采购订单ID */
|
||||||
orderId: string;
|
orderId: string;
|
||||||
|
/** 驳回原因 */
|
||||||
|
rejectReason: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
type PurchaseOrderShowQry = {
|
type PurchaseOrderShowQry = {
|
||||||
@ -3580,6 +3599,8 @@ declare namespace BusinessAPI {
|
|||||||
orderId: string;
|
orderId: string;
|
||||||
/** 步骤标识 */
|
/** 步骤标识 */
|
||||||
active?: number;
|
active?: number;
|
||||||
|
/** 工头 */
|
||||||
|
foreman?: string;
|
||||||
/** 采购订单费用信息 */
|
/** 采购订单费用信息 */
|
||||||
orderCostList: OrderCost[];
|
orderCostList: OrderCost[];
|
||||||
/** 采购订单包装箱信息 */
|
/** 采购订单包装箱信息 */
|
||||||
@ -3598,6 +3619,8 @@ declare namespace BusinessAPI {
|
|||||||
active?: number;
|
active?: number;
|
||||||
/** 产地负责人 */
|
/** 产地负责人 */
|
||||||
originPrincipal?: string;
|
originPrincipal?: string;
|
||||||
|
/** 工头 */
|
||||||
|
foreman?: string;
|
||||||
/** 备注 */
|
/** 备注 */
|
||||||
remark?: string;
|
remark?: string;
|
||||||
/** 车辆信息 */
|
/** 车辆信息 */
|
||||||
@ -3623,6 +3646,8 @@ declare namespace BusinessAPI {
|
|||||||
active?: number;
|
active?: number;
|
||||||
/** 产地负责人 */
|
/** 产地负责人 */
|
||||||
originPrincipal?: string;
|
originPrincipal?: string;
|
||||||
|
/** 工头 */
|
||||||
|
foreman?: string;
|
||||||
/** 报价方式:1_按毛重报价;2_按净重报价; */
|
/** 报价方式:1_按毛重报价;2_按净重报价; */
|
||||||
pricingMethod?: 'BY_GROSS_WEIGHT' | 'BY_NET_WEIGHT';
|
pricingMethod?: 'BY_GROSS_WEIGHT' | 'BY_NET_WEIGHT';
|
||||||
/** 销售金额 */
|
/** 销售金额 */
|
||||||
@ -3643,14 +3668,16 @@ declare namespace BusinessAPI {
|
|||||||
freightCharge?: number;
|
freightCharge?: number;
|
||||||
/** 瓜农数量 */
|
/** 瓜农数量 */
|
||||||
supplierCount?: number;
|
supplierCount?: number;
|
||||||
/** 订单状态: 0-草稿, 1-待审核, 2-待老板审核, 3-已发货(待付款), 4-已付款, 5-已完结 */
|
/** 采购订单状态: 0_草稿;1_审核中;2_审批中;3_待发货;4_已发货;5_已驳回;6_已撤回;7_已关闭;8_已完结 */
|
||||||
state?:
|
state?:
|
||||||
| 'DRAFT'
|
| 'DRAFT'
|
||||||
| 'WAITING_AUDIT'
|
| 'WAITING_AUDIT'
|
||||||
| 'WAITING_BOSS_APPROVE'
|
| 'WAITING_APPROVE'
|
||||||
| 'SHIPPING'
|
| 'WAITING_SHIPMENT'
|
||||||
|
| 'SHIPPED'
|
||||||
| 'PAID'
|
| 'PAID'
|
||||||
| 'COMPLETED';
|
| 'COMPLETED'
|
||||||
|
| 'REJECTED';
|
||||||
/** 备注 */
|
/** 备注 */
|
||||||
remark?: string;
|
remark?: string;
|
||||||
/** 创建人ID */
|
/** 创建人ID */
|
||||||
@ -3723,6 +3750,8 @@ declare namespace BusinessAPI {
|
|||||||
roleIdList?: number[];
|
roleIdList?: number[];
|
||||||
/** 平台Id */
|
/** 平台Id */
|
||||||
platformId?: string;
|
platformId?: string;
|
||||||
|
/** 平台Id */
|
||||||
|
platformIdList?: string;
|
||||||
/** 角色类型 */
|
/** 角色类型 */
|
||||||
type?: number;
|
type?: number;
|
||||||
offset?: number;
|
offset?: number;
|
||||||
@ -3783,6 +3812,8 @@ declare namespace BusinessAPI {
|
|||||||
description?: string;
|
description?: string;
|
||||||
/** 平台id */
|
/** 平台id */
|
||||||
platformId: string;
|
platformId: string;
|
||||||
|
/** 平台 */
|
||||||
|
platformVO?: PlatformVO;
|
||||||
/** 权限列表 */
|
/** 权限列表 */
|
||||||
permissionId: number[];
|
permissionId: number[];
|
||||||
/** 菜单列表 */
|
/** 菜单列表 */
|
||||||
@ -3810,7 +3841,8 @@ declare namespace BusinessAPI {
|
|||||||
| 'CHARGING_PILE_PURCHASE_CONFIG'
|
| 'CHARGING_PILE_PURCHASE_CONFIG'
|
||||||
| 'CUSTOM_THEME_CONFIG'
|
| 'CUSTOM_THEME_CONFIG'
|
||||||
| 'CUSTOM_MENU_CONFIG'
|
| 'CUSTOM_MENU_CONFIG'
|
||||||
| 'WX_CP_NOTIFY_CONFIG';
|
| 'WX_CP_NOTIFY_CONFIG'
|
||||||
|
| 'SMART_RECOGNITION_PROMPT';
|
||||||
};
|
};
|
||||||
|
|
||||||
type SettingUpdateCmd = {
|
type SettingUpdateCmd = {
|
||||||
@ -3832,13 +3864,15 @@ declare namespace BusinessAPI {
|
|||||||
| 'CHARGING_PILE_PURCHASE_CONFIG'
|
| 'CHARGING_PILE_PURCHASE_CONFIG'
|
||||||
| 'CUSTOM_THEME_CONFIG'
|
| 'CUSTOM_THEME_CONFIG'
|
||||||
| 'CUSTOM_MENU_CONFIG'
|
| 'CUSTOM_MENU_CONFIG'
|
||||||
| 'WX_CP_NOTIFY_CONFIG';
|
| 'WX_CP_NOTIFY_CONFIG'
|
||||||
|
| 'SMART_RECOGNITION_PROMPT';
|
||||||
/** 系统设置项内容 */
|
/** 系统设置项内容 */
|
||||||
settingValue:
|
settingValue:
|
||||||
| AliPayConfigValue
|
| AliPayConfigValue
|
||||||
| ChargingPilePurchaseConfig
|
| ChargingPilePurchaseConfig
|
||||||
| CustomMenuConfigValue
|
| CustomMenuConfigValue
|
||||||
| CustomThemeConfigValue
|
| CustomThemeConfigValue
|
||||||
|
| SmartRecognitionPromptValue
|
||||||
| TencentMapConfigValue
|
| TencentMapConfigValue
|
||||||
| WxCpNotifyConfigValue
|
| WxCpNotifyConfigValue
|
||||||
| WxMaCodeUploadConfigValue
|
| WxMaCodeUploadConfigValue
|
||||||
@ -3871,13 +3905,15 @@ declare namespace BusinessAPI {
|
|||||||
| 'CHARGING_PILE_PURCHASE_CONFIG'
|
| 'CHARGING_PILE_PURCHASE_CONFIG'
|
||||||
| 'CUSTOM_THEME_CONFIG'
|
| 'CUSTOM_THEME_CONFIG'
|
||||||
| 'CUSTOM_MENU_CONFIG'
|
| 'CUSTOM_MENU_CONFIG'
|
||||||
| 'WX_CP_NOTIFY_CONFIG';
|
| 'WX_CP_NOTIFY_CONFIG'
|
||||||
|
| 'SMART_RECOGNITION_PROMPT';
|
||||||
/** 系统设置项内容 */
|
/** 系统设置项内容 */
|
||||||
settingValue:
|
settingValue:
|
||||||
| AliPayConfigValue
|
| AliPayConfigValue
|
||||||
| ChargingPilePurchaseConfig
|
| ChargingPilePurchaseConfig
|
||||||
| CustomMenuConfigValue
|
| CustomMenuConfigValue
|
||||||
| CustomThemeConfigValue
|
| CustomThemeConfigValue
|
||||||
|
| SmartRecognitionPromptValue
|
||||||
| TencentMapConfigValue
|
| TencentMapConfigValue
|
||||||
| WxCpNotifyConfigValue
|
| WxCpNotifyConfigValue
|
||||||
| WxMaCodeUploadConfigValue
|
| WxMaCodeUploadConfigValue
|
||||||
@ -3940,6 +3976,10 @@ declare namespace BusinessAPI {
|
|||||||
companyName?: string;
|
companyName?: string;
|
||||||
/** 备注 */
|
/** 备注 */
|
||||||
remark?: string;
|
remark?: string;
|
||||||
|
/** 发货单明细 */
|
||||||
|
shipOrderItemList?: ShipOrderItem[];
|
||||||
|
/** 发货单包装信息 */
|
||||||
|
shipOrderPackageList?: ShipOrderPackage[];
|
||||||
};
|
};
|
||||||
|
|
||||||
type ShipOrderDestroyCmd = {
|
type ShipOrderDestroyCmd = {
|
||||||
@ -3995,7 +4035,7 @@ declare namespace BusinessAPI {
|
|||||||
};
|
};
|
||||||
|
|
||||||
type ShipOrderPackage = {
|
type ShipOrderPackage = {
|
||||||
/** 发货单子项ID */
|
/** 发货单包装信息Id */
|
||||||
orderPackageId: string;
|
orderPackageId: string;
|
||||||
/** 发货单ID */
|
/** 发货单ID */
|
||||||
shipOrderId: string;
|
shipOrderId: string;
|
||||||
@ -4498,6 +4538,13 @@ declare namespace BusinessAPI {
|
|||||||
data?: VehicleExtractionVO;
|
data?: VehicleExtractionVO;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
type SmartRecognitionPromptValue =
|
||||||
|
// #/components/schemas/SettingValue
|
||||||
|
SettingValue & {
|
||||||
|
/** 提示词 */
|
||||||
|
prompt?: string;
|
||||||
|
};
|
||||||
|
|
||||||
type SupplierCheckQry = {
|
type SupplierCheckQry = {
|
||||||
pageSize?: number;
|
pageSize?: number;
|
||||||
pageIndex?: number;
|
pageIndex?: number;
|
||||||
|
|||||||
19
packages/app-operation/src/utils/groupby.ts
Normal file
19
packages/app-operation/src/utils/groupby.ts
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
// 添加一个辅助函数用于分组
|
||||||
|
const groupBy = <T>(
|
||||||
|
array: T[],
|
||||||
|
keyFn: (item: T) => string,
|
||||||
|
): Record<string, T[]> => {
|
||||||
|
return array.reduce(
|
||||||
|
(groups, item) => {
|
||||||
|
const key = keyFn(item);
|
||||||
|
if (!groups[key]) {
|
||||||
|
groups[key] = [];
|
||||||
|
}
|
||||||
|
groups[key].push(item);
|
||||||
|
return groups;
|
||||||
|
},
|
||||||
|
{} as Record<string, T[]>,
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default groupBy;
|
||||||
@ -1,14 +0,0 @@
|
|||||||
export const replaceMerchantApp = async (merchantAppVO: API.MerchantAppVO) => {
|
|
||||||
window.localStorage.setItem('merchant-app-id', merchantAppVO.merchantAppId);
|
|
||||||
|
|
||||||
window.localStorage.setItem('app-plan-id', merchantAppVO.appPlanId);
|
|
||||||
|
|
||||||
// 历史记录清空
|
|
||||||
window.history.replaceState(null, '', '/');
|
|
||||||
|
|
||||||
// window.location.replace(
|
|
||||||
// merchantAppVO.appPlanVO.homePage +
|
|
||||||
// '?merchantAppId=' +
|
|
||||||
// merchantAppVO.merchantAppId,
|
|
||||||
// );
|
|
||||||
};
|
|
||||||
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user