修复评标场所、区域bug
This commit is contained in:
@ -49,13 +49,13 @@ interface AreaOptions {
|
|||||||
const {areasInfo, modalVisible, onCancel, reload} = props;;
|
const {areasInfo, modalVisible, onCancel, reload} = props;;
|
||||||
const [saveLoading, setSaveLoading] = useState<boolean>(false);
|
const [saveLoading, setSaveLoading] = useState<boolean>(false);
|
||||||
const [placeList, setPlaceList] = useState<any[]>([]);
|
const [placeList, setPlaceList] = useState<any[]>([]);
|
||||||
const [areaList, setAreaList] = useState<any[]>([]);
|
// const [areaList, setAreaList] = useState<any[]>([]);
|
||||||
const [selectAreaStatus, setSelectAreaStatus] = useState<any>();
|
const [selectAreaStatus, setSelectAreaStatus] = useState<any>();
|
||||||
const currentPlace = useRef<any>();
|
const currentPlace = useRef<any>();
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
const clearForm = () => {
|
const clearForm = () => {
|
||||||
form.resetFields();
|
form.resetFields();
|
||||||
setAreaList([]);
|
// setAreaList([]);
|
||||||
}
|
}
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
clearForm();
|
clearForm();
|
||||||
@ -63,12 +63,8 @@ interface AreaOptions {
|
|||||||
getPlaceListByPermission().then(res => {
|
getPlaceListByPermission().then(res => {
|
||||||
if(res.code === 200){
|
if(res.code === 200){
|
||||||
setPlaceList(EnvPlaceOptions(res.data));
|
setPlaceList(EnvPlaceOptions(res.data));
|
||||||
if(areasInfo?.placeRegionCode){
|
if(areasInfo?.placeId){
|
||||||
getPlatAreaList({placeId: areasInfo?.placeRegionCode}).then(res => {
|
currentPlace.current = areasInfo?.placeId;
|
||||||
if(res.code === 200){
|
|
||||||
setAreaList(EnvAreaOptions(res.data));
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -91,16 +87,16 @@ interface AreaOptions {
|
|||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
const EnvAreaOptions = (data: AreaOptions[]) => {
|
// const EnvAreaOptions = (data: AreaOptions[]) => {
|
||||||
let value = [];
|
// let value = [];
|
||||||
for (let i = 0; i < data.length; i++) {
|
// for (let i = 0; i < data.length; i++) {
|
||||||
// if (i === 0) {
|
// // if (i === 0) {
|
||||||
// value.push({label:'-请选择-',value:''});
|
// // value.push({label:'-请选择-',value:''});
|
||||||
// }
|
// // }
|
||||||
value.push({label:data[i].name, value:data[i].indexCode});
|
// value.push({label:data[i].name, value:data[i].indexCode});
|
||||||
}
|
// }
|
||||||
return value;
|
// return value;
|
||||||
}
|
// }
|
||||||
/**
|
/**
|
||||||
* 评标场所回调
|
* 评标场所回调
|
||||||
* @param value
|
* @param value
|
||||||
@ -213,8 +209,8 @@ interface AreaOptions {
|
|||||||
<Select labelInValue options={placeList} placeholder='请选择' onChange={handlePlaceChange}>
|
<Select labelInValue options={placeList} placeholder='请选择' onChange={handlePlaceChange}>
|
||||||
</Select>
|
</Select>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item label="评标区域名称" required initialValue={areasInfo?.areaName}>
|
<Form.Item label="评标区域名称" required>
|
||||||
<Form.Item name="areaName" noStyle rules={[{ required: true, message: '请填写评标区域名称/选择评标区域' }]}>
|
<Form.Item name="areaName" initialValue={areasInfo?.areaName} noStyle rules={[{ required: true, message: '请填写评标区域名称/选择评标区域' }]}>
|
||||||
<Input style={{ width: 'calc(85% - 8px)' }} placeholder="请填写评标区域名称/选择评标区域" maxLength={200} />
|
<Input style={{ width: 'calc(85% - 8px)' }} placeholder="请填写评标区域名称/选择评标区域" maxLength={200} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Button style={{ width: 'calc(15%)', margin: '0 0 0 8px' }} type='primary' onClick={() => ShowExternAreaModal()}>选择</Button>
|
<Button style={{ width: 'calc(15%)', margin: '0 0 0 8px' }} type='primary' onClick={() => ShowExternAreaModal()}>选择</Button>
|
||||||
|
@ -110,6 +110,9 @@ interface PlaceInfo {
|
|||||||
getPlatforms(platformParams).then(res =>{
|
getPlatforms(platformParams).then(res =>{
|
||||||
if(res.code === 200){
|
if(res.code === 200){
|
||||||
setPlatforms(EnvPlatformOptions(res.data));
|
setPlatforms(EnvPlatformOptions(res.data));
|
||||||
|
if(placeInfo?.platformList){
|
||||||
|
currentPlatform.current = placeInfo?.platformList;
|
||||||
|
}
|
||||||
// if(placeInfo?.platformList && placeInfo?.platformList[0]?.platformId){
|
// if(placeInfo?.platformList && placeInfo?.platformList[0]?.platformId){
|
||||||
// getExternPlaces(placeInfo?.platformList[0]?.platformId).then(res => {
|
// getExternPlaces(placeInfo?.platformList[0]?.platformId).then(res => {
|
||||||
// setExternPlaces(EnvExternPlacesOptions(res.data));
|
// setExternPlaces(EnvExternPlacesOptions(res.data));
|
||||||
@ -450,8 +453,8 @@ interface PlaceInfo {
|
|||||||
<Select labelInValue options={platforms} placeholder="请选择管理平台" onChange={handlePlatformChange}>
|
<Select labelInValue options={platforms} placeholder="请选择管理平台" onChange={handlePlatformChange}>
|
||||||
</Select>
|
</Select>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item label="评标场所名称" required initialValue={placeInfo?.placeName}>
|
<Form.Item label="评标场所名称" required>
|
||||||
<Form.Item name="placeName" noStyle rules={[{ required: true, message: '请填写评标场所名称/选择评标场所' }]}>
|
<Form.Item name="placeName" initialValue={placeInfo?.placeName} noStyle rules={[{ required: true, message: '请填写评标场所名称/选择评标场所' }]}>
|
||||||
<Input style={{ width: 'calc(85% - 8px)' }} placeholder="请填写评标场所名称/选择评标场所" maxLength={200} />
|
<Input style={{ width: 'calc(85% - 8px)' }} placeholder="请填写评标场所名称/选择评标场所" maxLength={200} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Button style={{ width: 'calc(15%)', margin: '0 0 0 8px' }} type='primary' onClick={() => ShowExternPlaceModal()}>选择</Button>
|
<Button style={{ width: 'calc(15%)', margin: '0 0 0 8px' }} type='primary' onClick={() => ShowExternPlaceModal()}>选择</Button>
|
||||||
|
@ -54,7 +54,6 @@ const SelectExternPlace: React.FC<SelectExternPlaceProps> = (props) => {
|
|||||||
}, [values])
|
}, [values])
|
||||||
|
|
||||||
const queryExternPlaceList = async () => {
|
const queryExternPlaceList = async () => {
|
||||||
console.log(values[0]?.platformId);
|
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
return await getExternPlaces({platformId:values[0]?.platformId}).then(res => {
|
return await getExternPlaces({platformId:values[0]?.platformId}).then(res => {
|
||||||
if (res?.code == 200) {
|
if (res?.code == 200) {
|
||||||
|
Reference in New Issue
Block a user