From 2a165a8e70947fe1a3641ea328d1f6daf7fff459 Mon Sep 17 00:00:00 2001 From: dminyi <1301963064@qq.com> Date: Fri, 30 Aug 2024 09:47:36 +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/applyDialog.jsx | 96 ++++-- gz-customerSystem/src/views/register/visit/component/map.jsx | 2 gz-customerSystem/src/views/register/visit/component/agentDialog.jsx | 127 +++++---- gz-customerSystem/src/views/register/visit/component/visitorRegister.jsx | 223 +++++++--------- gz-customerSystem/src/components/personCard/index.jsx | 187 +++++++------- gz-customerSystem/public/locationSelect.js | 11 gz-customerSystem/src/views/register/visit/index.jsx | 76 +++++ gz-customerSystem/src/utils/selectOption.js | 18 + 8 files changed, 416 insertions(+), 324 deletions(-) diff --git a/gz-customerSystem/public/locationSelect.js b/gz-customerSystem/public/locationSelect.js index 0ba3c4c..c15064d 100644 --- a/gz-customerSystem/public/locationSelect.js +++ b/gz-customerSystem/public/locationSelect.js @@ -660,6 +660,11 @@ 'value': '62893', 'parentId': '36953', }, + { + 'label': '广州大学城', + 'value': '51091', + 'parentId': '36953', + }, ], }, { @@ -1051,12 +1056,6 @@ 'parentId': '50285', }, ], - }, - { - 'label': '广州大学城', - 'value': '51091', - 'parentId': '1601', - 'children': null, }, ], }, diff --git a/gz-customerSystem/src/components/personCard/index.jsx b/gz-customerSystem/src/components/personCard/index.jsx index fb4cf52..dc1acb3 100644 --- a/gz-customerSystem/src/components/personCard/index.jsx +++ b/gz-customerSystem/src/components/personCard/index.jsx @@ -10,6 +10,7 @@ import PropTypes from 'prop-types'; import { Typography, Row, Col, Space, Tooltip } from 'antd'; import { del, add } from '../../assets/images'; +import * as $$ from '@/utils/utility'; const { Link, Text } = Typography; /** @@ -19,102 +20,102 @@ * handleDeleteParty, // 删除当事人 */ const PersonCard = ({ isCheck, data, handleCheckParty, handleDeleteParty, handleAdd, handleEdit }) => { - let isAgent = false - let isAgentFor = false - const typeList = data.map(item => { - return item.partyType - })//获取有多少申请人和被申请人 - if (typeList.indexOf(0) != -1) { - isAgent = true - } - if (typeList.indexOf(1) != -1) { - isAgentFor = true - } - return ( - <Row gutter={[24, 16]}> - {data.map((x, t) => ( - <Col span={7} key={t}> - <div className="public-personCard" style={{ cursor: 'pointer' }}> - <div - className={`public-personCard-card public-personCard-card-${(x.partyType === 0 || x.partyType === 2) ? 'blue' : 'orange'}`} - onClick={() => handleCheckParty(x)} - > - {x.trueName.substr(0, 1)} - <div className="public-personCard-card-check">查看</div> - <img - src={del} - alt='' - style={{ width: '16px', height: '16px', position: 'absolute', top: '-8px', left: '56px' }} - onClick={(event) => { handleDeleteParty(event, x) }} - /> - </div> - <div className="public-personCard-content"> - <div className="public-personCard-title"> - <Text style={{ maxWidth: '80%', paddingRight: '8px' }} ellipsis={{ tooltip: x.trueName }}> - {x.trueName} - </Text> - <Text onClick={() => { handleEdit(x) }} ellipsis={{ tooltip: x.perClassName }} className={`public-personCard-tag public-personCard-tag-${(x.partyType === 0 || x.partyType === 2) ? 'blue' : 'orange'}`}> - {x.perClassName} - </Text> - </div> - { - (x.perClass === '09_01001-1' || !x.perClass) && - <> - <div>证件号码:{x.mobile}</div> - <div>联系方式:{x.personNumber}</div> - </> - } - { - x.perClass === '09_01001-2' && - <> - <div>统一社会信用代码:{x.mobile}</div> - <div>法定代表人:{x.companyName}</div> - </> - } - { - x.perClass === '09_01001-3' && - <> - <div>组织机构代码:{x.mobile}</div> - <div>机构代表人:{x.companyName}</div> - </> - } - <Space style={{ display: 'flex', flexWrap: 'wrap' }}> - {x.remark?.map((item, index) => ( - <div key={index} style={{ lineHeight: '22px', padding: '0px 8px', backgroundColor: `${item.color}`, width: 'fit-content', borderRadius: '4px', marginTop: '4px', color: '#fff' }}>{item.label}</div> - ))} - </Space> - </div> - </div> - </Col> - ))} - <Col span={3}> - <div className="dataSync-addBtn"> - <Tooltip - title={(<Space direction='vertical '> - <div className="dataSync-btnApply" style={{ backgroundColor: '#1A6FB8' }} onClick={() => { handleAdd(0) }}>申请方当事人</div> - {isAgent && <div className="dataSync-btnApply" style={{ backgroundColor: '#3491FA' }} onClick={() => { handleAdd(2) }}>申请方代理人</div>} - <div className="dataSync-btnApply" style={{ backgroundColor: '#EF6C24' }} onClick={() => { handleAdd(1) }}>被申请方当事人</div> - {isAgentFor && <div className="dataSync-btnApply" style={{ backgroundColor: '#FA8C16' }} onClick={() => { handleAdd(3) }}>被申请方代理人</div>} - </Space>)} - placement={data.length !== 0 && data.length % 3 === 0 ? 'left' : "right"} - color='#ffff' - overlayStyle={{}} - > - <div style={{ backgroundColor: '#f2f3f5', borderRadius: '50%', width: '64px', height: '64px' }}> - <img src={add} alt="添加" style={{ width: '32px', margin: '16px' }} /> - </div> - </Tooltip> - </div> - </Col> - </Row> - ); + let isAgent = false + let isAgentFor = false + const typeList = data.map(item => { + return item.perType + })//获取有多少申请人和被申请人 + if (typeList.indexOf('15_020008-1') != -1) { + isAgent = true + } + if (typeList.indexOf('15_020008-2') != -1) { + isAgentFor = true + } + return ( + <Row gutter={[24, 16]}> + {data.map((x, t) => ( + <Col span={7} key={t}> + <div className="public-personCard" style={{ cursor: 'pointer' }}> + <div + className={`public-personCard-card public-personCard-card-${(x.perType === '15_020008-1' || x.perType === '24_00006-1') ? 'blue' : 'orange'}`} + onClick={() => handleCheckParty(x)} + > + {x.trueName.substr(0, 1)} + <div className="public-personCard-card-check">查看</div> + <img + src={del} + alt='' + style={{ width: '16px', height: '16px', position: 'absolute', top: '-8px', left: '56px' }} + onClick={(event) => { handleDeleteParty(event, x) }} + /> + </div> + <div className="public-personCard-content"> + <div className="public-personCard-title"> + <Text style={{ maxWidth: '80%', paddingRight: '8px' }} ellipsis={{ tooltip: x.trueName }}> + {x.trueName} + </Text> + <Text onClick={() => { handleEdit(x) }} ellipsis={{ tooltip: x.perTypeName }} className={`public-personCard-tag public-personCard-tag-${(x.perType === '15_020008-1' || x.perType === '24_00006-1') ? 'blue' : 'orange'}`}> + {x.perTypeName} + </Text> + </div> + { + (x.perClass === '09_01001-1' || !x.perClass) && + <> + <div>证件号码:{x.certiNo}</div> + <div>联系方式:{x.mobile}</div> + </> + } + { + x.perClass === '09_01001-2' && + <> + <div>统一社会信用代码:{x.orgaCode}</div> + <div>法定代表人:{x.deputy}</div> + </> + } + { + x.perClass === '09_01001-3' && + <> + <div>组织机构代码:{x.orgaCode}</div> + <div>机构代表人:{x.deputy}</div> + </> + } + <Space style={{ display: 'flex', flexWrap: 'wrap' }}> + {x.remark?.map((item, index) => ( + <div key={index} style={{ lineHeight: '22px', padding: '0px 8px', backgroundColor: `${item.color}`, width: 'fit-content', borderRadius: '4px', marginTop: '4px', color: '#fff' }}>{item.label}</div> + ))} + </Space> + </div> + </div> + </Col> + ))} + <Col span={3}> + <div className="dataSync-addBtn"> + <Tooltip + title={(<Space direction='vertical '> + <div className="dataSync-btnApply" style={{ backgroundColor: '#1A6FB8' }} onClick={() => { handleAdd('15_020008-1') }}>申请方当事人</div> + {isAgent && <div className="dataSync-btnApply" style={{ backgroundColor: '#3491FA' }} onClick={() => { handleAdd('24_00006-1') }}>申请方代理人</div>} + <div className="dataSync-btnApply" style={{ backgroundColor: '#EF6C24' }} onClick={() => { handleAdd('15_020008-2') }}>被申请方当事人</div> + {isAgentFor && <div className="dataSync-btnApply" style={{ backgroundColor: '#FA8C16' }} onClick={() => { handleAdd('24_00006-2') }}>被申请方代理人</div>} + </Space>)} + placement={data.length !== 0 && data.length % 3 === 0 ? 'left' : "right"} + color='#ffff' + overlayStyle={{}} + > + <div style={{ backgroundColor: '#f2f3f5', borderRadius: '50%', width: '64px', height: '64px' }}> + <img src={add} alt="添加" style={{ width: '32px', margin: '16px' }} /> + </div> + </Tooltip> + </div> + </Col> + </Row> + ); }; PersonCard.propTypes = { - isCheck: PropTypes.bool, - data: PropTypes.array, - handleCheckParty: PropTypes.func, - handleDeleteParty: PropTypes.func, + isCheck: PropTypes.bool, + data: PropTypes.array, + handleCheckParty: PropTypes.func, + handleDeleteParty: PropTypes.func, }; export default PersonCard; \ No newline at end of file diff --git a/gz-customerSystem/src/utils/selectOption.js b/gz-customerSystem/src/utils/selectOption.js index 207d9f1..dc90dc7 100644 --- a/gz-customerSystem/src/utils/selectOption.js +++ b/gz-customerSystem/src/utils/selectOption.js @@ -516,6 +516,21 @@ label: '不同意' }, ]; +//事项等级 +const caseLevelList = [ + { + value: 1, + label: '一级' + }, + { + value: 2, + label: '二级' + }, + { + value: 3, + label: '三级' + }, +] // VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV 暂时用不到,防止以后会用的,先保留 VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV @@ -1057,6 +1072,8 @@ }, ]; + + const obj = { caseCanal, visitWay, @@ -1074,6 +1091,7 @@ meetWay, dispType, auditResult, + caseLevelList, // VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV 暂时用不到,防止以后会用的,先保留 VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV diff --git a/gz-customerSystem/src/views/register/visit/component/agentDialog.jsx b/gz-customerSystem/src/views/register/visit/component/agentDialog.jsx index bea0658..1a2c4f0 100644 --- a/gz-customerSystem/src/views/register/visit/component/agentDialog.jsx +++ b/gz-customerSystem/src/views/register/visit/component/agentDialog.jsx @@ -5,6 +5,7 @@ import { IconLink, } from '@arco-design/web-react/icon'; +import * as $$ from '@/utils/utility'; const FormItem = Form.Item; const Option = Select.Option; @@ -22,21 +23,22 @@ formRef.current.setFieldsValue({ ...props.editData }) + console.log(props); //过滤代理人 setVisitList(props.fakeData.filter(item => { - if (props.editData.dialogType === 2) { - return item.partyType === 0 + if (props.editData.perType === '24_00006-1') { + return item.perType === '15_020008-1' } else { - return item.partyType === 1 + return item.perType === '15_020008-2' } })) } else { //过滤代理人 setVisitList(props.fakeData.filter(item => { - if (props.dialogType === 2) { - return item.partyType === 0 + if (props.dialogType === '24_00006-1') { + return item.perType === '15_020008-1' } else { - return item.partyType === 1 + return item.perType === '15_020008-2' } })) } @@ -47,16 +49,16 @@ if (formRef.current) { formRef.current.validate(undefined, (errors, values) => { if (!errors) { + const fieldValue = formRef.current.getFields() if (props.editData) { props.handleAddParty({ - ...props.editData, - ...values, + ...fieldValue }) } else { props.handleAddParty({ - ...values, - partyType: props.dialogType, - perClassName: props.dialogType === 2 ? '申请方代理人' : '被申请方代理人', + ...fieldValue, + perType: props.dialogType, + perTypeName: $$.options.personType.find(item => item.value === props.dialogType).label, }) } props.onClose() @@ -126,7 +128,7 @@ <Col span={12}> <FormItem label={(<div style={{ display: 'flex' }}>联系方式<div className="must">必填</div></div>)} - field='personNumber' + field='mobile' rules={[ { required: true, message: '请输入联系方式' }, { match: /^\+?(\d{1,3})?[-. (]*(\d{3})[-. )]*(\d{3})[-. ]*(\d{4})$/, message: '请输入正确的电话号码' }, @@ -138,16 +140,17 @@ <Col span={12}> <FormItem label={(<div style={{ display: 'flex' }}>证件类型<div className="must">必填</div></div>)} - field='docType' + field='certiType' rules={[{ required: true, message: '请选择证件类型' }]} > - <Select placeholder='请选择' allowClear> - {['居民身份证',].map((option, index) => ( - <Option key={option} value={option}> - {option} - </Option> - ))} - </Select> + <Select + placeholder='请选择' + allowClear + options={$$.options.cardType} + onChange={(value, options) => { + formRef.current.setFieldValue('certiTypeName', options && options.children) + }} + /> </FormItem> </Col> <Col span={12}> @@ -157,7 +160,7 @@ { required: true, message: '请输入证件号码' }, { match: /^[1-9]\d{5}(19|20)\d{2}(0[1-9]|1[0-2])(0[1-9]|[12][0-9]|3[01])\d{3}(\d|X)$/, message: '请输入正确的证件号码' } ]} - field='mobile' + field='certiNo' > <InputSearch searchButton='读取卡证' @@ -166,32 +169,38 @@ </FormItem> </Col> <Col span={12}> - <FormItem label='联系地址' field='money'> + <FormItem label='联系地址' field='addr'> <Input placeholder='请填写' /> </FormItem> </Col> <Col span={12}> - <FormItem label='户籍地址' field='money'> + <FormItem label='户籍地址' field='placeAddr'> <Input placeholder='请填写' /> </FormItem> </Col> <Col span={12}> - <FormItem label='工作单位' field='money'> + <FormItem label='工作单位' field='workUnit'> <Input placeholder='请填写' /> </FormItem> </Col> <Col span={12}> <FormItem label='民族' - field='minzu' + field='nation' > - <Select placeholder='请选择' allowClear> - {['汉族',].map((option, index) => ( - <Option key={option} value={option}> - {option} - </Option> - ))} - </Select> + <Select + placeholder='请选择' + allowClear + showSearch + options={$$.options.nation} + filterOption={(inputValue, option) => + option.props.value.toLowerCase().indexOf(inputValue.toLowerCase()) >= 0 || + option.props.children.toLowerCase().indexOf(inputValue.toLowerCase()) >= 0 + } + onChange={(value, options) => { + formRef.current.setFieldValue('nationName', options && options.children) + }} + /> </FormItem> </Col> <Col span={12}> @@ -201,61 +210,69 @@ > <RadioGroup type='button' + options={$$.options.sex} + onChange={(value, options) => { + if (value) { + formRef.current.setFieldValue('sexName', value === '09_00003-1' ? '男' : '女') + } else { + formRef.current.setFieldValue('sexName', '') + } + }} > - <Radio value='0'>男</Radio> - <Radio value='1'>女</Radio> </RadioGroup> </FormItem> </Col> <Col span={12}> <FormItem label='是否极具个人极端倾向' - field='isBad' + field='extreme' > <RadioGroup> - <Radio value='0'>否</Radio> - <Radio value='1'>是</Radio> + <Radio value={0}>否</Radio> + <Radio value={1}>是</Radio> </RadioGroup> </FormItem> </Col> <Col span={12}> <FormItem label='委托关系' - field='weituo' + field='agentRelate' > - <Select placeholder='请选择' allowClear> - {['亲属',].map((option, index) => ( - <Option key={option} value={option}> - {option} - </Option> - ))} - </Select> + <Select + placeholder='请选择' + allowClear + options={$$.options.agentType} + onChange={(value, options) => { + formRef.current.setFieldValue('agentRelateName', options && options.children) + }} + /> </FormItem> </Col> <Col span={12}> <FormItem label='委托类型' - field='type' + field='agentType' > - <Select placeholder='请选择' allowClear> - {['一般授权代理',].map((option, index) => ( - <Option key={option} value={option}> - {option} - </Option> - ))} - </Select> + <Select + placeholder='请选择' + allowClear + options={$$.options.agentType} + onChange={(value, options) => { + formRef.current.setFieldValue('agentTypeName', options && options.children) + }} + /> </FormItem> </Col> <Col span={12}> <FormItem label={(<div style={{ display: 'flex' }}>代理对象<div className="must">必填</div></div>)} rules={[{ required: true, message: '请选择代理对象' }]} - field='dailimap' + field='personId' > <CheckboxGroup direction='vertical' options={visitList.map(x => ({ - label: <span>{x.trueName} <span style={{ color: '#86909c' }}>({x.perClassName})</span></span>, + label: <span>{x.trueName} <span style={{ color: '#86909c' }}>({x.perTypeName})</span></span>, value: x.id, }))} > diff --git a/gz-customerSystem/src/views/register/visit/component/applyDialog.jsx b/gz-customerSystem/src/views/register/visit/component/applyDialog.jsx index 95eca5e..f2cb86c 100644 --- a/gz-customerSystem/src/views/register/visit/component/applyDialog.jsx +++ b/gz-customerSystem/src/views/register/visit/component/applyDialog.jsx @@ -1,6 +1,6 @@ import React, { useState, useEffect, useRef, Fragment } from "react"; import * as $$ from '@/utils/utility'; -import { Row, Col, Space } from 'antd'; +import { Row, Col } from 'antd'; import { CheckOutlined, } from '@ant-design/icons'; @@ -35,6 +35,7 @@ formRef.current.setFieldsValue({ ...props.editData }) + setPerClass(props.editData.perClass) } }, []) @@ -87,7 +88,7 @@ <Col span={12}> <FormItem label={(<div style={{ display: 'flex' }}>联系方式<div className="must">必填</div></div>)} - field='personNumber' + field='mobile' rules={[ { required: true, message: '请输入联系方式' }, { match: /^\+?(\d{1,3})?[-. (]*(\d{3})[-. )]*(\d{3})[-. ]*(\d{4})$/, message: '请输入正确的电话号码' }, @@ -99,16 +100,17 @@ <Col span={12}> <FormItem label={(<div style={{ display: 'flex' }}>证件类型<div className="must">必填</div></div>)} - field='docType' + field='certiType' rules={[{ required: true, message: '请选择证件类型' }]} > - <Select placeholder='请选择' allowClear> - {['居民身份证',].map((option, index) => ( - <Option key={option} value={option}> - {option} - </Option> - ))} - </Select> + <Select + placeholder='请选择' + allowClear + options={$$.options.cardType} + onChange={(value, options) => { + formRef.current.setFieldValue('certiTypeName', options && options.children) + }} + /> </FormItem> </Col> <Col span={12}> @@ -118,7 +120,7 @@ { required: true, message: '请输入证件号码' }, { match: /^[1-9]\d{5}(19|20)\d{2}(0[1-9]|1[0-2])(0[1-9]|[12][0-9]|3[01])\d{3}(\d|X)$/, message: '请输入正确的证件号码' } ]} - field='mobile' + field='certiNo' > <InputSearch searchButton='读取卡证' @@ -127,12 +129,12 @@ </FormItem> </Col> <Col span={12}> - <FormItem label='联系地址' field='phoneAddress'> + <FormItem label='联系地址' field='addr'> <Input placeholder='请填写' /> </FormItem> </Col> <Col span={12}> - <FormItem label='户籍地址' field='domicileAddress'> + <FormItem label='户籍地址' field='placeAddr'> <Input placeholder='请填写' /> </FormItem> </Col> @@ -155,6 +157,9 @@ option.props.value.toLowerCase().indexOf(inputValue.toLowerCase()) >= 0 || option.props.children.toLowerCase().indexOf(inputValue.toLowerCase()) >= 0 } + onChange={(value, options) => { + formRef.current.setFieldValue('nationName', options && options.children) + }} > </Select> </FormItem> @@ -166,20 +171,26 @@ > <RadioGroup type='button' + options={$$.options.sex} + onChange={(value, options) => { + if (value) { + formRef.current.setFieldValue('sexName', value === '09_00003-1' ? '男' : '女') + } else { + formRef.current.setFieldValue('sexName', '') + } + }} > - <Radio value='0'>男</Radio> - <Radio value='1'>女</Radio> </RadioGroup> </FormItem> </Col> <Col span={12}> <FormItem label='是否极具个人极端倾向' - field='isBad' + field='extreme' > <RadioGroup> - <Radio value='0'>否</Radio> - <Radio value='1'>是</Radio> + <Radio value={0}>否</Radio> + <Radio value={1}>是</Radio> </RadioGroup> </FormItem> </Col> @@ -224,8 +235,8 @@ </Col> <Col span={12}> <FormItem - label={isLegal ? '企业名称' : '机构名称'} - rules={[{ required: true }]} + label={(<div style={{ display: 'flex' }}>{isLegal ? '企业名称' : '机构名称'}<div className="must">必填</div></div>)} + rules={[{ required: true, message: '请输入' + isLegal ? '企业名称' : '机构名称' }]} field='trueName' > <InputSearch @@ -236,41 +247,49 @@ </FormItem> </Col> <Col span={12}> - <FormItem label='联系方式' field='phoneNumber'> + <FormItem + label={(<div style={{ display: 'flex' }}>联系方式<div className="must">必填</div></div>)} + field='mobile' + rules={[ + { required: true, message: '请输入联系方式' }, + { match: /^\+?(\d{1,3})?[-. (]*(\d{3})[-. )]*(\d{3})[-. ]*(\d{4})$/, message: '请输入正确的电话号码' }, + ]} + > <Input placeholder='请填写' /> </FormItem> </Col> <Col span={12}> - <FormItem label={isLegal ? '企业所在地' : '机构所在地'} field='money'> + <FormItem label={isLegal ? '企业所在地' : '机构所在地'} field='addr'> <Input placeholder='请填写' /> </FormItem> </Col> <Col span={12}> - <FormItem label={isLegal ? '统一社会信用代码' : '组织机构代码'} field='mobile'> + <FormItem label={isLegal ? '统一社会信用代码' : '组织机构代码'} field='orgaCode'> <Input placeholder='请填写' /> </FormItem> </Col> <Col span={12}> - <FormItem label={isLegal ? '法定代表人' : '机构代表人'} field='companyName'> + <FormItem label={isLegal ? '法定代表人' : '机构代表人'} field='deputy'> <Input placeholder='请填写' /> </FormItem> </Col> <Col span={12}> <FormItem label={isLegal ? '企业类型' : '机构类型'} - field='minzu' + field='orgaType' > - <Select placeholder='请选择' allowClear> - {['餐饮服务',].map((option, index) => ( - <Option key={option} value={option}> - {option} - </Option> - ))} - </Select> + <Select + placeholder='请选择' + allowClear + options={$$.options.agentType} + onChange={(value, options) => { + formRef.current.setFieldValue('orgaTypeName', options && options.children) + }} + /> </FormItem> </Col> <Col span={12}> - <FormItem label='住所' field='money'> + <FormItem label='住所' field='placeAddr'> <Input placeholder='请填写' /> </FormItem> </Col> @@ -284,17 +303,18 @@ if (formRef.current) { formRef.current.validate(undefined, (errors, values) => { if (!errors) { + const fieldValue = formRef.current.getFields() if (props.editData) { props.handleAddParty({ - ...props.editData, - ...values + ...fieldValue }) } else { props.handleAddParty({ - ...values, - partyType: props.dialogType, + ...fieldValue, + perType: props.dialogType, perClass: perClass, - perClassName: props.dialogType === 0 ? '申请方当事人' : '被申请方当事人' + perTypeName: $$.options.personType.find(item => item.value === props.dialogType).label, + perClassName: $$.options.personClass.find(item => item.value === perClass).label }) } props.onClose() diff --git a/gz-customerSystem/src/views/register/visit/component/map.jsx b/gz-customerSystem/src/views/register/visit/component/map.jsx index 5542f87..f7ee283 100644 --- a/gz-customerSystem/src/views/register/visit/component/map.jsx +++ b/gz-customerSystem/src/views/register/visit/component/map.jsx @@ -115,7 +115,7 @@ //使用地址 const handleUseAddress = (e) => { e.stopPropagation() - props.selectAdd(addressData.addName) + props.selectAdd(addressData) } return ( diff --git a/gz-customerSystem/src/views/register/visit/component/visitorRegister.jsx b/gz-customerSystem/src/views/register/visit/component/visitorRegister.jsx index 95f20c8..57329ba 100644 --- a/gz-customerSystem/src/views/register/visit/component/visitorRegister.jsx +++ b/gz-customerSystem/src/views/register/visit/component/visitorRegister.jsx @@ -9,7 +9,6 @@ applyMaterials_active, evidenceMaterials, evidenceMaterials_active, - } from '@/assets/images'; import { CheckOutlined, } from '@ant-design/icons'; import TableView from '@/components/TableView'; @@ -17,18 +16,19 @@ import ApplyDialog from "./applyDialog"; import AgentDialog from "./agentDialog"; import DetailDialog from "./detailDialog"; -import FilesCheck from '../../../filesCheck'; import NewFileCheck from '../../../filesCheck/newFileCheck'; import { IconLink } from '@arco-design/web-react/icon'; import MapView from './map' import { scan } from '@/assets/images/icon' -import MyDrawer from '@/components/MyDrawer'; import { EventLevelDrawer, MattersDetail } from './levelDetail' const RadioGroup = Radio.Group;// 根据调解案号获取纠纷登记信息 const FormItem = Form.Item; -const Option = Select.Option; const InputSearch = Input.Search; + +function getId() { + return $$.ax.request({ url: `caseUtils/getNewTimeId`, type: 'get', service: 'utils' }); +} const VisitorRegister = (props) => { @@ -36,29 +36,32 @@ const [addVisabled, setAddVisabled] = useState(false);//添加当事人弹窗控制 const [fakeData, setFakeData] = useState([]);//当事人信息数据 const [scanFile, setScanFile] = useState(false); - const [filesList, setFilesList] = useState([]); const [scanImage, setScanImage] = useState(false); const [scaned, setScaned] = useState(false); const [upload, setUpLoad] = useState(false); const [sourceType, setSourceType] = useState('09_01010-1'); const [filesCheck, setFilesCheck] = useState(false); const [fileView, setFileView] = useState(); - const [selectedAddress, setSelectedAddress] = useState(''); const [fileTip, setFileTip] = useState('0'); const [detailVisabled, setDetailVisabled] = useState(false);//查看信息弹窗控制 const [mapView, setMapView] = useState(false); - const [flagId, setFlagId] = useState(1);//赋予当事人唯一id,用于删除 const [visible, setVisible] = useState(false); const [apply, setApply] = useState(false); const [editData, setEditData] = useState(null); - - const addressOptions = [ - { label: '地址1', value: 'address1' }, - { label: '地址2', value: 'address2' }, - // 更多地址... - ]; - const [agentVisible, setAgentVisible] = useState(false); + const peopleMap = { + '15_020008-1': '申请方', + '15_020008-2': '被申请方', + '24_00006-1': '申请方代理人', + '24_00006-2': '被申请方代理人' + } + + useEffect(() => { + if (props.formRef.current) { + //引入当事人数据 + props.formRef.current.setFieldValue('fakeData', fakeData) + } + }, [fakeData]) const personIconType = (v) => { switch (v) { @@ -149,21 +152,6 @@ </> ) } - } - - const formItemLayout = { - labelCol: { - span: 4, - }, - wrapperCol: { - span: 17, - }, - }; - - const peopleMap = { - 0: '申请方', - 1: '被申请方', - 2: '代理人' } const fakeData1 = [ @@ -273,41 +261,6 @@ // 更多列配置... ]; - const options = [ - { - value: 'beijing', - label: 'Beijing', - children: [ - { - value: 'Beijing', - label: 'Beijing', - children: [ - { - value: 'chaoyang', - label: 'Chaoyang', - }, - ], - }, - ], - }, - { - value: 'shanghai', - label: 'Shanghai', - children: [ - { - value: 'shanghaishi', - label: 'Shanghai', - children: [ - { - value: 'huangpu', - label: 'Huangpu', - }, - ], - }, - ], - }, - ]; - const options1 = [ { value: 'jingjijiufen', @@ -335,10 +288,20 @@ }, ]; + //获取id + const getAppId = async (value) => { + const res = await getId() + if (res.type) { + setFakeData([...fakeData, { + ...value, + id: res.data + }]) + } + } + //查看 const handleCheckParty = (value) => { - console.log(value); - setDialogType(value.partyType) + setDialogType(value.perType) setDetailVisabled(true) } @@ -354,9 +317,9 @@ return `${year}-${month}-${day} ${hours}:${minutes}`; } - //添加申请人: 0、被申请人: 1、申请代理人: 2、被申请代理人:3 + //添加当事人 const handleAdd = (type) => { - if (type === 2 || type === 3) { + if (type === '24_00006-1' || type === '24_00006-2') { setAgentVisible(true) } else { setAddVisabled(true) @@ -364,14 +327,8 @@ setDialogType(type) } - - const handleAddressChange = (value) => { - setSelectedAddress(value); - }; - //添加当事人 const handleAddParty = (value) => { - console.log(value,'value1'); if (value.id) { //编辑 const newList = fakeData.map(item => { @@ -384,11 +341,7 @@ setFakeData(newList) setEditData(null) } else { - setFakeData([...fakeData, { - ...value, - id: flagId - }]) - setFlagId(flagId + 1) + getAppId(value) } } @@ -401,14 +354,14 @@ //编辑 const handleEdit = (value) => { - console.log(value); - if (value.partyType === 0 || value.partyType === 1) { + if (value.perType === '15_020008-1' || value.perType === '15_020008-2') { //当事人 setAddVisabled(true) } else { //代理人 setAgentVisible(true) } + setDialogType(value.perType) setEditData(value) } @@ -424,7 +377,6 @@ <div style={{ margin: '16px 0' }}> <PersonCard isCheck={true} - partyType={'applicant'} // 这里设定为申请人 data={fakeData} handleCheckParty={handleCheckParty} handleAdd={handleAdd} @@ -443,32 +395,29 @@ requiredSymbol={false} scrollToFirstError={true} initialValues={{ - level: '三级', - visitingTime: getFormattedDateTime(), - isSerious: '否', + caseLevel: 3, + visitTime: getFormattedDateTime(), + majorStatus: 0, }}//默认值 > <Row gutter={[32, 0]}> <Col span={8}> - <FormItem label={<div style={{ display: 'flex' }}> - 事项等级 - <Tooltip onClick={() => setApply(true)}> - <img src={question1} alt="" style={{ width: '13px', height: '13px', margin: '4px 4px 0px 4px' }} /> - </Tooltip> - </div> - } - field='level' > - <Select placeholder='Select city' allowClear> - {['一级', '二级', '三级', '四级'].map((option, index) => ( - <Option key={option} value={option}> - {option} - </Option> - ))} + <FormItem + label={<div style={{ display: 'flex' }}> + 事项等级 + <Tooltip onClick={() => setApply(true)}> + <img src={question1} alt="" style={{ width: '13px', height: '13px', margin: '4px 4px 0px 4px' }} /> + </Tooltip> + </div> + } + field='caseLevel' + > + <Select placeholder='请选择事项等级' allowClear options={$$.options.caseLevelList}> </Select> </FormItem> </Col> <Col span={8}> - <FormItem label='来访时间' field='visitingTime'> + <FormItem label='来访时间' field='visitTime'> <DatePicker style={{ width: '100%' }} format='YYYY-MM-DD HH:mm' @@ -477,15 +426,15 @@ </FormItem> </Col> <Col span={8}> - <FormItem label='来访人数(人)' field='visitingNumber'> - <InputNumber placeholder='请填写' /> + <FormItem label='来访人数(人)' field='visitPeopleNum'> + <InputNumber placeholder='请填写' min={1} /> </FormItem> </Col> <Col span={8}> <FormItem label={(<div style={{ display: 'flex' }}>纠纷类型<div className="must">必填</div></div>)} rules={[{ message: '请选择纠纷类型', required: true }]} - field='disputeType' + field='caseType' > <Cascader placeholder='请选择' @@ -493,7 +442,6 @@ onChange={(value, option) => { console.log(value, option); }} - // defaultValue={['shanghai', 'shanghaishi', 'huangpu']} allowClear /> </FormItem> @@ -502,8 +450,7 @@ <FormItem label={(<div style={{ display: 'flex' }}>纠纷发生时间<div className="must">必填</div></div>)} rules={[{ message: '请选择纠纷发生时间', required: true }]} - field='disputeTime' - + field='occurTime' > <DatePicker style={{ width: '100%' }} @@ -517,7 +464,7 @@ <FormItem label={(<div style={{ display: 'flex' }}>纠纷发生地点<div className="must">必填</div></div>)} rules={[{ message: '请选择纠纷发生地点', required: true }]} - field='disputeAddress' + field='addr' > <InputSearch placeholder='选择纠纷发生地的详细地址' @@ -531,22 +478,46 @@ <FormItem label='问题属地' field='quesAddress'> <Cascader placeholder='请选择' - options={options} + options={$$.locationOption()} + showSearch onChange={(value, option) => { - console.log(value, option); + if (option) { + props.formRef.current.setFieldsValue({ + queProv: option[0].value, + queProvName: option[0].label, + queCity: option[1].value, + queCityName: option[1].label, + queArea: option[2].value, + queAreaName: option[2].label, + queRoad: option[3] && option[3].value || '', + queRoadName: option[3] && option[3].label || '', + }) + } else { + //清除数据 + props.formRef.current.setFieldsValue({ + queProv: undefined, + queProvName: undefined, + queCity: undefined, + queCityName: undefined, + queArea: undefined, + queAreaName: undefined, + queRoad: undefined, + queRoadName: undefined, + }) + } }} allowClear /> </FormItem> </Col> <Col span={8}> - <FormItem label='涉及人数(人)' field='peopleNumber'> + <FormItem label='涉及人数(人)' field='peopleNum'> <InputNumber placeholder='请填写' /> </FormItem> </Col> <Col span={8}> - <FormItem label='涉及金额(元)' field='money'> + <FormItem label='涉及金额(元)' field='amount'> <InputNumber placeholder='请填写' /> </FormItem> </Col> @@ -562,7 +533,7 @@ <div style={{ marginLeft: '8px', color: '#1A6FB8', fontSize: '14px', cursor: 'pointer' }} onClick={() => setScanFile(true)}>识别上传材料</div> </div> } - field='summarize' + field='caseDes' rules={[{ message: '请填写事项概况', required: true }]} > <Input.TextArea @@ -586,7 +557,7 @@ <div style={{ marginLeft: '8px', color: '#1A6FB8', fontSize: '14px', cursor: 'pointer' }} onClick={() => setScanFile(true)}>识别上传材料</div> </div> } - field='apply' + field='caseClaim' rules={[{ message: '请填写申请请求', required: true }]} > @@ -603,12 +574,12 @@ <FormItem label='是否重大矛盾纠纷' style={{ width: '300px', marginBottom: 0 }} - field='isSerious' + field='majorStatus' layout='horizontal' labelCol={{ span: 11 }} wrapperCol={{ span: 13 }} > - <RadioGroup options={['否', '是']} /> + <RadioGroup options={[{ value: 0, label: '否' }, { value: 1, label: '是' }]} /> </FormItem> </div> </Row> @@ -748,10 +719,13 @@ {/* </div> */} </Modal> <Modal - title={'添加' + peopleMap[dialogType]} + title={(editData ? '修改' : '添加') + peopleMap[dialogType]} visible={addVisabled} onOk={() => setAddVisabled(false)} - onCancel={() => setAddVisabled(false)} + onCancel={() => { + setAddVisabled(false) + setEditData(null) + }} autoFocus={false} focusLock={true} footer={null} @@ -766,10 +740,13 @@ /> </Modal> <Modal - title={'添加代理人'} + title={(editData ? '修改' : '添加') + peopleMap[dialogType]} visible={agentVisible} onOk={() => setAgentVisible(false)} - onCancel={() => setAgentVisible(false)} + onCancel={() => { + setAgentVisible(false) + setEditData(null) + }} autoFocus={false} focusLock={true} footer={null} @@ -808,8 +785,12 @@ maskClosable={false} > <MapView - selectAdd={(value) => { - props.formRef.current.setFieldValue('disputeAddress', value) + selectAdd={(data) => { + props.formRef.current.setFieldsValue({ + addr: data.addName, + lng: data.pt.lng, + lat: data.pt.lat, + }) setMapView(false) }} /> diff --git a/gz-customerSystem/src/views/register/visit/index.jsx b/gz-customerSystem/src/views/register/visit/index.jsx index b912ecd..371c7df 100644 --- a/gz-customerSystem/src/views/register/visit/index.jsx +++ b/gz-customerSystem/src/views/register/visit/index.jsx @@ -13,7 +13,7 @@ import "@arco-themes/react-gzzz/css/arco.css"; import '../index.less'; import { Space } from 'antd'; -import { Button, Steps, Tabs } from '@arco-design/web-react'; +import { Button, Steps, Tabs, Message } from '@arco-design/web-react'; import VisitorRegister from './component/visitorRegister'; import Preview from './preview'; import MattersInfo from './component/MattersInfo'; @@ -22,10 +22,17 @@ const Step = Steps.Step; const TabPane = Tabs.TabPane; -function getCaseDataApi(submitData) { - return $$.ax.request({ url: `caseInfo/getCaseInfo?id=${submitData}`, type: 'get', service: 'mediate' }); +function saveDispute(data) { + return $$.ax.request({ url: `casedraftInfo/caseDraftRegister`, type: 'post', service: 'mediate', data }); } +function getId() { + return $$.ax.request({ url: `caseUtils/getNewTimeCaseId`, type: 'get', service: 'utils' }); +} + +function submitDispute(data) { + return $$.ax.request({ url: `caseInfo/caseRegister`, type: 'post', service: 'mediate', data }); +} const Organization = () => { @@ -47,22 +54,59 @@ isNeedStep: true,//加上这个就有进度条 }, ]) - + const breadcrumbDataMap = { + 1: { breadcrumbData: [{ title: '工作台' }, { title: '来访登记' }], title: '来访登记' }, + 3: { breadcrumbData: [{ title: '工作台' }, { title: '事件中心' }], title: '办理反馈' } + } //提交信息,需要校验规则 const handleSubmit = async () => { if (formRef.current) { formRef.current.validate(undefined, (errors, values) => { - console.log(errors, values); + if (!errors) { + const data = formRef.current.getFields() + handleData(data).then(res => { + reauestSubmit({ + ...res, + isSelfAccept: 0, + isDraft: 0, + operateType: 0, + }) + }) + } }); } } //保存草稿信息,不需要校验规则 - const handleSave = async () => { + const handleSave = () => { if (formRef.current) { const data = formRef.current.getFields() - console.log(data); + handleData(data).then(res => { + requestSave(res) + }) + } + } + + //数据处理 + const handleData = async (data) => { + const { fakeData, ...newObj } = data + if (data.id) { + return { + ...newObj, + personList: fakeData?.filter(item => item.perType === "15_020008-1" || item.perType === "15_020008-2"), + agentList: fakeData?.filter(item => item.perType === "24_00006-1" || item.perType === "24_00006-2"), + } + } else { + const res = await getId() + if (res.type) { + return { + ...newObj, + personList: fakeData?.filter(item => item.perType === "15_020008-1" || item.perType === "15_020008-2"), + agentList: fakeData?.filter(item => item.perType === "24_00006-1" || item.perType === "24_00006-2"), + id: res.data + } + } } } @@ -83,9 +127,21 @@ }); } - const breadcrumbDataMap = { - 1: { breadcrumbData: [{ title: '工作台' }, { title: '来访登记' }], title: '来访登记' }, - 3: { breadcrumbData: [{ title: '工作台' }, { title: '事件中心' }], title: '办理反馈' } + //保存请求 + const requestSave = async (data) => { + const response = await saveDispute(data) + if (response.type) { + Message.success('保存草稿成功!') + } + } + + //提交请求 + const reauestSubmit = async (data) => { + const response = await submitDispute(data) + if (response.type) { + Message.success('提交成功!') + setCurrent(2) + } } return ( -- Gitblit v1.8.0