Commit 56cbeb19 authored by 前端-黄佳鑫's avatar 前端-黄佳鑫

feat: 交易能力 -> components组件国际化

parent 58cd5ee7
......@@ -20,6 +20,7 @@ import dealAbility from './zh-CN/dealAbility'
import purchaserEvaluation from './zh-CN/purchaserEvaluation'
import stockSellStorage from './zh-CN/stockSellStorage'
import supplierEvaluation from './zh-CN/supplierEvaluation'
import transactionComponents from './zh-CN/transaction_components'
import content from './zh-CN/content'
import commodity from './zh-CN/commodity'
import trademark from './zh-CN/trademark'
......@@ -55,6 +56,7 @@ export default {
...purchaserEvaluation,
...stockSellStorage,
...supplierEvaluation,
...transactionComponents,
...content,
...processRuleSetting,
}
This diff is collapsed.
import React from 'react'
import { EnvironmentOutlined } from '@ant-design/icons'
import { Popover, Row, Space } from 'antd'
import { getIntl } from 'umi';
const intl = getIntl();
export const AddressPop = (props) => {
const { pickInfo = null, children } = props
return pickInfo && pickInfo.deliveryType === 2 ? <Space>
......@@ -9,7 +10,7 @@ export const AddressPop = (props) => {
<Popover content={
<Row>
<div>
<h3><EnvironmentOutlined/> 自提地址</h3>
<h3><EnvironmentOutlined/> {intl.formatMessage({id: 'transaction_components.zitidizhi'})}</h3>
<p>{pickInfo.receiver || pickInfo.shipperName} / {pickInfo.phone}</p>
<p>{pickInfo.receiver ? pickInfo.address : `${pickInfo.provinceName}${pickInfo.cityName}${pickInfo.districtName}${pickInfo.address}`}</p>
</div>
......
......@@ -3,6 +3,7 @@ import ModalForm from '@/components/ModalForm'
import { createFormActions, registerVirtualBox, FormEffectHooks } from '@formily/antd'
import { OrderDetailContext } from '../../_public/order/context'
import { Checkbox } from 'antd'
import { getIntl } from 'umi'
export interface ApprovedOrderModalProps {
currentRef: any,
......@@ -11,12 +12,13 @@ export interface ApprovedOrderModalProps {
title?: string,
isUseElectronicContract?: boolean,
}
const intl = getIntl();
// 虚线边框
registerVirtualBox("CustomDashLayout", ({ children, schema }) => {
return (
<>
<p style={{ fontSize: 12, color: '#c0c4cc' }}>注:勾选则表示同意签署电子合同,电子合同与纸质合同一样具备同等法律效力</p>
<p style={{ fontSize: 12, color: '#c0c4cc' }}>{intl.formatMessage({id: 'transaction_components.zhugouxuanzebiaoshitong'})}</p>
<div style={{ borderTop: "1px dashed #DFE1E6", marginTop: 24, height: 24 }}>
{children}
</div>
......@@ -42,10 +44,10 @@ const ApproveSchemaUseContract = {
"x-component-props": {
children: "",
},
title: '电子合同',
title: intl.formatMessage({id: 'transaction_components.dianzihetong'}),
"x-rules": [
{
message: '请选择电子合同',
message: intl.formatMessage({id: 'transaction_components.qingxuanzedianzihetong'}),
required: true
}
],
......@@ -72,8 +74,8 @@ const ApproveSchemaUseContract = {
state: {
type: 'radio',
enum: [
{ label: '审核通过', value: 1 },
{ label: '审核不通过', value: 0 },
{ label: intl.formatMessage({id: 'transaction_components.shenhetongguo'}), value: 1 },
{ label: intl.formatMessage({id: 'transaction_components.shenhebutongguo'}), value: 0 },
],
default: 1,
"x-component-props": {
......@@ -101,13 +103,13 @@ const ApproveSchemaUseContract = {
type: 'textarea',
"x-component-props": {
rows: 4,
placeholder: '在此输入你的原因, 最多60个汉字'
placeholder: intl.formatMessage({id: 'transaction_components.zaicishurunideyuanyin'})
},
title: '审核不通过原因',
title: intl.formatMessage({id: 'transaction_components.shenhebutongguoyuanyin'}),
"x-rules": [
{
required: true,
message: '请输入审核不通过原因'
message: intl.formatMessage({id: 'transaction_components.qingshurushenhebutongguo'})
},
{
limitByte: true,
......@@ -134,8 +136,8 @@ const ApproveSchema = {
agree: {
type: 'radio',
enum: [
{ label: '审核通过', value: 1 },
{ label: '审核不通过', value: 0 },
{ label: intl.formatMessage({id: 'transaction_components.shenhetongguo'}), value: 1 },
{ label: intl.formatMessage({id: 'transaction_components.shenhebutongguo'}), value: 0 },
],
default: 1,
"x-component-props": {
......@@ -163,13 +165,13 @@ const ApproveSchema = {
type: 'textarea',
"x-component-props": {
rows: 4,
placeholder: '在此输入你的原因, 最多60个汉字'
placeholder: intl.formatMessage({id: 'transaction_components.zaicishurunideyuanyin'})
},
title: '审核不通过原因',
title: intl.formatMessage({id: 'transaction_components.shenhebutongguoyuanyin'}),
"x-rules": [
{
required: true,
message: '请输入审核不通过原因'
message: intl.formatMessage({id: 'transaction_components.qingshurushenhebutongguo'})
},
{
limitByte: true,
......@@ -206,7 +208,7 @@ const ApprovedOrderModal:React.FC<ApprovedOrderModalProps> = (props) => {
}
return <ModalForm
modalTitle={title || '提示'}
modalTitle={title || intl.formatMessage({id: 'transaction_components.tishi'})}
currentRef={currentRef}
confirm={onConfirm}
actions={approvedActions}
......@@ -219,7 +221,7 @@ const ApprovedOrderModal:React.FC<ApprovedOrderModalProps> = (props) => {
}
})
// 上级审核不通过
if(data && (data.innerStatusName === '提交审核不通过' || data.innerStatusName === '审核不通过(一级)' || data.innerStatusName === '审核不通过(二级)')) {
if(data && (data.innerStatusName === intl.formatMessage({id: 'transaction_components.tijiaoshenhebutongguo'}) || data.innerStatusName === intl.formatMessage({id: 'transaction_components.shenhebutongguoyiji'}) || data.innerStatusName === intl.formatMessage({id: 'transaction_components.shenhebutongguoerji'}))) {
ctx.setFieldValue("agree", 0)
ctx.setFieldState("agree", state => {
state.props["x-component-props"] = {
......
import React from 'react';
import { FilePdfFilled, FileWordFilled, FileFilled } from '@ant-design/icons';
import styles from './index.less';
import { getIntl } from 'umi';
interface ContractItem {
electronicContractUrl?: string;
......@@ -16,7 +17,7 @@ const IconMap = {
'.doc': <FileWordFilled />,
'.doxc': <FileWordFilled />,
};
const intl = getIntl();
const ContractItem: React.FC<ContractItem> = ({
electronicContractUrl,
electronicContractName,
......@@ -50,7 +51,7 @@ const ContractItem: React.FC<ContractItem> = ({
const ContractList: React.FC<ContractList> = ({ dataSource }) => {
if (!Array.isArray(dataSource)) {
return <div className={styles.noData}>没有相关数据~</div>;
return <div className={styles.noData}>{intl.formatMessage({id: 'transaction_components.meiyouxiangguanshuju'})}</div>;
}
return (
......
......@@ -2,7 +2,7 @@ import React, { useContext, useRef } from 'react'
import { Button, message } from 'antd'
import { createFormActions, ISchema } from '@formily/antd'
import ModalForm from '@/components/ModalForm'
import { history } from 'umi'
import { getIntl, history } from 'umi'
import { useHttpRequest } from '@/hooks/useHttpRequest'
import { OrderDetailContext } from '../../_public/order/context'
import { getContractSelectListContractTemplate, postContractContractSignSaleSignContractCreate } from '@/services/ContractV2Api'
......@@ -11,7 +11,7 @@ import { postOrderVendorValidateSubmit } from '@/services/OrderNewV2Api'
export interface OrderElectronModalProps {
currentRef: any
}
const intl = getIntl();
const schemaActions = createFormActions()
const schema: ISchema = {
......@@ -27,10 +27,10 @@ const schema: ISchema = {
properties: {
usingElectronicContracts: {
type: 'radio',
title: '是否使用电子合同',
title: intl.formatMessage({id: 'transaction_components.shifoushiyongdianzihetong'}),
enum: [
{ label: '是', value: 1 },
{ label: '否', value: 0 },
{ label: intl.formatMessage({id: 'transaction_components.shi'}), value: 1 },
{ label: intl.formatMessage({id: 'transaction_components.fou'}), value: 0 },
],
default: 1,
"x-linkages": [
......@@ -49,10 +49,10 @@ const schema: ISchema = {
contractTemplateId: {
type: 'string',
enum: [],
title: '电子合同模板',
title: intl.formatMessage({id: 'transaction_components.dianzihetongmuban'}),
required: true,
"x-component-props": {
placeholder: '请选择电子合同模板',
placeholder: intl.formatMessage({id: 'transaction_components.qingxuanzedianzihetongmu'}),
style: {
minWidth: 140
}
......@@ -67,10 +67,10 @@ const schema: ISchema = {
"x-component-props": {
children: ""
},
title: '电子合同',
title: intl.formatMessage({id: 'transaction_components.dianzihetong'}),
"x-rules": [
{
message: '请选择电子合同',
message: intl.formatMessage({id: 'transaction_components.qingxuanzedianzihetong'}),
required: true
}
]
......@@ -85,10 +85,10 @@ const schema: ISchema = {
},
agree: {
type: 'radio',
title: '是否审核通过',
title: intl.formatMessage({id: 'transaction_components.shifoushenhetongguo'}),
enum: [
{ label: '审核通过', value: 1 },
{ label: '审核不通过', value: 0 },
{ label: intl.formatMessage({id: 'transaction_components.shenhetongguo'}), value: 1 },
{ label: intl.formatMessage({id: 'transaction_components.shenhebutongguo'}), value: 0 },
],
default: 1,
"x-linkages": [
......@@ -103,13 +103,13 @@ const schema: ISchema = {
type: 'textarea',
"x-component-props": {
rows: 4,
placeholder: '在此输入你的原因, 最多60个汉字'
placeholder: intl.formatMessage({id: 'transaction_components.zaicishurunideyuanyin'})
},
title: '审核不通过原因',
title: intl.formatMessage({id: 'transaction_components.shenhebutongguoyuanyin'}),
"x-rules": [
{
required: true,
message: '请输入审核不通过原因'
message: intl.formatMessage({id: 'transaction_components.qingshurushenhebutongguo'})
},
{
limitByte: true,
......@@ -130,7 +130,7 @@ const CreateOrderElectronModal:React.FC<OrderElectronModalProps> = (props) => {
const createElectron = async () => {
const contractTemplateId = schemaActions.getFieldValue('contractTemplateId')
if (data.isElectronicContract === 1 && !contractTemplateId) {
message.error('请先选择电子合同模板')
message.error(intl.formatMessage({id: 'transaction_components.qingxianxuanzedianzihetong'}))
return ;
}
const orderId = data.orderId
......@@ -152,7 +152,7 @@ const CreateOrderElectronModal:React.FC<OrderElectronModalProps> = (props) => {
})
}
}
const electronBtn = <Button style={{marginLeft: 24}} onClick={createElectron} loading={loading}>生成电子合同</Button>
const electronBtn = <Button style={{marginLeft: 24}} onClick={createElectron} loading={loading}>{intl.formatMessage({id: 'transaction_components.shengchengdianzihetong'})}</Button>
const handleSubmit = async (value) => {
const params = {
......@@ -171,7 +171,7 @@ const CreateOrderElectronModal:React.FC<OrderElectronModalProps> = (props) => {
return (
<ModalForm
modalTitle='确认提交审核'
modalTitle={intl.formatMessage({id: 'transaction_components.querentijiaoshenhe'})}
previewPlaceholder=' '
currentRef={props.currentRef}
schema={schema}
......
......@@ -3,13 +3,14 @@ import React from 'react';
import { Row, Col } from 'antd';
import Card from '../../../card';
import style from './index.less';
import { getIntl } from 'umi';
export interface BasicInfoProps {
effect?: any,
}
const count = 0;
const intl = getIntl();
const BasicLayout: React.FC<BasicInfoProps> = (props: any) => {
const { effect } = props;
......@@ -18,7 +19,7 @@ const BasicLayout: React.FC<BasicInfoProps> = (props: any) => {
return (
<Card
id='basicLayout'
title='基本信息'
title={intl.formatMessage({id: 'transaction_components.jibenxinxi'})}
>
<Row gutter={[8, 8]}>
{effect.length > count && effect.map((item, index) => (
......
import React from 'react';
import { Tooltip, Image, Form, Input, Popconfirm } from 'antd';
import { QuestionCircleOutlined } from '@ant-design/icons';
import { getIntl } from 'umi';
const intl = getIntl();
const columns_1 = ({
dataSource,
setDataSource,
......@@ -35,40 +36,40 @@ const columns_1 = ({
dataIndex: 'skuId'
},
{
title: '商品图片',
title: intl.formatMessage({id: 'transaction_components.shangpintupian'}),
key: 'productImgUrl',
dataIndex: 'productImgUrl',
render: (text) => <Image width={32} height={32} src={text} />
},
{
title: '商品名称',
title: intl.formatMessage({id: 'transaction_components.shangpinmingcheng'}),
key: 'productName',
dataIndex: 'productName'
},
{
title: '品类',
title: intl.formatMessage({id: 'transaction_components.pinlei'}),
key: 'category',
dataIndex: 'category'
},
{
title: '品牌',
title: intl.formatMessage({id: 'transaction_components.pinpai'}),
key: 'brand',
dataIndex: 'brand'
},
{
title: '单位',
title: intl.formatMessage({id: 'transaction_components.danwei'}),
key: 'unit',
dataIndex: 'unit'
},
{
title: '商品价格',
title: intl.formatMessage({id: 'transaction_components.shangpinjiage'}),
key: 'price',
dataIndex: 'price',
render: (text) => `¥${Number(text).toFixed(2)}`
},
{
title: <Tooltip placement="top" title="活动价格表示商城直接以该商品的活动价格进行销售">
活动价格 <QuestionCircleOutlined />
title: <Tooltip placement="top" title={intl.formatMessage({id: 'transaction_components.huodongjiagebiaoshishangcheng'})}>
{intl.formatMessage({id: 'transaction_components.huodongjiage'})} <QuestionCircleOutlined />
</Tooltip>,
key: 'activityPrice',
dataIndex: 'activityPrice',
......@@ -81,10 +82,10 @@ const columns_1 = ({
required: true, validator: (_rule, value) => {
const pattern = /^(\-)?\d+(\.\d{1,4})?$/;
if (!value) {
return Promise.reject(new Error('请输入活动价格'));
return Promise.reject(new Error(intl.formatMessage({id: 'transaction_components.qingshuruhuodongjiage'})));
}
if (!pattern.test(value) || (Number(value) >= Number(_record.price))) {
return Promise.reject(new Error('必须大于0且小于商品价格'));
return Promise.reject(new Error(intl.formatMessage({id: 'transaction_components.bixudayu0qiexiaoyu'})));
}
return Promise.resolve();
}
......@@ -95,7 +96,7 @@ const columns_1 = ({
)
},
{
title: '个人限购数量',
title: intl.formatMessage({id: 'transaction_components.gerenxiangoushuliang'}),
key: 'restrictNum',
dataIndex: 'restrictNum',
render: (_text, _record, index) => (
......@@ -106,14 +107,14 @@ const columns_1 = ({
dependencies={[`restrictTotalNum_${index}`]}
rules={[{
required: true,
message: '请输入个人限购数量'
message: intl.formatMessage({id: 'transaction_components.qingshurugerenxiangoushu'})
},
({ getFieldValue }) => ({
validator: (_rule, value) => {
const pattern = /^(\-)?\d+(\.\d{1,3})?$/;
const restrictTotalNum = getFieldValue(`restrictTotalNum_${index}`);
if (!pattern.test(value) || !(Number(value) < Number(restrictTotalNum))) {
return Promise.reject(new Error('必须大于0且小于活动限购总数量'));
return Promise.reject(new Error(intl.formatMessage({id: 'transaction_components.bixudayu0qiexiaoyu1'})));
}
return Promise.resolve();
},
......@@ -125,7 +126,7 @@ const columns_1 = ({
)
},
{
title: '活动限购总数量',
title: intl.formatMessage({id: 'transaction_components.huodongxiangouzongshuliang'}),
key: 'restrictTotalNum',
dataIndex: 'restrictTotalNum',
render: (_text, _record, index) => (
......@@ -135,14 +136,14 @@ const columns_1 = ({
name={`restrictTotalNum_${index}`}
rules={[{
required: true,
message: '请输入活动限购总数量'
message: intl.formatMessage({id: 'transaction_components.qingshuruhuodongxiangouzong'})
},
({ getFieldValue }) => ({
validator: (_rule, value) => {
const pattern = /^(\-)?\d+(\.\d{1,3})?$/;
const restrictNum = getFieldValue(`restrictNum_${index}`);
if (!pattern.test(value) || !(Number(value) > Number(restrictNum))) {
return Promise.reject(new Error('必须大于0且大于个人限购数量'));
return Promise.reject(new Error(intl.formatMessage({id: 'transaction_components.bixudayu0qiedayu'})));
}
return Promise.resolve();
}
......@@ -154,15 +155,15 @@ const columns_1 = ({
)
},
{
title: '操作',
title: intl.formatMessage({id: 'transaction_components.caozuo'}),
key: 'operation',
dataIndex: 'operation',
render: (_text, _record) => (
<Popconfirm
title="是否删除?"
title={intl.formatMessage({id: 'transaction_components.shifoushanchu'})}
onConfirm={() => handleDelete(_record.skuId)}
>
<a>删除</a>
<a>{intl.formatMessage({id: 'transaction_components.shanchu'})}</a>
</Popconfirm>
)
},
......
import React from 'react';
import { Tooltip, Image, Form, Input, Popconfirm } from 'antd';
import { QuestionCircleOutlined } from '@ant-design/icons';
import { getIntl } from 'umi';
const intl = getIntl();
const columns_2 = ({
dataSource,
setDataSource,
......@@ -46,40 +47,40 @@ const columns_2 = ({
dataIndex: 'skuId'
},
{
title: '商品图片',
title: intl.formatMessage({id: 'transaction_components.shangpintupian'}),
key: 'productImgUrl',
dataIndex: 'productImgUrl',
render: (text) => <Image width={32} height={32} src={text} />
},
{
title: '商品名称',
title: intl.formatMessage({id: 'transaction_components.shangpinmingcheng'}),
key: 'productName',
dataIndex: 'productName'
},
{
title: '品类',
title: intl.formatMessage({id: 'transaction_components.pinlei'}),
key: 'category',
dataIndex: 'category'
},
{
title: '品牌',
title: intl.formatMessage({id: 'transaction_components.pinpai'}),
key: 'brand',
dataIndex: 'brand'
},
{
title: '单位',
title: intl.formatMessage({id: 'transaction_components.danwei'}),
key: 'unit',
dataIndex: 'unit'
},
{
title: '商品价格',
title: intl.formatMessage({id: 'transaction_components.shangpinjiage'}),
key: 'price',
dataIndex: 'price',
render: (text) => `¥${Number(text).toFixed(2)}`
},
{
title: <Tooltip placement="top" title="直降价格为商品价格的直降价格,如原价每件¥20.00的商品,每件降价¥2.00,则直降价格输入框中输入 ¥2.00">
直降价格 <QuestionCircleOutlined />
title: <Tooltip placement="top" title={intl.formatMessage({id: 'transaction_components.zhijiangjiageweishangpinjia'})}>
{intl.formatMessage({id: 'transaction_components.zhijiangjiage'})} <QuestionCircleOutlined />
</Tooltip>,
key: 'plummetPrice',
dataIndex: 'plummetPrice',
......@@ -92,10 +93,10 @@ const columns_2 = ({
required: true, validator: (_rule, value) => {
const pattern = /^(\-)?\d+(\.\d{1,4})?$/;
if (!value) {
return Promise.reject(new Error('请输入活动价格'));
return Promise.reject(new Error(intl.formatMessage({id: 'transaction_components.qingshuruhuodongjiage'})));
}
if (!pattern.test(value) || (Number(value) >= Number(_record.price))) {
return Promise.reject(new Error('必须大于0且小于商品价格'));
return Promise.reject(new Error(intl.formatMessage({ id: 'transaction_components.bixudayu0qiexiaoyu' })));
}
return Promise.resolve();
}
......@@ -106,13 +107,13 @@ const columns_2 = ({
)
},
{
title: '活动价格',
title: intl.formatMessage({ id: 'transaction_components.huodongjiage' }),
key: 'activityPrice',
dataIndex: 'activityPrice',
render: (text) => text ? `¥${Number(text).toFixed(2)}` : `¥0`
},
{
title: '个人限购数量',
title: intl.formatMessage({ id: 'transaction_components.gerenxiangoushuliang' }),
key: 'restrictNum',
dataIndex: 'restrictNum',
render: (_text, _record, index) => (
......@@ -123,14 +124,14 @@ const columns_2 = ({
dependencies={[`restrictTotalNum_${index}`]}
rules={[{
required: true,
message: '请输入个人限购数量'
message: intl.formatMessage({ id: 'transaction_components.qingshurugerenxiangoushu' })
},
({ getFieldValue }) => ({
validator: (_rule, value) => {
const pattern = /^(\-)?\d+(\.\d{1,3})?$/;
const restrictTotalNum = getFieldValue(`restrictTotalNum_${index}`);
if (!pattern.test(value) || !(Number(value) < Number(restrictTotalNum))) {
return Promise.reject(new Error('必须大于0且小于活动限购总数量'));
return Promise.reject(new Error(intl.formatMessage({ id: 'transaction_components.bixudayu0qiexiaoyu1' })));
}
return Promise.resolve();
},
......@@ -142,7 +143,7 @@ const columns_2 = ({
)
},
{
title: '活动限购总数量',
title: intl.formatMessage({ id: 'transaction_components.huodongxiangouzongshuliang' }),
key: 'restrictTotalNum',
dataIndex: 'restrictTotalNum',
render: (_text, _record, index) => (
......@@ -152,14 +153,14 @@ const columns_2 = ({
name={`restrictTotalNum_${index}`}
rules={[{
required: true,
message: '请输入活动限购总数量'
message: intl.formatMessage({ id: 'transaction_components.qingshuruhuodongxiangouzong' })
},
({ getFieldValue }) => ({
validator: (_rule, value) => {
const pattern = /^(\-)?\d+(\.\d{1,3})?$/;
const restrictNum = getFieldValue(`restrictNum_${index}`);
if (!pattern.test(value) || !(Number(value) > Number(restrictNum))) {
return Promise.reject(new Error('必须大于0且大于个人限购数量'));
return Promise.reject(new Error(intl.formatMessage({ id: 'transaction_components.bixudayu0qiedayu' })));
}
return Promise.resolve();
}
......@@ -171,15 +172,15 @@ const columns_2 = ({
)
},
{
title: '操作',
title: intl.formatMessage({ id: 'transaction_components.caozuo' }),
key: 'operation',
dataIndex: 'operation',
render: (_text, _record) => (
<Popconfirm
title="是否删除?"
title={intl.formatMessage({ id: 'transaction_components.shifoushanchu' })}
onConfirm={() => handleDelete(_record.skuId)}
>
<a>删除</a>
<a>{intl.formatMessage({ id: 'transaction_components.shanchu' })}</a>
</Popconfirm>
)
},
......
import React from 'react';
import { Tooltip, Image, Form, Input, Popconfirm } from 'antd';
import { QuestionCircleOutlined } from '@ant-design/icons';
import { getIntl } from 'umi';
const intl = getIntl();
const columns_3 = ({
dataSource,
setDataSource,
......@@ -43,40 +44,40 @@ const columns_3 = ({
dataIndex: 'skuId'
},
{
title: '商品图片',
title: intl.formatMessage({id: 'transaction_components.shangpintupian'}),
key: 'productImgUrl',
dataIndex: 'productImgUrl',
render: (text) => <Image width={32} height={32} src={text} />
},
{
title: '商品名称',
title: intl.formatMessage({id: 'transaction_components.shangpinmingcheng'}),
key: 'productName',
dataIndex: 'productName'
},
{
title: '品类',
title: intl.formatMessage({id: 'transaction_components.pinlei'}),
key: 'category',
dataIndex: 'category'
},
{
title: '品牌',
title: intl.formatMessage({id: 'transaction_components.pinpai'}),
key: 'brand',
dataIndex: 'brand'
},
{
title: '单位',
title: intl.formatMessage({id: 'transaction_components.danwei'}),
key: 'unit',
dataIndex: 'unit'
},
{
title: '商品价格',
title: intl.formatMessage({id: 'transaction_components.shangpinjiage'}),
key: 'price',
dataIndex: 'price',
render: (text) => `¥${Number(text).toFixed(2)}`
},
{
title: <Tooltip placement="top" title="折扣为商品价格的折扣,输入数字,如85折,输入85,9折输入90">
折扣 <QuestionCircleOutlined />
title: <Tooltip placement="top" title={intl.formatMessage({id: 'transaction_components.zhekouweishangpinjiagede'})}>
{intl.formatMessage({id: 'transaction_components.zhekou'})} <QuestionCircleOutlined />
</Tooltip>,
key: 'discount',
dataIndex: 'discount',
......@@ -87,31 +88,31 @@ const columns_3 = ({
name={`discount_${index}`}
rules={[{
required: true,
message: '请输入折扣'
message: intl.formatMessage({id: 'transaction_components.qingshuruzhekou'})
},
() => ({
validator: (_rule, value) => {
const pattern = /^(\-)?\d+(\.\d{1,3})?$/;
if (!pattern.test(value)) {
return Promise.reject(new Error('折扣必须大于0'));
return Promise.reject(new Error(intl.formatMessage({id: 'transaction_components.zhekoubixudayu0'})));
}
return Promise.resolve();
},
})
]}
>
<Input style={{ width: '112px' }} addonAfter="折" onPressEnter={(e) => handleInputChange(e, 'discount', index)} onBlur={(e) => handleInputChange(e, 'discount', index)} />
<Input style={{ width: '112px' }} addonAfter={intl.formatMessage({id: 'transaction_components.zhe'})} onPressEnter={(e) => handleInputChange(e, 'discount', index)} onBlur={(e) => handleInputChange(e, 'discount', index)} />
</Form.Item>
)
},
{
title: '活动价格',
title: intl.formatMessage({ id: 'transaction_components.huodongjiage' }),
key: 'activityPrice',
dataIndex: 'activityPrice',
render: (text) => text ? `¥${Number(text).toFixed(2)}` : `¥0`
},
{
title: '个人限购数量',
title: intl.formatMessage({ id: 'transaction_components.gerenxiangoushuliang' }),
key: 'restrictNum',
dataIndex: 'restrictNum',
render: (_text, _record, index) => (
......@@ -122,14 +123,14 @@ const columns_3 = ({
dependencies={[`restrictTotalNum_${index}`]}
rules={[{
required: true,
message: '请输入个人限购数量'
message: intl.formatMessage({ id: 'transaction_components.qingshurugerenxiangoushu' })
},
({ getFieldValue }) => ({
validator: (_rule, value) => {
const pattern = /^(\-)?\d+(\.\d{1,3})?$/;
const restrictTotalNum = getFieldValue(`restrictTotalNum_${index}`);
if (!pattern.test(value) || !(Number(value) < Number(restrictTotalNum))) {
return Promise.reject(new Error('必须大于0且小于活动限购总数量'));
return Promise.reject(new Error(intl.formatMessage({ id: 'transaction_components.bixudayu0qiexiaoyu1' })));
}
return Promise.resolve();
},
......@@ -141,7 +142,7 @@ const columns_3 = ({
)
},
{
title: '活动限购总数量',
title: intl.formatMessage({ id: 'transaction_components.huodongxiangouzongshuliang' }),
key: 'restrictTotalNum',
dataIndex: 'restrictTotalNum',
render: (_text, _record, index) => (
......@@ -151,14 +152,14 @@ const columns_3 = ({
name={`restrictTotalNum_${index}`}
rules={[{
required: true,
message: '请输入活动限购总数量'
message: intl.formatMessage({ id: 'transaction_components.qingshuruhuodongxiangouzong' })
},
({ getFieldValue }) => ({
validator: (_rule, value) => {
const pattern = /^(\-)?\d+(\.\d{1,3})?$/;
const restrictNum = getFieldValue(`restrictNum_${index}`);
if (!pattern.test(value) || !(Number(value) > Number(restrictNum))) {
return Promise.reject(new Error('必须大于0且大于个人限购数量'));
return Promise.reject(new Error(intl.formatMessage({ id: 'transaction_components.bixudayu0qiedayu' })));
}
return Promise.resolve();
}
......@@ -170,15 +171,15 @@ const columns_3 = ({
)
},
{
title: '操作',
title: intl.formatMessage({ id: 'transaction_components.caozuo' }),
key: 'operation',
dataIndex: 'operation',
render: (_text, _record) => (
<Popconfirm
title="是否删除?"
title={intl.formatMessage({ id: 'transaction_components.shifoushanchu' })}
onConfirm={() => handleDelete(_record.skuId)}
>
<a>删除</a>
<a>{intl.formatMessage({ id: 'transaction_components.shanchu' })}</a>
</Popconfirm>
)
},
......
import React from 'react';
import { Image, Form, Input, Popconfirm, Button } from 'antd';
import { getIntl } from 'umi';
const intl = getIntl();
const columns_4 = ({
dataSource,
setDataSource,
......@@ -35,39 +36,39 @@ const columns_4 = ({
dataIndex: 'skuId'
},
{
title: '商品图片',
title: intl.formatMessage({id: 'transaction_components.shangpintupian'}),
key: 'productImgUrl',
dataIndex: 'productImgUrl',
render: (text) => <Image width={32} height={32} src={text} />
},
{
title: '商品名称',
title: intl.formatMessage({id: 'transaction_components.shangpinmingcheng'}),
key: 'productName',
dataIndex: 'productName'
},
{
title: '品类',
title: intl.formatMessage({id: 'transaction_components.pinlei'}),
key: 'category',
dataIndex: 'category'
},
{
title: '品牌',
title: intl.formatMessage({id: 'transaction_components.pinpai'}),
key: 'brand',
dataIndex: 'brand'
},
{
title: '单位',
title: intl.formatMessage({id: 'transaction_components.danwei'}),
key: 'unit',
dataIndex: 'unit'
},
{
title: '商品价格',
title: intl.formatMessage({id: 'transaction_components.shangpinjiage'}),
key: 'price',
dataIndex: 'price',
render: (text) => `¥${Number(text).toFixed(2)}`
},
{
title: '个人限购数量',
title: intl.formatMessage({ id: 'transaction_components.gerenxiangoushuliang' }),
key: 'restrictNum',
dataIndex: 'restrictNum',
render: (_text, _record, index) => (
......@@ -78,14 +79,14 @@ const columns_4 = ({
dependencies={[`restrictTotalNum_${index}`]}
rules={[{
required: true,
message: '请输入个人限购数量'
message: intl.formatMessage({ id: 'transaction_components.qingshurugerenxiangoushu' })
},
({ getFieldValue }) => ({
validator: (_rule, value) => {
const pattern = /^(\-)?\d+(\.\d{1,3})?$/;
const restrictTotalNum = getFieldValue(`restrictTotalNum_${index}`);
if (!pattern.test(value) || !(Number(value) < Number(restrictTotalNum))) {
return Promise.reject(new Error('必须大于0且小于活动限购总数量'));
return Promise.reject(new Error(intl.formatMessage({ id: 'transaction_components.bixudayu0qiexiaoyu1' })));
}
return Promise.resolve();
},
......@@ -97,7 +98,7 @@ const columns_4 = ({
)
},
{
title: '活动限购总数量',
title: intl.formatMessage({ id: 'transaction_components.huodongxiangouzongshuliang' }),
key: 'restrictTotalNum',
dataIndex: 'restrictTotalNum',
render: (_text, _record, index) => (
......@@ -107,14 +108,14 @@ const columns_4 = ({
name={`restrictTotalNum_${index}`}
rules={[{
required: true,
message: '请输入活动限购总数量'
message: intl.formatMessage({ id: 'transaction_components.qingshuruhuodongxiangouzong' })
},
({ getFieldValue }) => ({
validator: (_rule, value) => {
const pattern = /^(\-)?\d+(\.\d{1,3})?$/;
const restrictNum = getFieldValue(`restrictNum_${index}`);
if (!pattern.test(value) || !(Number(value) > Number(restrictNum))) {
return Promise.reject(new Error('必须大于0且大于个人限购数量'));
return Promise.reject(new Error(intl.formatMessage({ id: 'transaction_components.bixudayu0qiedayu' })));
}
return Promise.resolve();
}
......@@ -126,25 +127,25 @@ const columns_4 = ({
)
},
{
title: '操作',
title: intl.formatMessage({ id: 'transaction_components.caozuo' }),
key: 'operation',
dataIndex: 'operation',
render: (_text, _record) => (
<>
<Popconfirm
title="是否删除?"
title={intl.formatMessage({ id: 'transaction_components.shifoushanchu' })}
onConfirm={() => handleDelete(_record.skuId)}
>
<a>删除</a>
<a>{intl.formatMessage({ id: 'transaction_components.shanchu' })}</a>
</Popconfirm>
{(value === 6) && (
<Button type='link' onClick={() => handlCollocation(_record)}>设置赠品</Button>
<Button type='link' onClick={() => handlCollocation(_record)}>{intl.formatMessage({id: 'transaction_components.shezhizengpin'})}</Button>
)}
{(value === 13) && (
<Button type='link' onClick={() => handlCollocation(_record)}>设置换购商品</Button>
<Button type='link' onClick={() => handlCollocation(_record)}>{intl.formatMessage({id: 'transaction_components.shezhihuangoushangpin'})}</Button>
)}
{(value === 15) && (
<Button type='link' onClick={() => handlCollocation(_record)}>设置搭配商品</Button>
<Button type='link' onClick={() => handlCollocation(_record)}>{intl.formatMessage({id: 'transaction_components.shezhidapeishangpin'})}</Button>
)}
</>
)
......
import React from 'react';
import { Image, Form, Input, Popconfirm } from 'antd';
import { getIntl } from 'umi';
const intl = getIntl();
const columns_5 = ({
dataSource,
setDataSource,
......@@ -33,39 +34,39 @@ const columns_5 = ({
dataIndex: 'skuId'
},
{
title: '商品图片',
title: intl.formatMessage({id: 'transaction_components.shangpintupian'}),
key: 'productImgUrl',
dataIndex: 'productImgUrl',
render: (text) => <Image width={32} height={32} src={text} />
},
{
title: '商品名称',
title: intl.formatMessage({id: 'transaction_components.shangpinmingcheng'}),
key: 'productName',
dataIndex: 'productName'
},
{
title: '品类',
title: intl.formatMessage({id: 'transaction_components.pinlei'}),
key: 'category',
dataIndex: 'category'
},
{
title: '品牌',
title: intl.formatMessage({id: 'transaction_components.pinpai'}),
key: 'brand',
dataIndex: 'brand'
},
{
title: '单位',
title: intl.formatMessage({id: 'transaction_components.danwei'}),
key: 'unit',
dataIndex: 'unit'
},
{
title: '商品价格',
title: intl.formatMessage({id: 'transaction_components.shangpinjiage'}),
key: 'price',
dataIndex: 'price',
render: (text) => `¥${Number(text).toFixed(2)}`
},
{
title: '团购价格',
title: intl.formatMessage({id: 'transaction_components.tuangoujiage'}),
key: 'activityPrice',
dataIndex: 'activityPrice',
render: (_text, _record, index) => (
......@@ -77,10 +78,10 @@ const columns_5 = ({
required: true, validator: (_rule, value) => {
const pattern = /^(\-)?\d+(\.\d{1,3})?$/;
if (!value) {
return Promise.reject(new Error('请输入团购价格'));
return Promise.reject(new Error(intl.formatMessage({id: 'transaction_components.qingshurutuangoujiage'})));
}
if (!pattern.test(value) || (Number(value) >= Number(_record.price))) {
return Promise.reject(new Error('必须大于0且小于商品价格'));
return Promise.reject(new Error(intl.formatMessage({ id: 'transaction_components.bixudayu0qiexiaoyu' })));
}
return Promise.resolve();
}
......@@ -91,7 +92,7 @@ const columns_5 = ({
)
},
{
title: '个人限购数量',
title: intl.formatMessage({ id: 'transaction_components.gerenxiangoushuliang' }),
key: 'restrictNum',
dataIndex: 'restrictNum',
render: (_text, _record, index) => (
......@@ -102,14 +103,14 @@ const columns_5 = ({
dependencies={[`restrictTotalNum_${index}`]}
rules={[{
required: true,
message: '请输入个人限购数量'
message: intl.formatMessage({ id: 'transaction_components.qingshurugerenxiangoushu' })
},
({ getFieldValue }) => ({
validator: (_rule, value) => {
const pattern = /^(\-)?\d+(\.\d{1,3})?$/;
const restrictTotalNum = getFieldValue(`restrictTotalNum_${index}`);
if (!pattern.test(value) || !(Number(value) < Number(restrictTotalNum))) {
return Promise.reject(new Error('必须大于0且小于活动限购总数量'));
return Promise.reject(new Error(intl.formatMessage({ id: 'transaction_components.bixudayu0qiexiaoyu1' })));
}
return Promise.resolve();
},
......@@ -121,7 +122,7 @@ const columns_5 = ({
)
},
{
title: '活动限购总数量',
title: intl.formatMessage({ id: 'transaction_components.huodongxiangouzongshuliang' }),
key: 'restrictTotalNum',
dataIndex: 'restrictTotalNum',
render: (_text, _record, index) => (
......@@ -131,14 +132,14 @@ const columns_5 = ({
name={`restrictTotalNum_${index}`}
rules={[{
required: true,
message: '请输入活动限购总数量'
message: intl.formatMessage({ id: 'transaction_components.qingshuruhuodongxiangouzong' })
},
({ getFieldValue }) => ({
validator: (_rule, value) => {
const pattern = /^(\-)?\d+(\.\d{1,3})?$/;
const restrictNum = getFieldValue(`restrictNum_${index}`);
if (!pattern.test(value) || !(Number(value) > Number(restrictNum))) {
return Promise.reject(new Error('必须大于0且大于个人限购数量'));
return Promise.reject(new Error(intl.formatMessage({ id: 'transaction_components.bixudayu0qiedayu' })));
}
return Promise.resolve();
}
......@@ -150,15 +151,15 @@ const columns_5 = ({
)
},
{
title: '操作',
title: intl.formatMessage({ id: 'transaction_components.caozuo' }),
key: 'operation',
dataIndex: 'operation',
render: (_text, _record) => (
<Popconfirm
title="是否删除?"
title={intl.formatMessage({ id: 'transaction_components.shifoushanchu' })}
onConfirm={() => handleDelete(_record.skuId)}
>
<a>删除</a>
<a>{intl.formatMessage({ id: 'transaction_components.shanchu' })}</a>
</Popconfirm>
)
},
......
import React from 'react';
import { Tooltip, Image, Form, Input, Popconfirm } from 'antd';
import { QuestionCircleOutlined } from '@ant-design/icons';
import { getIntl } from 'umi';
const intl = getIntl();
const columns_6 = ({
dataSource,
setDataSource,
......@@ -34,40 +35,40 @@ const columns_6 = ({
dataIndex: 'skuId'
},
{
title: '商品图片',
title: intl.formatMessage({id: 'transaction_components.shangpintupian'}),
key: 'productImgUrl',
dataIndex: 'productImgUrl',
render: (text) => <Image width={32} height={32} src={text} />
},
{
title: '商品名称',
title: intl.formatMessage({id: 'transaction_components.shangpinmingcheng'}),
key: 'productName',
dataIndex: 'productName'
},
{
title: '品类',
title: intl.formatMessage({id: 'transaction_components.pinlei'}),
key: 'category',
dataIndex: 'category'
},
{
title: '品牌',
title: intl.formatMessage({id: 'transaction_components.pinpai'}),
key: 'brand',
dataIndex: 'brand'
},
{
title: '单位',
title: intl.formatMessage({id: 'transaction_components.danwei'}),
key: 'unit',
dataIndex: 'unit'
},
{
title: '商品价格',
title: intl.formatMessage({id: 'transaction_components.shangpinjiage'}),
key: 'price',
dataIndex: 'price',
render: (text) => `¥${Number(text).toFixed(2)}`
},
{
title: <Tooltip placement="top" title="第一个用户帮砍价时的起始价格">
起始价格 <QuestionCircleOutlined />
title: <Tooltip placement="top" title={intl.formatMessage({id: 'transaction_components.diyigeyonghubangkanjia'})}>
{intl.formatMessage({id: 'transaction_components.qishijiage'})} <QuestionCircleOutlined />
</Tooltip>,
key: 'plummetPrice',
dataIndex: 'plummetPrice',
......@@ -80,13 +81,13 @@ const columns_6 = ({
required: true, validator: (_rule, value) => {
const pattern = /^(\-)?\d+(\.\d{1,4})?$/;
if (!value) {
return Promise.reject(new Error('请输入起始价格'));
return Promise.reject(new Error(intl.formatMessage({id: 'transaction_components.qingshuruqishijiage'})));
}
if (!pattern.test(value)) {
return Promise.reject(new Error('最多保留4位小数'));
return Promise.reject(new Error(intl.formatMessage({id: 'transaction_components.zuiduobaoliu4weixiaoshu'})));
}
if ((Number(value) > Number(_record.price))) {
return Promise.reject(new Error('必须大于0且小于等于商品价格'));
return Promise.reject(new Error(intl.formatMessage({id: 'transaction_components.bixudayu0qiexiaoyu'})));
}
return Promise.resolve();
}
......@@ -97,8 +98,8 @@ const columns_6 = ({
)
},
{
title: <Tooltip placement="top" title="砍价过程中最后一次砍价不能超过砍价底价">
砍价底价 <QuestionCircleOutlined />
title: <Tooltip placement="top" title={intl.formatMessage({id: 'transaction_components.kanjiaguochengzhongzuihouyi'})}>
{intl.formatMessage({id: 'transaction_components.kanjiadijia'})} <QuestionCircleOutlined />
</Tooltip>,
key: 'activityPrice',
dataIndex: 'activityPrice',
......@@ -109,17 +110,17 @@ const columns_6 = ({
name={`activityPrice_${index}`}
rules={[{
required: true,
message: '请输入砍价底价'
message: intl.formatMessage({id: 'transaction_components.qingshurukanjiadijia'})
},
({ getFieldValue }) => ({
validator: (_rule, value) => {
const pattern = /^(\-)?\d+(\.\d{1,4})?$/;
const plummetPrice = getFieldValue(`plummetPrice_${index}`);
if (!pattern.test(value)) {
return Promise.reject(new Error('最多保留4位小数'));
return Promise.reject(new Error(intl.formatMessage({id: 'transaction_components.zuiduobaoliu4weixiaoshu'})));
}
if (!(Number(value) < Number(plummetPrice))) {
return Promise.reject(new Error('必须大于0且小于起始价格'));
return Promise.reject(new Error(intl.formatMessage({id: 'transaction_components.bixudayu0qiexiaoyu3'})));
}
return Promise.resolve();
},
......@@ -131,7 +132,7 @@ const columns_6 = ({
)
},
{
title: '个人限购数量',
title: intl.formatMessage({ id: 'transaction_components.gerenxiangoushuliang' }),
key: 'restrictNum',
dataIndex: 'restrictNum',
render: (_text, _record, index) => (
......@@ -142,14 +143,14 @@ const columns_6 = ({
dependencies={[`restrictTotalNum_${index}`]}
rules={[{
required: true,
message: '请输入个人限购数量'
message: intl.formatMessage({ id: 'transaction_components.qingshurugerenxiangoushu' })
},
({ getFieldValue }) => ({
validator: (_rule, value) => {
const pattern = /^(\-)?\d+(\.\d{1,3})?$/;
const restrictTotalNum = getFieldValue(`restrictTotalNum_${index}`);
if (!pattern.test(value) || !(Number(value) < Number(restrictTotalNum))) {
return Promise.reject(new Error('必须大于0且小于活动限购总数量'));
return Promise.reject(new Error(intl.formatMessage({ id: 'transaction_components.bixudayu0qiexiaoyu1' })));
}
return Promise.resolve();
},
......@@ -161,7 +162,7 @@ const columns_6 = ({
)
},
{
title: '活动限购总数量',
title: intl.formatMessage({ id: 'transaction_components.huodongxiangouzongshuliang' }),
key: 'restrictTotalNum',
dataIndex: 'restrictTotalNum',
render: (_text, _record, index) => (
......@@ -171,14 +172,14 @@ const columns_6 = ({
name={`restrictTotalNum_${index}`}
rules={[{
required: true,
message: '请输入活动限购总数量'
message: intl.formatMessage({ id: 'transaction_components.qingshuruhuodongxiangouzong' })
},
({ getFieldValue }) => ({
validator: (_rule, value) => {
const pattern = /^(\-)?\d+(\.\d{1,3})?$/;
const restrictNum = getFieldValue(`restrictNum_${index}`);
if (!pattern.test(value) || !(Number(value) > Number(restrictNum))) {
return Promise.reject(new Error('必须大于0且大于个人限购数量'));
return Promise.reject(new Error(intl.formatMessage({ id: 'transaction_components.bixudayu0qiedayu' })));
}
return Promise.resolve();
}
......@@ -190,15 +191,15 @@ const columns_6 = ({
)
},
{
title: '操作',
title: intl.formatMessage({ id: 'transaction_components.caozuo' }),
key: 'operation',
dataIndex: 'operation',
render: (_text, _record) => (
<Popconfirm
title="是否删除?"
title={intl.formatMessage({ id: 'transaction_components.shifoushanchu' })}
onConfirm={() => handleDelete(_record.skuId)}
>
<a>删除</a>
<a>{intl.formatMessage({ id: 'transaction_components.shanchu' })}</a>
</Popconfirm>
)
},
......
import React from 'react';
import { Tooltip, Image, Form, Input, Popconfirm } from 'antd';
import { QuestionCircleOutlined } from '@ant-design/icons';
import { getIntl } from 'umi';
const intl = getIntl();
const columns_7 = ({
dataSource,
setDataSource,
......@@ -35,40 +36,40 @@ const columns_7 = ({
dataIndex: 'skuId'
},
{
title: '商品图片',
title: intl.formatMessage({ id: 'transaction_components.shangpintupian' }),
key: 'productImgUrl',
dataIndex: 'productImgUrl',
render: (text) => <Image width={32} height={32} src={text} />
},
{
title: '商品名称',
title: intl.formatMessage({ id: 'transaction_components.shangpinmingcheng' }),
key: 'productName',
dataIndex: 'productName'
},
{
title: '品类',
title: intl.formatMessage({ id: 'transaction_components.pinlei' }),
key: 'category',
dataIndex: 'category'
},
{
title: '品牌',
title: intl.formatMessage({ id: 'transaction_components.pinpai' }),
key: 'brand',
dataIndex: 'brand'
},
{
title: '单位',
title: intl.formatMessage({ id: 'transaction_components.danwei' }),
key: 'unit',
dataIndex: 'unit'
},
{
title: '商品价格',
title: intl.formatMessage({ id: 'transaction_components.shangpinjiage' }),
key: 'price',
dataIndex: 'price',
render: (text) => `¥${Number(text).toFixed(2)}`
},
{
title: <Tooltip placement="top" title="秒杀价格表示在秒杀时间段内商城直接以该商品的秒杀价格进行销售">
秒杀价格 <QuestionCircleOutlined />
title: <Tooltip placement="top" title={intl.formatMessage({id: 'transaction_components.miaoshajiagebiaoshizaimiao'})}>
{intl.formatMessage({id: 'transaction_components.miaoshajiage'})} <QuestionCircleOutlined />
</Tooltip>,
key: 'activityPrice',
dataIndex: 'activityPrice',
......@@ -79,16 +80,16 @@ const columns_7 = ({
name={`activityPrice_${index}`}
rules={[{
required: true,
message: '请输入秒杀价格'
message: intl.formatMessage({id: 'transaction_components.qingshurumiaoshajiage'})
},
({ getFieldValue }) => ({
validator: (_rule, value) => {
const pattern = /^(\-)?\d+(\.\d{1,4})?$/;
if (!pattern.test(value)) {
return Promise.reject(new Error('最多保留4位小数'));
return Promise.reject(new Error(intl.formatMessage({id: 'transaction_components.zuiduobaoliu4weixiaoshu'})));
}
if ((Number(value) > Number(_record.price))) {
return Promise.reject(new Error('必须大于0且小于等于商品价格'));
return Promise.reject(new Error(intl.formatMessage({id: 'transaction_components.bixudayu0qiexiaoyu2'})));
}
return Promise.resolve();
},
......@@ -100,7 +101,7 @@ const columns_7 = ({
)
},
{
title: '个人限购数量',
title: intl.formatMessage({ id: 'transaction_components.gerenxiangoushuliang' }),
key: 'restrictNum',
dataIndex: 'restrictNum',
render: (_text, _record, index) => (
......@@ -111,14 +112,14 @@ const columns_7 = ({
dependencies={[`restrictTotalNum_${index}`]}
rules={[{
required: true,
message: '请输入个人限购数量'
message: intl.formatMessage({ id: 'transaction_components.qingshurugerenxiangoushu' })
},
({ getFieldValue }) => ({
validator: (_rule, value) => {
const pattern = /^(\-)?\d+(\.\d{1,3})?$/;
const restrictTotalNum = getFieldValue(`restrictTotalNum_${index}`);
if (!pattern.test(value) || !(Number(value) < Number(restrictTotalNum))) {
return Promise.reject(new Error('必须大于0且小于活动限购总数量'));
return Promise.reject(new Error(intl.formatMessage({ id: 'transaction_components.bixudayu0qiexiaoyu1' })));
}
return Promise.resolve();
},
......@@ -130,7 +131,7 @@ const columns_7 = ({
)
},
{
title: '活动限购总数量',
title: intl.formatMessage({ id: 'transaction_components.huodongxiangouzongshuliang' }),
key: 'restrictTotalNum',
dataIndex: 'restrictTotalNum',
render: (_text, _record, index) => (
......@@ -140,14 +141,14 @@ const columns_7 = ({
name={`restrictTotalNum_${index}`}
rules={[{
required: true,
message: '请输入活动限购总数量'
message: intl.formatMessage({ id: 'transaction_components.qingshuruhuodongxiangouzong' })
},
({ getFieldValue }) => ({
validator: (_rule, value) => {
const pattern = /^(\-)?\d+(\.\d{1,3})?$/;
const restrictNum = getFieldValue(`restrictNum_${index}`);
if (!pattern.test(value) || !(Number(value) > Number(restrictNum))) {
return Promise.reject(new Error('必须大于0且大于个人限购数量'));
return Promise.reject(new Error(intl.formatMessage({ id: 'transaction_components.bixudayu0qiedayu' })));
}
return Promise.resolve();
}
......@@ -159,15 +160,15 @@ const columns_7 = ({
)
},
{
title: '操作',
title: intl.formatMessage({ id: 'transaction_components.caozuo' }),
key: 'operation',
dataIndex: 'operation',
render: (_text, _record) => (
<Popconfirm
title="是否删除?"
title={intl.formatMessage({ id: 'transaction_components.shifoushanchu' })}
onConfirm={() => handleDelete(_record.skuId)}
>
<a>删除</a>
<a>{intl.formatMessage({ id: 'transaction_components.shanchu' })}</a>
</Popconfirm>
)
},
......
import React from 'react';
import { Image, Form, Input, Popconfirm } from 'antd';
import { getIntl } from 'umi';
const intl = getIntl();
const columns_8 = ({
dataSource,
setDataSource,
......@@ -33,54 +34,54 @@ const columns_8 = ({
dataIndex: 'skuId'
},
{
title: '商品图片',
title: intl.formatMessage({id: 'transaction_components.shangpintupian'}),
key: 'productImgUrl',
dataIndex: 'productImgUrl',
render: (text) => <Image width={32} height={32} src={text} />
},
{
title: '商品名称',
title: intl.formatMessage({id: 'transaction_components.shangpinmingcheng'}),
key: 'productName',
dataIndex: 'productName'
},
{
title: '品类',
title: intl.formatMessage({id: 'transaction_components.pinlei'}),
key: 'category',
dataIndex: 'category'
},
{
title: '品牌',
title: intl.formatMessage({id: 'transaction_components.pinpai'}),
key: 'brand',
dataIndex: 'brand'
},
{
title: '单位',
title: intl.formatMessage({id: 'transaction_components.danwei'}),
key: 'unit',
dataIndex: 'unit'
},
{
title: '商品价格',
title: intl.formatMessage({id: 'transaction_components.shangpinjiage'}),
key: 'price',
dataIndex: 'price',
render: (text) => `¥${Number(text).toFixed(2)}`
},
{
title: '预售价格',
title: intl.formatMessage({id: 'transaction_components.yushoujiage'}),
key: 'activityPrice',
dataIndex: 'activityPrice',
},
{
title: '单位定金',
title: intl.formatMessage({id: 'transaction_components.danweidingjin'}),
key: 'activityPrice',
dataIndex: 'activityPrice',
},
{
title: '定金抵扣单价',
title: intl.formatMessage({id: 'transaction_components.dingjindikoudanjia'}),
key: 'activityPrice',
dataIndex: 'activityPrice',
},
{
title: '个人限购数量',
title: intl.formatMessage({ id: 'transaction_components.gerenxiangoushuliang' }),
key: 'restrictNum',
dataIndex: 'restrictNum',
render: (_text, _record, index) => (
......@@ -91,14 +92,14 @@ const columns_8 = ({
dependencies={[`restrictTotalNum_${index}`]}
rules={[{
required: true,
message: '请输入个人限购数量'
message: intl.formatMessage({ id: 'transaction_components.qingshurugerenxiangoushu' })
},
({ getFieldValue }) => ({
validator: (_rule, value) => {
const pattern = /^(\-)?\d+(\.\d{1,3})?$/;
const restrictTotalNum = getFieldValue(`restrictTotalNum_${index}`);
if (!pattern.test(value) || !(Number(value) < Number(restrictTotalNum))) {
return Promise.reject(new Error('必须大于0且小于活动限购总数量'));
return Promise.reject(new Error(intl.formatMessage({ id: 'transaction_components.bixudayu0qiexiaoyu1' })));
}
return Promise.resolve();
},
......@@ -110,7 +111,7 @@ const columns_8 = ({
)
},
{
title: '活动限购总数量',
title: intl.formatMessage({ id: 'transaction_components.huodongxiangouzongshuliang' }),
key: 'restrictTotalNum',
dataIndex: 'restrictTotalNum',
render: (_text, _record, index) => (
......@@ -120,14 +121,14 @@ const columns_8 = ({
name={`restrictTotalNum_${index}`}
rules={[{
required: true,
message: '请输入活动限购总数量'
message: intl.formatMessage({ id: 'transaction_components.qingshuruhuodongxiangouzong' })
},
({ getFieldValue }) => ({
validator: (_rule, value) => {
const pattern = /^(\-)?\d+(\.\d{1,3})?$/;
const restrictNum = getFieldValue(`restrictNum_${index}`);
if (!pattern.test(value) || !(Number(value) > Number(restrictNum))) {
return Promise.reject(new Error('必须大于0且大于个人限购数量'));
return Promise.reject(new Error(intl.formatMessage({ id: 'transaction_components.bixudayu0qiedayu' })));
}
return Promise.resolve();
}
......@@ -139,15 +140,15 @@ const columns_8 = ({
)
},
{
title: '操作',
title: intl.formatMessage({ id: 'transaction_components.caozuo' }),
key: 'operation',
dataIndex: 'operation',
render: (_text, _record) => (
<Popconfirm
title="是否删除?"
title={intl.formatMessage({ id: 'transaction_components.shifoushanchu' })}
onConfirm={() => handleDelete(_record.skuId)}
>
<a>删除</a>
<a>{intl.formatMessage({ id: 'transaction_components.shanchu' })}</a>
</Popconfirm>
)
},
......
......@@ -5,6 +5,7 @@ import { Context } from '../context';
import Card from '../../../card';
import style from './index.less';
import { isEmpty } from 'lodash';
import { getIntl } from 'umi';
const LOGSTATESTYPE = {
/** 外部流转 */
......@@ -19,7 +20,7 @@ export interface ProgressProps {
/** 选中哪个radio */
logstate?: number,
}
const intl = getIntl();
const ProgressLayout: React.FC<ProgressProps> = (props: any) => {
const { logstate } = props;
const context = useContext(Context);
......@@ -37,7 +38,7 @@ const ProgressLayout: React.FC<ProgressProps> = (props: any) => {
return (
<Card
id='progressLayout'
title='流转进度'
title={intl.formatMessage({id: 'transaction_components.liuzhuanjindu'})}
extra={
<>
{!isEmpty(data) && (
......@@ -45,9 +46,9 @@ const ProgressLayout: React.FC<ProgressProps> = (props: any) => {
onChange={(e) => setLogStatesStatus(e.target.value)}
defaultValue={data.externalLogStates ? LOGSTATESTYPE.EXTERNALSTATES : LOGSTATESTYPE.INTERIORSTATES}
>
{data.externalLogStates && <Radio.Button value={LOGSTATESTYPE.EXTERNALSTATES}>外部流转</Radio.Button>}
{data.interiorLogStates && <Radio.Button value={LOGSTATESTYPE.INTERIORSTATES}>内部流转</Radio.Button>}
{data.examineInteriorLogStates && <Radio.Button value={LOGSTATESTYPE.EXMAINEINERIORSTATES}>竞价结果内部流转</Radio.Button>}
{data.externalLogStates && <Radio.Button value={LOGSTATESTYPE.EXTERNALSTATES}>{intl.formatMessage({id: 'transaction_components.waibuliuzhuan'})}</Radio.Button>}
{data.interiorLogStates && <Radio.Button value={LOGSTATESTYPE.INTERIORSTATES}>{intl.formatMessage({id: 'transaction_components.neibuliuzhuan'})}</Radio.Button>}
{data.examineInteriorLogStates && <Radio.Button value={LOGSTATESTYPE.EXMAINEINERIORSTATES}>{intl.formatMessage({id: 'transaction_components.jingjiajieguoneibuliuzhuan'})}</Radio.Button>}
</Radio.Group>
)}
</>
......
......@@ -6,7 +6,8 @@ import {
EXTERNALSTATE_COLOR,
INTERNALSTATE_COLOR,
} from '@/pages/transaction/components/stateColor';
import { getIntl } from 'umi';
const intl = getIntl();
const format = (text) => {
return <>{moment(text).format("YYYY-MM-DD HH:mm")}</>
}
......@@ -15,35 +16,35 @@ const { Text } = Typography;
/** 外部流转记录 */
export const EXTERNALLOGS: ColumnType<any>[] = [
{
title: '流转顺序号',
title: intl.formatMessage({id: 'transaction_components.liuzhuanshunxuhao'}),
key: 'index',
dataIndex: 'index',
render: (_text: any, _record: any, index: number) => <Text>{index + 1}</Text>
},
{
title: '操作角色',
title: intl.formatMessage({id: 'transaction_components.caozuojuese'}),
key: 'roleName',
dataIndex: 'roleName',
},
{
title: '状态',
title: intl.formatMessage({id: 'transaction_components.zhuangtai'}),
key: 'state',
dataIndex: 'state',
render: (_text: any, _record: any) => <Tag color={EXTERNALSTATE_COLOR[_text] || 'default'}>{_record.stateName}</Tag>
},
{
title: '操作',
title: intl.formatMessage({ id: 'transaction_components.caozuo' }),
key: 'operation',
dataIndex: 'operation',
},
{
title: '操作时间',
title: intl.formatMessage({id: 'transaction_components.caozuoshijian'}),
key: 'createTime',
dataIndex: 'createTime',
render: (_text: any, _record: any) => <Text>{format(_record.createTime || _record.operationTime)}</Text>
},
{
title: '审核意见',
title: intl.formatMessage({id: 'transaction_components.shenheyijian'}),
key: 'auditOpinion',
dataIndex: 'auditOpinion',
},
......@@ -51,45 +52,45 @@ export const EXTERNALLOGS: ColumnType<any>[] = [
/** 内部流转记录 */
export const INTERNALLOGS: ColumnType<any>[] = [
{
title: '流转顺序号',
title: intl.formatMessage({id: 'transaction_components.liuzhuanshunxuhao'}),
key: 'index',
dataIndex: 'index',
render: (_text: any, _record: any, index: number) => <Text>{index + 1}</Text>
},
{
title: '操作人',
title: intl.formatMessage({id: 'transaction_components.caozuoren'}),
key: 'roleName',
dataIndex: 'roleName',
},
{
title: '部门',
title: intl.formatMessage({id: 'transaction_components.bumen'}),
key: 'department',
dataIndex: 'department',
},
{
title: '职位',
title: intl.formatMessage({id: 'transaction_components.zhiwei'}),
key: 'position',
dataIndex: 'position',
},
{
title: '状态',
title: intl.formatMessage({id: 'transaction_components.zhuangtai'}),
key: 'state',
dataIndex: 'state',
render: (_text: any, _record: any) => <Tag color={INTERNALSTATE_COLOR[_text] || 'default'}>{_record.stateName}</Tag>
},
{
title: '操作',
title: intl.formatMessage({ id: 'transaction_components.caozuo' }),
key: 'operation',
dataIndex: 'operation',
},
{
title: '操作时间',
title: intl.formatMessage({id: 'transaction_components.caozuoshijian'}),
key: 'createTime',
dataIndex: 'createTime',
render: (_text: any, _record: any) => <Text>{format(_record.createTime || _record.operationTime)}</Text>
},
{
title: '审核意见',
title: intl.formatMessage({id: 'transaction_components.shenheyijian'}),
key: 'auditOpinion',
dataIndex: 'auditOpinion',
},
......
......@@ -8,6 +8,7 @@ import {
INTERNALLOGS,
} from './columns';
import { isEmpty } from 'lodash';
import { getIntl } from 'umi';
const LOGSTATESTYPE = {
/** 外部流转 */
......@@ -15,7 +16,7 @@ const LOGSTATESTYPE = {
/** 内部流转 */
INTERIORSTATES: 2
}
const intl = getIntl();
export interface ProgressProps {
/** 选中哪个radio */
logstate?: number,
......@@ -38,7 +39,7 @@ const RecordLayout: React.FC<ProgressProps> = (props: any) => {
return (
<Card
id='recordLyout'
title='流转记录'
title={intl.formatMessage({id: 'transaction_components.liuzhuanjilu'})}
extra={
<>
{!isEmpty(data) && (
......@@ -46,8 +47,8 @@ const RecordLayout: React.FC<ProgressProps> = (props: any) => {
onChange={(e) => setLogStatus(e.target.value)}
defaultValue={data.externalLogs ? LOGSTATESTYPE.EXTERNALSTATES : LOGSTATESTYPE.INTERIORSTATES}
>
{data.externalLogs && <Radio.Button value={LOGSTATESTYPE.EXTERNALSTATES}>外部流转</Radio.Button>}
{data.interiorLogs && <Radio.Button value={LOGSTATESTYPE.INTERIORSTATES}>内部流转</Radio.Button>}
{data.externalLogs && <Radio.Button value={LOGSTATESTYPE.EXTERNALSTATES}>{intl.formatMessage({id: 'transaction_components.waibuliuzhuan'})}</Radio.Button>}
{data.interiorLogs && <Radio.Button value={LOGSTATESTYPE.INTERIORSTATES}>{intl.formatMessage({id: 'transaction_components.neibuliuzhuan'})}</Radio.Button>}
</Radio.Group>
)}
</>
......
......@@ -13,9 +13,10 @@ import style from './index.less'
import { BidDetailContext } from '../components/context';
import { sumBy } from 'lodash';
import { postPurchaseConfirmQuotedPriceSubmitContrastPrice } from '@/services/PurchaseV2Api';
import { getIntl } from 'umi';
const { TextArea } = Input;
const intl = getIntl();
export interface IProps {
id: number,
turn: number,
......@@ -35,7 +36,7 @@ const BidModal: React.FC<IProps> = (props: any) => {
const beforeDocUpload = (file: any) => {
const isLt20M = file.size / 1024 / 1024 < 20;
if (!isLt20M) {
message.error('上传文件大小不超过 20M!');
message.error(intl.formatMessage({id: 'transaction_components.shangchuanwenjiandaxiaobuchao'}));
}
return isLt20M;
}
......@@ -119,7 +120,7 @@ const BidModal: React.FC<IProps> = (props: any) => {
for(let i = 0; i < dataSource.length; i++) {
const count = sumBy(dataSource[i].company, 'awardTaxProbability');
if (count > 100 || count < 100) {
message.warning(`${dataSource[i].number}授标百分比分配不准确,请核对!`);
message.warning(`${dataSource[i].number}${intl.formatMessage({id: 'transaction_components.shoubiaobaifenbifenpeibu'})}`);
return
}
}
......@@ -135,7 +136,7 @@ const BidModal: React.FC<IProps> = (props: any) => {
return (
<Modal
title='提交审核'
title={intl.formatMessage({id: 'transaction_components.tijiaoshenhe'})}
visible={visible}
width={600}
onCancel={onCancel}
......@@ -144,11 +145,11 @@ const BidModal: React.FC<IProps> = (props: any) => {
<Form form={form} layout="vertical">
<Form.Item
name='awardComments'
label='授标意见'
label={intl.formatMessage({id: 'transaction_components.shoubiaoyijian'})}
>
<TextArea />
</Form.Item>
<Form.Item label='附件' name='upload'>
<Form.Item label={intl.formatMessage({id: 'transaction_components.fujian'})} name='upload'>
<div className={style.upload_data}>
{files.length > 0 && files.map((v, index) => (
<div key={index} className={style.upload_item}>
......@@ -170,8 +171,8 @@ const BidModal: React.FC<IProps> = (props: any) => {
beforeUpload={beforeDocUpload}
onChange={handleChange}
>
<Button loading={loading} icon={<UploadOutlined />}>上传文件</Button>
<div style={{ marginTop: '8px' }}>一次上传一个文件,每个附件大小不能超过 20M</div>
<Button loading={loading} icon={<UploadOutlined />}>{intl.formatMessage({id: 'transaction_components.shangchuanwenjian'})}</Button>
<div style={{ marginTop: '8px' }}>{intl.formatMessage({id: 'transaction_components.yicishangchuanyigewenjian'})}</div>
</Upload>
</Form.Item>
</Form>
......
......@@ -10,6 +10,7 @@ import moment from 'moment';
import styles from './index.less';
import { isEmpty } from 'lodash';
import { getIntl } from 'umi';
const actions = createFormActions()
const { onFieldChange$ } = FormEffectHooks;
......@@ -25,7 +26,7 @@ export interface IProps {
fetch?: () => Promise<unknown>,
maxNumber?: number
}
const intl = getIntl();
const ModalOperate: React.FC<IProps> = (props: any) => {
const {
title,
......@@ -110,11 +111,11 @@ const ModalOperate: React.FC<IProps> = (props: any) => {
case 'planAudit':
case 'merkeingAudit':
case 'marketing':
return '审核不通过原因';
return intl.formatMessage({id: 'transaction_components.shenhebutongguoyuanyin'});
case 'billBack':
return '退回原因';
return intl.formatMessage({id: 'transaction_components.tuihuiyuanyin'});
default:
return '作废原因';
return intl.formatMessage({id: 'transaction_components.zuofeiyuanyin'});
}
}
const modalNode = () => {
......@@ -123,8 +124,8 @@ const ModalOperate: React.FC<IProps> = (props: any) => {
return <Field
enum={
[
{ label: '审核通过', value: 1 },
{ label: '审核不通过', value: 0 }
{ label: intl.formatMessage({ id: 'transaction_components.shenhetongguo' }), value: 1 },
{ label: intl.formatMessage({ id: 'transaction_components.shenhebutongguo' }), value: 0 }
]}
name='state'
required
......@@ -133,7 +134,7 @@ const ModalOperate: React.FC<IProps> = (props: any) => {
/>
case 'abandon':
return <Field
title="作废时间"
title={intl.formatMessage({id: 'transaction_components.zuofeishijian'})}
name="reasonTime"
required
x-component="DatePicker"
......@@ -149,7 +150,7 @@ const ModalOperate: React.FC<IProps> = (props: any) => {
/>
case 'discard':
return <Field
title="作废时间"
title={intl.formatMessage({id: 'transaction_components.zuofeishijian'})}
name="reasonTime"
required
x-component="DatePicker"
......@@ -164,7 +165,7 @@ const ModalOperate: React.FC<IProps> = (props: any) => {
case 'date':
return <>
<Field
title="报价截止时间"
title={intl.formatMessage({id: 'transaction_components.baojiajiezhishijian'})}
name="quotedPriceTime"
required
x-component="DatePicker"
......@@ -179,13 +180,13 @@ const ModalOperate: React.FC<IProps> = (props: any) => {
<Field
name="isNow"
x-component="CheckboxGroup"
description="勾选后供应商不能再提交报价单"
enum={[{ label: '立即截止报价', value: 1 }]}
description={intl.formatMessage({id: 'transaction_components.gouxuanhougongyingshangbuneng'})}
enum={[{ label: intl.formatMessage({id: 'transaction_components.lijijiezhibaojia'}), value: 1 }]}
/>
</>
case 'next':
return <Field
title="下轮报价截止时间"
title={intl.formatMessage({id: 'transaction_components.xialunbaojiajiezhishijian'})}
name="quotedPriceTime"
required
x-component="DatePicker"
......@@ -199,7 +200,7 @@ const ModalOperate: React.FC<IProps> = (props: any) => {
/>
case 'key':
return <Field
title="请输入解密密钥"
title={intl.formatMessage({id: 'transaction_components.qingshurujiemimiyao'})}
x-component="Input"
name="password"
required
......@@ -209,8 +210,8 @@ const ModalOperate: React.FC<IProps> = (props: any) => {
return <Field
enum={
[
{ label: '审核通过', value: 1 },
{ label: '审核不通过', value: 0 }
{ label: intl.formatMessage({ id: 'transaction_components.shenhetongguo' }), value: 1 },
{ label: intl.formatMessage({ id: 'transaction_components.shenhebutongguo' }), value: 0 }
]}
name='status'
required
......@@ -221,8 +222,8 @@ const ModalOperate: React.FC<IProps> = (props: any) => {
return <Field
enum={
[
{ label: '审核通过', value: 1 },
{ label: '审核不通过', value: 0 }
{ label: intl.formatMessage({ id: 'transaction_components.shenhetongguo' }), value: 1 },
{ label: intl.formatMessage({ id: 'transaction_components.shenhebutongguo' }), value: 0 }
]}
name='agree'
required
......@@ -233,8 +234,8 @@ const ModalOperate: React.FC<IProps> = (props: any) => {
return <Field
enum={
[
{ label: '审核通过', value: 1 },
{ label: '审核不通过', value: 0 }
{ label: intl.formatMessage({ id: 'transaction_components.shenhetongguo' }), value: 1 },
{ label: intl.formatMessage({ id: 'transaction_components.shenhebutongguo' }), value: 0 }
]}
name='isPass'
required
......@@ -357,11 +358,11 @@ const ModalOperate: React.FC<IProps> = (props: any) => {
x-component="TextArea"
required
x-component-props={{
placeholder: `在此输入你的内容,最多${maxNumber}个汉字`
placeholder: `${intl.formatMessage({id: 'transaction_components.zaicishurunideneirong'})}${maxNumber}${intl.formatMessage({id: 'transaction_components.gehanzi'})}`
}}
x-rules={{
max: maxNumber,
message: `原因最多${maxNumber}个汉字`
message: `${intl.formatMessage({id: 'transaction_components.yuanyinzuiduo'})}${maxNumber}${intl.formatMessage({id: 'transaction_components.gehanzi'})}`
}}
/>)}
</SchemaForm>
......
import React, { ReactNode } from 'react'
import { Row, Col, Skeleton } from 'antd'
import { history } from 'umi'
import { getIntl, history } from 'umi'
import { ArrowLeftOutlined } from '@ant-design/icons'
import style from './index.less'
import { OrderKindType } from '@/constants/order'
const intl = getIntl();
export interface OrderDetailHeaderProps {
extraRight?: ReactNode,
detailList?: { label: string, name: string, render?(text, record?), [key: string]: any }[],
......@@ -19,9 +19,9 @@ const OrderDetailHeader:React.FC<OrderDetailHeaderProps> = ({ extraRight, detail
// 单独处理请购单 对应单号文案
if(detailData?.orderKind === OrderKindType.REQUISITION_ORDER) {
detailList[0]['label'] = '对应请购单号'
detailList[0]['label'] = intl.formatMessage({id: 'transaction_components.duiyingqinggoudanhao'})
} else {
detailList[0]['label'] = '对应报价单号'
detailList[0]['label'] = intl.formatMessage({id: 'transaction_components.duiyingbaojiadanhao'})
}
return (
......@@ -35,7 +35,7 @@ const OrderDetailHeader:React.FC<OrderDetailHeaderProps> = ({ extraRight, detail
<Col>
<ArrowLeftOutlined onClick={() => history.goBack()}/>
</Col>
<Col className={style.titleAvator}></Col>
<Col className={style.titleAvator}>{intl.formatMessage({id: 'transaction_components.dan'})}</Col>
</Row>
</Col>
}
......@@ -43,7 +43,7 @@ const OrderDetailHeader:React.FC<OrderDetailHeaderProps> = ({ extraRight, detail
<Col style={{flex: 1}}>
<Row justify='space-between' align='middle' style={{paddingTop: 14}}>
<Col style={{flex: 1}}>
<div className={style.titleAvatorText}>订单号: {detailData.orderNo}</div>
<div className={style.titleAvatorText}>{intl.formatMessage({id: 'transaction_components.dingdanhao'})}: {detailData.orderNo}</div>
<Row>
{detailList.map(v => {
const { label, render, name, ...colProps } = v
......
import React, { useEffect, useState, useContext } from 'react'
import { message, Modal } from 'antd'
import { OrderDetailContext } from '../../_public/order/context'
import { history } from 'umi'
import { getIntl, history } from 'umi'
import { useHttpRequest } from '@/hooks/useHttpRequest'
export interface OrderElectronModalProps {
......@@ -9,7 +9,7 @@ export interface OrderElectronModalProps {
type?: 'purchaseOrder' | 'saleOrder',
ctx?: any
}
const intl = getIntl();
//@todo 尚未完成
const OrderElectronModal:React.FC<OrderElectronModalProps> = (props) => {
const { currentRef, type, ctx } = props
......@@ -77,9 +77,9 @@ const OrderElectronModal:React.FC<OrderElectronModalProps> = (props) => {
<Modal
width={1000}
style={{minHeight: 600}}
title='签署电子合同'
okText='签署合同并提交'
cancelText='不签署'
title={intl.formatMessage({id: 'transaction_components.qianshudianzihetong'})}
okText={intl.formatMessage({id: 'transaction_components.qianshuhetongbingtijiao'})}
cancelText={intl.formatMessage({id: 'transaction_components.buqianshu'})}
visible={visible}
onOk={handleSubmit}
// confirmLoading={loading}
......
import React, { useRef, useContext } from 'react'
import { Form, Input } from 'antd';
import './index.less'
import { getIntl } from 'umi';
const intl = getIntl();
export interface ProductTableCellProps {
title: React.ReactNode;
editable: boolean;
......@@ -83,11 +84,11 @@ export const ProductTableCell:React.FC<ProductTableCellProps> = ({
rules={[
{
required: true,
message: `${title}必须填写`,
message: `${title}${intl.formatMessage({id: 'transaction_components.bixutianxie'})}`,
},
{
pattern: /^\d+(\.\d{1,3})?$/,
message: `数量仅限三位小数`,
message: intl.formatMessage({id: 'transaction_components.shuliangjinxiansanweixiaoshu'}),
},
// {
// min: 0,
......
import { ISchema } from "@formily/antd";
import { getIntl } from "umi";
const intl = getIntl();
export const schema: ISchema = {
type: 'object',
properties: {
......@@ -17,10 +18,10 @@ export const schema: ISchema = {
addresId: {
type: 'string',
enum: [],
title: '发货地址',
title: intl.formatMessage({id: 'transaction_components.fahuodizhi'}),
"x-rules": [
{
message: '请选择发货地址',
message: intl.formatMessage({id: 'transaction_components.qingxuanzefahuodizhi'}),
required: true
}
],
......@@ -31,10 +32,10 @@ export const schema: ISchema = {
deliveryTime: {
type: 'string',
"x-component": 'date',
title: '发货日期',
title: intl.formatMessage({id: 'transaction_components.fahuoriqi'}),
"x-rules": [
{
message: '请选择发货日期',
message: intl.formatMessage({id: 'transaction_components.qingxuanzefahuoriqi'}),
required: true
}
],
......@@ -45,7 +46,7 @@ export const schema: ISchema = {
},
logisticsNo: {
type: 'string',
title: '物流单号',
title: intl.formatMessage({id: 'transaction_components.wuliudanhao'}),
"x-rules": [
{
limitByte: true,
......@@ -59,7 +60,7 @@ export const schema: ISchema = {
logisticsCompanyId: {
type: 'string',
enum: [],
title: '物流公司',
title: intl.formatMessage({id: 'transaction_components.wuliugongsi'}),
"x-mega-props": {
span: 1
}
......@@ -95,67 +96,67 @@ export const schema: ISchema = {
// 商品列 @todo 补充积分类型文案
export const productColumns: any = [
{
title: '商品ID',
title: intl.formatMessage({id: 'transaction_components.shangpinID'}),
dataIndex: 'skuId',
align: 'center',
key: 'skuId'
},
{
title: '商品名称',
title: intl.formatMessage({id: 'transaction_components.shangpinmingcheng'}),
dataIndex: 'name',
align: 'center',
key: 'name',
},
{
title: '品类',
title: intl.formatMessage({id: 'transaction_components.pinlei'}),
dataIndex: 'category',
align: 'center',
key: 'category'
},
{
title: '品牌',
title: intl.formatMessage({id: 'transaction_components.pinpai'}),
dataIndex: 'brand',
align: 'center',
key: 'brand',
},
{
title: '单位',
title: intl.formatMessage({id: 'transaction_components.danwei'}),
dataIndex: 'unit',
align: 'center',
key: 'unit'
},
// {
// title: '单价',
// title: intl.formatMessage({id: 'transaction_components.danjia'}),
// dataIndex: 'price',
// align: 'center',
// key: 'price',
// },
{
title: '已发货',
title: intl.formatMessage({id: 'transaction_components.yifahuo'}),
dataIndex: 'delivered',
align: 'center',
key: 'delivered',
},
{
title: '未发货',
title: intl.formatMessage({id: 'transaction_components.weifahuo'}),
dataIndex: 'leftCount',
align: 'center',
key: 'leftCount',
},
{
title: '已收货',
title: intl.formatMessage({id: 'transaction_components.yishouhuo'}),
dataIndex: 'received',
align: 'center',
key: 'received',
},
{
title: '差异数量',
title: intl.formatMessage({id: 'transaction_components.chayishuliang'}),
dataIndex: 'differCount',
align: 'center',
key: 'differCount',
},
{
title: '发货数量',
title: intl.formatMessage({id: 'transaction_components.fahuoshuliang'}),
dataIndex: 'deliveryCount',
align: 'left',
key: 'deliveryCount',
......@@ -176,75 +177,75 @@ export const materialColumns: any = [
className: 'commonHide'
},
{
title: '物料编号',
title: intl.formatMessage({id: 'transaction_components.wuliaobianhao'}),
dataIndex: 'productNo',
align: 'center',
key: 'productNo',
},
{
title: '物料名称/规格',
title: intl.formatMessage({id: 'transaction_components.wuliaomingchengguige'}),
dataIndex: 'name',
align: 'center',
key: 'name',
// render: (t, r) => `${t}/${r.type}`
},
{
title: '品类',
title: intl.formatMessage({id: 'transaction_components.pinlei'}),
dataIndex: 'category',
align: 'center',
key: 'category',
},
{
title: '品牌',
title: intl.formatMessage({id: 'transaction_components.pinpai'}),
dataIndex: 'brand',
align: 'center',
key: 'brand',
},
{
title: '单位',
title: intl.formatMessage({id: 'transaction_components.danwei'}),
dataIndex: 'unit',
align: 'center',
key: 'unit',
},
{
title: '关联报价商品ID/名称/规格/品类/品牌',
title: intl.formatMessage({id: 'transaction_components.guanlianbaojiashangpinIDming'}),
dataIndex: 'quotedSkuId',
align: 'center',
key: 'quotedSkuId',
render: (t, r) => t ? `${t}/${r.quotedName || ''}/${r.quotedCategory || ''}/${r.quotedBrand || ''}` : ''
},
{
title: '采购数量',
title: intl.formatMessage({id: 'transaction_components.caigoushuliang'}),
dataIndex: 'quantity',
align: 'center',
key: 'quantity',
},
{
title: '已发货',
title: intl.formatMessage({id: 'transaction_components.yifahuo'}),
dataIndex: 'delivered',
align: 'center',
key: 'delivered',
},
{
title: '未发货',
title: intl.formatMessage({id: 'transaction_components.weifahuo'}),
dataIndex: 'leftCount',
align: 'center',
key: 'leftCount',
},
{
title: '已收货',
title: intl.formatMessage({id: 'transaction_components.yishouhuo'}),
dataIndex: 'received',
align: 'center',
key: 'received',
},
{
title: '差异数量',
title: intl.formatMessage({id: 'transaction_components.chayishuliang'}),
dataIndex: 'differCount',
align: 'center',
key: 'differCount',
},
{
title: '发货数量',
title: intl.formatMessage({id: 'transaction_components.fahuoshuliang'}),
dataIndex: 'deliveryCount',
align: 'left',
key: 'deliveryCount',
......
......@@ -2,7 +2,7 @@ import React, { useContext, useRef, useEffect, useState } from 'react'
import { Button, Drawer } from 'antd'
import NiceForm from '@/components/NiceForm'
import { createFormActions } from '@formily/antd'
import { history } from 'umi'
import { getIntl, history } from 'umi'
import { useAsyncSelect } from '@/formSchema/effects/useAsyncSelect'
import { OrderDetailContext } from '../../_public/order/context'
import moment from 'moment'
......@@ -15,7 +15,7 @@ import { getLogisticsSelectListCompany, getLogisticsSelectListShipperAddress } f
export interface OrderHandDeleveModalProps {
currentRef: any
}
const intl = getIntl();
const schemaActions = createFormActions()
const OrderHandDeleveModal:React.FC<OrderHandDeleveModalProps> = (props) => {
......@@ -80,16 +80,16 @@ const OrderHandDeleveModal:React.FC<OrderHandDeleveModalProps> = (props) => {
}}
>
<Button onClick={handleConfirm} type="primary" loading={loading} style={{ marginRight: 8 }}>
确定
{intl.formatMessage({id: 'transaction_components.queding'})}
</Button>
<Button onClick={()=>setVisible(false)}>
取消
{intl.formatMessage({id: 'transaction_components.quxiao'})}
</Button>
</div>)
return (
<Drawer
title='手工发货'
title={intl.formatMessage({id: 'transaction_components.shougongfahuo'})}
width={1400}
bodyStyle={{ paddingLeft: 0, paddingTop: 0 }}
onClose={onClose}
......
......@@ -2,13 +2,13 @@ import React, { useContext, useState, useEffect } from 'react'
import { Modal, Row, Col } from 'antd'
import { useHttpRequest } from '@/hooks/useHttpRequest'
import { OrderDetailContext } from '../../_public/order/context'
import { history } from 'umi'
import { getIntl, history } from 'umi'
import moment from 'moment'
export interface OrderHandReceivedModalProps {
currentRef: any
}
const intl = getIntl();
const OrderHandReceivedModal:React.FC<OrderHandReceivedModalProps> = ({currentRef}) => {
const { data } = useContext(OrderDetailContext)
......@@ -34,7 +34,7 @@ const OrderHandReceivedModal:React.FC<OrderHandReceivedModalProps> = ({currentRe
}, [])
return <Modal
title='收货信息'
title={intl.formatMessage({id: 'transaction_components.shouhuoxinxi'})}
onOk={handleConfirm}
onCancel={() => setConfirmVisible(false)}
visible={confirmVisible}
......@@ -44,19 +44,19 @@ const OrderHandReceivedModal:React.FC<OrderHandReceivedModalProps> = ({currentRe
formData &&
<>
<Row>
<Col span={6}><p>发货地址: </p></Col>
<Col span={6}><p>{intl.formatMessage({id: 'transaction_components.fahuodizhi'})}: </p></Col>
<Col><p>{formData.name}</p></Col>
</Row>
<Row>
<Col span={6}><p>发货时间: </p></Col>
<Col span={6}><p>{intl.formatMessage({id: 'transaction_components.fahuoshijian'})}: </p></Col>
<Col><p>{moment(formData.deliverTime).format('YYYY-MM-DD')}</p></Col>
</Row>
<Row>
<Col span={6}><p>物流单号: </p></Col>
<Col span={6}><p>{intl.formatMessage({id: 'transaction_components.wuliudanhao'})}: </p></Col>
<Col><p><a href={`https://www.kuaidi100.com/chaxun?nu=${formData.deliverNo}`} target="_blank">{formData.deliverNo}</a></p></Col>
</Row>
<Row>
<Col span={6}><p>物流公司: </p></Col>
<Col span={6}><p>{intl.formatMessage({id: 'transaction_components.wuliugongsi'})}: </p></Col>
<Col><p>{formData.logisticsCompany}</p></Col>
</Row>
</>
......
......@@ -2,12 +2,12 @@ import React, { useState, useEffect, useContext, useRef } from 'react'
import { Modal, List, Button, Space } from 'antd'
import { usePageStatus } from '@/hooks/usePageStatus'
import { OrderDetailContext } from '../../_public/order/context'
import { history } from 'umi'
import { getIntl, history } from 'umi'
import OverflowText from '@/components/OverflowText'
import { useHttpRequest } from '@/hooks/useHttpRequest'
import ImagePreview from '@/components/ImagePreview'
import { postOrderVendorValidatePayConfirm } from '@/services/OrderNewV2Api'
const intl = getIntl();
export interface OrderPayResultModalProps {
type: 'default' | 'preview',
currentRef: any
......@@ -49,14 +49,14 @@ const OrderPayResultModal:React.FC<OrderPayResultModalProps> = ({type, currentRe
return (
<Modal
title={type === 'default' ? '确认支付结果' : '查看支付结果'}
title={type === 'default' ? intl.formatMessage({id: 'transaction_components.querenzhifujieguo'}) : intl.formatMessage({id: 'transaction_components.zhakanzhifujieguo'})}
visible={visible}
onCancel={handleCancel}
confirmLoading={loading}
footer={(type === 'default' && transData) ? <Space>
<Button onClick={handleCancel}>取消</Button>
<Button onClick={() => handleConfirm(0)} type='dashed'>确认未到账</Button>
<Button onClick={() => handleConfirm(1)} type='primary'>确认到账</Button>
<Button onClick={handleCancel}>{intl.formatMessage({id: 'transaction_components.quxiao'})}</Button>
<Button onClick={() => handleConfirm(0)} type='dashed'>{intl.formatMessage({id: 'transaction_components.querenweidaozhang'})}</Button>
<Button onClick={() => handleConfirm(1)} type='primary'>{intl.formatMessage({id: 'transaction_components.querendaozhang'})}</Button>
</Space> : null}
>
<List
......@@ -64,7 +64,7 @@ const OrderPayResultModal:React.FC<OrderPayResultModalProps> = ({type, currentRe
dataSource={transData || []}
renderItem={(item: string, index: number) => (
// <List.Item style={{fontSize: 12}} extra={<Button type='link' onClick={() => imgRef.current.toggle(index)}>预览</Button>}>
<List.Item style={{fontSize: 12}} extra={<Button type='link' href={item} target="_blank">预览</Button>}>
<List.Item style={{fontSize: 12}} extra={<Button type='link' href={item} target="_blank">{intl.formatMessage({id: 'transaction_components.yulan'})}</Button>}>
<OverflowText style={{flex: '.9'}}>
{item}
</OverflowText>
......
import React, { useContext, useEffect, useRef, useState } from 'react'
import { Row, Col, Modal, List, Table, Button, Form, Input } from 'antd'
import { history } from 'umi'
import { getIntl, history } from 'umi'
import { OrderDetailContext } from '../../_public/order/context'
import MellowCard from '@/components/MellowCard'
import OverflowText from '@/components/OverflowText'
import { EditOutlined } from '@ant-design/icons'
import { postOrderVendorValidateSubmitPaymentUpdate } from '@/services/OrderNewV2Api'
const intl = getIntl();
// table编辑控件
const EditableContext = React.createContext<any>({});
interface EditableRowProps {
......@@ -76,11 +76,11 @@ const EditableCell: React.FC<EditableCellProps> = ({
rules={[
{
required: true,
message: `此项为必填项`,
message: intl.formatMessage({ id: 'transaction_components.cixiangweibitianxiang' }),
},
{
pattern: /^\d+(\.\d{1,2})?$/,
message: `支付比例仅限两位小数`,
message: intl.formatMessage({ id: 'transaction_components.zhifubilijinxianliangwei' }),
}
]}
>
......@@ -89,7 +89,7 @@ const EditableCell: React.FC<EditableCellProps> = ({
) : (
<div className="editable-cell-value-wrap" style={{ paddingRight: 24 }} onClick={toggleEdit}>
{children}
<EditOutlined/>
<EditOutlined />
</div>
);
}
......@@ -102,9 +102,9 @@ const EditableCell: React.FC<EditableCellProps> = ({
* 展示 支付比例和简单流程的发货信息
*/
export interface OrderPayTabsProps {}
export interface OrderPayTabsProps { }
const OrderPayTabs:React.FC<OrderPayTabsProps> = () => {
const OrderPayTabs: React.FC<OrderPayTabsProps> = () => {
const [visible, setVisible] = useState(false)
const [urlsDatas, setUrlsDatas] = useState([])
const { data, ctl, reloadFormData } = useContext(OrderDetailContext)
......@@ -120,9 +120,9 @@ const OrderPayTabs:React.FC<OrderPayTabsProps> = () => {
useEffect(() => {
// 过滤支付信息 取第一个待支付或者未到账的id
if(payments.length) {
if (payments.length) {
let payment = payments.filter(item => item.showPayment)
if(payment.length) {
if (payment.length) {
ctl.setPayId(payment[0].paymentId)
}
}
......@@ -147,8 +147,8 @@ const OrderPayTabs:React.FC<OrderPayTabsProps> = () => {
postOrderVendorValidateSubmitPaymentUpdate({
orderId: data.orderId,
payRates: newData.map(item => ({ batchNo: item.batchNo, payRate: item.payRate }))
}).then(res=>{
if(res.code === 1000) {
}).then(res => {
if (res.code === 1000) {
reloadFormData()
}
})
......@@ -167,25 +167,25 @@ const OrderPayTabs:React.FC<OrderPayTabsProps> = () => {
className: 'commonHide',
},
{
title: '支付次数',
title: intl.formatMessage({ id: 'transaction_components.zhifucishu' }),
dataIndex: 'batchNo',
align: 'center',
key: 'batchNo',
},
{
title: '支付环节',
title: intl.formatMessage({ id: 'transaction_components.zhifuhuanjie' }),
dataIndex: 'payNode',
align: 'center',
key: 'payNode',
},
{
title: '外部状态',
title: intl.formatMessage({ id: 'transaction_components.waibuzhuangtai' }),
dataIndex: 'outerStatusName',
align: 'center',
key: 'outerStatusName',
},
{
title: '支付比例(%)',
title: intl.formatMessage({ id: 'transaction_components.zhifubili' }),
key: 'payRate',
dataIndex: 'payRate',
formItem: 'input',
......@@ -196,30 +196,30 @@ const OrderPayTabs:React.FC<OrderPayTabsProps> = () => {
// },
},
{
title: creditsCommodity ? '积分' : '支付金额',
title: creditsCommodity ? intl.formatMessage({id: 'transaction_components.jifen'}) : intl.formatMessage({id: 'transaction_components.zhifujine'}),
dataIndex: 'payAmount',
align: 'center',
key: 'payAmount',
render: (t, r) => creditsCommodity ? t : `¥${t}`
},
{
title: '支付方式',
title: intl.formatMessage({id: 'transaction_components.zhifufangshi'}),
dataIndex: 'payTypeName',
align: 'center',
key: 'payTypeName',
},
{
title: '支付渠道',
title: intl.formatMessage({id: 'transaction_components.zhifuqudao'}),
dataIndex: 'payChannelName',
align: 'center',
key: 'payChannelName',
},
{
title: '操作',
title: intl.formatMessage({ id: 'transaction_components.caozuo' }),
dataIndex: 'operation',
align: 'center',
key: 'operation',
render: (t, r) => r.showView && <Button type="link" onClick={()=>handlePreivew(r.batchNo)}>查看</Button>
render: (t, r) => r.showView && <Button type="link" onClick={() => handlePreivew(r.batchNo)}>{intl.formatMessage({id: 'transaction_components.zhakan'})}</Button>
}
]
......@@ -249,20 +249,20 @@ const OrderPayTabs:React.FC<OrderPayTabsProps> = () => {
return (
<>
<Row gutter={24} style={{marginTop: 24, marginBottom: 24}}>
<Col span={processEnum === 24 ? 12 : 24}>
<MellowCard title="支付信息" bordered={false} fullHeight>
<Table
columns={editColumns}
dataSource={payments}
components={paymentComponents}
rowKey='paymentId'
pagination={false}
/>
</MellowCard>
</Col>
{/* @todo 简单流程的发货信息 显示 */}
{/* {
<Row gutter={24} style={{ marginTop: 24, marginBottom: 24 }}>
<Col span={processEnum === 24 ? 12 : 24}>
<MellowCard title={intl.formatMessage({id: 'transaction_components.zhifuxinxi'})} bordered={false} fullHeight>
<Table
columns={editColumns}
dataSource={payments}
components={paymentComponents}
rowKey='paymentId'
pagination={false}
/>
</MellowCard>
</Col>
{/* @todo 简单流程的发货信息 显示 */}
{/* {
processEnum === 24 && data &&
<Col span={12}>
<MellowCard title="发货信息" fullHeight>
......@@ -285,25 +285,25 @@ const OrderPayTabs:React.FC<OrderPayTabsProps> = () => {
</MellowCard>
</Col>
} */}
</Row>
<Modal
title='查看支付结果'
visible={visible}
onCancel={()=>setVisible(false)}
footer={null}
>
<List
itemLayout="horizontal"
dataSource={ urlsDatas || []}
renderItem={(item: string, index: number) => (
<List.Item style={{fontSize: 12}} extra={<a href={urlsDatas[index]} target='_blank'>预览</a>}>
<OverflowText style={{flex: '.9'}}>
{item}
</OverflowText>
</List.Item>
)}
/>
</Modal>
</Row>
<Modal
title={intl.formatMessage({id: 'transaction_components.zhakanzhifujieguo'})}
visible={visible}
onCancel={() => setVisible(false)}
footer={null}
>
<List
itemLayout="horizontal"
dataSource={urlsDatas || []}
renderItem={(item: string, index: number) => (
<List.Item style={{ fontSize: 12 }} extra={<a href={urlsDatas[index]} target='_blank'>{intl.formatMessage({id: 'transaction_components.yulan'})}</a>}>
<OverflowText style={{ flex: '.9' }}>
{item}
</OverflowText>
</List.Item>
)}
/>
</Modal>
</>
)
}
......
......@@ -7,11 +7,12 @@ import { createFormActions } from '@formily/antd'
import MellowCard from '@/components/MellowCard'
import { OrderKindType } from '@/constants/order'
import { AddressPop } from '../addressPop'
import { getIntl } from 'umi'
export interface OrderProductTableProps {
editable: boolean
}
const intl = getIntl();
// 订单商品cell切换
const EditableContext = React.createContext<any>({});
......@@ -53,29 +54,29 @@ export const MoneyTotalBox = ({ dataSource, preview }) => {
return <RowStyle>
<Col span={2}>
<div>{creditsCommodity ? '合计所需积分' : '合计金额'}</div>
<div>{creditsCommodity ? intl.formatMessage({id: 'transaction_components.hejisuoxujifen'}) : intl.formatMessage({id: 'transaction_components.hejijine'})}</div>
<div>{creditsCommodity ? sum : `¥${sum}`}</div>
</Col>
{
!creditsCommodity && <Col span={2}>
<div>促销立减</div>
<div>{intl.formatMessage({id: 'transaction_components.cuxiaolijian'})}</div>
<div>{`-¥${promotionAmount}`}</div>
</Col>
}
{
!creditsCommodity && <Col span={2}>
<div>优惠抵扣</div>
<div>{intl.formatMessage({id: 'transaction_components.youhuidikou'})}</div>
<div>{`-¥${couponAmount}`}</div>
</Col>
}
{
contractOrder ? null : <>
<Col span={2}>
<div>运费</div>
<div>{intl.formatMessage({id: 'transaction_components.yunfei'})}</div>
<div>{`¥${freight}`}</div>
</Col>
<Col span={2}>
<div>{creditsCommodity ? '总计所需积分' : '总计金额'}</div>
<div>{creditsCommodity ? intl.formatMessage({id: 'transaction_components.zongjisuoxujifen'}) : intl.formatMessage({id: 'transaction_components.zongjijine'})}</div>
<div>{creditsCommodity ? amountMoney : `¥${amountMoney}`}</div>
</Col>
</>
......@@ -152,7 +153,7 @@ const EditableCell: React.FC<EditableCellProps> = ({
rules={[
{
required: true,
message: `此项为必填项`,
message: intl.formatMessage({id: 'transaction_components.cixiangweibitianxiang'}),
},
]}
>
......@@ -237,38 +238,38 @@ const OrderProductTable:React.FC<OrderProductTableProps> = ({editable}) => {
key: 'skuId',
},
{
title: '商品名称',
title: intl.formatMessage({id: 'transaction_components.shangpinmingcheng'}),
dataIndex: 'name',
align: 'center',
key: 'name',
render: (t, r) => `${t}/${r.spec}`
},
{
title: '品类',
title: intl.formatMessage({id: 'transaction_components.pinlei'}),
dataIndex: 'category',
align: 'center',
key: 'category',
},
{
title: '品牌',
title: intl.formatMessage({id: 'transaction_components.pinpai'}),
dataIndex: 'brand',
align: 'center',
key: 'brand',
},
{
title: '单位',
title: intl.formatMessage({id: 'transaction_components.danwei'}),
dataIndex: 'unit',
align: 'center',
key: 'unit',
},
{
title: creditsCommodity ? '所需积分' : '单价(元)',
title: creditsCommodity ? intl.formatMessage({id: 'transaction_components.suoxujifen'}) : intl.formatMessage({id: 'transaction_components.danjiayuan'}),
dataIndex: 'price',
align: 'left',
key: 'price'
},
{
title: '会员折扣',
title: intl.formatMessage({id: 'transaction_components.huiyuanzhekou'}),
dataIndex: 'discount',
align: 'center',
key: 'discount',
......@@ -276,34 +277,34 @@ const OrderProductTable:React.FC<OrderProductTableProps> = ({editable}) => {
render: (text, record) => text + '%'
},
{
title: creditsCommodity ? '兑换数量' : '采购数量',
title: creditsCommodity ? intl.formatMessage({id: 'transaction_components.duihuanshuliang'}) : intl.formatMessage({id: 'transaction_components.caigoushuliang'}),
dataIndex: 'quantity',
align: 'center',
key: 'quantity',
editable: true
},
{
title: '含税',
title: intl.formatMessage({id: 'transaction_components.hanshui'}),
dataIndex: 'tax',
align: 'center',
key: 'tax',
render: (t, r) => t ? '是' : '否'
render: (t, r) => t ? intl.formatMessage({id: 'transaction_components.shi'}) : intl.formatMessage({id: 'transaction_components.fou'})
},
{
title: '税率',
title: intl.formatMessage({id: 'transaction_components.shuil'}),
dataIndex: 'taxRate',
align: 'center',
key: 'taxRate',
render: (t, r) => t ? `${t}%` : null
},
{
title: creditsCommodity ? '所需积分小计' : '金额',
title: creditsCommodity ? intl.formatMessage({id: 'transaction_components.suoxujifenxiaoji'}) : intl.formatMessage({id: 'transaction_components.jine'}),
dataIndex: 'amount',
align: 'center',
key: 'amount',
},
{
title: '配送方式',
title: intl.formatMessage({id: 'transaction_components.peisongfangshi'}),
dataIndex: 'deliverType',
align: 'center',
key: 'deliverType',
......@@ -322,45 +323,45 @@ const OrderProductTable:React.FC<OrderProductTableProps> = ({editable}) => {
className: 'commonHide'
},
{
title: '物料编号',
title: intl.formatMessage({id: 'transaction_components.wuliaobianhao'}),
dataIndex: 'productNo',
align: 'center',
key: 'productNo',
},
{
title: '物料名称/规格',
title: intl.formatMessage({id: 'transaction_components.wuliaomingchengguige'}),
dataIndex: 'name',
align: 'center',
key: 'name',
render: (t, r) => <>{t}/{r.spec}</>
},
{
title: '品类',
title: intl.formatMessage({id: 'transaction_components.pinlei'}),
dataIndex: 'category',
align: 'center',
key: 'category',
},
{
title: '品牌',
title: intl.formatMessage({id: 'transaction_components.pinpai'}),
dataIndex: 'brand',
align: 'center',
key: 'brand',
},
{
title: '单位',
title: intl.formatMessage({id: 'transaction_components.danwei'}),
dataIndex: 'unit',
align: 'center',
key: 'unit',
},
{
title: '关联报价商品ID/名称/规格/品类/品牌',
title: intl.formatMessage({id: 'transaction_components.guanlianbaojiashangpinIDming'}),
dataIndex: 'quotedSkuId',
align: 'center',
key: 'quotedSkuId',
render: (t, r) => t ? `${t}/${r.quotedName}/${r.quotedCategory}/${r.quotedBrand}` : ''
},
{
title: '单价(元)',
title: intl.formatMessage({id: 'transaction_components.danjiayuan'}),
dataIndex: 'price',
align: 'left',
key: 'price',
......@@ -372,33 +373,33 @@ const OrderProductTable:React.FC<OrderProductTableProps> = ({editable}) => {
// key: 'stock',
// },
{
title: '采购数量',
title: intl.formatMessage({id: 'transaction_components.caigoushuliang'}),
dataIndex: 'quantity',
align: 'center',
key: 'quantity',
},
{
title: '含税',
title: intl.formatMessage({id: 'transaction_components.hanshui'}),
dataIndex: 'tax',
align: 'center',
key: 'tax',
render: (t, r) => t ? '是' : '否'
render: (t, r) => t ? intl.formatMessage({id: 'transaction_components.shi'}) : intl.formatMessage({id: 'transaction_components.fou'})
},
{
title: '税率',
title: intl.formatMessage({id: 'transaction_components.shuil'}),
dataIndex: 'taxRate',
align: 'center',
key: 'taxRate',
render: (t, r) => t ? `${t}%` : null
},
{
title: '金额',
title: intl.formatMessage({id: 'transaction_components.jine'}),
dataIndex: 'amount',
align: 'center',
key: 'amount',
},
{
title: '配送方式',
title: intl.formatMessage({id: 'transaction_components.peisongfangshi'}),
dataIndex: 'deliverType',
align: 'center',
key: 'deliverType',
......@@ -425,7 +426,7 @@ const OrderProductTable:React.FC<OrderProductTableProps> = ({editable}) => {
};
});
return (
<MellowCard title={contractOrder ? '订单物料' : '订单商品'} style={{marginTop: 24}} bordered={false}>
<MellowCard title={contractOrder ? intl.formatMessage({id: 'transaction_components.dingdanwuliao'}) : intl.formatMessage({id: 'transaction_components.dingdanshangpin'})} style={{marginTop: 24}} bordered={false}>
<Table
columns={ contractOrder ? materialInfo : productInfoColumns }
dataSource={product.products}
......
......@@ -4,46 +4,47 @@ import StatusColors from '../statusColors'
import { formatTimeString } from '@/utils'
import { OrderDetailContext } from '../../_public/order/context'
import MellowCard from '@/components/MellowCard'
import { getIntl } from 'umi'
export interface OrderTransformRecordProps {
type: 'saleOrder' | 'purchaseOrder'
}
const intl = getIntl();
const outOrderCols: any[] = [
{
title: '流转顺序号',
title: intl.formatMessage({id: 'transaction_components.liuzhuanshunxuhao'}),
dataIndex: 'no',
align: 'center',
key: 'no',
render: (_, __, index: number) => index + 1
},
{
title: '操作角色',
title: intl.formatMessage({id: 'transaction_components.caozuojuese'}),
dataIndex: 'operatorRoleName',
align: 'center',
key: 'operatorRoleName',
},
{
title: '状态',
title: intl.formatMessage({id: 'transaction_components.zhuangtai'}),
dataIndex: 'statusName',
align: 'center',
key: 'statusName',
},
{
title: '操作',
title: intl.formatMessage({ id: 'transaction_components.caozuo' }),
dataIndex: 'operation',
align: 'center',
key: 'operation',
},
{
title: '操作时间',
title: intl.formatMessage({id: 'transaction_components.caozuoshijian'}),
dataIndex: 'createTime',
align: 'center',
key: 'createTime',
render: time => formatTimeString(time)
},
{
title: '审核意见',
title: intl.formatMessage({id: 'transaction_components.shenheyijian'}),
dataIndex: 'remark',
align: 'center',
key: 'remark',
......@@ -51,51 +52,51 @@ const outOrderCols: any[] = [
]
const PurchaseSideOrderCols: any[] = [
{
title: '流转记录',
title: intl.formatMessage({id: 'transaction_components.liuzhuanjilu'}),
dataIndex: 'no',
align: 'center',
key: 'no',
render: (_, __, index: number) => index + 1
},
{
title: '操作人',
title: intl.formatMessage({id: 'transaction_components.caozuoren'}),
dataIndex: 'operator',
align: 'center',
key: 'operator',
},
{
title: '部门',
title: intl.formatMessage({id: 'transaction_components.bumen'}),
dataIndex: 'department',
align: 'center',
key: 'department',
},
{
title: '职位',
title: intl.formatMessage({id: 'transaction_components.zhiwei'}),
dataIndex: 'jobTitle',
align: 'center',
key: 'jobTitle',
},
{
title: '状态',
title: intl.formatMessage({id: 'transaction_components.zhuangtai'}),
dataIndex: 'statusName',
align: 'center',
key: 'statusName',
},
{
title: '操作',
title: intl.formatMessage({ id: 'transaction_components.caozuo' }),
dataIndex: 'operation',
align: 'center',
key: 'operation',
},
{
title: '操作时间',
title: intl.formatMessage({id: 'transaction_components.caozuoshijian'}),
dataIndex: 'createTime',
align: 'center',
key: 'createTime',
render: text => formatTimeString(text)
},
{
title: '审核意见',
title: intl.formatMessage({id: 'transaction_components.shenheyijian'}),
dataIndex: 'remark',
align: 'center',
key: 'remark',
......@@ -104,52 +105,52 @@ const PurchaseSideOrderCols: any[] = [
const SaleSideOrderCols: any[] = [
{
title: '流转记录',
title: intl.formatMessage({id: 'transaction_components.liuzhuanjilu'}),
dataIndex: 'no',
align: 'center',
key: 'no',
render: (_, __, index: number) => index + 1
},
{
title: '操作人',
title: intl.formatMessage({id: 'transaction_components.caozuoren'}),
dataIndex: 'operator',
align: 'center',
key: 'operator',
},
{
title: '部门',
title: intl.formatMessage({id: 'transaction_components.bumen'}),
dataIndex: 'department',
align: 'center',
key: 'department',
},
{
title: '职位',
title: intl.formatMessage({id: 'transaction_components.zhiwei'}),
dataIndex: 'jobTitle',
align: 'center',
key: 'jobTitle',
},
{
title: '状态',
title: intl.formatMessage({id: 'transaction_components.zhuangtai'}),
dataIndex: 'statusName',
align: 'center',
key: 'statusName',
// render: (text, record) => <StatusColors status={text} type='transformSaleInside' text={record.stateName} />
},
{
title: '操作',
title: intl.formatMessage({ id: 'transaction_components.caozuo' }),
dataIndex: 'operation',
align: 'center',
key: 'operation',
},
{
title: '操作时间',
title: intl.formatMessage({id: 'transaction_components.caozuoshijian'}),
dataIndex: 'createTime',
align: 'center',
key: 'createTime',
render: text => formatTimeString(text)
},
{
title: '审核意见',
title: intl.formatMessage({id: 'transaction_components.shenheyijian'}),
dataIndex: 'remark',
align: 'center',
key: 'remark',
......@@ -166,7 +167,7 @@ const OrderTransformRecord:React.FC<OrderTransformRecordProps> = ({type}) => {
(outerHistories?.length > 0 || innerHistories?.length > 0) &&
<MellowCard style={{marginTop: 24}} bordered={false}>
<Tabs defaultActiveKey="1">
<Tabs.TabPane tab='外部订单流转记录' key="1">
<Tabs.TabPane tab={intl.formatMessage({id: 'transaction_components.waibudingdanliuzhuanjilu'})} key="1">
<Table
columns={outOrderCols}
dataSource={outerHistories}
......@@ -175,7 +176,7 @@ const OrderTransformRecord:React.FC<OrderTransformRecordProps> = ({type}) => {
/>
</Tabs.TabPane>
{
innerHistories?.length > 0 && <Tabs.TabPane tab='内部订单流转记录' key="2">
innerHistories?.length > 0 && <Tabs.TabPane tab={intl.formatMessage({id: 'transaction_components.neibudingdanliuzhuanjilu'})} key="2">
<Table
columns={type === 'saleOrder' ? SaleSideOrderCols : PurchaseSideOrderCols}
dataSource={innerHistories}
......
/*
* @Author: LeeJiancong
* @Date: 2020-09-10 11:00:17
* @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-09-10 11:17:09
*/
/**
* @description: 需求选择
* @param {type}
* @return {type}
*/
import React, { Component } from 'react';
import {Space,Radio,Tooltip} from 'antd'
import {QuestionCircleOutlined} from '@ant-design/icons'
export interface plarms{
platType: number;//类型 1平台 2系统匹配 3会员选择
changePlatform?: Function;//事件
disabled?: boolean;
}
const PlatType: React.FC<plarms> = (props) => {
return (
<Space size={16}>
<Radio.Group disabled={props.disabled} value={props.platType} onChange={(e) => props.changePlatform(e)}>
<Radio value={1}>
发布至平台
<Tooltip title="需求发布至企业商城求购频">
<QuestionCircleOutlined />
</Tooltip>
</Radio>
<Radio value={2}>
系统匹配
<Tooltip title="系统通过需求单品类、商品属性、适用地市与平台会员发布的商品品类、
商品属性、归属地区进行匹配,推荐满足条件的平台会员">
<QuestionCircleOutlined />
</Tooltip>
</Radio>
<Radio value={3}>
指定会员
<Tooltip title="选择与当前会员有归属关系的会员且角色类型为服务提供的会员(供应商),
需求只发送给指定会员">
<QuestionCircleOutlined />
</Tooltip>
</Radio>
</Radio.Group>
</Space>
)
}
PlatType.defaultProps ={
platType: 1,
disabled: false
}
export default PlatType
\ No newline at end of file
/*
* @Author: LeeJiancong
* @Date: 2020-09-10 11:00:17
* @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-09-10 11:17:09
*/
/**
* @description: 需求选择
* @param {type}
* @return {type}
*/
import React, { Component } from 'react';
import {Space,Radio,Tooltip} from 'antd'
import {QuestionCircleOutlined} from '@ant-design/icons'
import { getIntl } from 'umi';
export interface plarms{
platType: number;//类型 1平台 2系统匹配 3会员选择
changePlatform?: Function;//事件
disabled?: boolean;
}
const intl = getIntl();
const PlatType: React.FC<plarms> = (props) => {
return (
<Space size={16}>
<Radio.Group disabled={props.disabled} value={props.platType} onChange={(e) => props.changePlatform(e)}>
<Radio value={1}>
{intl.formatMessage({id: 'transaction_components.fabuzhipingtai'})}
<Tooltip title={intl.formatMessage({id: 'transaction_components.xuqiufabuzhiqiyeshang'})}>
<QuestionCircleOutlined />
</Tooltip>
</Radio>
<Radio value={2}>
{intl.formatMessage({id: 'transaction_components.xitongpipei'})}
<Tooltip title={intl.formatMessage({id: 'transaction_components.xitongtongguoxuqiudanpin'})}>
<QuestionCircleOutlined />
</Tooltip>
</Radio>
<Radio value={3}>
{intl.formatMessage({id: 'transaction_components.zhidinghuiyuan'})}
<Tooltip title={intl.formatMessage({id: 'transaction_components.xuanzeyudangqianhuiyuanyou'})}>
<QuestionCircleOutlined />
</Tooltip>
</Radio>
</Radio.Group>
</Space>
)
}
PlatType.defaultProps ={
platType: 1,
disabled: false
}
export default PlatType
import React from 'react'
import { Tag } from 'antd'
import { getIntl } from 'umi';
export interface IStatusColor {
[key: string]: {
......@@ -14,7 +15,7 @@ export interface StatusColorsProps {
text?: string,
type: 'out' | 'inside' | 'saleInside' | 'payOut' | 'deliveInside' | 'inquiry' | 'transformOut' | 'transformInside' | 'transformSaleInside'
}
const intl = getIntl();
export enum ORDER_EXAMINE_ENUM {
/**
......@@ -54,13 +55,13 @@ export enum ORDER_EXAMINE_ENUM {
}
export const ORDER_EXAMINE_LIST = ['',
'新增订单',
'一级审核中',
'二级审核中',
'提交订单',
'提交成功',
'一级审核不通过',
'二级审核不通过'
intl.formatMessage({ id: 'transaction_components.xinzengdingdan' }),
intl.formatMessage({ id: 'transaction_components.yijishenhezhong' }),
intl.formatMessage({ id: 'transaction_components.erjishenhezhong' }),
intl.formatMessage({ id: 'transaction_components.tijiaodingdan' }),
intl.formatMessage({ id: 'transaction_components.tijiaochenggong' }),
intl.formatMessage({ id: 'transaction_components.yijishenhebutongguo' }),
intl.formatMessage({ id: 'transaction_components.erjishenhebutongguo' })
]
// 状态颜色映射
......@@ -85,7 +86,7 @@ const matchStatusColor = (status: number): string => {
}
// 订单内部状态显示
const StatusColors:React.FC<StatusColorsProps> = (props) => {
const StatusColors: React.FC<StatusColorsProps> = (props) => {
const { status, type, text = null } = props
const statusShowColor = matchStatusColor(status)
return (<Tag color={statusShowColor}>{text}</Tag>)
......
......@@ -10,8 +10,9 @@ import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilte
import { searchSelectGetSelectCategoryOptionEffect } from '@/pages/transaction/effect/index';
import { useLinkageUtils } from '@/utils/formEffectUtils';
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable';
import { getIntl } from 'umi';
const { onFormMount$ } = FormEffectHooks
const intl = getIntl();
interface Iprops {
/** 列表接口 */
// fetch?: () => Promise<unknown>,
......
......@@ -6,9 +6,10 @@ import { StandardTable } from 'god';
import { ColumnsType } from 'antd/es/table';
import NiceForm from '@/components/NiceForm';
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable';
import { getIntl } from 'umi';
const formActions = createFormActions();
const intl = getIntl();
interface Iprops {
modalType?: "Modal" | "Drawer"
/**
......@@ -101,10 +102,10 @@ const TableModal: React.FC<Iprops> = (props: Iprops) => {
return (
<div style={{ textAlign: 'right' }}>
<Button onClick={handleOnClose} style={{ marginRight: 8 }}>
取消
{intl.formatMessage({id: 'transaction_components.quxiao'})}
</Button>
<Button onClick={handleOk} type="primary">
提交
{intl.formatMessage({id: 'transaction_components.tijiao'})}
</Button>
</div>
)
......
......@@ -4,6 +4,7 @@ import data from '@/pages/transaction/common/uploadProps';
import { DeleteOutlined, FilePdfOutlined, UploadOutlined } from '@ant-design/icons';
import style from './index.less';
import { isEmpty } from 'lodash';
import { getIntl } from 'umi';
type fileType = {
/** 名字 */
......@@ -11,7 +12,6 @@ type fileType = {
/** 链接 */
url: string
}
interface UploadFilesProps {
visible?: boolean,
/** label */
......@@ -34,7 +34,7 @@ interface UploadFilesProps {
onRemove?: (e?: number) => void,
}
const intl = getIntl();
const UploadFiles: React.FC<UploadFilesProps> = (props: any) => {
const { visible = true, width, accept, size, fileList, onChange, onRemove } = props;
const [loading, setLoading] = useState<boolean>(false);
......@@ -46,10 +46,10 @@ const UploadFiles: React.FC<UploadFilesProps> = (props: any) => {
let ext = file['name'].substr(index + 1);
const accepts = accept.split(",").some((item) => item === `.${ext}`);
if (!accepts) {
message.error(`文件类型必须为${accept}`);
message.error(`${intl.formatMessage({id: 'transaction_components.wenjianleixingbixuwei'})}${accept}`);
}
if (!isSize) {
message.error(`上传文件大小不超过 ${size}M!`);
message.error(`${intl.formatMessage({id: 'transaction_components.shangchuanwenjiandaxiaobuchao1'})} ${size}M!`);
}
return (accepts && isSize)
}
......@@ -97,8 +97,8 @@ const UploadFiles: React.FC<UploadFilesProps> = (props: any) => {
beforeUpload={beforeUpload}
onChange={handleFilesChange}
>
<Button loading={loading} icon={<UploadOutlined />}>上传文件</Button>
<div style={{ marginTop: '8px', color: '#909399' }}>一次上传一个文件,每个附件大小不能超过 {size}M</div>
<Button loading={loading} icon={<UploadOutlined />}>{intl.formatMessage({id: 'transaction_components.shangchuanwenjian'})}</Button>
<div style={{ marginTop: '8px', color: '#909399' }}>{intl.formatMessage({id: 'transaction_components.yicishangchuanyigewenjian1'})} {size}M</div>
</Upload>
)}
</>
......
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