Commit 31bc3eb5 authored by 前端-钟卫鹏's avatar 前端-钟卫鹏

fix: 采购销售订单详情货币符号翻译,处理订单内外部状态tag不同语言显示异常问题

parent 09b22555
......@@ -55,29 +55,29 @@ export const MoneyTotalBox = ({ dataSource, preview }) => {
return <RowStyle>
<Col span={2}>
<div>{creditsCommodity ? intl.formatMessage({id: 'transaction_components.hejisuoxujifen'}) : intl.formatMessage({id: 'transaction_components.hejijine'})}</div>
<div>{creditsCommodity ? sum : `${sum}`}</div>
<div>{creditsCommodity ? sum : `${intl.formatMessage({ id: 'common.money' })}${sum}`}</div>
</Col>
{
!creditsCommodity && !contractOrder && <Col span={2}>
<div>{intl.formatMessage({id: 'transaction_components.cuxiaolijian'})}</div>
<div>{`-${promotionAmount}`}</div>
<div>{`-${intl.formatMessage({ id: 'common.money' })}${promotionAmount}`}</div>
</Col>
}
{
!creditsCommodity && !contractOrder && <Col span={2}>
<div>{intl.formatMessage({id: 'transaction_components.youhuidikou'})}</div>
<div>{`-${couponAmount}`}</div>
<div>{`-${intl.formatMessage({ id: 'common.money' })}${couponAmount}`}</div>
</Col>
}
{
contractOrder ? null : <>
<Col span={2}>
<div>{intl.formatMessage({id: 'transaction_components.yunfei'})}</div>
<div>{`${freight}`}</div>
<div>{`${intl.formatMessage({ id: 'common.money' })}${freight}`}</div>
</Col>
<Col span={2}>
<div>{creditsCommodity ? intl.formatMessage({id: 'transaction_components.zongjisuoxujifen'}) : intl.formatMessage({id: 'transaction_components.zongjijine'})}</div>
<div>{creditsCommodity ? amountMoney : `${amountMoney}`}</div>
<div>{creditsCommodity ? amountMoney : `${intl.formatMessage({ id: 'common.money' })}${amountMoney}`}</div>
</Col>
</>
}
......
......@@ -249,18 +249,18 @@ export const MoneyTotalBox = ({ dataSource, isEditData }) => {
return <RowStyle>
<Col span={2}>
<div>{creditsCommodity ? intl.formatMessage({ id: 'transaction_components.hejisuoxujifen' }) : intl.formatMessage({ id: 'transaction_components.hejijine' })}</div>
<div>{creditsCommodity ? sum : `${sum}`}</div>
<div>{creditsCommodity ? sum : `${intl.formatMessage({ id: 'common.money' })}${sum}`}</div>
</Col>
{
!creditsCommodity && !contractOrder && <Col span={2}>
<div>{intl.formatMessage({ id: 'transaction_components.cuxiaolijian' })}</div>
<div>{`-${promotionAmount}`}</div>
<div>{`-${intl.formatMessage({ id: 'common.money' })}${promotionAmount}`}</div>
</Col>
}
{
!creditsCommodity && !contractOrder && <Col span={2}>
<div>{intl.formatMessage({ id: 'transaction_components.youhuidikou' })}</div>
<div><Button type="link" style={{ padding: 0, height: '18px', lineHeight: '18px' }}>{`-${couponAmount}`}</Button></div>
<div><Button type="link" style={{ padding: 0, height: '18px', lineHeight: '18px' }}>{`-${intl.formatMessage({ id: 'common.money' })}${couponAmount}`}</Button></div>
</Col>
}
{
......@@ -272,11 +272,11 @@ export const MoneyTotalBox = ({ dataSource, isEditData }) => {
{/* 查询列表跳转的修改 */}
{modifyPrice && <SettingOutlined style={{ marginLeft: 8 }} onClick={handleModify} />}
</div>
<div>{`${freight}`}</div>
<div>{`${intl.formatMessage({ id: 'common.money' })}${freight}`}</div>
</Col>
<Col span={2}>
<div>{creditsCommodity ? intl.formatMessage({ id: 'transaction_components.zongjisuoxujifen' }) : intl.formatMessage({ id: 'transaction_components.zongjijine' })}</div>
<div>{creditsCommodity ? amountMoney : `${amountMoney}`}</div>
<div>{creditsCommodity ? amountMoney : `${intl.formatMessage({ id: 'common.money' })}${amountMoney}`}</div>
</Col>
</>
}
......
import React from 'react'
import React, { CSSProperties } from 'react'
import { Tag } from 'antd'
import { getIntl } from 'umi';
......@@ -90,16 +90,33 @@ const StatusColors: React.FC<StatusColorsProps> = (props) => {
const { status, type, text = null } = props
const statusShowColor = matchStatusColor(status)
// return (<Tag color={statusShowColor}>{text}</Tag>)
return (<p style={{
// 计算中韩字符长度
let chart = window.localStorage.getItem('umi_locale'), _text;
if(chart === 'ko-KR' || chart === 'zh-CN') {
_text = text.replace(/[\uac00-\ud7ff]|[\u4e00-\u9fa5]/g, 'OO')
} else {
_text = text
}
console.log(_text)
const css: CSSProperties = _text.length >= 16 ? {
width: 100,
whiteSpace: 'nowrap',
overflow: 'hidden',
textOverflow: 'ellipsis',
// backgroundColor: '#ef6260',
backgroundColor: statusShowColor,
padding: '0 7px',
borderRadius: '2px',
color: 'white'
} : {
width: 'fit-content',
backgroundColor: statusShowColor,
padding: '0 7px',
// borderRadius: '2px',
// color: 'white'
}} title={text}>{text}</p>)
borderRadius: '2px',
color: 'white'
}
return (<p style={css} title={text}>{text}</p>)
}
StatusColors.defaultProps = {}
......
import React from 'react'
import React, { CSSProperties } from 'react'
import { Tag } from 'antd'
export interface IStatusColor {
......@@ -81,16 +81,33 @@ const StatusColors: React.FC<StatusColorsProps> = (props) => {
const statusShowColor = matchStatusColor(status)
// 优先显示 后端返回的状态文本
// return (<Tag color={statusShowColor}>{text}</Tag>)
return (<p style={{
// 计算中韩字符长度
let chart = window.localStorage.getItem('umi_locale'), _text;
if(chart === 'ko-KR' || chart === 'zh-CN') {
_text = text.replace(/[\uac00-\ud7ff]|[\u4e00-\u9fa5]/g, 'OO')
} else {
_text = text
}
const css: CSSProperties = _text.length > 16 ? {
width: 100,
whiteSpace: 'nowrap',
overflow: 'hidden',
textOverflow: 'ellipsis',
// backgroundColor: '#ef6260',
backgroundColor: statusShowColor,
padding: '0 7px',
// borderRadius: '2px',
// color: 'white'
}} title={text}>{text}</p>)
borderRadius: '2px',
color: 'white'
} : {
width: 'fit-content',
backgroundColor: statusShowColor,
padding: '0 7px',
borderRadius: '2px',
color: 'white'
}
return (<p style={css} title={text}>{text}</p>)
}
StatusColors.defaultProps = {}
......
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