Commit 9999370c authored by 前端-钟卫鹏's avatar 前端-钟卫鹏

fix: 修改地址字段

parent 77026ae3
......@@ -96,13 +96,14 @@ export const useBidDetail = (options: OrderDetailHookProps) => {
if (code === 1000) {
setFormData(data)
if(data?.deliverAddress) {
PublicApi.getLogisticsReceiverAddressGet({id: data.deliverAddress}).then(_res => {
const { data: _data } = _res
const { provinceName, cityName, districtName, address } = _data
if(code === 1000) {
setAddress(`${provinceName}/${cityName}/${districtName}/${address}`)
}
})
// PublicApi.getLogisticsReceiverAddressGet({id: data.deliverAddress}).then(_res => {
// const { data: _data } = _res
// const { provinceName, cityName, districtName, address } = _data
// if(code === 1000) {
// setAddress(`${provinceName}/${cityName}/${districtName}/${address}`)
// }
// })
setAddress(data.deliverAddress)
}
} else {
message.error(msg)
......
......@@ -134,6 +134,10 @@ const AddNewBid:React.FC<AddNewBidProps> = (props) => {
if(id) {
params['id'] = id
}
addSchemaAction.getFieldState('deliverAddressId', state => {
params['deliverAddress'] = state.props.enum.filter(item => item['value'] === params['deliverAddressId'])[0]['label']
})
let res = await PublicApi.postPurchaseInviteTenderSaveOrUpdateInviteTender(params)
if(res.code === 1000) {
history.goBack()
......@@ -201,7 +205,7 @@ const AddNewBid:React.FC<AddNewBidProps> = (props) => {
effects={($, ctx) => {
$('onFormMount').subscribe(async () => {
const addressRes = await PublicApi.getLogisticsSelectListReceiverAddress()
ctx.setFieldState('deliverAddress', state => {
ctx.setFieldState('deliverAddressId', state => {
state.props.enum = addressRes.data.map(item => ({ label: item.fullAddress, value: item.id }))
})
......
......@@ -635,7 +635,7 @@ const otherRequset: ISchema = {
wrapperCol: 10
},
properties: {
deliverAddress: {
deliverAddressId: {
type: 'number',
title: '交付地址',
enum: [],
......
......@@ -171,9 +171,10 @@ const AddTender:React.FC<AddTenderProps> = (props) => {
$('onFormMount').subscribe(async () => {
$('onFieldValueChange', 'deliverAddress').subscribe(async state => {
if(state.value) {
const res = await PublicApi.getLogisticsReceiverAddressGet({id: state.value})
const { provinceName, cityName, districtName, address } = res.data
ctx.setFieldValue('fullAddress', `${provinceName}${cityName}${districtName}${address}`)
// const res = await PublicApi.getLogisticsReceiverAddressGet({id: state.value})
// const { provinceName, cityName, districtName, address } = res.data
// ctx.setFieldValue('fullAddress', `${provinceName}${cityName}${districtName}${address}`)
ctx.setFieldValue('fullAddress', state.value)
}
})
})
......
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