Commit 20c8de57 authored by Sixiang_Zzb's avatar Sixiang_Zzb

服务商编辑页 优化

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