Commit b99e226a authored by XieZhiXiong's avatar XieZhiXiong

feat: 添加售后组件相关 CN国际化

parent 5e3ae658
......@@ -31,6 +31,7 @@ import trademark from './zh-CN/trademark'
import repositories from './zh-CN/repositories'
import payandSettle from './zh-CN/payandSettle'
import processRuleSetting from './zh-CN/system/processRuleSetting'
import afterService from './zh-CN/afterService';
export default {
'global.siteName': '瓴犀',
......@@ -67,4 +68,5 @@ export default {
...components,
...content,
...processRuleSetting,
...afterService,
}
export default {
'afterService.common.productColumns.orderNo': '订单号',
'afterService.common.productColumns.productId': '商品ID',
'afterService.common.productColumns.productName': '商品名称',
'afterService.common.productColumns.category': '品类',
'afterService.common.productColumns.brand': '品牌',
'afterService.common.productColumns.unit': '单位',
'afterService.common.productColumns.materialNo': '物料编号',
'afterService.common.productColumns.materialName': '物料名称',
'afterService.common.productColumns.materialSpec': '规格',
'afterService.common.productColumns.materialMergeInfo1': '关联报价商品ID、名称、规格、品类、品牌',
'afterService.common.productColumns.materialMergeInfo2': '关联投标商品ID、名称、规格、品类、品牌',
'afterService.common.productColumns.purchaseCount': '采购数量',
'afterService.common.productColumns.purchasePrice': '采购单价',
'afterService.common.productColumns.payAmount': '已支付',
'afterService.common.productColumns.payAmount2': '已支付金额',
'afterService.common.productColumns.purchaseAmount': '采购金额',
'afterService.common.productColumns.returnCount': '退货数量',
'afterService.common.productColumns.refundAmount': '退货金额',
'afterService.common.productColumns.needReturnName': '是否退货',
'afterService.common.productColumns.checkInfo': '查看详情',
// 售后退货相关流转进度
'afterService.common.return.anchors.taskList': '流转进度',
'afterService.common.return.anchors.basicInfo': '基本信息',
'afterService.common.return.anchors.goodsDetailList': '退货商品',
'afterService.common.return.anchors.faultFileList': '附件',
'afterService.common.return.anchors.returnGoodsAddress': '退货收货地址',
'afterService.common.return.anchors.evaluate': '售后评价',
'afterService.common.return.anchors.returnDeliveryGoodsList': '退货发货信息',
'afterService.common.return.anchors.refundList': '退款明细',
'afterService.common.return.anchors.workflowRecord': '流转记录',
'afterService.common.return.products': '退货商品',
'afterService.common.basicInfo.applyNo': '申请单号',
'afterService.common.basicInfo.orderType': '售后订单类型',
'afterService.common.basicInfo.applyTime': '单据时间',
'afterService.common.basicInfo.applyAbstract': '申请摘要',
'afterService.common.basicInfo.supplierName': '供应会员',
'afterService.common.basicInfo.outerStatus': '外部状态',
'afterService.common.basicInfo.innerStatus': '内部状态',
'afterService.common.cancel': '取 消',
'afterService.common.confirm': '确 定',
}
\ No newline at end of file
This diff is collapsed.
import common from './common';
import returnApplication from './returnApplication';
import components from './components';
export default {
...common,
...returnApplication,
...components,
};
\ No newline at end of file
export default {
'returnApplication.detailInfo.productColumns.orderNo': '订单号',
}
\ No newline at end of file
......@@ -100,4 +100,5 @@ export default {
/** 其他 */
'common.money': '¥',
'common.money.yuan': '元',
}
......@@ -6,6 +6,7 @@
* @Description: 申请单基础信息
*/
import React, { CSSProperties } from 'react';
import { useIntl } from 'umi';
import { Descriptions } from 'antd';
import MellowCard, { MellowCardProps } from '@/components/MellowCard';
import styles from './index.less';
......@@ -46,9 +47,12 @@ const defaultColumnProps: ColumnProps = {
const AfterServiceBasicInfo: React.FC<IProps> = (props: IProps) => {
const { data, ...rest } = props;
const intl = useIntl();
return (
<MellowCard
title="基本信息"
title={intl.formatMessage({ id: 'afterService.components.BasicInfo.title' }, { default: '基本信息' })}
bodyStyle={{
paddingBottom: 0,
}}
......
......@@ -6,6 +6,7 @@
* @Description: 线下退款凭证
*/
import React from 'react';
import { useIntl } from 'umi';
import { Modal, Upload } from 'antd';
import styles from './index.less';
......@@ -14,7 +15,7 @@ interface CheckVoucherModalProps {
fileList: {
uid: string,
name: string,
status: string,
status: any,
url: string,
}[],
onCancel: () => void;
......@@ -26,6 +27,8 @@ const CheckVoucherModal: React.FC<CheckVoucherModalProps> = ({
onCancel,
}) => {
const intl = useIntl();
const handleCancel = () => {
if (onCancel) {
onCancel();
......@@ -34,7 +37,7 @@ const CheckVoucherModal: React.FC<CheckVoucherModalProps> = ({
return (
<Modal
title="查看凭证"
title={intl.formatMessage({ id: 'afterService.components.CheckVoucherModal.title' }, { default: '查看凭证' })}
width={576}
visible={visible}
onCancel={handleCancel}
......
......@@ -5,8 +5,8 @@
* @LastEditTime: 2021-11-17 19:31:55
* @Description: 退货发货抽屉
*/
import React from 'react';
import { useIntl } from 'umi';
import {
Drawer,
Button,
......@@ -240,6 +240,8 @@ const DeliverDrawer: React.FC<IProps> = (props) => {
ediableLogistics = true,
} = props;
const intl = useIntl();
// 获取物流公司
const fetchLogisticsCompany = (): Promise<any[]> => {
return new Promise((resolve, reject) => {
......@@ -282,7 +284,7 @@ const DeliverDrawer: React.FC<IProps> = (props) => {
return (
<Drawer
title={`${TYPE_NAME_MAP[afterType]}发货处理`}
title={intl.formatMessage({ id: 'afterService.components.DeliverDrawer.title' }, { type: TYPE_NAME_MAP[afterType] })}
width={1100}
onClose={handleClose}
visible={visible}
......@@ -293,14 +295,14 @@ const DeliverDrawer: React.FC<IProps> = (props) => {
}}
>
<Button onClick={handleClose} style={{ marginRight: 16 }}>
取 消
{intl.formatMessage({ id: 'afterService.common.cancel' }, { default: '取 消' })}
</Button>
<Button
onClick={() => formActions.submit()}
type="primary"
loading={submitLoading}
>
确 定
{intl.formatMessage({ id: 'afterService.common.confirm' }, { default: '确 定' })}
</Button>
</div>
}
......@@ -354,7 +356,7 @@ const DeliverDrawer: React.FC<IProps> = (props) => {
}),
state => {
if (+value > +noDeliveryCountValue) {
state.errors = [`填写值已超过未${FLOW_TYPE_NAME_MAP[flowType]}发货数量,请重新填写`];
state.errors = [intl.formatMessage({ id: 'afterService.components.DeliverDrawer.overflow' }, { flow: FLOW_TYPE_NAME_MAP[flowType] })];;
} else {
state.errors = [];
}
......
......@@ -6,17 +6,20 @@
* @Description:
*/
import { ISchema } from '@formily/antd';
import { getIntl } from 'umi';
import moment from 'moment';
import { PATTERN_MAPS } from '@/constants/regExp';
const intl = getIntl();
export const TYPE_NAME_MAP = {
2: '换货',
3: '退货',
2: intl.formatMessage({ id: 'afterService.components.DeliverDrawer.type.replace' }, { default: '换货' }),
3: intl.formatMessage({ id: 'afterService.components.DeliverDrawer.type.refund' }, { default: '退货' }),
};
export const FLOW_TYPE_NAME_MAP = {
exchangeDeliver: '换货',
returnDeliver: '退货',
exchangeDeliver: intl.formatMessage({ id: 'afterService.components.DeliverDrawer.flow.replace' }, { default: '换货' }),
returnDeliver: intl.formatMessage({ id: 'afterService.components.DeliverDrawer.flow.refund' }, { default: '退货' }),
};
export const createSchema = (type: 2 | 3, flowType: 'returnDeliver' | 'exchangeDeliver'): ISchema => ({
......@@ -37,70 +40,70 @@ export const createSchema = (type: 2 | 3, flowType: 'returnDeliver' | 'exchangeD
properties: {
orderNo: {
type: 'string',
title: '订单号',
title: intl.formatMessage({ id: 'afterService.components.DeliverDrawer.orderNo' }, { default: '订单号' }),
editable: false,
},
productId: {
type: 'string',
title: '商品ID',
title: intl.formatMessage({ id: 'afterService.components.DeliverDrawer.productId' }, { default: '商品ID' }),
editable: false,
},
productName: {
type: 'string',
title: '商品名称',
title: intl.formatMessage({ id: 'afterService.components.DeliverDrawer.productName' }, { default: '商品名称' }),
editable: false,
},
category: {
type: 'string',
title: '品类',
title: intl.formatMessage({ id: 'afterService.components.DeliverDrawer.category' }, { default: '品类' }),
editable: false,
},
brand: {
type: 'string',
title: '品牌',
title: intl.formatMessage({ id: 'afterService.components.DeliverDrawer.brand' }, { default: '品牌' }),
editable: false,
},
unit: {
type: 'string',
title: '单位',
title: intl.formatMessage({ id: 'afterService.components.DeliverDrawer.unit' }, { default: '单位' }),
editable: false,
},
applyCount: {
type: 'string',
title: `${TYPE_NAME_MAP[type]}数量`,
title: intl.formatMessage({ id: 'afterService.components.DeliverDrawer.applyCount' }, { type: TYPE_NAME_MAP[type] }),
editable: false,
},
deliveryCount: {
type: 'string',
title: `已${FLOW_TYPE_NAME_MAP[flowType]}发货`,
title: intl.formatMessage({ id: 'afterService.components.DeliverDrawer.deliveryCount' }, { flow: FLOW_TYPE_NAME_MAP[flowType] }),
editable: false,
},
noDeliveryCount: {
type: 'string',
title: `未${FLOW_TYPE_NAME_MAP[flowType]}发货`,
title: intl.formatMessage({ id: 'afterService.components.DeliverDrawer.noDeliveryCount' }, { flow: FLOW_TYPE_NAME_MAP[flowType] }),
editable: false,
},
receiveCount: {
type: 'string',
title: `已${FLOW_TYPE_NAME_MAP[flowType]}收货`,
title: intl.formatMessage({ id: 'afterService.components.DeliverDrawer.receiveCount' }, { flow: FLOW_TYPE_NAME_MAP[flowType] }),
editable: false,
},
subCount: {
type: 'string',
title: '差异数量',
title: intl.formatMessage({ id: 'afterService.components.DeliverDrawer.subCount' }, { default: '差异数量' }),
editable: false,
},
count: {
type: 'string',
title: `${FLOW_TYPE_NAME_MAP[flowType]}发货数量`,
title: intl.formatMessage({ id: 'afterService.components.DeliverDrawer.count' }, { flow: FLOW_TYPE_NAME_MAP[flowType] }),
'x-rules': [
{
required: true,
message: `请输入${FLOW_TYPE_NAME_MAP[flowType]}发货数量`,
message: intl.formatMessage({ id: 'afterService.components.DeliverDrawer.count.required' }, { flow: FLOW_TYPE_NAME_MAP[flowType] }),
},
{
pattern: PATTERN_MAPS.weight,
message: '最多保留3位小数,大于或等于0'
message: intl.formatMessage({ id: 'afterService.components.DeliverDrawer.count.legal' }, { default: '最多保留3位小数,大于或等于0' }),
},
],
},
......@@ -122,7 +125,7 @@ export const createSchema = (type: 2 | 3, flowType: 'returnDeliver' | 'exchangeD
properties: {
returnDeliverAddress: {
type: 'string',
title: `${FLOW_TYPE_NAME_MAP[flowType]}发货地址`,
title: intl.formatMessage({ id: 'afterService.components.DeliverDrawer.returnDeliverAddress' }, { flow: FLOW_TYPE_NAME_MAP[flowType] }),
'x-component': 'CustomAddressSelect',
'x-component-props': {
isDefaultAddress: true,
......@@ -130,13 +133,13 @@ export const createSchema = (type: 2 | 3, flowType: 'returnDeliver' | 'exchangeD
'x-rules': [
{
required: true,
message: `请选择${FLOW_TYPE_NAME_MAP[flowType]}发货地址`,
message: intl.formatMessage({ id: 'afterService.components.DeliverDrawer.returnDeliverAddress.required' }, { flow: FLOW_TYPE_NAME_MAP[flowType] }),
},
],
},
deliveryTime: {
type: 'date',
title: `${FLOW_TYPE_NAME_MAP[flowType]}发货时间`,
title: intl.formatMessage({ id: 'afterService.components.DeliverDrawer.deliveryTime' }, { flow: FLOW_TYPE_NAME_MAP[flowType] }),
'x-component-props': {
format: 'YYYY-MM-DD HH:mm:ss',
showTime: true,
......@@ -146,7 +149,7 @@ export const createSchema = (type: 2 | 3, flowType: 'returnDeliver' | 'exchangeD
},
logisticsOrderNo: {
type: 'string',
title: '物流单号',
title: intl.formatMessage({ id: 'afterService.components.DeliverDrawer.logisticsOrderNo' }, { default: '物流单号' }),
required: true,
'x-component-props': {
maxLength: 11,
......@@ -154,7 +157,7 @@ export const createSchema = (type: 2 | 3, flowType: 'returnDeliver' | 'exchangeD
},
logisticsName: {
type: 'string',
title: '物流公司',
title: intl.formatMessage({ id: 'afterService.components.DeliverDrawer.logisticsName' }, { default: '物流公司' }),
required: true,
enum: [],
'x-component-props': {
......@@ -163,7 +166,7 @@ export const createSchema = (type: 2 | 3, flowType: 'returnDeliver' | 'exchangeD
},
// 收集值用
logisticsNameTxt: {
title: '物流公司',
title: intl.formatMessage({ id: 'afterService.components.DeliverDrawer.logisticsName' }, { default: '物流公司' }),
type: 'string',
display: false,
},
......
......@@ -6,6 +6,7 @@
* @Description: 换货收货地址
*/
import React, { useEffect } from 'react';
import { useIntl } from 'umi';
import MellowCard, { MellowCardProps } from '@/components/MellowCard';
import { createAsyncFormActions, FormEffectHooks } from '@formily/antd';
import { getLogisticsSelectListShipperAddress } from '@/services/LogisticsV2Api';
......@@ -141,6 +142,8 @@ const ExchangeAddressInfo: React.FC<ExchangeAddressInfo> = ({
...rest
}) => {
const intl = useIntl();
useEffect(() => {
const { setFieldState } = modalFormActions;
switch (shippingAddress.deliveryType) {
......@@ -174,14 +177,11 @@ const ExchangeAddressInfo: React.FC<ExchangeAddressInfo> = ({
});
} else {
setFieldState('shippingAddressShow', state => {
state.title = '换货自提地址';
state.title = intl.formatMessage({ id: 'afterService.components.ExchangeAddressInfo.pickupAddress' }, { default: '换货自提地址' });
});
setFieldState('pickupAddress', state => {
state.visible = true;
});
setFieldState('shippingAddressShow', fieldState => {
fieldState.title = '换货自提地址'
});
setFieldState('*(shippingAddress,pickupAddress)', state => {
state.visible = false;
});
......@@ -231,7 +231,7 @@ const ExchangeAddressInfo: React.FC<ExchangeAddressInfo> = ({
return (
<MellowCard
title="换货收货地址"
title={intl.formatMessage({ id: 'afterService.components.ExchangeAddressInfo.title' }, { default: '换货收货地址' })}
{...rest}
>
<NiceForm
......
......@@ -6,8 +6,11 @@
* @Description:
*/
import { ISchema } from '@formily/antd';
import { getIntl } from 'umi';
import { DELIVERY_TYPE_ENUM } from '@/constants/afterService';
const intl = getIntl();
export const schema: ISchema = {
type: 'object',
properties: {
......@@ -23,11 +26,11 @@ export const schema: ISchema = {
},
properties: {
deliveryType: {
title: '配送方式',
title: intl.formatMessage({ id: 'afterService.components.ExchangeAddressInfo.deliveryType' }, { default: '配送方式' }),
type: 'string',
enum: DELIVERY_TYPE_ENUM,
'x-component-props': {
placeholder: '请选择',
placeholder: intl.formatMessage({ id: 'afterService.components.ExchangeAddressInfo.deliveryType.placeholder' }, { default: '请选择' }),
style: {
width: '80%',
},
......@@ -35,17 +38,17 @@ export const schema: ISchema = {
'x-rules': [
{
required: true,
message: '请选择配送方式',
message: intl.formatMessage({ id: 'afterService.components.ExchangeAddressInfo.deliveryType.required' }, { default: '请选择配送方式' }),
},
],
},
shippingAddress: {
type: 'string',
title: '换货发货地址',
title: intl.formatMessage({ id: 'afterService.components.ExchangeAddressInfo.deliveryAddress' }, { default: '换货发货地址' }),
visible: true,
enum: [],
'x-component-props': {
placeholder: '请选择',
placeholder: intl.formatMessage({ id: 'afterService.components.ExchangeAddressInfo.deliveryAddress.placeholder' }, { default: '请选择' }),
style: {
width: '80%',
},
......@@ -53,17 +56,17 @@ export const schema: ISchema = {
'x-rules': [
{
required: true,
message: '请选择换货发货地址',
message: intl.formatMessage({ id: 'afterService.components.ExchangeAddressInfo.deliveryAddress.required' }, { default: '请选择换货发货地址' }),
},
],
},
pickupAddress: {
type: 'string',
title: '换货自提地址',
title: intl.formatMessage({ id: 'afterService.components.ExchangeAddressInfo.pickupAddress' }, { default: '换货自提地址' }),
visible: false,
enum: [],
'x-component-props': {
placeholder: '请选择',
placeholder: intl.formatMessage({ id: 'afterService.components.ExchangeAddressInfo.pickupAddress.placeholder' }, { default: '请选择' }),
style: {
width: '80%',
},
......@@ -71,18 +74,18 @@ export const schema: ISchema = {
'x-rules': [
{
required: true,
message: '请选择换货自提地址',
message: intl.formatMessage({ id: 'afterService.components.ExchangeAddressInfo.pickupAddress.required' }, { default: '请选择换货自提地址' }),
},
],
},
deliveryAddress: {
type: 'object',
title: '换货收货地址',
title: intl.formatMessage({ id: 'afterService.components.ExchangeAddressInfo.shippingAddress' }, { default: '换货收货地址' }),
'x-component': 'Address',
},
shippingAddressShow: {
type: 'object',
title: '换货发货地址',
title: intl.formatMessage({ id: 'afterService.components.ExchangeAddressInfo.deliveryAddress' }, { default: '换货发货地址' }),
visible: false,
'x-component': 'ShippingAddress',
},
......
......@@ -6,6 +6,7 @@
* @Description: 附件列表
*/
import React from 'react';
import { useIntl } from 'umi';
import { Empty, Descriptions, Upload } from 'antd';
import { FileData } from '@/utils';
import MellowCard, { MellowCardProps } from '@/components/MellowCard';
......@@ -19,9 +20,11 @@ const FileList: React.FC<FileListProps> = ({
fileList = [],
...rest
}) => {
const intl = useIntl();
return (
<MellowCard
title="附件"
title={intl.formatMessage({ id: 'afterService.components.FileList.title' }, { default: '附件' })}
bodyStyle={{
paddingBottom: 6,
}}
......@@ -41,7 +44,7 @@ const FileList: React.FC<FileListProps> = ({
// </FormMegaLayout>
// </SchemaForm>
<Descriptions column={1}>
<Descriptions.Item label="相关不良原因举证附件">
<Descriptions.Item label={intl.formatMessage({ id: 'afterService.components.FileList.fileList' }, { default: '相关不良原因举证附件' })}>
<Upload
className={styles.file}
fileList={fileList}
......
......@@ -6,6 +6,7 @@
* @Description: 确认完成审核 Modal
*/
import React from 'react';
import { useIntl } from 'umi';
import { Modal } from 'antd';
import { createFormActions, FormEffectHooks, FormPath } from '@formily/antd';
import NiceForm from '@/components/NiceForm';
......@@ -31,6 +32,8 @@ const FinishedModal: React.FC<VerifyModalProps> = ({
onVisible,
}) => {
const intl = useIntl();
const handleSubmit = values => {
if (onSubmit) {
onSubmit(values);
......@@ -39,7 +42,7 @@ const FinishedModal: React.FC<VerifyModalProps> = ({
return (
<Modal
title="售后评价"
title={intl.formatMessage({ id: 'afterService.components.FinishedModal.title' }, { default: '售后评价' })}
visible={visible}
confirmLoading={confirmLoading}
onOk={() => modalFormActions.submit()}
......
import { ISchema } from '@formily/antd';
import { getIntl } from 'umi';
const intl = getIntl();
export const auditModalSchema: ISchema = {
type: 'object',
......@@ -12,25 +15,25 @@ export const auditModalSchema: ISchema = {
properties: {
level: {
type: 'string',
title: '售后满意度',
title: intl.formatMessage({ id: 'afterService.components.FinishedModal.level' }, { default: '售后满意度' }),
default: 5,
enum: [
{ label: '5分', value: 5 },
{ label: '4分', value: 4 },
{ label: '3分', value: 3 },
{ label: '2分', value: 2 },
{ label: '1分', value: 1 },
{ label: intl.formatMessage({ id: 'afterService.components.FinishedModal.level.5' }, { default: '5分' }), value: 5 },
{ label: intl.formatMessage({ id: 'afterService.components.FinishedModal.level.4' }, { default: '4分' }), value: 4 },
{ label: intl.formatMessage({ id: 'afterService.components.FinishedModal.level.3' }, { default: '3分' }), value: 3 },
{ label: intl.formatMessage({ id: 'afterService.components.FinishedModal.level.2' }, { default: '2分' }), value: 2 },
{ label: intl.formatMessage({ id: 'afterService.components.FinishedModal.level.1' }, { default: '1分' }), value: 1 },
],
'x-component': 'radio',
'x-component-props': {},
},
content: {
type: 'string',
title: '售后评价',
title: intl.formatMessage({ id: 'afterService.components.FinishedModal.content' }, { default: '售后评价' }),
'x-component': 'textarea',
required: true,
'x-component-props': {
placeholder: '在此输入你的内容,最长120个字符,60个汉字',
placeholder: intl.formatMessage({ id: 'afterService.components.FinishedModal.content.placeholder' }, { default: '在此输入你的内容,最长120个字符,60个汉字' }),
rows: 5,
},
'x-rules': [
......
import React from 'react';
import { useIntl } from 'umi';
import {
Badge,
} from 'antd';
......@@ -65,35 +66,37 @@ const AsFlowRecords: React.FC<AsFlowRecordsProps> = ({
innerStatusColorMap = {},
...rest
}) => {
const intl = useIntl();
const outerColumns: EditableColumns[] = [
{
title: '序号',
title: intl.formatMessage({ id: 'afterService.components.FlowRecords.outerColumns.index' }, { default: '序号' }),
dataIndex: 'index',
render: (_, record, index) => index + 1,
},
{
title: '操作角色',
title: intl.formatMessage({ id: 'afterService.components.FlowRecords.outerColumns.roleName' }, { default: '操作角色' }),
dataIndex: 'roleName',
},
{
title: '状态',
title: intl.formatMessage({ id: 'afterService.components.FlowRecords.outerColumns.status' }, { default: '状态' }),
dataIndex: 'status',
render: (text, record) => (
<StatusTag type={outerStatusMap[record.statusCode] || 'default'} title={text} />
),
},
{
title: '操作',
title: intl.formatMessage({ id: 'afterService.components.FlowRecords.outerColumns.operate' }, { default: '操作' }),
dataIndex: 'operate',
align: 'center',
},
{
title: '操作时间',
title: intl.formatMessage({ id: 'afterService.components.FlowRecords.outerColumns.operateTime' }, { default: '操作时间' }),
dataIndex: 'operateTime',
ellipsis: true,
},
{
title: '审核意见',
title: intl.formatMessage({ id: 'afterService.components.FlowRecords.outerColumns.opinion' }, { default: '审核意见' }),
dataIndex: 'opinion',
ellipsis: true,
},
......@@ -101,39 +104,39 @@ const AsFlowRecords: React.FC<AsFlowRecordsProps> = ({
const innerColumns: EditableColumns[] = [
{
title: '序号',
title: intl.formatMessage({ id: 'afterService.components.FlowRecords.innerColumns.step' }, { default: '序号' }),
dataIndex: 'step',
},
{
title: '操作人',
title: intl.formatMessage({ id: 'afterService.components.FlowRecords.innerColumns.operator' }, { default: '操作人' }),
dataIndex: 'operator',
},
{
title: '部门',
title: intl.formatMessage({ id: 'afterService.components.FlowRecords.innerColumns.department' }, { default: '部门' }),
dataIndex: 'department',
},
{
title: '职位',
title: intl.formatMessage({ id: 'afterService.components.FlowRecords.innerColumns.jobTitle' }, { default: '职位' }),
dataIndex: 'jobTitle',
},
{
title: '状态',
title: intl.formatMessage({ id: 'afterService.components.FlowRecords.innerColumns.status' }, { default: '状态' }),
dataIndex: 'status',
render: (text, record) => (
<Badge color={innerStatusColorMap[record.statusCode] || '#606266'} text={text} />
),
},
{
title: '操作',
title: intl.formatMessage({ id: 'afterService.components.FlowRecords.innerColumns.operate' }, { default: '操作' }),
dataIndex: 'operate',
},
{
title: '操作时间',
title: intl.formatMessage({ id: 'afterService.components.FlowRecords.innerColumns.operateTime' }, { default: '操作时间' }),
dataIndex: 'operateTime',
ellipsis: true,
},
{
title: '审核意见',
title: intl.formatMessage({ id: 'afterService.components.FlowRecords.innerColumns.opinion' }, { default: '审核意见' }),
dataIndex: 'opinion',
ellipsis: true,
},
......
......@@ -7,6 +7,7 @@
*/
import React from 'react';
import { Drawer, Button, Pagination, message } from 'antd';
import { getIntl } from 'umi';
import { createFormActions } from '@formily/antd';
import moment from 'moment';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
......@@ -21,6 +22,8 @@ import { goodItem, OrderListRes } from './interface';
import { listSearchSchema } from './schema';
import styles from './index.less';
const intl = getIntl();
const formActions = createFormActions();
const PAGE_SIZE = 16;
......@@ -437,7 +440,7 @@ class GoodsDrawer extends React.Component<GoodsDrawerProps, GoodsDrawerState> {
// 过滤合同编号不同的的商品
const filtered1 = data.filter(item => item.contractNo === first.contractNo);
if (filtered1.length !== data.length) {
message.warning('已过滤掉 合同编号不同 商品');
message.warning(intl.formatMessage({ id: 'afterService.components.GoodsDrawer.filter.1' }, { default: '已过滤掉 合同编号不同 商品' }));
}
// 售后退货、换货才涉及工作流相关
if (this.props.afterType !== 2 && this.props.afterType !== 3) {
......@@ -446,7 +449,7 @@ class GoodsDrawer extends React.Component<GoodsDrawerProps, GoodsDrawerState> {
// 过滤工作流不同的的商品
const filtered2 = filtered1.filter(item => item.processKey === first.processKey);
if (filtered2.length !== filtered1.length) {
message.warning('已过滤掉 售后工作流不同 商品');
message.warning(intl.formatMessage({ id: 'afterService.components.GoodsDrawer.filter.2' }, { default: '已过滤掉 售后工作流不同 商品' }));
}
return filtered2;
};
......@@ -461,7 +464,7 @@ class GoodsDrawer extends React.Component<GoodsDrawerProps, GoodsDrawerState> {
loading,
} = this.state;
const {
title = '选择维修商品',
title = intl.formatMessage({ id: 'afterService.components.GoodsDrawer.title' }, { default: '选择维修商品' }),
visible = false,
nestProps = {},
searchable = false,
......@@ -481,10 +484,10 @@ class GoodsDrawer extends React.Component<GoodsDrawerProps, GoodsDrawerState> {
}}
>
<Button onClick={this.handleClose} style={{ marginRight: 8 }}>
取消
{intl.formatMessage({ id: 'afterService.common.cancel' }, { default: '取 消' })}
</Button>
<Button onClick={this.handleConfirm} type="primary">
确定
{intl.formatMessage({ id: 'afterService.common.confirm' }, { default: '确 定' })}
</Button>
</div>
}
......
......@@ -6,8 +6,11 @@
* @Description:
*/
import { ISchema } from '@formily/antd';
import { getIntl } from 'umi';
import { FORM_FILTER_PATH } from '@/formSchema/const';
const intl = getIntl();
export const listSearchSchema: ISchema = {
type: 'object',
properties: {
......@@ -19,9 +22,9 @@ export const listSearchSchema: ISchema = {
type: 'string',
'x-component': 'Search',
'x-component-props': {
placeholder: '搜索',
placeholder: intl.formatMessage({ id: 'afterService.components.GoodsDrawer.orderNo.placeholder' }, { default: '搜索' }),
align: 'flex-left',
tip: '输入 订单号 进行搜索',
tip: intl.formatMessage({ id: 'afterService.components.GoodsDrawer.orderNo.tip' }, { default: '输入 订单号 进行搜索' }),
},
},
[FORM_FILTER_PATH]: {
......@@ -37,7 +40,7 @@ export const listSearchSchema: ISchema = {
digest: {
type: 'string',
'x-component-props': {
placeholder: '订单摘要',
placeholder: intl.formatMessage({ id: 'afterService.components.GoodsDrawer.digest.placeholder' }, { default: '订单摘要' }),
allowClear: true,
},
},
......@@ -46,7 +49,7 @@ export const listSearchSchema: ISchema = {
default: '',
'x-component': 'dateSelect',
'x-component-props': {
placeholder: '下单时间(全部)',
placeholder: intl.formatMessage({ id: 'afterService.components.GoodsDrawer.date.placeholder' }, { default: '下单时间(全部)' }),
allowClear: true,
},
},
......@@ -56,7 +59,7 @@ export const listSearchSchema: ISchema = {
span: 1,
},
'x-component-props': {
children: '查询',
children: intl.formatMessage({ id: 'afterService.components.GoodsDrawer.query' }, { default: '查询' }),
},
},
},
......
......@@ -6,6 +6,7 @@
* @Description: 手动发货弹窗
*/
import React from 'react';
import { getIntl } from 'umi';
import { Modal } from 'antd';
import { createFormActions, FormEffectHooks, FormPath } from '@formily/antd';
import { DatePicker } from '@formily/antd-components';
......@@ -17,6 +18,8 @@ import { useLinkageUtils } from '@/utils/formEffectUtils';
import { schema } from './schema';
import styles from './index.less';
const intl = getIntl();
const modalFormActions = createFormActions();
const {
onFieldValueChange$,
......@@ -41,7 +44,7 @@ const VerifyModal: React.FC<VerifyModalProps> = ({
onSubmit,
onVisible,
isEdit = true,
title = '换货发货处理',
title = intl.formatMessage({ id: 'afterService.components.ManualDeliveryModal.title' }, { default: '换货发货处理' }),
value = {},
}) => {
......
......@@ -6,6 +6,9 @@
* @Description:
*/
import { ISchema } from '@formily/antd';
import { getIntl } from 'umi';
const intl = getIntl();
export const schema: ISchema = {
type: 'object',
......@@ -19,40 +22,40 @@ export const schema: ISchema = {
properties: {
deliveryAddress: {
type: 'string',
title: '发货地址',
title: intl.formatMessage({ id: 'afterService.components.ManualDeliveryModal.deliveryAddress' }, { default: '发货地址' }),
enum: [],
required: true,
'x-component-props': {
placeholder: '请选择',
placeholder: intl.formatMessage({ id: 'afterService.components.ManualDeliveryModal.deliveryAddress.placeholder' }, { default: '请选择' }),
},
},
deliveryAddressTxt: {
title: '发货地址',
title: intl.formatMessage({ id: 'afterService.components.ManualDeliveryModal.deliveryAddress' }, { default: '发货地址' }),
type: 'string',
display: false,
},
deliveryTime: {
type: 'string',
title: '发货时间',
title: intl.formatMessage({ id: 'afterService.components.ManualDeliveryModal.deliveryTime' }, { default: '发货时间' }),
'x-component': 'DatePicker',
required: true,
'x-component-props': {
placeholder: '请选择',
placeholder: intl.formatMessage({ id: 'afterService.components.ManualDeliveryModal.deliveryTime.placeholder' }, { default: '请选择' }),
showTime: true,
style: { width: '100%' },
},
},
logisticsOrderNo: {
type: 'string',
title: '发货单号',
title: intl.formatMessage({ id: 'afterService.components.ManualDeliveryModal.logisticsOrderNo' }, { default: '发货单号' }),
required: true,
'x-component-props': {
placeholder: '请输入',
placeholder: intl.formatMessage({ id: 'afterService.components.ManualDeliveryModal.logisticsOrderNo.placeholder' }, { default: '请输入' }),
},
},
logisticsOrderNoTxt: {
type: 'string',
title: '发货单号',
title: intl.formatMessage({ id: 'afterService.components.ManualDeliveryModal.logisticsOrderNo' }, { default: '发货单号' }),
visible: false,
'x-component': 'Children',
'x-component-props': {
......@@ -61,15 +64,15 @@ export const schema: ISchema = {
},
logisticsName: {
type: 'string',
title: '物流公司',
title: intl.formatMessage({ id: 'afterService.components.ManualDeliveryModal.logisticsName' }, { default: '物流公司' }),
required: true,
enum: [],
'x-component-props': {
placeholder: '请选择',
placeholder: intl.formatMessage({ id: 'afterService.components.ManualDeliveryModal.logisticsName.placeholder' }, { default: '请选择' }),
},
},
logisticsNameTxt: {
title: '物流公司',
title: intl.formatMessage({ id: 'afterService.components.ManualDeliveryModal.logisticsName' }, { default: '物流公司' }),
type: 'string',
display: false,
},
......
......@@ -6,6 +6,7 @@
* @Description: 外部流转组件
*/
import React from 'react';
import { useIntl } from 'umi';
import { Steps, Empty } from 'antd';
import MellowCard, { MellowCardProps } from '@/components/MellowCard';
import styles from './index.less';
......@@ -33,13 +34,15 @@ const OuterCirculation: React.FC<OuterCirculation> = ({
...rest
}) => {
const intl = useIntl();
if (!Array.isArray(steps)) {
return null;
}
return (
<MellowCard
title="外部流转"
title={intl.formatMessage({ id: 'afterService.components.OuterCirculation.title' }, { default: '外部流转' })}
{...rest}
>
<div className={styles.steps}>
......
......@@ -41,7 +41,7 @@ interface HistoryListHistoryListProps extends MellowCardProps {
const ProductList: React.FC<HistoryListHistoryListProps> = ({
dataSource = [],
title = '标题',
title = '',
columns = [],
rowKey = 'id',
target,
......
......@@ -6,6 +6,7 @@
* @Description: 余额退款
*/
import React, { useEffect, useState } from 'react';
import { useIntl } from 'umi';
import { Descriptions, Spin, Divider } from 'antd';
import { getPayAssetAccountGetChildUserBalance } from '@/services/PayV2Api';
import { priceFormat } from '@/utils/numberFomat';
......@@ -34,6 +35,8 @@ const Balance: React.FC<BalanceProps> = ({
const [balance, setBalance] = useState(0);
const [loading, setLoading] = useState(false);
const intl = useIntl();
const getPayAssetAccountGetUserBalance = () => {
if (!purchaserId || !purchaserRoleId) {
return;
......@@ -62,7 +65,7 @@ const Balance: React.FC<BalanceProps> = ({
<div className={styles.balance}>
<Descriptions column={1}>
<Descriptions.Item
label="当前退款金额(元)"
label={`${intl.formatMessage({ id: 'afterService.components.RefundModal.refundAmount' }, { default: '当前退款金额' })}(${intl.formatMessage({ id: 'common.money.yuan' }, { default: '元' })})`}
style={{
paddingBottom: 0,
}}
......@@ -72,8 +75,11 @@ const Balance: React.FC<BalanceProps> = ({
</Descriptions>
<Divider dashed />
<Descriptions column={1}>
<Descriptions.Item label="账户可用余额(元)">
<span className={styles.amount}>{priceFormat(balance)}</span>
<Descriptions.Item label={`${intl.formatMessage({ id: 'afterService.components.Balance.balance' }, { default: '账户可用余额' })}(${intl.formatMessage({ id: 'common.money.yuan' }, { default: '元' })})`}>
<span className={styles.amount}>
{intl.formatMessage({ id: 'common.money' }, { default: '¥' })}
{priceFormat(balance)}
</span>
</Descriptions.Item>
</Descriptions>
</div>
......
......@@ -6,6 +6,7 @@
* @Description: 货到付款退款确认
*/
import React from 'react';
import { useIntl } from 'umi';
import { Descriptions, Divider } from 'antd';
import { priceFormat } from '@/utils/numberFomat';
import styles from './index.less';
......@@ -29,26 +30,26 @@ const COD: React.FC<BalanceProps> = ({
value,
}) => {
const intl = useIntl();
return (
<div className={styles.COD}>
<Descriptions column={1}>
<Descriptions.Item label="当前退款金额(元)">
<Descriptions.Item label={`${intl.formatMessage({ id: 'afterService.components.RefundModal.refundAmount' }, { default: '当前退款金额' })}(${intl.formatMessage({ id: 'common.money.yuan' }, { default: '元' })})`}>
<span className={styles['amount-plus']}>{priceFormat(value.refundAmount)}</span>
</Descriptions.Item>
<Descriptions.Item
label="支付方式"
label={intl.formatMessage({ id: 'afterService.components.COD.payType' }, { default: '支付方式' })}
style={{
paddingBottom: 0,
}}
>
货到付款
{intl.formatMessage({ id: 'afterService.components.COD' }, { default: '货到付款' })}
</Descriptions.Item>
</Descriptions>
<Divider dashed />
<p className={styles.tip}>
支付方式为货到付款的订单,用户确认退款方式与退款金额后,
系统会按照退款流程来完成退款动作,实际资金的退款结算由
交易双方线下处理。
{intl.formatMessage({ id: 'afterService.components.COD.tip' }, { default: '支付方式为货到付款的订单,用户确认退款方式与退款金额后,系统会按照退款流程来完成退款动作,实际资金的退款结算由交易双方线下处理。' })}
</p>
</div>
)
......
......@@ -6,6 +6,7 @@
* @Description: 授信退款
*/
import React, { useState, useEffect } from 'react';
import { useIntl } from 'umi';
import { Descriptions, Spin, Divider, Progress } from 'antd';
import { getPayCreditGetMemberCredit } from '@/services/PayV2Api';
import { priceFormat } from '@/utils/numberFomat';
......@@ -56,6 +57,8 @@ const Credit: React.FC<BalanceProps> = ({
});
const [loading, setLoading] = useState(false);
const intl = useIntl();
const getMemberCredit = () => {
if (
!purchaserId ||
......@@ -91,7 +94,7 @@ const Credit: React.FC<BalanceProps> = ({
<div className={styles.credit}>
<Descriptions column={1}>
<Descriptions.Item
label="当前退款金额"
label={`${intl.formatMessage({ id: 'afterService.components.RefundModal.refundAmount' }, { default: '当前退款金额' })}(${intl.formatMessage({ id: 'common.money.yuan' }, { default: '元' })})`}
style={{
paddingBottom: 0,
}}
......@@ -110,13 +113,13 @@ const Credit: React.FC<BalanceProps> = ({
}}
/>
<Descriptions column={2}>
<Descriptions.Item label="可用授信额度(元)">
<Descriptions.Item label={`${intl.formatMessage({ id: 'afterService.components.Credit.canUseQuota' }, { default: '可用授信额度' })}(${intl.formatMessage({ id: 'common.money.yuan' }, { default: '元' })})`}>
<span className={styles.amount}>{priceFormat(credit.canUseQuota)}</span>
</Descriptions.Item>
<Descriptions.Item label="已用授信额度(元)">
<Descriptions.Item label={`${intl.formatMessage({ id: 'afterService.components.Credit.useQuota' }, { default: '已用授信额度' })}(${intl.formatMessage({ id: 'common.money.yuan' }, { default: '元' })})`}>
<span className={styles.amount}>{priceFormat(credit.useQuota)}</span>
</Descriptions.Item>
<Descriptions.Item label="总授信额度(元)">
<Descriptions.Item label={`${intl.formatMessage({ id: 'afterService.components.Credit.quota' }, { default: '总授信额度' })}(${intl.formatMessage({ id: 'common.money.yuan' }, { default: '元' })})`}>
<span className={styles.amount}>{priceFormat(credit.quota)}</span>
</Descriptions.Item>
</Descriptions>
......
......@@ -6,6 +6,7 @@
* @Description: 上传支付凭证
*/
import React, { useState, useEffect } from 'react';
import { useIntl } from 'umi';
import { message, Spin, Modal, Upload } from 'antd';
import styled from 'styled-components';
import { createFormActions } from '@formily/antd';
......@@ -142,6 +143,8 @@ const UploadPaymentVoucher: React.FC<IProps> = (props: IProps) => {
const [loading, setLoading] = useState(false);
const [refundDisabled, setRefundDisabled] = useState(false);
const intl = useIntl();
// 获取对公账户信息
const fetchSettleAccountsGetMemberAccountConfig = () => {
if (!purchaserId || !purchaserRoleId) {
......@@ -177,7 +180,7 @@ const UploadPaymentVoucher: React.FC<IProps> = (props: IProps) => {
const beforeUploadVoucher = file => {
setRefundDisabled(true);
if (file.size / 1024 > 200) {
message.warning('图片大小超过200K');
message.warning(intl.formatMessage({ id: 'afterService.components.UploadPaymentVoucher.upload.legal' }, { default: '图片大小超过200K' }));
return Upload.LIST_IGNORE;
}
return Promise.resolve();
......@@ -192,7 +195,7 @@ const UploadPaymentVoucher: React.FC<IProps> = (props: IProps) => {
if (onSubmit) {
if (!bankAccount || !bankAccount.id) {
message.error('没有收款账户相关信息,无法退款');
message.error(intl.formatMessage({ id: 'afterService.components.UploadPaymentVoucher.nothing' }, { default: '没有收款账户相关信息,无法退款' }));
return;
}
onSubmit({
......@@ -210,7 +213,7 @@ const UploadPaymentVoucher: React.FC<IProps> = (props: IProps) => {
return (
<Modal
width={600}
title="上传支付凭证"
title={intl.formatMessage({ id: 'afterService.components.UploadPaymentVoucher.title' }, { default: '上传支付凭证' })}
visible={visible}
onCancel={() => handleModalVisible()}
onOk={() => formActions.submit()}
......
......@@ -6,8 +6,11 @@
* @Description:
*/
import { ISchema } from '@formily/antd';
import { getIntl } from 'umi';
import { UPLOAD_TYPE } from '@/constants';
const intl = getIntl();
export const schema: ISchema = {
type: 'object',
properties: {
......@@ -19,27 +22,27 @@ export const schema: ISchema = {
wrapperCol: 20,
labelAlign: 'left',
full: true,
description: '单个凭证文件大小不能超过 200K',
description: intl.formatMessage({ id: 'afterService.components.UploadPaymentVoucher.tip' }, { default: '单个凭证文件大小不能超过 200K' }),
},
properties: {
name: {
type: 'string',
title: '还款账户名称',
title: intl.formatMessage({ id: 'afterService.components.UploadPaymentVoucher.name' }, { default: '还款账户名称' }),
'x-component': 'Text',
},
bankAccount: {
type: 'string',
title: '银行账号',
title: intl.formatMessage({ id: 'afterService.components.UploadPaymentVoucher.bankAccount' }, { default: '银行账号' }),
'x-component': 'Text',
},
bankDeposit: {
type: 'string',
title: '开户行',
title: intl.formatMessage({ id: 'afterService.components.UploadPaymentVoucher.bankDeposit' }, { default: '开户行' }),
'x-component': 'Text',
},
fileList: {
type: 'string',
title: '上传退款凭证',
title: intl.formatMessage({ id: 'afterService.components.UploadPaymentVoucher.fileList' }, { default: '上传退款凭证' }),
'x-component': 'FixUpload',
'x-component-props': {
action: '/api/file/file/upload/prefix',
......@@ -59,7 +62,7 @@ export const schema: ISchema = {
'x-rules': [
{
required: true,
message: '请上传退款凭证',
message: intl.formatMessage({ id: 'afterService.components.UploadPaymentVoucher.fileList.required' }, { default: '请上传退款凭证' }),
},
],
},
......
import React, { Suspense } from 'react';
import { Modal } from 'antd';
import { useIntl } from 'umi';
const Balance = React.lazy(() => import('./Balance'));
const Credit = React.lazy(() => import('./Credit'));
......@@ -48,10 +49,12 @@ const RefundModal: React.FC<RefundModalProps> = ({
...rest
} = value;
const intl = useIntl();
const tempMap = {
balance: {
width: 600,
title: '退款处理',
title: intl.formatMessage({ id: 'afterService.components.RefundModal.title' }, { default: '退款处理' }),
render: () => (
<Suspense fallback={null}>
<Balance
......@@ -64,7 +67,7 @@ const RefundModal: React.FC<RefundModalProps> = ({
},
credit: {
width: 600,
title: '退款处理',
title: intl.formatMessage({ id: 'afterService.components.RefundModal.title' }, { default: '退款处理' }),
render: () => (
<Suspense fallback={null}>
<Credit
......@@ -79,7 +82,7 @@ const RefundModal: React.FC<RefundModalProps> = ({
},
COD: {
width: 600,
title: '货到付款退款确认',
title: intl.formatMessage({ id: 'afterService.components.COD.title' }, { default: '货到付款退款确认' }),
render: () => (
<Suspense fallback={null}>
<COD
......@@ -92,8 +95,8 @@ const RefundModal: React.FC<RefundModalProps> = ({
const template = tempMap[modalName] || {
width: 640,
title: '标题',
render: () => ('没有找到 modal 模板'),
title: intl.formatMessage({ id: 'afterService.components.RefundModal.default' }, { default: '标题' }),
render: () => (intl.formatMessage({ id: 'afterService.components.RefundModal.nothing' }, { default: '没有找到 modal 模板' })),
};
return (
......@@ -106,7 +109,7 @@ const RefundModal: React.FC<RefundModalProps> = ({
okButtonProps={{
loading: submitLoading,
}}
okText="退款"
okText={intl.formatMessage({ id: 'afterService.components.RefundModal.okText' }, { default: '退款' })}
destroyOnClose
>
{template.render()}
......
......@@ -6,6 +6,7 @@
* @Description: 维修地址
*/
import React from 'react';
import { useIntl } from 'umi';
import { Descriptions } from 'antd';
import MellowCard, { MellowCardProps } from '@/components/MellowCard';
import styles from './index.less';
......@@ -26,13 +27,15 @@ const RepairAddressInfo: React.FC<RepairAddressInfoProps> = ({
info = {},
...rest
}) => {
const intl = useIntl();
return (
<MellowCard
title="维修地址"
title={intl.formatMessage({ id: 'afterService.components.RepairAddressInfo.title' }, { default: '维修地址' })}
{...rest}
>
<Descriptions column={1} className={styles.desc}>
<Descriptions.Item label="维修地址" labelStyle={{ width: 106 }}>
<Descriptions.Item label={intl.formatMessage({ id: 'afterService.components.RepairAddressInfo.title' }, { default: '维修地址' })} labelStyle={{ width: 106 }}>
<p>{info.receiverName || ''} / {info.phone || ''}</p>
<p>{info.fullAddress || ''}</p>
</Descriptions.Item>
......
......@@ -6,6 +6,7 @@
* @Description: 退货地址信息
*/
import React, { useEffect } from 'react';
import { useIntl } from 'umi';
import MellowCard, { MellowCardProps } from '@/components/MellowCard';
import { createAsyncFormActions, FormEffectHooks, FormPath } from '@formily/antd';
import { getLogisticsSelectListReceiverAddress } from '@/services/LogisticsV2Api';
......@@ -100,6 +101,8 @@ const ReturnAddressInfo: React.FC<ReturnAddressInfo> = ({
...rest
}) => {
const intl = useIntl();
useEffect(() => {
const { setFieldState } = modalFormActions;
if (isEdit) {
......@@ -147,7 +150,7 @@ const ReturnAddressInfo: React.FC<ReturnAddressInfo> = ({
return (
<MellowCard
title="退货收货地址"
title={intl.formatMessage({ id: 'afterService.components.ReturnAddressInfo.title' }, { default: '退货收货地址' })}
fullHeight
{...rest}
>
......
......@@ -6,8 +6,11 @@
* @Description:
*/
import { ISchema } from '@formily/antd';
import { getIntl } from 'umi';
import { DELIVERY_TYPE_ENUM } from '@/constants/afterService';
const intl = getIntl();
export const schema: ISchema = {
type: 'object',
properties: {
......@@ -23,42 +26,42 @@ export const schema: ISchema = {
},
properties: {
deliveryType: {
title: '配送方式',
title: intl.formatMessage({ id: 'afterService.components.ReturnAddressInfo.deliveryType' }, { default: '配送方式' }),
type: 'string',
enum: DELIVERY_TYPE_ENUM,
editable: false,
},
deliveryAddress: {
type: 'string',
title: '退货收货地址',
title: intl.formatMessage({ id: 'afterService.components.ReturnAddressInfo.shippingAddress' }, { default: '退货收货地址' }),
enum: [],
'x-component-props': {
placeholder: '请选择',
placeholder: intl.formatMessage({ id: 'afterService.components.ReturnAddressInfo.shippingAddress.placeholder' }, { default: '请选择' }),
},
'x-rules': [
{
required: true,
message: '请选择退货收货地址',
message: intl.formatMessage({ id: 'afterService.components.ReturnAddressInfo.shippingAddress.required' }, { default: '请选择退货收货地址' }),
},
],
},
// 展示用
shippingAddress: {
type: 'object',
title: '退货发货地址',
title: intl.formatMessage({ id: 'afterService.components.ReturnAddressInfo.deliveryAddress' }, { default: '退货发货地址' }),
'x-component': 'Address',
},
// 展示用
pickupAddress: {
type: 'object',
title: '退货自提地址',
title: intl.formatMessage({ id: 'afterService.components.ReturnAddressInfo.pickupAddress' }, { default: '退货自提地址' }),
visible: false,
'x-component': 'Address',
},
// 展示用
deliveryAddressShow: {
type: 'object',
title: '退货收货地址',
title: intl.formatMessage({ id: 'afterService.components.ReturnAddressInfo.shippingAddress' }, { default: '退货收货地址' }),
visible: false,
'x-component': 'DeliveryAddress',
},
......
......@@ -6,9 +6,12 @@
* @Description: 联动逻辑相关
*/
import BigNumber from 'bignumber.js';
import { getIntl } from 'umi';
import { FormEffectHooks } from '@formily/antd';
import { isMaterialOrder } from '../../../utils';
const intl = getIntl();
const {
onFieldInputChange$,
onFieldValueChange$,
......@@ -64,7 +67,7 @@ export const useBusinessEffects = (context, actions) => {
'returnCount',
state => {
if (+value > remainingValue) {
state.errors = '填写值已超过最大可退货数量,请重新填写';
state.errors = intl.formatMessage({ id: 'afterService.components.ReturnInfoDrawer.returnCount.max' }, { default: '填写值已超过最大可退货数量,请重新填写' });
} else {
state.errors = '';
}
......
......@@ -6,6 +6,7 @@
* @Description: 查看退货数量与退款金额 抽屉
*/
import React, { useEffect, useState } from 'react';
import { useIntl } from 'umi';
import { Drawer, Button, Spin } from 'antd';
import NiceForm from '@/components/NiceForm';
import { createAsyncFormActions, FormEffectHooks } from '@formily/antd';
......@@ -178,6 +179,8 @@ const ReturnInfoDrawer: React.FC<ReturnInfoDrawerProps> = ({
const [innerApplyInfo, setInnerApplyInfo] = useState<ReturnApplyInfo | null>(applyInfo);
const [payInfoLoading, setPayInfoLoading] = useState(false);
const intl = useIntl();
const getPayInfo = async () => {
if (!applyInfo || !applyInfo.orderId) {
return;
......@@ -185,7 +188,7 @@ const ReturnInfoDrawer: React.FC<ReturnInfoDrawerProps> = ({
const isMateriel = isMaterialOrder(applyInfo.orderType);
if (isMateriel) {
schemaAction.setFieldState('productName', state => {
state.title = '物料名称';
state.title = intl.formatMessage({ id: 'afterService.components.ReturnInfoDrawer.materialName' }, { default: '物料名称' });
});
}
let payList = applyInfo.payList ? applyInfo.payList.map((item) => ({
......@@ -261,7 +264,7 @@ const ReturnInfoDrawer: React.FC<ReturnInfoDrawerProps> = ({
return (
<Drawer
title={`${isEdit ? '编辑' : '查看'}退货数量与退款金额`}
title={isEdit ? intl.formatMessage({ id: 'afterService.components.ReturnInfoDrawer.edit' }, { default: '编辑退货数量与退款金额' }) : intl.formatMessage({ id: 'afterService.components.ReturnInfoDrawer.check' }, { default: '查看退货数量与退款金额' })}
placement="right"
width={1120}
onClose={handleClose}
......@@ -277,14 +280,14 @@ const ReturnInfoDrawer: React.FC<ReturnInfoDrawerProps> = ({
onClick={handleClose}
style={{ marginRight: 8 }}
>
{onSubmit ? '取消' : '关闭'}
{onSubmit ? intl.formatMessage({ id: 'afterService.components.ReturnInfoDrawer.cancel' }, { default: '取消' }) : intl.formatMessage({ id: 'afterService.components.ReturnInfoDrawer.close' }, { default: '关闭' })}
</Button>
{onSubmit && (
<Button
onClick={() => schemaAction.submit()}
type="primary"
>
确定
{intl.formatMessage({ id: 'afterService.components.ReturnInfoDrawer.confirm' }, { default: '确定' })}
</Button>
)}
</div>
......
......@@ -6,6 +6,7 @@
* @Description: 评价
*/
import React from 'react';
import { useIntl } from 'umi';
import { Row, Col, Descriptions } from 'antd';
import MellowCard, { MellowCardProps } from '@/components/MellowCard';
import { Gauge } from '@/components/Charts';
......@@ -46,9 +47,11 @@ const Score: React.FC<ScoreProps> = ({
content,
...rest
}) => {
const intl = useIntl();
return (
<MellowCard
title="售后评价"
title={intl.formatMessage({ id: 'afterService.components.Score.title' }, { default: '售后评价' })}
className={styles.evaluate}
{...rest}
>
......@@ -58,10 +61,10 @@ const Score: React.FC<ScoreProps> = ({
<div className={styles['score-left']}>
<Descriptions column={1}>
<Descriptions.Item
label="售后满意度"
label={intl.formatMessage({ id: 'afterService.components.Score.score' }, { default: '售后满意度' })}
>
<span className={styles['score-star']}>
{`${score}`}
{`${score}${intl.formatMessage({ id: 'afterService.components.Score.score.unit' }, { default: '分' })}`}
</span>
</Descriptions.Item>
</Descriptions>
......@@ -82,7 +85,7 @@ const Score: React.FC<ScoreProps> = ({
<Col span={16}>
<Descriptions column={1}>
<Descriptions.Item
label="售后评价"
label={intl.formatMessage({ id: 'afterService.components.Score.content' }, { default: '售后评价' })}
>
{content}
</Descriptions.Item>
......
......@@ -6,6 +6,7 @@
* @Description: 中止弹窗
*/
import React from 'react';
import { useIntl } from 'umi';
import { Modal } from 'antd';
import { createFormActions } from '@formily/antd';
import { DatePicker } from '@formily/antd-components';
......@@ -49,6 +50,8 @@ const StopModal: React.FC<StopModalProps> = (props) => {
submitLoading,
} = props;
const intl = useIntl();
const handleSubmit = (values: ValuesType) => {
if (onSubmit) {
onSubmit(values);
......@@ -57,7 +60,7 @@ const StopModal: React.FC<StopModalProps> = (props) => {
return (
<Modal
title="中止原因"
title={intl.formatMessage({ id: 'afterService.components.StopModal.title' }, { default: '中止原因' })}
visible={visible}
confirmLoading={submitLoading}
onOk={() => formActions.submit()}
......
......@@ -6,6 +6,9 @@
* @Description:
*/
import { ISchema } from '@formily/antd';
import { getIntl } from 'umi';
const intl = getIntl();
const schema: ISchema = {
type: 'object',
......@@ -21,23 +24,23 @@ const schema: ISchema = {
properties: {
date: {
type: 'string',
title: '中止时间',
title: intl.formatMessage({ id: 'afterService.components.StopModal.date' }, { default: '中止时间' }),
'x-component': 'DatePicker',
editable: false,
},
remark: {
type: 'string',
title: '中止原因',
title: intl.formatMessage({ id: 'afterService.components.StopModal.remark' }, { default: '中止原因' }),
'x-component': 'Textarea',
'x-component-props': {
placeholder: '在此输入你的内容,最长100个字符,50个汉字',
placeholder: intl.formatMessage({ id: 'afterService.components.StopModal.remark.placeholder' }, { default: '在此输入你的内容,最长100个字符,50个汉字' }),
maxLength: 60,
rows: 5,
},
'x-rules': [
{
required: true,
message: '请填写原因',
message: intl.formatMessage({ id: 'afterService.components.StopModal.remark.required' }, { default: '请填写原因' }),
},
{
limitByte: true, // 自定义校验规则
......
......@@ -6,6 +6,7 @@
* @Description: 提交审核 Modal
*/
import React, { useEffect } from 'react';
import { useIntl } from 'umi';
import { Modal } from 'antd';
import { createAsyncFormActions, FormEffectHooks, FormPath } from '@formily/antd';
import NiceForm from '@/components/NiceForm';
......@@ -36,6 +37,8 @@ const VerifyModal: React.FC<VerifyModalProps> = ({
rejected = false,
}) => {
const intl = useIntl();
useEffect(() => {
// 内部状态为 审核通过 才能选择 审核通过选项
if (rejected) {
......@@ -61,7 +64,7 @@ const VerifyModal: React.FC<VerifyModalProps> = ({
return (
<Modal
title="提交审核"
title={intl.formatMessage({ id: 'afterService.components.VerifyModal.title' }, { default: '提交审核' })}
visible={visible}
confirmLoading={confirmLoading}
onOk={() => modalFormActions.submit()}
......
import { ISchema } from '@formily/antd';
import { getIntl } from 'umi';
const intl = getIntl();
export const auditModalSchema: ISchema = {
type: 'object',
......@@ -14,19 +17,19 @@ export const auditModalSchema: ISchema = {
type: 'string',
default: 1,
enum: [
{ label: '审核通过', value: 1 },
{ label: '审核不通过', value: 0 },
{ label: intl.formatMessage({ id: 'afterService.components.VerifyModal.agree.pass' }, { default: '审核通过' }), value: 1 },
{ label: intl.formatMessage({ id: 'afterService.components.VerifyModal.agree.noPass' }, { default: '审核不通过' }), value: 0 },
],
'x-component': 'radio',
'x-component-props': {},
},
opinion: {
type: 'string',
title: '审核不通过原因',
title: intl.formatMessage({ id: 'afterService.components.VerifyModal.reason.noPass' }, { default: '审核不通过原因' }),
'x-component': 'textarea',
required: true,
'x-component-props': {
placeholder: '在此输入你的内容,最长120个字符,60个汉字',
placeholder: intl.formatMessage({ id: 'afterService.components.VerifyModal.reason.placeholder' }, { default: '在此输入你的内容,最长120个字符,60个汉字' }),
rows: 5,
},
'x-rules': [
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment