|
|
@ -27,6 +27,8 @@ const Adjustment = (props) => { |
|
|
|
const [codeList, setCodeList] = useState([]); |
|
|
|
const [indexList, setIndexList] = useState([]); |
|
|
|
const [roadFind, setRoadFind] = useState({}); |
|
|
|
const [routeCodeDisabled, setRouteCodeDisabled] = useState(true); |
|
|
|
const [sectionNoDisabled, setSectionNoDisabled] = useState(true); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -63,11 +65,6 @@ const Adjustment = (props) => { |
|
|
|
const [form] = Form.useForm() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
<Modal visible={true} |
|
|
|
onCancel={() => { |
|
|
@ -97,24 +94,66 @@ const Adjustment = (props) => { |
|
|
|
let name = [] |
|
|
|
let code = [] |
|
|
|
let index = [] |
|
|
|
let data = road?.filter(d => (allValues?.routeName ? allValues?.routeName == d?.routeName : true) |
|
|
|
&& (allValues?.routeCode ? allValues?.routeCode == d?.routeCode : true) && |
|
|
|
(allValues?.sectionNo ? allValues?.sectionNo == d?.sectionNo : true)) |
|
|
|
|
|
|
|
let data = [...road] |
|
|
|
data?.forEach(v => { |
|
|
|
if (v.routeName && !name.includes(v.routeName)) { |
|
|
|
name.push(v.routeName) |
|
|
|
} |
|
|
|
if (v.routeCode && !code.includes(v.routeCode)) { |
|
|
|
code.push(v.routeCode) |
|
|
|
}); |
|
|
|
for (let d in changedValues) { |
|
|
|
if (d == 'routeName') { |
|
|
|
form.setFieldsValue({ |
|
|
|
routeCode: "", |
|
|
|
sectionNo: "" |
|
|
|
}) |
|
|
|
data?.forEach(v => { |
|
|
|
if (allValues?.routeName && allValues?.routeName == v.routeName && v.routeCode && !code.includes(v.routeCode)) { |
|
|
|
code.push(v.routeCode) |
|
|
|
} |
|
|
|
}); |
|
|
|
setCodeList(code) |
|
|
|
} |
|
|
|
if (v.sectionNo && !index.includes(v.sectionNo)) { |
|
|
|
index.push(v.sectionNo) |
|
|
|
|
|
|
|
if (d == 'routeCode') { |
|
|
|
form.setFieldsValue({ |
|
|
|
sectionNo: "", |
|
|
|
}) |
|
|
|
|
|
|
|
data = road?.filter(s => allValues?.routeName == s?.routeName) |
|
|
|
data?.forEach(v => { |
|
|
|
if (allValues?.routeCode && allValues?.routeCode == v?.routeCode && v.sectionNo && !index.includes(v.sectionNo)) { |
|
|
|
index.push(v.sectionNo) |
|
|
|
} |
|
|
|
|
|
|
|
if (!allValues?.routeCode && v.routeCode && !code.includes(v.routeCode)) { |
|
|
|
code.push(v.routeCode) |
|
|
|
} |
|
|
|
}); |
|
|
|
if (!allValues?.routeCode) { |
|
|
|
setCodeList(code) |
|
|
|
} |
|
|
|
setIndexList(index) |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
setNameList(name) |
|
|
|
setCodeList(code) |
|
|
|
setIndexList(index) |
|
|
|
|
|
|
|
|
|
|
|
if (allValues?.routeName) { |
|
|
|
setRouteCodeDisabled(false) |
|
|
|
} else { |
|
|
|
setRouteCodeDisabled(true) |
|
|
|
} |
|
|
|
|
|
|
|
if (allValues?.routeName && allValues?.routeCode) { |
|
|
|
setSectionNoDisabled(false) |
|
|
|
} else { |
|
|
|
setSectionNoDisabled(true) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (allValues?.routeName && allValues?.routeCode && allValues?.sectionNo) { |
|
|
|
form.setFieldsValue({ |
|
|
@ -144,14 +183,14 @@ const Adjustment = (props) => { |
|
|
|
name="routeCode" |
|
|
|
rules={[{ required: true, message: '请选择路线代码' }]} |
|
|
|
> |
|
|
|
<Select style={{ marginBottom: 10 }} allowClear showSearch={true} placeholder="请选择路线代码" options={codeList?.map(v => ({ value: v, label: v })) || []} /> |
|
|
|
<Select style={{ marginBottom: 10 }} disabled={routeCodeDisabled} allowClear showSearch={true} placeholder="请选择路线代码" options={codeList?.map(v => ({ value: v, label: v })) || []} /> |
|
|
|
</Form.Item> |
|
|
|
<Form.Item |
|
|
|
label="路段序号" |
|
|
|
name="sectionNo" |
|
|
|
rules={[{ required: true, message: '请选择抽取比例' }]} |
|
|
|
rules={[{ required: true, message: '请选择路段序号' }]} |
|
|
|
> |
|
|
|
<Select style={{}} allowClear showSearch={true} placeholder="请选择抽取比例" options={indexList?.map(v => ({ value: v, label: v })) || []} /> |
|
|
|
<Select style={{}} allowClear showSearch={true} disabled={sectionNoDisabled} placeholder="请选择路段序号" options={indexList?.map(v => ({ value: v, label: v })) || []} /> |
|
|
|
</Form.Item> |
|
|
|
|
|
|
|
<Form.Item label='起点地名' name='startingPlaceName'> |
|
|
|