Commit 20c8de57 authored by Sixiang_Zzb's avatar Sixiang_Zzb

服务商编辑页 优化

parent 105d2bdf
...@@ -17,17 +17,15 @@ const Edit = (props: any) => { ...@@ -17,17 +17,15 @@ const Edit = (props: any) => {
}; };
const [CList, setCList] = useState(CommunityList); const [CList, setCList] = useState(CommunityList);
const [SList, setSList] = useState(['1']);
const [load, setload] = useState(false); const [load, setload] = useState(false);
const printContent = (List: any) => { const printContent = (List: any) => {
setCList(List); setCList(List);
}; };
const formRef = useRef(null); const formRef = useRef(null as any);
useEffect(() => { useEffect(() => {
console.log(SaveChooseData);
RA(43, {}, module, dispatch); RA(43, {}, module, dispatch);
}, []); }, []);
...@@ -40,16 +38,29 @@ const Edit = (props: any) => { ...@@ -40,16 +38,29 @@ const Edit = (props: any) => {
value: i.toString(), value: i.toString(),
}; };
}); });
if (SaveChooseData != null) {
formRef.current.setFieldsValue(SaveChooseData);
}
} }
}, [DataServices]); }, [DataServices]);
useEffect(() => {
if (SaveChooseData != null) {
console.log(SaveChooseData);
console.log(options);
let arr: [] = [];
SaveChooseData.serviceScopeList.forEach((v: any) => {
options.forEach((ele: any) => {
if (v === ele.label) {
arr.push(ele.value as never);
}
});
});
SaveChooseData.serviceScopeList = arr;
formRef.current.setFieldsValue(SaveChooseData);
}
}, [SaveChooseData]);
const onFinish = (values: any) => { const onFinish = (values: any) => {
var val = values; var val = values;
val.serviceCommunityList = CList; val.serviceCommunityList = CList;
// val.serviceScopeList = SList
val.creator = 'admin'; val.creator = 'admin';
val.updater = 'admin'; val.updater = 'admin';
setload(true); setload(true);
...@@ -114,7 +125,7 @@ const Edit = (props: any) => { ...@@ -114,7 +125,7 @@ const Edit = (props: any) => {
}, },
]} ]}
> >
<Checkbox.Group options={options} /> <Checkbox.Group options={options as any} />
</Form.Item> </Form.Item>
</div> </div>
</div> </div>
......
...@@ -219,7 +219,7 @@ const ServiceProviderManagement = (props: any) => { ...@@ -219,7 +219,7 @@ const ServiceProviderManagement = (props: any) => {
onSubmit={CallBackTitleSearch} onSubmit={CallBackTitleSearch}
defaultValue={{ defaultValue={{
providerName: readyData.providerName, providerName: readyData.providerName,
status: parseInt(readyData.serviceScope), status: readyData.serviceScope ? parseInt(readyData.serviceScope) : undefined,
}} }}
checklist={ checklist={
readyData.serviceCommunityList.length !== 0 ? readyData.serviceCommunityList : null readyData.serviceCommunityList.length !== 0 ? readyData.serviceCommunityList : null
......
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