Commit 10a5b088 authored by 卢均锐's avatar 卢均锐

fix: [12500]

parent 3c244324
......@@ -208,7 +208,7 @@ const ModalOperate: React.FC<IProps> = (props: any) => {
}, [visible])
const handleSubmit = (val: any) => {
if(confirmLoading){
if (confirmLoading) {
return;
}
setConfirmLoading(true);
......@@ -304,7 +304,16 @@ const ModalOperate: React.FC<IProps> = (props: any) => {
}}
x-rules={{
max: maxNumber,
message: `原因最多${maxNumber}个汉字`
message: `原因最多${maxNumber}个汉字`,
validator: (value) => {
let _str = value;
_str = _str.replace(/[\u4E00-\u9FA5]/g, "AA");
if (_str.length > maxNumber * 2) {
return { type: 'error', message: `最长${maxNumber * 2}个字符,${maxNumber}个汉字`};
} else {
return null;
}
}
}}
/>)}
</SchemaForm>
......
......@@ -82,7 +82,19 @@ const SubmitResultModal: React.FC<SubmitResultModalProps> = (props: any) => {
<Form.Item
label='授标意见'
name='opinion'
rules={[{ required: true, message: '请输入授标意见' }]}
rules={[
{ required: true, message: '请输入授标意见' }, () => ({
validator(_, value) {
let _str = value;
_str = _str.replace(/[\u4E00-\u9FA5]/g, "AA");
if (_str.length > 200) {
return Promise.reject(new Error('最长200个字符,100个汉字'));
} else {
return Promise.resolve();
}
},
})
]}
>
<Input.TextArea rows={3} maxLength={200} placeholder="最长200个字符,100个汉字" />
</Form.Item>
......
......@@ -214,9 +214,21 @@ const BasicInfo: React.FC<Iprops> = (props: any) => {
<Form.Item
label='竞价单摘要'
name='details'
rules={[{ required: true, message: '请输入竞价单摘要' }]}
rules={[
{ required: true, message: '请输入竞价单摘要' }, () => ({
validator(_, value) {
let _str = value;
_str = _str.replace(/[\u4E00-\u9FA5]/g, "AA");
if (_str.length > 60) {
return Promise.reject(new Error('最长60个字符,30个汉字'));
} else {
return Promise.resolve();
}
},
})
]}
>
<Input maxLength={30} placeholder='最长60个字符,30个汉字' />
<Input maxLength={60} placeholder='最长60个字符,30个汉字' />
</Form.Item>
<Form.Item
label={<Tooltip placement="right" title='设置了归属地市后,此商品可根据地市进行筛选,未设置时默认为所有地市'>适用地市<QuestionCircleOutlined style={{ marginLeft: '5px' }} /></Tooltip>}
......
......@@ -144,9 +144,21 @@ const BidRequirement: React.FC<Iprops> = (props: any) => {
<Form.Item
label="报名要求"
name="demand"
rules={[{ required: true, message: '请输入报名要求' }]}
rules={[
{ required: true, message: '请输入报名要求' }, () => ({
validator(_, value) {
let _str = value;
_str = _str.replace(/[\u4E00-\u9FA5]/g, "AA");
if (_str.length > 200) {
return Promise.reject(new Error('最长200个字符,100个汉字'));
} else {
return Promise.resolve();
}
},
})
]}
>
<TextArea rows={3} maxLength={100} placeholder="最长200个字符,100个汉字" />
<TextArea rows={3} maxLength={200} placeholder="最长200个字符,100个汉字" />
</Form.Item>
<Form.Item
label="报名要求附件"
......
......@@ -121,7 +121,7 @@ const Condition: React.FC<Iprops> = (props: any) => {
>
<DatePicker style={{ width: '100%' }}
disabledDate={(current) => {
return current && current <= moment().startOf('day')
return current && current <= moment().startOf('day')
}}
/>
</Form.Item>
......@@ -142,49 +142,121 @@ const Condition: React.FC<Iprops> = (props: any) => {
<Form.Item
label="报价要求"
name="offer"
rules={[{ required: true, message: '请输入报价要求' }]}
rules={[
{ required: true, message: '请输入报价要求' }, () => ({
validator(_, value) {
let _str = value;
_str = _str.replace(/[\u4E00-\u9FA5]/g, "AA");
if (_str.length > 100) {
return Promise.reject(new Error('最长100个字符,50个汉字'));
} else {
return Promise.resolve();
}
},
})
]}
>
<TextArea rows={3} maxLength={50} placeholder="最长100个字符,50个汉字" />
<TextArea rows={3} maxLength={100} placeholder="最长100个字符,50个汉字" />
</Form.Item>
<Form.Item
label="付款方式"
name="paymentType"
rules={[{ required: true, message: '请输入付款方式' }]}
rules={[
{ required: true, message: '请输入付款方式' }, () => ({
validator(_, value) {
let _str = value;
_str = _str.replace(/[\u4E00-\u9FA5]/g, "AA");
if (_str.length > 100) {
return Promise.reject(new Error('最长100个字符,50个汉字'));
} else {
return Promise.resolve();
}
},
})
]}
>
<TextArea rows={3} maxLength={50} placeholder="最长100个字符,50个汉字" />
<TextArea rows={3} maxLength={100} placeholder="最长100个字符,50个汉字" />
</Form.Item>
<Form.Item
label="税费要求"
name="taxes"
rules={[{ required: true, message: '请输入税费要求' }]}
rules={[
{ required: true, message: '请输入税费要求' }, () => ({
validator(_, value) {
let _str = value;
_str = _str.replace(/[\u4E00-\u9FA5]/g, "AA");
if (_str.length > 100) {
return Promise.reject(new Error('最长100个字符,50个汉字'));
} else {
return Promise.resolve();
}
},
})
]}
>
<TextArea rows={3} maxLength={50} placeholder="最长100个字符,50个汉字" />
<TextArea rows={3} maxLength={100} placeholder="最长100个字符,50个汉字" />
</Form.Item>
<Form.Item
label="物流要求"
name="logistics"
rules={[{ required: true, message: '请输入物流要求' }]}
rules={[
{ required: true, message: '请输入物流要求' }, () => ({
validator(_, value) {
let _str = value;
_str = _str.replace(/[\u4E00-\u9FA5]/g, "AA");
if (_str.length > 100) {
return Promise.reject(new Error('最长100个字符,50个汉字'));
} else {
return Promise.resolve();
}
},
})
]}
>
<TextArea rows={3} maxLength={50} placeholder="最长100个字符,50个汉字" />
<TextArea rows={3} maxLength={100} placeholder="最长100个字符,50个汉字" />
</Form.Item>
<Form.Item
label="包装要求"
name="packRequire"
rules={[{ required: true, message: '请输入包装要求' }]}
rules={[
{ required: true, message: '请输入包装要求' }, () => ({
validator(_, value) {
let _str = value;
_str = _str.replace(/[\u4E00-\u9FA5]/g, "AA");
if (_str.length > 100) {
return Promise.reject(new Error('最长100个字符,50个汉字'));
} else {
return Promise.resolve();
}
},
})
]}
>
<TextArea rows={3} maxLength={50} placeholder="最长100个字符,50个汉字" />
<TextArea rows={3} maxLength={100} placeholder="最长100个字符,50个汉字" />
</Form.Item>
<Form.Item
label="其他要求"
name="otherRequire"
rules={[{ required: true, message: '请输入其他要求' }]}
rules={[
{ required: true, message: '请输入其他要求' }, () => ({
validator(_, value) {
let _str = value;
_str = _str.replace(/[\u4E00-\u9FA5]/g, "AA");
if (_str.length > 100) {
return Promise.reject(new Error('最长100个字符,50个汉字'));
} else {
return Promise.resolve();
}
},
})
]}
>
<TextArea rows={3} maxLength={50} placeholder="最长100个字符,50个汉字" />
<TextArea rows={3} maxLength={100} placeholder="最长100个字符,50个汉字" />
</Form.Item>
</Form>
</>
......
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