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