Merge branch 'master' of http://120.79.193.119:9090/r/gzzfw/frontEnd/gzDyh into master
2 files added
11 files modified
| | |
| | | * @Company: hugeInfo |
| | | * @Author: ldh |
| | | * @Date: 2022-02-16 11:25:57 |
| | | * @LastEditTime: 2024-09-02 10:43:43 |
| | | * @LastEditTime: 2024-09-02 19:58:19 |
| | | * @LastEditors: dminyi 1301963064@qq.com |
| | | * @Version: 1.0.0 |
| | | * @Description: api地址 |
New file |
| | |
| | | import React, { useEffect, useState } from 'react' |
| | | import { Upload, Form } from '@arco-design/web-react'; |
| | | import { |
| | | IconAttachment, |
| | | } from '@arco-design/web-react/icon'; |
| | | import * as $$ from '../../utils/utility'; |
| | | import './index.less'; |
| | | |
| | | const FormItem = Form.Item; |
| | | |
| | | /** |
| | | * params *, //upload组件参数 |
| | | * field *, // form的标识 |
| | | * handleChangeFile, // 文件上传成功之后的回调 |
| | | * label *, // form的label名 |
| | | * editData *, // 编辑回显数据 |
| | | */ |
| | | |
| | | export default function ArcoUpload(props) { |
| | | const [myFileList, setMyFileList] = useState([]) |
| | | useEffect(() => { |
| | | if(props.editData) { |
| | | console.log(props.editData[props.field]); |
| | | setMyFileList(props.editData[props.field]) |
| | | } |
| | | }, [props.editData]) |
| | | |
| | | return ( |
| | | <FormItem |
| | | label={props.label} |
| | | field={props.field} |
| | | triggerPropName='fileList' |
| | | > |
| | | <Upload |
| | | drag |
| | | multiple |
| | | accept='.png,.jpg,.pdf' |
| | | onDrop={(e) => { |
| | | }} |
| | | tip='支持png、jpg、pdf格式的图片上传,每次上传大小不超过10M' |
| | | showUploadList={{ |
| | | fileIcon: <IconAttachment style={{ color: '#1D2129' }} />, |
| | | }} |
| | | headers={{ Authorization: $$.getSessionStorage('customerSystemToken') }} |
| | | onChange={(fileList, file) => { |
| | | console.log(fileList, myFileList, file); |
| | | const { status, response } = file |
| | | //因为字节upLoad组件有bug,不能区分添加文件还是删除文件,所以用这种办法来判断是不是删除 |
| | | const isDel = myFileList && myFileList.length > fileList.length |
| | | //上传失败 |
| | | if (status === 'error' && !isDel) { |
| | | $$.info({ type: 'error', content: '抱歉,网络错误附件上传失败,请稍后重试' }); |
| | | } |
| | | //上传成功 |
| | | if (status === 'done' && !isDel) { |
| | | if (response.code === 0 || response.code === '0') { |
| | | // 返回附件成功上传的回调 |
| | | $$.infoSuccess({ content: response.msg }); |
| | | if (props.handleChangeFile) { |
| | | props.handleChangeFile(response); |
| | | } |
| | | } |
| | | } |
| | | //删除文件 |
| | | if (isDel) { |
| | | |
| | | } |
| | | setMyFileList(fileList) |
| | | }} |
| | | {...props.params}//自定义 |
| | | /> |
| | | </FormItem> |
| | | ) |
| | | } |
New file |
| | |
| | | .arco-upload-list { |
| | | display: flex; |
| | | align-items: center; |
| | | flex-wrap: wrap; |
| | | } |
| | | .arco-upload-list-item { |
| | | width: calc(50% - 17px); |
| | | margin-top: 24px; |
| | | margin-left: 17px; |
| | | |
| | | &:nth-child(2n+1) { |
| | | width: calc(50% - 17px); |
| | | margin-right: 17px; |
| | | margin-left: 0px; |
| | | } |
| | | } |
| | |
| | | { |
| | | label: '代理对象', |
| | | value: '', |
| | | field: 'personList', |
| | | field: 'personId', |
| | | }, |
| | | ], |
| | | [ |
| | |
| | | perClass: data.perClassName || data.perTypeName |
| | | } |
| | | } else { |
| | | 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: res.field === 'personList' ? data[res.field].join(',') : data[res.field] |
| | | value: filterValue |
| | | } |
| | | } else { |
| | | return { |
| | | ...res, |
| | | value: data[res.field] |
| | | } |
| | | } |
| | | } |
| | | }) |
| | |
| | | unmountOnExit={true} |
| | | maskClosable={false} |
| | | > |
| | | <DetailDialog editData={editData} /> |
| | | <DetailDialog editData={editData} personData={data} /> |
| | | </Modal> |
| | | </Fragment> |
| | | ); |
| | |
| | | <Route path="myConfirmation" element={<MyConfirmation />} /> |
| | | <Route path="judicialOverview" element={<JudicialOverview />} /> |
| | | {/* 来访登记*/} |
| | | <Route path="visit" element={<Visit />} /> |
| | | <Route path="visit/:id?" element={<Visit />} /> |
| | | <Route path="visit/eventFlow" element={<EventFlow />} /> |
| | | <Route path="visit/handleFeedback" element={<HandleFeedback />} /> |
| | | |
| | |
| | | }, |
| | | |
| | | ] |
| | | |
| | | const obj = { |
| | | caseTypeSelect |
| | | }; |
| | | |
| | | export default obj; |
| | |
| | | |
| | | // 下拉框 |
| | | export { default as options } from './selectOption'; |
| | | |
| | | export { default as caseTypeSelect } from './caseTypeSelect'; |
| | | export { default as caseOptions } from './caseCauseSelect'; |
| | | |
| | | // icon 对照表 |
| | |
| | | } |
| | | } |
| | | |
| | | .arco-upload-list-type-text .arco-upload-list-item:first-of-type, |
| | | .arco-upload-list-type-picture-list .arco-upload-list-item:first-of-type { |
| | | margin-top: 34px; |
| | | // .arco-upload-list-type-text .arco-upload-list-item:first-of-type, |
| | | // .arco-upload-list-type-picture-list .arco-upload-list-item:first-of-type { |
| | | // margin-top: 34px; |
| | | |
| | | } |
| | | // } |
| | | |
| | | .unitDialogResult { |
| | | font-size: 16px; |
| | |
| | | import { Row, Col, Space } from 'antd'; |
| | | import { Form, Input, Button, Radio, Select, Checkbox, Upload } from '@arco-design/web-react'; |
| | | import KeyVisits from "@/components/personCard/KeyVisits"; |
| | | import { |
| | | IconLink, |
| | | } from '@arco-design/web-react/icon'; |
| | | import * as $$ from '@/utils/utility'; |
| | | import ArcoUpload from '@/components/ArcoUpload'; |
| | | |
| | | const FormItem = Form.Item; |
| | | const Option = Select.Option; |
| | | const InputSearch = Input.Search; |
| | | const RadioGroup = Radio.Group; |
| | | const CheckboxGroup = Checkbox.Group; |
| | | const appUrl = $$.appUrl; |
| | | |
| | | function getId() { |
| | | return $$.ax.request({ url: `caseUtils/getNewTimeId`, type: 'get', service: 'utils' }); |
| | | } |
| | | |
| | | export default function AgentDialog(props) { |
| | | const formRef = useRef(); |
| | | const [visitList, setVisitList] = useState([]) |
| | | const [id, setId] = useState() |
| | | |
| | | useEffect(() => { |
| | | if (props.editData) { |
| | |
| | | formRef.current.setFieldsValue({ |
| | | ...props.editData |
| | | }) |
| | | console.log(props); |
| | | //过滤代理人 |
| | | setVisitList(props.fakeData.filter(item => { |
| | | if (props.editData.perType === '24_00006-1') { |
| | |
| | | return item.perType === '15_020008-2' |
| | | } |
| | | })) |
| | | //获取id |
| | | getAppId() |
| | | } |
| | | }, []) |
| | | |
| | | //获取id |
| | | const getAppId = async () => { |
| | | const res = await getId() |
| | | if (res.type) { |
| | | setId(res.data) |
| | | } |
| | | } |
| | | |
| | | //保存信息 |
| | | const handleSave = () => { |
| | |
| | | if (props.editData) { |
| | | props.handleAddParty({ |
| | | ...fieldValue |
| | | }) |
| | | }, true) |
| | | } else { |
| | | props.handleAddParty({ |
| | | ...fieldValue, |
| | | perType: props.dialogType, |
| | | perTypeName: $$.options.personType.find(item => item.value === props.dialogType).label, |
| | | }) |
| | | id: id |
| | | }, false) |
| | | } |
| | | props.onClose() |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | |
| | | //上传身份证识别 |
| | | const handleChangeFile = (data) => { |
| | | if (data.data && data.data.length != 0) { |
| | | if (data.data[0].idcardOcrResult) { |
| | | const { birthday, ...rest } = data.data[0].idcardOcrResult |
| | | //回填信息 |
| | | formRef.current.setFieldsValue({ |
| | | ...rest |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | > |
| | | <Row gutter={[32, 0]} style={{ margin: '0 -10px' }}> |
| | | <Col span={24}> |
| | | <FormItem |
| | | label='身份证明材料' |
| | | <ArcoUpload |
| | | params={{ |
| | | action: `${appUrl.fileUrl}/${appUrl.sys}/api/web/fileInfo/upload?mainId=${props.mainId}&ownerId=${id}&ownerType=22_00018-202`, |
| | | }} |
| | | field='file' |
| | | > |
| | | <Upload |
| | | drag |
| | | multiple |
| | | accept='image/*' |
| | | action='/' |
| | | onDrop={(e) => { |
| | | }} |
| | | tip='支持png、jpg、pdf格式的图片上传,每次上传大小不超过10M' |
| | | showUploadList={{ |
| | | fileIcon: <IconLink style={{ color: '#1D2129' }} />, |
| | | }} |
| | | handleChangeFile={handleChangeFile} |
| | | label='身份证明材料' |
| | | editData={props.editData} |
| | | /> |
| | | </FormItem> |
| | | </Col> |
| | | <Col span={24}> |
| | | <FormItem |
| | | label='代理人委托书' |
| | | field='file1' |
| | | > |
| | | <Upload |
| | | drag |
| | | multiple |
| | | accept='image/*' |
| | | action='/' |
| | | onDrop={(e) => { |
| | | <ArcoUpload |
| | | params={{ |
| | | action: `${appUrl.fileUrl}/${appUrl.sys}/api/web/fileInfo/upload?mainId=${props.mainId}&ownerId=${id}&ownerType=22_00018-202`, |
| | | }} |
| | | tip='支持png、jpg、pdf格式的图片上传,每次上传大小不超过10M' |
| | | field='file1' |
| | | label='代理人委托书' |
| | | editData={props.editData} |
| | | /> |
| | | </FormItem> |
| | | </Col> |
| | | <Col span={12}> |
| | | <FormItem |
| | |
| | | > |
| | | 保存 |
| | | </Button> |
| | | <Button className="dialogBack"> |
| | | <Button |
| | | className="dialogBack" |
| | | onClick={() => { |
| | | if (props.editData) { |
| | | formRef.current.resetFields(); |
| | | formRef.current.setFieldsValue({ |
| | | ...props.editData |
| | | }) |
| | | } else { |
| | | formRef.current.resetFields(); |
| | | } |
| | | }} |
| | | > |
| | | 重置 |
| | | </Button> |
| | | </div> |
| | |
| | | import { Form, Input, Button, Radio, Select, Modal, Cascader, Upload, Message } from '@arco-design/web-react'; |
| | | import KeyVisits from "@/components/personCard/KeyVisits"; |
| | | import SelectUnitDialog from "./selectUnitDialog"; |
| | | import { |
| | | IconLink, |
| | | } from '@arco-design/web-react/icon'; |
| | | import ArcoUpload from '@/components/ArcoUpload'; |
| | | |
| | | const FormItem = Form.Item; |
| | | const Option = Select.Option; |
| | | const InputSearch = Input.Search; |
| | | const RadioGroup = Radio.Group; |
| | | const appUrl = $$.appUrl; |
| | | |
| | | |
| | | function getId() { |
| | | return $$.ax.request({ url: `caseUtils/getNewTimeId`, type: 'get', service: 'utils' }); |
| | | } |
| | | |
| | | export default function ApplyDialog(props) { |
| | | const formRef = useRef(); |
| | | const [perClass, setPerClass] = useState('09_01001-1'); |
| | | const [visible, setVisible] = useState(false); |
| | | const [id, setId] = useState() |
| | | |
| | | useEffect(() => { |
| | | if (props.editData) { |
| | |
| | | ...props.editData |
| | | }) |
| | | setPerClass(props.editData.perClass) |
| | | setId(props.editData.id) |
| | | } else { |
| | | getAppId() |
| | | } |
| | | }, []) |
| | | |
| | | //获取id |
| | | const getAppId = async () => { |
| | | const res = await getId() |
| | | if (res.type) { |
| | | setId(res.data) |
| | | } |
| | | } |
| | | |
| | | const personIconType = (v) => { |
| | | switch (v) { |
| | |
| | | } |
| | | } |
| | | |
| | | //上传身份证识别 |
| | | const handleChangeFile = (data) => { |
| | | if (data.data && data.data.length != 0) { |
| | | if (data.data[0].idcardOcrResult) { |
| | | const { birthday, ...rest } = data.data[0].idcardOcrResult |
| | | //回填信息 |
| | | formRef.current.setFieldsValue({ |
| | | ...rest |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | |
| | | //页面返回 |
| | | const formType = (type) => { |
| | | if (type === '09_01001-1') { |
| | |
| | | return ( |
| | | <> |
| | | <Col span={24}> |
| | | <FormItem |
| | | label='身份证明材料' |
| | | <ArcoUpload |
| | | params={{ |
| | | action: `${appUrl.fileUrl}/${appUrl.sys}/api/web/fileInfo/upload?mainId=${props.mainId}&ownerId=${id}&ownerType=22_00018-202`, |
| | | }} |
| | | field='file' |
| | | > |
| | | <Upload |
| | | drag |
| | | multiple |
| | | accept='image/*' |
| | | action='/' |
| | | onDrop={(e) => { |
| | | }} |
| | | tip='支持png、jpg、pdf格式的图片上传,每次上传大小不超过10M' |
| | | showUploadList={{ |
| | | fileIcon: <IconLink style={{ color: '#1D2129' }} />, |
| | | }} |
| | | handleChangeFile={handleChangeFile} |
| | | label='身份证明材料' |
| | | editData={props.editData} |
| | | /> |
| | | </FormItem> |
| | | </Col> |
| | | <Col span={12}> |
| | | <FormItem |
| | |
| | | return ( |
| | | <> |
| | | <Col span={24}> |
| | | <FormItem |
| | | label={isLegal ? '企业登记材料' : '机构登记材料'} |
| | | field='file' |
| | | > |
| | | <Upload |
| | | drag |
| | | multiple |
| | | accept='image/*' |
| | | action='/' |
| | | onDrop={(e) => { |
| | | <ArcoUpload |
| | | params={{ |
| | | action: `${appUrl.fileUrl}/${appUrl.sys}/api/web/fileInfo/upload?mainId=${props.mainId}&ownerId=${id}&ownerType=22_00018-202`, |
| | | }} |
| | | tip='支持png、jpg、pdf格式的图片上传,每次上传大小不超过10M' |
| | | field='file' |
| | | label={isLegal ? '企业登记材料' : '机构登记材料'} |
| | | editData={props.editData} |
| | | /> |
| | | </FormItem> |
| | | </Col> |
| | | <Col span={24}> |
| | | <FormItem |
| | | label={isLegal ? '法定代表人身份证明材料' : '机构代表人身份证明材料'} |
| | | field='file1' |
| | | > |
| | | <Upload |
| | | drag |
| | | multiple |
| | | accept='image/*' |
| | | action='/' |
| | | onDrop={(e) => { |
| | | <ArcoUpload |
| | | params={{ |
| | | action: `${appUrl.fileUrl}/${appUrl.sys}/api/web/fileInfo/upload?mainId=${props.mainId}&ownerId=${id}&ownerType=22_00018-202`, |
| | | }} |
| | | tip='支持png、jpg、pdf格式的图片上传,每次上传大小不超过10M' |
| | | field='file1' |
| | | label={isLegal ? '法定代表人身份证明材料' : '机构代表人身份证明材料'} |
| | | editData={props.editData} |
| | | /> |
| | | </FormItem> |
| | | </Col> |
| | | <Col span={12}> |
| | | <FormItem |
| | |
| | | formRef.current.validate(undefined, (errors, values) => { |
| | | if (!errors) { |
| | | const fieldValue = formRef.current.getFields() |
| | | console.log(fieldValue); |
| | | if (props.editData) { |
| | | props.handleAddParty({ |
| | | ...fieldValue |
| | | }) |
| | | }, true) |
| | | } else { |
| | | props.handleAddParty({ |
| | | ...fieldValue, |
| | | perType: props.dialogType, |
| | | perClass: perClass, |
| | | perTypeName: $$.options.personType.find(item => item.value === props.dialogType).label, |
| | | perClassName: $$.options.personClass.find(item => item.value === perClass).label |
| | | }) |
| | | perClassName: $$.options.personClass.find(item => item.value === perClass).label, |
| | | id: id |
| | | }, false) |
| | | } |
| | | props.onClose() |
| | | } |
| | |
| | | > |
| | | 保存 |
| | | </Button> |
| | | <Button className="dialogBack"> |
| | | <Button |
| | | className="dialogBack" |
| | | onClick={() => { |
| | | if (props.editData) { |
| | | formRef.current.resetFields(); |
| | | formRef.current.setFieldsValue({ |
| | | ...props.editData |
| | | }) |
| | | setPerClass(props.editData.perClass) |
| | | } else { |
| | | formRef.current.resetFields(); |
| | | setPerClass('09_01001-1') |
| | | } |
| | | }} |
| | | > |
| | | 重置 |
| | | </Button> |
| | | </div> |
| | |
| | | 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();//添加当事人的类型 |
| | |
| | | // 更多列配置... |
| | | ]; |
| | | |
| | | 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(); |
| | |
| | | }; |
| | | |
| | | //添加当事人 |
| | | 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) { |
| | |
| | | setFakeData(newList) |
| | | setEditData(null) |
| | | } else { |
| | | getAppId(value) |
| | | setFakeData([...fakeData, { |
| | | ...value |
| | | }]) |
| | | } |
| | | } |
| | | |
| | |
| | | <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 |
| | | /> |
| | |
| | | </FormItem> |
| | | </Col> |
| | | <Col span={8}> |
| | | <FormItem label='问题属地' field='quesAddress'> |
| | | <FormItem label='问题属地' field='myQuesAddress'> |
| | | <Cascader |
| | | placeholder='请选择' |
| | | options={$$.locationOption()} |
| | |
| | | onClose={() => setAddVisabled(false)} |
| | | handleAddParty={handleAddParty} |
| | | editData={editData} |
| | | mainId={props.mainId} |
| | | /> |
| | | </Modal> |
| | | <Modal |
| | |
| | | fakeData={fakeData} |
| | | dialogType={dialogType} |
| | | editData={editData} |
| | | mainId={props.mainId} |
| | | /> |
| | | </Modal> |
| | | <Modal |
| | |
| | | * @Author: dminyi 1301963064@qq.com |
| | | * @Date: 2024-08-09 09:59:43 |
| | | * @LastEditors: dminyi 1301963064@qq.com |
| | | * @LastEditTime: 2024-09-02 11:40:22 |
| | | * @LastEditTime: 2024-09-02 19:59:41 |
| | | * @FilePath: \gzDyh\gz-customerSystem\src\views\basicInformation\organization\index.jsx |
| | | * @Description: 来访登记 |
| | | */ |
| | | |
| | | import React, { useState, useRef, Fragment } from "react"; |
| | | import React, { useState, useRef, Fragment, useEffect } from "react"; |
| | | import NewPage from '@/components/NewPage'; |
| | | import * as $$ from '@/utils/utility'; |
| | | import "@arco-themes/react-gzzz/css/arco.css"; |
| | | import '../index.less'; |
| | | import { Space } from 'antd'; |
| | | import { Button, Steps, Tabs, Message } from '@arco-design/web-react'; |
| | | import { Button, Steps, Message } from '@arco-design/web-react'; |
| | | import VisitorRegister from './component/visitorRegister'; |
| | | import Preview from './preview'; |
| | | import { useParams } from 'react-router-dom'; |
| | | |
| | | const Step = Steps.Step; |
| | | |
| | |
| | | return $$.ax.request({ url: `caseInfo/caseRegister`, type: 'post', service: 'mediate', data }); |
| | | } |
| | | |
| | | function getDetailData(id) { |
| | | return $$.ax.request({ url: `/casedraftInfo/getCasedraftInfo?id=${id}`, type: 'get', service: 'mediate' }); |
| | | } |
| | | |
| | | const Organization = () => { |
| | | |
| | | const Organization = (props) => { |
| | | const formRef = useRef(); |
| | | const routeData = useParams(); |
| | | |
| | | const [isReview, setIsReview] = useState(false);//预览页面控制 |
| | | const [current, setCurrent] = useState(3); |
| | | const [current, setCurrent] = useState(1); |
| | | const [id, setId] = useState(); |
| | | |
| | | useEffect(() => { |
| | | if (routeData.id) { |
| | | getDeatil(routeData.id) |
| | | } else { |
| | | getAppId() |
| | | } |
| | | |
| | | }, []) |
| | | |
| | | //编辑 |
| | | const getDeatil = async (id) => { |
| | | const res = await getDetailData(id) |
| | | if (res.type) { |
| | | console.log(res); |
| | | const { agentList, personList, ...rest } = res.data |
| | | formRef.current.setFieldsValue({ |
| | | ...rest, |
| | | fakeData: agentList.concat(personList), |
| | | myCaseType: [rest.caseTypeFirst, rest.caseType], |
| | | myQuesAddress: rest.queRoad ? [rest.queProv, rest.queCity, rest.queArea, rest.queRoad] : undefined |
| | | }) |
| | | } |
| | | } |
| | | |
| | | //获取id |
| | | const getAppId = async () => { |
| | | const res = await getId() |
| | | if (res.type) { |
| | | setId(res.data) |
| | | } |
| | | } |
| | | |
| | | //提交信息,需要校验规则 |
| | | const handleSubmit = async () => { |
| | | 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() |
| | | const params = handleData(rest) |
| | | reauestSubmit({ |
| | | ...res, |
| | | ...params, |
| | | isSelfAccept: 0, |
| | | isDraft: 0, |
| | | operateType: 0, |
| | | }) |
| | | }) |
| | | } |
| | | }); |
| | |
| | | //保存草稿信息,不需要校验规则 |
| | | const handleSave = () => { |
| | | if (formRef.current) { |
| | | const data = formRef.current.getFields() |
| | | handleData(data).then(res => { |
| | | requestSave(res) |
| | | }) |
| | | const { myCaseType, myQuesAddress, ...rest } = formRef.current.getFields() |
| | | const params = handleData(rest) |
| | | requestSave(params) |
| | | } |
| | | } |
| | | |
| | | //数据处理 |
| | | const handleData = async (data) => { |
| | | const handleData = (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").map(item => { |
| | | //personNameList用于查看详情显示代理人名字,不需要上传,去除 |
| | | const { personNameList, ...rest } = item |
| | | return { |
| | | ...rest, |
| | | ...item, |
| | | personId: item.personId.join(',') |
| | | } |
| | | }), |
| | | } |
| | | } 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").map(item => { |
| | | //personNameList用于查看详情显示代理人名字,不需要上传,去除 |
| | | const { personNameList, ...rest } = item |
| | | return { |
| | | ...rest, |
| | | ...item, |
| | | personId: item.personId.join(',') |
| | | } |
| | | }), |
| | | id: res.data |
| | | } |
| | | id: id |
| | | } |
| | | } |
| | | } |
| | |
| | | </Steps> |
| | | </div> |
| | | <Preview style={{ display: isReview ? '' : 'none' }} /> |
| | | <VisitorRegister formRef={formRef} style={{ display: isReview ? 'none' : '' }} /> |
| | | <VisitorRegister formRef={formRef} style={{ display: isReview ? 'none' : '' }} mainId={id} /> |
| | | <div className="dataSync-excel"> |
| | | <Space size="large" style={{ margin: '4px 14px' }}> |
| | | <Button type="primary" style={{ backgroundColor: '#1A6FB8' }} onClick={handleSave} >保存</Button> |