Commit 1e9d7809 authored by 前端-黄佳鑫's avatar 前端-黄佳鑫

Merge branch 'dev-srm' of http://10.0.0.22:3000/lingxi/lingxi-business-paltform into dev-srm

parents 1e4e88a8 10a5b088
......@@ -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>}
......@@ -232,6 +244,7 @@ const BasicInfo: React.FC<Iprops> = (props: any) => {
onChange={(value) => {
handProvince(value, idx, 1)
}}
placeholder='请选择省'
>
{province.map(items => {
return (
......@@ -250,6 +263,7 @@ const BasicInfo: React.FC<Iprops> = (props: any) => {
onChange={(value) => {
handProvince(value, idx, 2)
}}
placeholder='请选择市'
>
{(item.provinceCode && city.length > 0 && city[idx]) && city[idx].citydata.map(items => {
return (
......
......@@ -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="报名要求附件"
......@@ -156,10 +168,10 @@ const BidRequirement: React.FC<Iprops> = (props: any) => {
<div className={styles.upload_data}>
{files.length > 0 && files.map((v, index) => (
<div key={index} className={styles.upload_item}>
<div className={styles.upload_left}>
<a className={styles.upload_left} href={v.url} target='_blank'>
<LinkOutlined />
<span>{v.name}</span>
</div>
</a>
<div className={styles.upload_right} onClick={() => removeFiles(index)}>
<DeleteOutlined />
</div>
......
......@@ -167,7 +167,11 @@ const BidRules: React.FC<Iprops> = (props: any) => {
})
]}
>
<Input addonBefore={'¥'} value={startingPrice} onChange={(e) => {
<Input
addonBefore={'¥'}
value={startingPrice}
placeholder='请输入起拍价'
onChange={(e) => {
let _val = e.target.value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1');
setStartingPrice(_val);
form.setFieldsValue({ startingPrice: _val });
......@@ -204,7 +208,11 @@ const BidRules: React.FC<Iprops> = (props: any) => {
})
]}
>
<Input addonBefore={'¥'} value={targetPrice} onChange={(e) => {
<Input
addonBefore={'¥'}
value={targetPrice}
placeholder='请输入目标价'
onChange={(e) => {
let _val = e.target.value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1');
setTargetPrice(_val);
form.setFieldsValue({ targetPrice: _val });
......@@ -241,7 +249,11 @@ const BidRules: React.FC<Iprops> = (props: any) => {
})
]}
>
<Input addonBefore={'¥'} value={minPrice} onChange={(e) => {
<Input
addonBefore={'¥'}
value={minPrice}
placeholder='请输入最小价差'
onChange={(e) => {
let _val = e.target.value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1');
setMinPrice(_val);
form.setFieldsValue({ minPrice: _val });
......@@ -272,7 +284,10 @@ const BidRules: React.FC<Iprops> = (props: any) => {
})
]}
>
<Input value={allowPurchaseCount} onChange={(e) => {
<Input
value={allowPurchaseCount}
placeholder='请输入报价次数'
onChange={(e) => {
let _val = e.target.value.replace(/[^\d]/g, '').replace(/^0{1,}/g, '');
setAllowPurchaseCount(_val);
form.setFieldsValue({ allowPurchaseCount: _val });
......
......@@ -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>
......@@ -132,6 +132,7 @@ const Condition: React.FC<Iprops> = (props: any) => {
>
<Select
onSelect={handleSelectAddress}
placeholder='请选择交付地址'
>
{address.map(v => (
<Option key={v.id} value={v.id}>{v.fullAddress}</Option>
......@@ -141,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>
</>
......
......@@ -90,10 +90,10 @@ const File: React.FC<IProps> = (props) => {
<div className={styles.upload_data}>
{files.length > 0 && files.map((v, index) => (
<div key={index} className={styles.upload_item}>
<div className={styles.upload_left}>
<a className={styles.upload_left} href={v.url} target='_blank'>
<LinkOutlined />
<span>{v.name}</span>
</div>
</a>
<div className={styles.upload_right} onClick={() => removeFiles(index)}>
<DeleteOutlined />
</div>
......
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