Commit 5f3d7527 authored by leimo's avatar leimo

Merge branch 'v2-220418-fixPurchaseBid' into 'v2-220418'

fix: [21887] 竞价报名--报名信息中的地址,需要选择地市,而不是获取字段的数据 See merge request linkseeks-design/pro-platform!128
parents c829c70e 31f29d6e
......@@ -7,18 +7,21 @@ const { Option } = Select;
const intl = getIntl();
const AreaSelect = (props: any) => {
const { mutators } = props;
const { ...rest } = props.props["x-component-props"] || {};
const { needName = false,...rest } = props.props["x-component-props"] || {};
/** 省列表 */
const [province, setProvince] = useState<any>([]);
const [provinceCode, setProvinceCode] = useState<any>('');
const [provinceName, setProvinceName] = useState<any>('');
/** 市列表 */
const [city, setCity] = useState<any>([]);
const [cityCode, setCityCode] = useState<any>('');
const [cityName, setCityName] = useState<any>('');
/** 区列表 */
const [district, setDistrict] = useState<any>([]);
const [districtCode, setDistrictCode] = useState<any>('');
const [districtName, setDistrictName] = useState<any>('');
/** 结果 */
const [result, setResult] = useState<any>({
provinceCode: '',
......@@ -76,17 +79,23 @@ const AreaSelect = (props: any) => {
}
}
setProvinceCode(val);
setResult({
provinceCode: val,
setProvinceName(_item.name)
let _result = {
provinceCode: _item.code,
// province: _item.name,
cityCode: '',
// city: '',
districtCode: '',
// area: '',
});
}
needName && (_result['province'] = _item.name);
needName && (_result['areaCode'] = '');
setResult(_result);
setDistrict([]);
setCityCode('');
setCityName('')
setDistrictCode('');
setDistrictName('')
} else if (num === 2) {
for (let i = 0; i < city.length; i++) {
if (city[i].code === val) {
......@@ -100,28 +109,40 @@ const AreaSelect = (props: any) => {
}
}
setCityCode(val);
setResult({
setCityName(_item.name)
let _result = {
provinceCode: provinceCode,
// province: provinceCode.name,
cityCode: val,
// city: _item.name,
districtCode: '',
// area: '',
});
}
needName && (_result['province'] = provinceName);
needName && (_result['city'] = _item.name);
needName && (_result['areaCode'] = '');
setResult(_result);
setDistrictCode('');
setDistrictName('')
} else {
for (let i = 0; i < district.length; i++) {
if (district[i].code === val) {
_item = district[i];
setDistrictCode(val);
setResult({
setDistrictName(_item.name)
let _result = {
provinceCode: provinceCode,
// province: provinceCode.name,
cityCode: cityCode,
// city: cityCode.name,
districtCode: val,
districtCode: _item.code,
// area: _item.name,
});
}
needName && (_result['province'] = provinceName);
needName && (_result['city'] = cityName);
needName && (_result['area'] = _item.name);
needName && (_result['areaCode'] = _item.code);
setResult(_result);
break;
}
}
......
......@@ -217,12 +217,25 @@ export const formSchema: ISchema = {
},
],
},
signUpAreas: {
'x-component': 'AreaSelect',
type: 'string',
title: intl.formatMessage({ id: 'detail.purchase.label17' }),
required: true,
"x-mega-props": {
span: 2
},
"x-rules": [],
'x-component-props': {
needName: true
}
},
MEGA_LAYOUT3_2: {
type: 'object',
'x-component': 'Mega-Layout',
'x-component-props': {
label: intl.formatMessage({ id: 'detail.purchase.label17' }),
required: true,
label: ' ',
// required: true,
wrapperCol: 24,
},
properties: {
......
......@@ -54,16 +54,18 @@ const SignUpForm = () => {
const handleSubmit = async (value) => {
console.log(value);
const _address = `${value['signUpAreas'].province}${value['signUpAreas'].city}${value['signUpAreas'].area}${value.address}`
const _params = {
biddingId: value.id,
mail: value.mail,
demandUrls: value.demandUrls,
enclosureUrls: value.enclosureUrls,
address: value.address,
address: _address,
tel: value.tel,
telPrefix: value.telPrefix,
contacts: value.contacts,
areas: value.areas,
signUpAreas: {...value['signUpAreas'],address: value.address}
}
console.log(_params)
setBtnLoading(true);
......@@ -113,7 +115,8 @@ const SignUpForm = () => {
member: name,
startSignUp: formatTimeString(data.startSignUp),
endSignUp: formatTimeString(data.endSignUp),
telPrefix: '86'
telPrefix: '86',
address: data['signUpAreas']?.address || ''
});
})
}
......
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