Commit 3613d3a5 authored by 前端-钟卫鹏's avatar 前端-钟卫鹏

fix: 处理新增请购单备注输入框校验异常

parent dc46c237
...@@ -4,6 +4,7 @@ import { EnvironmentOutlined } from '@ant-design/icons'; ...@@ -4,6 +4,7 @@ import { EnvironmentOutlined } from '@ant-design/icons';
import { FormDetailContext } from '@/formSchema/context'; import { FormDetailContext } from '@/formSchema/context';
import { getLogisticsSelectListMemberShipperAddress } from '@/services/LogisticsV2Api'; import { getLogisticsSelectListMemberShipperAddress } from '@/services/LogisticsV2Api';
import { useIntl } from 'umi'; import { useIntl } from 'umi';
import { validatorByte } from '@/utils/regExp';
export interface MaterialTableCellProps { export interface MaterialTableCellProps {
title: React.ReactNode; title: React.ReactNode;
...@@ -149,6 +150,7 @@ export const MaterialTableCell: React.FC<MaterialTableCellProps> = ({ ...@@ -149,6 +150,7 @@ export const MaterialTableCell: React.FC<MaterialTableCellProps> = ({
} }
let childNode = children; let childNode = children;
if (editable) { if (editable) {
console.log(dataIndex)
childNode = childNode =
<> <>
<Form.Item <Form.Item
...@@ -167,14 +169,18 @@ export const MaterialTableCell: React.FC<MaterialTableCellProps> = ({ ...@@ -167,14 +169,18 @@ export const MaterialTableCell: React.FC<MaterialTableCellProps> = ({
{ {
validator: validatorNumber validator: validatorNumber
}, },
] : dataIndex === 'remark' ? ] : (dataIndex === 'remark' ?
[ [
{ {
required: true, required: true,
message: intl.formatMessage({ id: 'purchaseRequisition.neirongbuneng1weikong', defaultMessage: '内容不能为空' }), message: intl.formatMessage({ id: 'purchaseRequisition.neirongbuneng1weikong', defaultMessage: '内容不能为空' }),
}, },
{
validator: (r, v, c) => validatorByte(r, v, c, 200)
}
] ]
: [ :
[
{ {
pattern: /^\d+(\.\d{1,4})?$/, pattern: /^\d+(\.\d{1,4})?$/,
message: intl.formatMessage({ id: 'purchaseRequisition.danjiajinxiansi', defaultMessage: '单价仅限四位小数' }), message: intl.formatMessage({ id: 'purchaseRequisition.danjiajinxiansi', defaultMessage: '单价仅限四位小数' }),
...@@ -182,7 +188,8 @@ export const MaterialTableCell: React.FC<MaterialTableCellProps> = ({ ...@@ -182,7 +188,8 @@ export const MaterialTableCell: React.FC<MaterialTableCellProps> = ({
{ {
validator: validatorNumber validator: validatorNumber
} }
]} ])
}
> >
{chooseFormItem(formItem, record[dataIndex] || '')} {chooseFormItem(formItem, record[dataIndex] || '')}
</Form.Item> </Form.Item>
......
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