Commit ad4bec1b authored by XieZhiXiong's avatar XieZhiXiong

fix: 修复首次编辑地址省市区信息出不来的问题

parent 97b29fd4
......@@ -563,27 +563,29 @@ const AddressSelect: React.FC<AddressSelectProps> = (props) => {
});
const res = addressType === 2 ? await getLogisticsShipperAddressGet({ id: `${id}` }) : await getLogisticsReceiverAddressGet({ id: `${id}` });
if (res.code === 1000) {
formActions.setFieldValue('name', addressType === 2 ? (res.data as GetLogisticsShipperAddressGetResponse).shipperName : (res.data as GetLogisticsReceiverAddressGetResponse).receiverName);
formActions.setFieldValue('provinceCode', res.data.provinceCode);
formActions.setFieldValue('cityCode', res.data.cityCode);
formActions.setFieldValue('districtCode', res.data.districtCode);
formActions.setFieldValue('streetCode', res.data.streetCode);
formActions.setFieldValue('detailed', res.data.address);
formActions.setFieldValue('postalCode', res.data.postalCode);
formActions.setFieldValue('areaCode', res.data.areaCode);
formActions.setFieldValue('phone', res.data.phone);
formActions.setFieldValue('tel', res.data.tel);
formActions.setFieldValue('isDefault', res.data.isDefault);
formActions.setFieldState('ADDRESS_NEW', state => {
state.visible = true;
});
formActions.setFieldState('ADD_ACTION', state => {
state.props['x-component-props'] = {
flag: false,
};
});
editAddressId.current = id;
setTimeout(() => {
formActions.setFieldValue('name', addressType === 2 ? (res.data as GetLogisticsShipperAddressGetResponse).shipperName : (res.data as GetLogisticsReceiverAddressGetResponse).receiverName);
formActions.setFieldValue('provinceCode', res.data.provinceCode);
formActions.setFieldValue('cityCode', res.data.cityCode);
formActions.setFieldValue('districtCode', res.data.districtCode);
formActions.setFieldValue('streetCode', res.data.streetCode);
formActions.setFieldValue('detailed', res.data.address);
formActions.setFieldValue('postalCode', res.data.postalCode);
formActions.setFieldValue('areaCode', res.data.areaCode);
formActions.setFieldValue('phone', res.data.phone);
formActions.setFieldValue('tel', res.data.tel);
formActions.setFieldValue('isDefault', res.data.isDefault);
formActions.setFieldState('ADD_ACTION', state => {
state.props['x-component-props'] = {
flag: false,
};
});
editAddressId.current = id;
}, 20);
} else {
message.warn(intl.formatMessage({ id: 'components.huoqudizhixinxishibai' }, { default: '获取地址信息失败' }));
}
......
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