From 552853dc3cd7864d70783153a8bcf2cc8909edd2 Mon Sep 17 00:00:00 2001 From: dminyi <1301963064@qq.com> Date: Mon, 02 Sep 2024 20:01:27 +0800 Subject: [PATCH] Merge branch 'master' of http://120.79.193.119:9090/r/gzzfw/frontEnd/gzDyh into master --- gz-customerSystem/src/views/register/visit/component/visitorRegister.jsx | 76 +++++++++++++------------------------ 1 files changed, 27 insertions(+), 49 deletions(-) diff --git a/gz-customerSystem/src/views/register/visit/component/visitorRegister.jsx b/gz-customerSystem/src/views/register/visit/component/visitorRegister.jsx index 630a3b2..89134f4 100644 --- a/gz-customerSystem/src/views/register/visit/component/visitorRegister.jsx +++ b/gz-customerSystem/src/views/register/visit/component/visitorRegister.jsx @@ -26,10 +26,6 @@ const FormItem = Form.Item; const InputSearch = Input.Search; -function getId() { - return $$.ax.request({ url: `caseUtils/getNewTimeId`, type: 'get', service: 'utils' }); -} - const VisitorRegister = (props) => { const [dialogType, setDialogType] = useState();//添加当事人的类型 @@ -260,44 +256,6 @@ // 更多列配置... ]; - const options1 = [ - { - value: 'jingjijiufen', - label: '经济纠纷', - children: [ - { - value: 'laodongjiufen', - label: '劳动纠纷', - }, - { - value: 'laodongzhengyijiufen', - label: '劳动争议纠纷', - }, - ], - }, - { - value: 'linlijiufen', - label: '邻里纠纷', - children: [ - { - value: 'linlijiufen', - label: '邻里纠纷', - }, - ], - }, - ]; - - //获取id - const getAppId = async (value) => { - const res = await getId() - if (res.type) { - setFakeData([...fakeData, { - ...value, - id: res.data - }]) - } - } - //获取当前时间 const getFormattedDateTime = () => { let now = new Date(); @@ -331,8 +289,9 @@ }; //添加当事人 - const handleAddParty = (value) => { - if (value.id) { + const handleAddParty = (value, isEdit) => { + console.log(value, isEdit); + if (isEdit) { //编辑 const newList = fakeData.map(item => { if (item.id === value.id) { @@ -344,7 +303,9 @@ setFakeData(newList) setEditData(null) } else { - getAppId(value) + setFakeData([...fakeData, { + ...value + }]) } } @@ -435,13 +396,28 @@ <FormItem label={(<div style={{ display: 'flex' }}>纠纷类型<div className="must">必填</div></div>)} rules={[{ message: '请选择纠纷类型', required: true }]} - field='caseType' + field='myCaseType' > <Cascader placeholder='请选择' - options={options1} + options={$$.caseTypeSelect.caseTypeSelect} onChange={(value, option) => { - console.log(value, option); + if (option) { + props.formRef.current.setFieldsValue({ + caseTypeFirst: option[0].value, + caseTypeFirstName: option[0].label, + caseType: option[1].value, + caseTypeName: option[1].label, + }) + } else { + //清除数据 + props.formRef.current.setFieldsValue({ + caseTypeFirst: undefined, + caseTypeFirstName: undefined, + caseType: undefined, + caseTypeName: undefined, + }) + } }} allowClear /> @@ -476,7 +452,7 @@ </FormItem> </Col> <Col span={8}> - <FormItem label='问题属地' field='quesAddress'> + <FormItem label='问题属地' field='myQuesAddress'> <Cascader placeholder='请选择' options={$$.locationOption()} @@ -671,6 +647,7 @@ onClose={() => setAddVisabled(false)} handleAddParty={handleAddParty} editData={editData} + mainId={props.mainId} /> </Modal> <Modal @@ -693,6 +670,7 @@ fakeData={fakeData} dialogType={dialogType} editData={editData} + mainId={props.mainId} /> </Modal> <Modal -- Gitblit v1.8.0