From 5df87dcdbcd6cd34939d43fba9d80b08e61f642b Mon Sep 17 00:00:00 2001 From: zhangyongtian <1181606322@qq.com> Date: Sat, 31 Aug 2024 17:56:45 +0800 Subject: [PATCH] feat: 当事人详情修改、纠纷类型完善 --- gz-customerSystem/src/utils/caseTypeSelect.js | 6 ++++++ gz-customerSystem/src/components/personCard/DetailDialog.jsx | 16 ++++++++++++---- gz-customerSystem/src/views/register/visit/component/visitorRegister.jsx | 25 ++++++++++++++++++++----- gz-customerSystem/src/components/personCard/index.jsx | 2 +- gz-customerSystem/src/views/register/visit/index.jsx | 8 ++++---- gz-customerSystem/src/utils/utility.js | 2 +- 6 files changed, 44 insertions(+), 15 deletions(-) diff --git a/gz-customerSystem/src/components/personCard/DetailDialog.jsx b/gz-customerSystem/src/components/personCard/DetailDialog.jsx index a62c172..2e177df 100644 --- a/gz-customerSystem/src/components/personCard/DetailDialog.jsx +++ b/gz-customerSystem/src/components/personCard/DetailDialog.jsx @@ -281,7 +281,7 @@ { label: '代理对象', value: '', - field: 'personList', + field: 'personId', }, ], [ @@ -337,9 +337,17 @@ perClass: data.perClassName || data.perTypeName } } else { - return { - ...res, - value: res.field === 'personList' ? data[res.field].join(',') : data[res.field] + if (res.field === 'personId') { + const filterValue = props.personData.filter(result => data[res.field].indexOf(result.id) != -1).map(result => result.trueName).join(',') + return { + ...res, + value: filterValue + } + } else { + return { + ...res, + value: data[res.field] + } } } }) diff --git a/gz-customerSystem/src/components/personCard/index.jsx b/gz-customerSystem/src/components/personCard/index.jsx index df5109e..90394f2 100644 --- a/gz-customerSystem/src/components/personCard/index.jsx +++ b/gz-customerSystem/src/components/personCard/index.jsx @@ -142,7 +142,7 @@ unmountOnExit={true} maskClosable={false} > - <DetailDialog editData={editData} /> + <DetailDialog editData={editData} personData={data} /> </Modal> </Fragment> ); diff --git a/gz-customerSystem/src/utils/caseTypeSelect.js b/gz-customerSystem/src/utils/caseTypeSelect.js index 7858103..bf234b7 100644 --- a/gz-customerSystem/src/utils/caseTypeSelect.js +++ b/gz-customerSystem/src/utils/caseTypeSelect.js @@ -45,3 +45,9 @@ }, ] + +const obj = { + caseTypeSelect +}; + +export default obj; diff --git a/gz-customerSystem/src/utils/utility.js b/gz-customerSystem/src/utils/utility.js index 43c3421..b7f9a0a 100644 --- a/gz-customerSystem/src/utils/utility.js +++ b/gz-customerSystem/src/utils/utility.js @@ -36,7 +36,7 @@ // 下拉框 export { default as options } from './selectOption'; - +export { default as caseTypeSelect } from './caseTypeSelect'; export { default as caseOptions } from './caseCauseSelect'; // icon 对照表 diff --git a/gz-customerSystem/src/views/register/visit/component/visitorRegister.jsx b/gz-customerSystem/src/views/register/visit/component/visitorRegister.jsx index 1e1a0c1..2149ce9 100644 --- a/gz-customerSystem/src/views/register/visit/component/visitorRegister.jsx +++ b/gz-customerSystem/src/views/register/visit/component/visitorRegister.jsx @@ -19,7 +19,7 @@ import { IconLink } from '@arco-design/web-react/icon'; import MapView from './map' import { scan } from '@/assets/images/icon' -import { EventLevelDrawer, MattersDetail } from './levelDetail' +import { EventLevelDrawer, MattersDetail } from './levelDetail'; const RadioGroup = Radio.Group;// 根据调解案号获取纠纷登记信息 const FormItem = Form.Item; @@ -424,13 +424,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 /> @@ -465,7 +480,7 @@ </FormItem> </Col> <Col span={8}> - <FormItem label='问题属地' field='quesAddress'> + <FormItem label='问题属地' field='myQuesAddress'> <Cascader placeholder='请选择' options={$$.locationOption()} diff --git a/gz-customerSystem/src/views/register/visit/index.jsx b/gz-customerSystem/src/views/register/visit/index.jsx index f9836b8..1826e76 100644 --- a/gz-customerSystem/src/views/register/visit/index.jsx +++ b/gz-customerSystem/src/views/register/visit/index.jsx @@ -43,8 +43,8 @@ if (formRef.current) { formRef.current.validate(undefined, (errors, values) => { if (!errors) { - const data = formRef.current.getFields() - handleData(data).then(res => { + const {myCaseType, myQuesAddress, ...rest} = formRef.current.getFields() + handleData(rest).then(res => { reauestSubmit({ ...res, isSelfAccept: 0, @@ -60,8 +60,8 @@ //保存草稿信息,不需要校验规则 const handleSave = () => { if (formRef.current) { - const data = formRef.current.getFields() - handleData(data).then(res => { + const {myCaseType, myQuesAddress, ...rest} = formRef.current.getFields() + handleData(rest).then(res => { requestSave(res) }) } -- Gitblit v1.8.0