From 33440bb15f8d7f07b68e34760129d3300cab5e88 Mon Sep 17 00:00:00 2001 From: zhangyongtian <1181606322@qq.com> Date: Tue, 27 Aug 2024 10:57:21 +0800 Subject: [PATCH] feat:编辑当事人逻辑 --- gz-customerSystem/src/views/register/visit/component/applyDialog.jsx | 31 ++++++++++++++++++++++++------- 1 files changed, 24 insertions(+), 7 deletions(-) diff --git a/gz-customerSystem/src/views/register/visit/component/applyDialog.jsx b/gz-customerSystem/src/views/register/visit/component/applyDialog.jsx index bca0bab..3d31adb 100644 --- a/gz-customerSystem/src/views/register/visit/component/applyDialog.jsx +++ b/gz-customerSystem/src/views/register/visit/component/applyDialog.jsx @@ -29,6 +29,15 @@ const [perClass, setPerClass] = useState('09_01001-1'); const [visible, setVisible] = useState(false); + useEffect(() => { + if (props.editData) { + //编辑 + formRef.current.setFieldsValue({ + ...props.editData + }) + } + }, []) + const personIconType = (v) => { switch (v) { @@ -271,12 +280,19 @@ if (formRef.current) { formRef.current.validate(undefined, (errors, values) => { if (!errors) { - props.handleAddParty({ - ...values, - partyType: props.dialogType, - perClass: perClass, - perClassName: props.dialogType === 0 ? '申请方当事人' : '被申请方当事人' - }) + if (props.editData) { + props.handleAddParty({ + ...props.editData, + ...values + }) + } else { + props.handleAddParty({ + ...values, + partyType: props.dialogType, + perClass: perClass, + perClassName: props.dialogType === 0 ? '申请方当事人' : '被申请方当事人' + }) + } props.onClose() } }); @@ -319,6 +335,7 @@ requiredSymbol={false} initialValues={{ }}//默认值 + scrollToFirstError > <Row gutter={[32, 0]} style={{ margin: '0 -10px' }}>{formType(perClass)}</Row> </Form> @@ -336,7 +353,7 @@ className="dialogPrimary" onClick={handleSave} > - 保存信息 + 保存 </Button> <Button className="dialogBack"> 重置 -- Gitblit v1.8.0