From 899e81654c9389785d58f9dbdf2ea7d2b2bc9082 Mon Sep 17 00:00:00 2001 From: zhangyongtian <1181606322@qq.com> Date: Fri, 13 Sep 2024 14:55:51 +0800 Subject: [PATCH] feat: 对接流程 --- gz-customerSystem/src/views/register/eventFlow/component/EventFlow.jsx | 2 gz-customerSystem/src/api/appUrl.js | 4 gz-customerSystem/src/views/register/index.jsx | 2 gz-customerSystem/src/views/register/handleFeedback/component/AuditView.jsx | 259 ++++++++++++------- gz-customerSystem/src/views/register/handleFeedback/component/handle.jsx | 107 +++---- gz-customerSystem/src/views/register/eventFlow/component/AssignedModel.jsx | 6 gz-customerSystem/src/views/register/index.less | 1 gz-customerSystem/src/views/register/matterDetail/UniteHandle.jsx | 211 +++++++++------ gz-customerSystem/src/views/register/closingReview/index.jsx | 22 - gz-customerSystem/src/views/register/handleFeedback/index.jsx | 91 +++---- gz-customerSystem/src/views/register/eventFlow/index.jsx | 17 gz-customerSystem/src/views/register/eventFlow/component/Examine.jsx | 41 +- gz-customerSystem/src/utils/utility.js | 4 13 files changed, 413 insertions(+), 354 deletions(-) diff --git a/gz-customerSystem/src/api/appUrl.js b/gz-customerSystem/src/api/appUrl.js index 5a1ea47..e536669 100644 --- a/gz-customerSystem/src/api/appUrl.js +++ b/gz-customerSystem/src/api/appUrl.js @@ -10,11 +10,11 @@ export const debug = { // web服务 // baseUrl: 'http://gz.hugeinfo.com.cn', - baseUrl: "http://192.168.3.108:9002", + baseUrl: "http://933ymn.natappfree.cc", // baseUrl: 'http://mdqgnh.natappfree.cc', // 附件服务 - fileUrl: "http://192.168.3.108:9002", + fileUrl: "http://933ymn.natappfree.cc", // fileUrl: 'http://gz.hugeinfo.com.cn', // 文件查看url 后面接附件编号 diff --git a/gz-customerSystem/src/utils/utility.js b/gz-customerSystem/src/utils/utility.js index 2ca8375..bc2e5b1 100644 --- a/gz-customerSystem/src/utils/utility.js +++ b/gz-customerSystem/src/utils/utility.js @@ -180,8 +180,8 @@ } // 时间格式化 -export function timeFormat(value, isValue, timeFormat) { - return !!value ? moment(value).format(timeFormat ? timeFormat : 'YYYY-MM-DD HH:mm:ss') : isValue ? '' : '-'; +export function timeFormat(value, isValue) { + return !!value ? moment(value).format('YYYY-MM-DD HH:mm:ss') : isValue ? '' : '-'; } export function minuteFormat(value, isValue) { diff --git a/gz-customerSystem/src/views/register/closingReview/index.jsx b/gz-customerSystem/src/views/register/closingReview/index.jsx index a4c2a37..c692ec3 100644 --- a/gz-customerSystem/src/views/register/closingReview/index.jsx +++ b/gz-customerSystem/src/views/register/closingReview/index.jsx @@ -4,20 +4,15 @@ import "@arco-themes/react-gzzz/css/arco.css"; import '../index.less'; import { Tabs } from '@arco-design/web-react'; -import { examine, Matter, transfer, applyRecord } from '@/assets/images' +import { examine, Matter, applyRecord } from '@/assets/images' import EventFlow from '../eventFlow/component/EventFlow'; import ApplyInfo from "../matterDetail/ApplyInfo"; -import { useParams } from 'react-router-dom'; import ReviewExamine from './component/ReviewExamine'; const TabPane = Tabs.TabPane; function getTabButton(caseTaskId) { return $$.ax.request({ url: `caseTask/getTabButton?caseTaskId=${caseTaskId}`, type: 'get', service: 'mediate' }); -} - -function getCaseInfoApi(id) { - return $$.ax.request({ url: '/caseInfo/getCaseInfo?id=' + id, type: 'get', service: 'mediate' }); } const myTab = [ @@ -40,18 +35,13 @@ const ClosingReview = () => { const caseId = $$.getQueryString('caseId') const caseTaskId = $$.getQueryString('caseTaskId') - const windupId = $$.getQueryString('windupId') - const routeData = useParams(); const [authorData, setAuthorData] = useState({}); const [tabsList, setTabsList] = useState([]); const [tabsActive, setTabsActive] = useState(); - const [newId, setNewId] = useState(caseId) useEffect(() => { getAuthor(); - getCaseInfo() - console.log(caseId,caseTaskId,'caseId','caseTaskId') }, []) //获取权限tab和按钮权限 @@ -76,14 +66,6 @@ } } - const getCaseInfo = async (id) => { - const res = await getCaseInfoApi(caseId) - if(res.type){ - console.log(res.data?.id,'res.data?.idres.data?.id') - setNewId(res.data?.id) - } - } - //根据id定义组件 const getTypeDom = (key) => { if (key === 'dslxq' || key === 'sxxq') { @@ -93,7 +75,7 @@ return <ApplyInfo /> } if (key === 'jash') { - return <ReviewExamine caseTaskId={caseTaskId} caseId={caseId} id={windupId} /> + return <ReviewExamine caseTaskId={caseTaskId} caseId={caseId} /> } } diff --git a/gz-customerSystem/src/views/register/eventFlow/component/AssignedModel.jsx b/gz-customerSystem/src/views/register/eventFlow/component/AssignedModel.jsx index f80c4bf..5cc265c 100644 --- a/gz-customerSystem/src/views/register/eventFlow/component/AssignedModel.jsx +++ b/gz-customerSystem/src/views/register/eventFlow/component/AssignedModel.jsx @@ -4,7 +4,6 @@ import ArcoUpload from '@/components/ArcoUpload'; import { Scrollbars } from "react-custom-scrollbars"; import SelectObjModal from '@/components/SelectObjModal/selectPerson'; -import { useParams } from 'react-router-dom'; import * as $$ from '@/utils/utility'; import { useNavigate } from 'react-router-dom'; @@ -22,7 +21,6 @@ } export default function BackModel(props) { - const routeData = useParams(); const navigate = useNavigate(); const formRef = useRef(); const [isModalVisible, setIsModalVisible] = useState(false); @@ -38,7 +36,7 @@ formRef.current.validate(undefined, (errors, values) => { if (!errors) { handleAssign({ - caseTaskId: routeData.caseTaskId, + caseTaskId: props.caseTaskId, assignContent: values.assignContent, handleUnitId: wantUser['handleUnit'][0].value, handleUnitName: wantUser['handleUnit'][0].name, @@ -63,7 +61,7 @@ //交办请求 const handleAssign = async (data) => { - const res = await assign({ ...data, caseTaskId: props.caseTaskId }) + const res = await assign(data) if (res.type) { $$.infoSuccess({ content: '交办成功!' }); props.onCancel(); diff --git a/gz-customerSystem/src/views/register/eventFlow/component/EventFlow.jsx b/gz-customerSystem/src/views/register/eventFlow/component/EventFlow.jsx index 210f3c3..fea76d8 100644 --- a/gz-customerSystem/src/views/register/eventFlow/component/EventFlow.jsx +++ b/gz-customerSystem/src/views/register/eventFlow/component/EventFlow.jsx @@ -112,10 +112,8 @@ }, []) const onWindowResize = () => { - let offsetLeft = 0; let offsetTop = 0; if (scrollRef.current.container) { - offsetLeft = getOffset(scrollRef.current.container).left; offsetTop = getOffset(scrollRef.current.container).top; } setHeight(getSize().windowH - offsetTop - 16) diff --git a/gz-customerSystem/src/views/register/eventFlow/component/Examine.jsx b/gz-customerSystem/src/views/register/eventFlow/component/Examine.jsx index 4a2727f..44324bc 100644 --- a/gz-customerSystem/src/views/register/eventFlow/component/Examine.jsx +++ b/gz-customerSystem/src/views/register/eventFlow/component/Examine.jsx @@ -5,6 +5,7 @@ import ArcoUpload from '@/components/ArcoUpload'; import { Scrollbars } from "react-custom-scrollbars"; import * as $$ from '@/utils/utility'; +import { getOffset, getSize } from '@/utils/utility'; const RadioGroup = Radio.Group; const FormItem = Form.Item; @@ -21,18 +22,16 @@ return $$.ax.request({ url: url, type: 'post', service: 'mediate', data }); } -function getId() { - return $$.ax.request({ url: `caseUtils/getNewTimeId`, type: 'get', service: 'utils' }); -} - function delFile(id) { return $$.ax.request({ url: `fileInfo/deleteFileById`, type: 'get', service: 'sys', data: { id } }); } export default function Examine(props) { const formRef = useRef(); + const scrollRef = useRef(null); const [infoData, setInfoData] = useState({}); const [id, setId] = useState(); + const [height, setHeight] = useState(500); const mainFlag = props.type == 'htsh' ? 'return' : 'appear' const options = [ { @@ -51,16 +50,25 @@ useEffect(() => { getInfoData() - getAppId() }, [props.type]) - //获取id - const getAppId = async () => { - const res = await getId() - if (res.type) { - setId(res.data) + useEffect(() => { + onWindowResize() + window.addEventListener("resize", onWindowResize); + // 返回一个函数,该函数会在组件卸载前执行 + return () => { + // 组件销毁时执行 + window.removeEventListener("resize", onWindowResize); + }; + }, []) + + const onWindowResize = () => { + let offsetTop = 0; + if (scrollRef.current.container) { + offsetTop = getOffset(scrollRef.current.container).top; } - } + setHeight(getSize().windowH - offsetTop - 74) + }; //回显数据 const getInfoData = async () => { @@ -69,6 +77,7 @@ }) if (res.type) { setInfoData(res.data || {}) + setId(res.data.id) } } @@ -125,12 +134,12 @@ {resIndex !== res.fileList.length - 1 && <>,</>} </a> }) - })} + }) || '-'} </div> </Col> <Col span={24}> <div><div className="title-text">申请时间</div></div> - <div>{infoData[mainFlag + 'Time'] || '-'}</div> + <div>{$$.myTimeFormat(infoData[mainFlag + 'Time'], 'YYYY-MM-DD HH:mm') || '-'}</div> </Col> <Col span={24}> <div><div className="title-text">申请人</div></div> @@ -143,7 +152,7 @@ </Row> </div> <div className='whiteBox' style={{ marginTop: '8px' }}> - <Scrollbars style={{ height: 'calc(100vh - 577px)' }} autoHide> + <Scrollbars style={{ height: height + 'px' }} autoHide ref={scrollRef}> <Space size='small'> <div className='MediationInfo-subTitle' style={{ marginTop: '-8px' }}></div><h5>审核</h5> </Space> @@ -186,7 +195,7 @@ options={options} onChange={(value) => { const obj = options.find(item => item.value === value) - formRef.current.setFieldValue('audit_content', obj.label) + formRef.current.setFieldValue('auditContent', obj.label) }} > </RadioGroup> @@ -195,7 +204,7 @@ <Col span={24}> <FormItem label=' ' - field='audit_content' + field='auditContent' rules={[{ required: true, message: '理由不能为空' }]} > <TextArea diff --git a/gz-customerSystem/src/views/register/eventFlow/index.jsx b/gz-customerSystem/src/views/register/eventFlow/index.jsx index e41522d..1e4ece1 100644 --- a/gz-customerSystem/src/views/register/eventFlow/index.jsx +++ b/gz-customerSystem/src/views/register/eventFlow/index.jsx @@ -8,7 +8,6 @@ import EventFlow from './component/EventFlow'; import Examine from "./component/Examine"; import ApplyInfo from "../matterDetail/ApplyInfo"; -import { useParams } from 'react-router-dom'; const Step = Steps.Step; const TabPane = Tabs.TabPane; @@ -28,11 +27,11 @@ label: '事项详情', key: 'sxxq', }, - // { - // img: applyRecord, - // label: '申请记录', - // key: 'sqjl', - // }, + { + img: applyRecord, + label: '申请记录', + key: 'sqjl', + }, { img: examine, label: '回退审核', @@ -45,7 +44,6 @@ }, ] const Organization = () => { - const routeData = useParams(); const caseTaskId = $$.getQueryString('caseTaskId') const caseId = $$.getQueryString('caseId') const [authorData, setAuthorData] = useState({}); @@ -59,7 +57,6 @@ //获取权限tab和按钮权限 const getAuthor = async () => { - console.log(caseTaskId, caseId) const res = await getTabButton({ caseTaskId: caseTaskId }) @@ -92,11 +89,9 @@ return <ApplyInfo /> } if (key === 'htsh' || key === 'sbsh' || key === 'lhczsh') { - return <Examine type={key} caseTaskId={routeData.caseTaskId} caseId={routeData.caseId} /> + return <Examine type={key} caseTaskId={caseTaskId} caseId={caseId} /> } } - - console.log(caseId, 'caseId') return ( <div style={{ position: 'relative' }}> diff --git a/gz-customerSystem/src/views/register/handleFeedback/component/AuditView.jsx b/gz-customerSystem/src/views/register/handleFeedback/component/AuditView.jsx index fb9456b..409bbb3 100644 --- a/gz-customerSystem/src/views/register/handleFeedback/component/AuditView.jsx +++ b/gz-customerSystem/src/views/register/handleFeedback/component/AuditView.jsx @@ -1,31 +1,66 @@ -import React, { useRef, useState } from 'react'; -import { Row, Col, Space, Tooltip } from 'antd'; -import { Form, Input, Radio, Button } from '@arco-design/web-react'; +import React, { useRef, useState, useEffect } from 'react'; +import { Row, Col, Space } from 'antd'; +import { Form, Input, Radio, Button, Tooltip } from '@arco-design/web-react'; import { register } from '@/assets/images' import { question1, } from '@/assets/images'; import ArcoUpload from '@/components/ArcoUpload'; import * as $$ from '@/utils/utility'; +import { Scrollbars } from "react-custom-scrollbars"; +import { getOffset, getSize } from '@/utils/utility'; const FormItem = Form.Item; const appUrl = $$.appUrl; const RadioGroup = Radio.Group; - +const TextArea = Input.TextArea; function delFile(id) { return $$.ax.request({ url: `fileInfo/deleteFileById`, type: 'get', service: 'sys', data: { id } }); } +function getData(data) { + return $$.ax.request({ url: `caseAssistApply/getByCaseId`, type: 'get', service: 'mediate', data }); +} +function submit(data) { + return $$.ax.request({ url: `caseAssistApply/reviewCaseAssistApply`, type: 'post', service: 'mediate', data }); +} -const AuditView = () => { +const AuditView = (props) => { const formRef = useRef(); - const [value, setValue] = useState(1); - const id = 1; + const scrollRef = useRef(null); + const [id, setId] = useState(); + const [infoData, setInfoData] = useState({}); + const [height, setHeight] = useState(500); - const onChange = (e) => { - console.log('radio checked', e.target.value); - setValue(e.target.value); + useEffect(() => { + getInfoData() + onWindowResize() + window.addEventListener("resize", onWindowResize); + // 返回一个函数,该函数会在组件卸载前执行 + return () => { + // 组件销毁时执行 + window.removeEventListener("resize", onWindowResize); + }; + }, []) + + const onWindowResize = () => { + let offsetTop = 0; + if (scrollRef.current.container) { + offsetTop = getOffset(scrollRef.current.container).top; + } + setHeight(getSize().windowH - offsetTop - 74) }; + + //回显数据 + const getInfoData = async () => { + const res = await getData({ + caseId: props.caseId + }) + if (res.type) { + setInfoData(res.data || {}) + setId(res.data.id) + } + } //删除文件 const handleDelFile = async (id) => { @@ -35,104 +70,130 @@ } } - return ( - <> - <div className="auditView"> - <Col span={24} className='title'> - <Space size='small'> - <div className='MediationInfo-subTitle' style={{ marginTop: '-9px' }}></div><h5>联合处置申请</h5> - </Space> - </Col> - <Row gutter={[16, 16]}> - <Col span={24}> - <div><div className="title-text">添加配合部门</div></div> - <div>白云区新市街司法所、白云区新市街劳监大队</div> - </Col> - <Col span={24}> - <div><div className="title-text">添加理由</div></div> - <div>在调解过程中,我们发现需要白云区新市街司法所的专业司法能力支持事项办理,以促进调解工作的顺利进行。</div> - </Col> - {/*事项等级分为三级,颜色需要做判断*/} - <Col span={24}> - <div className="title"><div className="title-text">申请时间</div></div> - <div >2024-7-21 12:00</div> - </Col> - <Col span={24}> - <div><div className="title-text">申请人</div></div> - <div>广州市白云区新市街汇桥北社区委员会 张三丰<img src={register} alt='' style={{ width: '14px', height: '14px', marginLeft: '8px', marginTop: '-1px' }}/></div> - </Col> - </Row> + const handleSubmit = () => { + if (formRef.current) { + formRef.current.validate(undefined, (errors, values) => { + if (!errors) { + const { file, ...rest } = formRef.current.getFields() + requestSubmit({ + ...rest, + id: id + }) + } + }) + } + } - </div> - <div className="auditView"> - <Col span={24} className='title'> - <Space size='small'> - <div className='MediationInfo-subTitle' style={{ marginTop: '-9px' }}></div><h5>审核</h5> - </Space> - </Col> - <Form - ref={formRef} - layout='vertical' - requiredSymbol={false} - scrollToFirstError={true} - > - <Row style={{ marginBottom: '-16px' }}> + const requestSubmit = async (data) => { + const res = await submit(data) + if (res.type) { + $$.infoSuccess({ content: '提交成功!' }); + } + } + + return ( + <div className='dataSync'> + <div className='dataSync-noBackTabPage'> + <div className="whiteBox"> + <Col span={24} className='title'> + <Space size='small'> + <div className='MediationInfo-subTitle' style={{ marginTop: '-9px' }}></div><h5>联合处置申请</h5> + </Space> + </Col> + <Row gutter={[16, 16]}> <Col span={24}> - <FormItem - label='审核结果' - field='majorStatus' - > - <RadioGroup options={[{ value: 0, label: '否' }, { value: 1, label: '是' }]} direction='vertical' /> - </FormItem> + <div><div className="title-text">添加配合部门</div></div> + <div>{infoData.applyAssistUnitName || '-'}</div> </Col> <Col span={24}> - <FormItem - label={(<div style={{ display: 'flex' }}>理由说明<div className="must">必填</div></div>)} - field='handleContent' - rules={[{ message: '请填写不同意联合处置申请的理由', required: true }]} - > - <Input.TextArea - maxLength={200} - showWordLimit - rows={5} - placeholder='请完整描述事项概况,应具备5要素:发生时间+发生地点+人物情况+事项起因+事项经过' - wrapperStyle={{ width: '100%' }} - /> - </FormItem> + <div><div className="title-text">添加理由</div></div> + <div>{infoData.applyContent || '-'}</div> </Col> <Col span={24}> - <FormItem - label={<div style={{ display: 'flex' }}> - <span style={{ color: '#86909C' }}>附件材料</span> - <Tooltip> - <img src={question1} alt="" style={{ width: '13px', height: '13px', margin: '4px 4px 0px 4px' }} /> - </Tooltip> - </div> - } - field='caseDes' - rules={[{ message: '请填写事项概况', required: true }]} - > - <ArcoUpload - params={{ - action: `${appUrl.fileUrl}/${appUrl.sys}/api/web/fileInfo/upload?mainId='24083010062110001'&&ownerId=${id}&ownerType=22_00018-102`, - }} - field='file1' - // handleChangeFile={handleChangeFile} - label='' - // editData={props.editData} - handleDelFile={handleDelFile} - /> - </FormItem> + <div className="title"><div className="title-text">申请时间</div></div> + <div>{$$.myTimeFormat(infoData.applyTime, 'YYYY-MM-DD HH:mm') || '-'}</div> + </Col> + <Col span={24}> + <div><div className="title-text">申请人</div></div> + <div> + {infoData.applyUnitName} + {infoData.applyUserName || '-'} + <img src={register} alt="" className="title-register" /> + </div> </Col> </Row> - </Form> - <Space style={{}}> - <Button type='primary' >提交</Button> - <Button type='secondary'>返回上级页面</Button> - </Space> - </div> - </> + </div> + <div className='whiteBox' style={{ marginTop: '8px' }}> + <Scrollbars style={{ height: height + 'px' }} autoHide ref={scrollRef}> + <Space size='small'> + <div className='MediationInfo-subTitle' style={{ marginTop: '-8px' }}></div><h5>审核</h5> + </Space> + <Form + ref={formRef} + layout='vertical' + requiredSymbol={false} + initialValues={{ + }}//默认值 + scrollToFirstError + > + <Row> + <Col span={24}> + <FormItem + label={(<div style={{ display: 'flex' }}>审核结果</div>)} + field='auditResult' + > + <RadioGroup + direction='vertical' + options={$$.options.auditResult} + onChange={(value) => { + if (value) { + const data = $$.options.auditResult.find(item => item.value === value) + formRef.current.setFieldValue('auditResultName', data.label) + } else { + formRef.current.setFieldValue('auditResultName', '') + } + }} + /> + </FormItem> + </Col> + <Col span={24}> + <FormItem + label={(<div style={{ display: 'flex' }}>理由说明<div className="must">必填</div></div>)} + field='auditContent' + rules={[{ required: true, message: '请选择理由说明' }]} + > + <TextArea + autoSize={{ minRows: 4, maxRows: 8 }} + placeholder='请填写不同意联合处置申请的理由' + /> + </FormItem> + </Col> + <Col span={24} className="doubleFile"> + <ArcoUpload + params={{ + action: `${appUrl.fileUrl}/${appUrl.sys}/api/web/fileInfo/upload?mainId=${props.caseId}&ownerId=${id}&ownerType=22_00018-509`, + }} + field='file' + label='附件材料' + handleDelFile={handleDelFile} + /> + </Col> + </Row> + </Form> + </Scrollbars> + <div className='dialogFooter'> + <Button + type="primary" + className="dialogPrimary" + onClick={handleSubmit} + > + 提交 + </Button> + </div> + </div> + </div> + </div> ) } diff --git a/gz-customerSystem/src/views/register/handleFeedback/component/handle.jsx b/gz-customerSystem/src/views/register/handleFeedback/component/handle.jsx index 3c2f1ba..1445e06 100644 --- a/gz-customerSystem/src/views/register/handleFeedback/component/handle.jsx +++ b/gz-customerSystem/src/views/register/handleFeedback/component/handle.jsx @@ -16,19 +16,11 @@ import SupervisingView from '../../matterDetail/Supervising' import UniteHandle from '../../matterDetail/UniteHandle'; import { useNavigate } from 'react-router-dom'; -import MyUpload from '@/components/MyUpload'; - - const Option = Select.Option; const FormItem = Form.Item; const TabPane = Tabs.TabPane; const appUrl = $$.appUrl; - - - - - function choosePrincipalApi(caseId, userId) { return $$.ax.request({ url: `caseInfoUnfold/choosePrincipal?caseId=${caseId}&userId=` + userId, type: 'get', service: 'mediate' }); @@ -92,9 +84,34 @@ const [caseResultId, setCaseResultId] = useState(''); const [managerName, setManagerName] = useState('') const [progressData, setProgressData] = useState({}); + const [staticButtonList, setStaticButtonList] = useState([]) - - + const myButton = [ + { + label: '添加办理记录', + type: 'primary', + click: () => addMark(), + key: 'tjbljl', + }, + { + label: '联合处置申请', + type: 'outline', + click: () => uniteHandle(), + key: 'lhczsq', + }, + { + label: '结案申请', + type: 'outline', + click: () => uniteHandle(), + key: 'jasq', + }, + { + label: '督办', + type: 'outline', + click: () => Supervising(), + key: 'db', + }, + ] const tabs1 = [ { index: '1', label: '公共模板:提醒尽快启动调解程序督办模板' }, @@ -104,12 +121,6 @@ const options = [ { value: '1', label: '一' }, { value: '2', label: '二' }, { value: '3', label: '三' } ]; - - - - - - const handleCheckedKeys = (userId) => { choosePrincipal(userId) @@ -217,8 +228,9 @@ if (type === 'uniteHandle') { setUniteHandleId(res.data) } - if (type === 'addMark') + if (type === 'addMark') { setId(res.data) + } if (type === 'caseResult') { setCaseResultId(res.data) } @@ -313,19 +325,20 @@ getFeedbackInfo(); }, []) - // useEffect(() => { - // if (authorData) { - // const { buttonList } = authorData; - // setStaticButtonList(myButton.filter(item => { - // const flag = buttonList.some(result => { - // if (result.id === item.key) { - // return true - // } - // }) - // return flag - // })) - // } - // }, [authorData]) + useEffect(() => { + if (authorData) { + const { buttonList } = authorData; + setStaticButtonList(myButton.filter(item => { + const flag = buttonList.some(result => { + if (result.id === item.key) { + return true + } + }) + return flag + })) + console.log(buttonList, myButton); + } + }, [authorData]) @@ -451,14 +464,13 @@ {!formView && <div className="dataSync-excel"> <Space size="middle" style={{ margin: '4px 14px' }}> - <Button type="primary" style={{ backgroundColor: '#1A6FB8' }} onClick={() => addMark()}>添加办理记录</Button> - <Button type='outline' style={{ color: '#1A6FB8', border: '1px solid #1A6FB8' }} onClick={() => uniteHandle()}>联合处置申请</Button> - <Button type='outline' style={{ color: '#1A6FB8', border: '1px solid #1A6FB8' }} onClick={() => handleCaseResultApply()} >结案申请</Button> - <Button type='outline' style={{ color: '#EF6C24', border: '1px solid #EF6C24' }} onClick={() => Supervising()}>督办</Button> + {staticButtonList?.map(item => { + const { label, key, click, ...rest } = item; + return <Button key={key} onClick={click} {...rest} >{label}</Button> + })} <Button type='secondary' onClick={() => navigate(-1)}>返回上级页面</Button> </Space> </div> - } </div> <div className='container-bottom-right'> @@ -475,29 +487,6 @@ <div className='progress' style={{ paddingBottom: '16px', marginTop: '0px' }} > <ProgressStep progressData={progressData} hasTab={true} /> </div> - - {/* <div style={{ display: 'flex', marginLeft: '16px', gap: '16px' }}> - {tabs.map((tab) => ( - <div - key={tab.index} - style={{ - color: selectedTab === tab.index ? 'rgba(26,111,184,1)' : 'rgba(0,0,0,0.45)', - padding: '6px 12px', - border: `1px solid ${selectedTab === tab.index ? 'rgba(26,111,184,1)' : 'rgba(229,230,235,1)'}`, - borderRadius: '4px', - cursor: 'pointer', - }} - onClick={() => handleTabChange(tab.index)} - > - {tab.label} - </div> - ))} - </div> - {selectedTab === '1' && - <div className='progress'> - <ProgressStep progressData={fakeData} /> - </div> - } */} </Typography.Paragraph> </TabPane> <TabPane @@ -642,7 +631,7 @@ </Row> </Form> </Modal> - <UniteHandle id={uniteHandleId} visible={uniteHandleView} handleOnCancel={() => setUniteHandleView(false)} /> + <UniteHandle id={uniteHandleId} visible={uniteHandleView} handleOnCancel={() => setUniteHandleView(false)} caseId={caseId} caseTaskId={caseTaskId} /> <CaseResult visible={caseResult} handleOnCancel={() => SetCaseResult(false)} caseResultId={caseResultId} caseId={caseId} caseTaskId={caseTaskId} /> </div> diff --git a/gz-customerSystem/src/views/register/handleFeedback/index.jsx b/gz-customerSystem/src/views/register/handleFeedback/index.jsx index 3d09833..14e810a 100644 --- a/gz-customerSystem/src/views/register/handleFeedback/index.jsx +++ b/gz-customerSystem/src/views/register/handleFeedback/index.jsx @@ -14,13 +14,13 @@ import "@arco-themes/react-gzzz/css/arco.css"; import '../index.less'; import { Typography, Steps, Tabs } from '@arco-design/web-react'; -import { Audit, Matter, applyRecord, transfer, Aimge } from '@/assets/images' +import { Audit, Matter, applyRecord, transfer, Aimge, examine } from '@/assets/images' import MatterDetail from '../matterDetail'; import Handle from './component/handle'; import AuditView from './component/AuditView'; import { AiQuestion } from '../visit/component/levelDetail'; import * as $$ from '@/utils/utility'; -import { useParams } from 'react-router-dom'; +import ApplyInfo from "../matterDetail/ApplyInfo"; const Step = Steps.Step; @@ -38,8 +38,6 @@ return $$.ax.request({ urlAi: `case-law/get-law`, typeAi: 'post', service: 'mediate', data }); } - - function getTabButton(caseTaskId) { return $$.ax.request({ url: `caseTask/getTabButton?caseTaskId=` + caseTaskId, type: 'get', service: 'mediate' }); } @@ -48,10 +46,7 @@ return $$.ax.request({ url: '/caseInfo/getCaseInfo?id=' + id, type: 'get', service: 'mediate' }); } - - const Organization = () => { - const routeData = useParams(); const caseTaskId = $$.getQueryString('caseTaskId') const caseId = $$.getQueryString('caseId') const [current, setCurrent] = useState(3); @@ -60,9 +55,7 @@ const [aiData, setAiData] = useState([]) const [aiLawData, setAiLawData] = useState([]); const [caseDetailAi, setCaseDetailAi] = useState({}); - const [caseDetailView, setCaseDetail] = useState({}) const [authorData, setAuthorData] = useState({}); - const [disTab, setDisTab] = useState(true); const [tabsList, setTabsList] = useState([]); const myTab = [ { @@ -71,35 +64,44 @@ key: "sxxq" }, { - img: transfer, + img: transfer, label: '事项办理', key: "sxbl", isNeedStep: true, }, - // { - // img: applyRecord, - // label: '申请记录', - // key: "sqjl", - // }, + { + img: applyRecord, + label: '申请记录', + key: "sqjl", + }, + { + img: examine, + label: '联合处置审核', + key: 'lhczsh', + }, ] + + useEffect(() => { + getCaseInfo(caseId) + getAuthor(); + }, []) const handleAi = () => { setAiQuestionView(true) } - const getCase = async (caseDes,caseClaim) => { + const getCase = async (caseDes, caseClaim) => { const res = await getCaseApi({ caseDes: caseDes, caseClaim: caseClaim, caseId: caseId }) - console.log(res.data, 'res') if (res.type) { setAiData(res.data) } } - const getLaw = async (caseDes,caseClaim) => { + const getLaw = async (caseDes, caseClaim) => { const res = await getLawApi({ caseDes: caseDes, caseClaim: caseClaim, @@ -110,17 +112,13 @@ } } - - const getAuthor = async () => { const res = await getTabButton(caseTaskId) if (res.type) { const { tabList } = res.data - console.log(tabList, 'tabList1') setAuthorData(res.data) if (tabList.length === 0) { //没有tab就不展示 - setDisTab(false) } else { setTabsList(myTab.filter(item => { const flag = tabList.some(result => { @@ -130,7 +128,6 @@ }) return flag })) - console.log(tabsList, 'tabsList2') setTabsActive(tabList[0].id) } } @@ -143,24 +140,26 @@ let caseDes = res.data.caseDes; let caseClaim = res.data.caseClaim; setCaseDetailAi(caseDes) - getCase(caseDes,caseClaim); - getLaw(caseDes,caseClaim); + getCase(caseDes, caseClaim); + getLaw(caseDes, caseClaim); } } - - - - useEffect(() => { - getCaseInfo(caseId) - getAuthor(); - // getCase(); - // getLaw(); - console.log(caseDetailAi, 'caseDetailAi') - }, []) - - - + //根据id定义组件 + const getTypeDom = (key) => { + if (key === 'sxxq') { + return <MatterDetail hasApplet={true} hasEditBtn={true} authorData={authorData} caseId={caseId} /> + } + if (key === 'sxbl') { + return <Handle authorData={authorData} caseId={caseId} caseTaskId={caseTaskId} /> + } + if (key === 'sqjl') { + return <ApplyInfo /> + } + if (key === 'lhczsh') { + return <AuditView authorData={authorData} caseId={caseId} caseTaskId={caseTaskId} /> + } + } return ( <div style={{ position: 'relative', height: '100vh' }}> @@ -170,9 +169,9 @@ } > <Tabs - defaultActiveTab='sxxq' onChange={(v) => setTabsActive(v)} className='myTabContent' + activeTab={tabsActive} > {tabsList?.map(item => { return <TabPane @@ -196,19 +195,7 @@ </Steps> </div> } - {tabsActive === 'sxxq' && - <MatterDetail hasApplet={true} hasEditBtn={true} authorData={authorData} caseId={caseId} /> - } - { - tabsActive === 'sxbl' && <Typography.Paragraph style={style}> - <Handle authorData={authorData} caseId={caseId} caseTaskId={caseTaskId} /> - </Typography.Paragraph> - } - { - tabsActive === 'sqjl' && <Typography.Paragraph style={style}> - <AuditView authorData={authorData} /> - </Typography.Paragraph> - } + {getTypeDom(item.key)} </TabPane> })} </Tabs> diff --git a/gz-customerSystem/src/views/register/index.jsx b/gz-customerSystem/src/views/register/index.jsx index f002ed1..4ea13a9 100644 --- a/gz-customerSystem/src/views/register/index.jsx +++ b/gz-customerSystem/src/views/register/index.jsx @@ -848,7 +848,7 @@ render: (text, record) => ( <Space style={{ color: '#1A6FB8' }}> <div onClick={() => navigate(`/mediate/visit/fileMessage?caseTaskId=${record.ownerId}&caseId=${record.caseId}`)} style={{ cursor: 'pointer' }}>详情</div> - <div onClick={() => navigate(`/mediate/visit/handleFeedback?caseTaskId=${record.ownerId}&caseId=${record.caseId}`)} style={{ cursor: 'pointer' }}>审核</div> + <div onClick={() => navigate(`/mediate/visit/closingReview?caseTaskId=${record.ownerId}&caseId=${record.caseId}`)} style={{ cursor: 'pointer' }}>审核</div> </Space> ), }]), diff --git a/gz-customerSystem/src/views/register/index.less b/gz-customerSystem/src/views/register/index.less index ef63471..80e2bd0 100644 --- a/gz-customerSystem/src/views/register/index.less +++ b/gz-customerSystem/src/views/register/index.less @@ -716,6 +716,7 @@ position: absolute; right: 0; top: 60%; + cursor: pointer; } .aiBox { diff --git a/gz-customerSystem/src/views/register/matterDetail/UniteHandle.jsx b/gz-customerSystem/src/views/register/matterDetail/UniteHandle.jsx index 53965fa..3bac15e 100644 --- a/gz-customerSystem/src/views/register/matterDetail/UniteHandle.jsx +++ b/gz-customerSystem/src/views/register/matterDetail/UniteHandle.jsx @@ -1,30 +1,28 @@ import React, { useState, useRef } from 'react'; -import { Form, Input, Tabs, Typography, Button, Modal, Select } from '@arco-design/web-react'; -import { Col, Space, Row, Tooltip } from 'antd'; +import { Form, Input, Button, Modal, Select, Tooltip } from '@arco-design/web-react'; +import { Col, Row } from 'antd'; import ArcoUpload from '@/components/ArcoUpload'; import * as $$ from '@/utils/utility'; import { question1, } from '@/assets/images'; +import SelectObjModal from '@/components/SelectObjModal/selectPerson'; const FormItem = Form.Item; -const Option = Select.Option; const appUrl = $$.appUrl; function delFile(id) { return $$.ax.request({ url: `fileInfo/deleteFileById`, type: 'get', service: 'sys', data: { id } }); } +function postAssistApply(data) { + return $$.ax.request({ url: `caseAssistApply/addCaseAssistApply`, type: 'post', service: 'mediate', data }); +} -const UniteHandle = ({ id, visible, handleOnCancel }) => { + +const UniteHandle = ({ id, visible, handleOnCancel, caseId, caseTaskId }) => { const formRef = useRef(); - const [supervising, setSupervising] = useState(false); - const [fileVisible, setFileVisible] = useState(false); - - const options = [ - { value: '1', label: '一' }, { value: '2', label: '二' }, { value: '3', label: '三' } - ]; - - - + const [isModalVisible, setIsModalVisible] = useState(false); + const [wantUser, setWantUser] = useState([]); + const [selectOptions, setSelectOptions] = useState([]);//部门选择的options //删除文件 const handleDelFile = async (id) => { @@ -35,84 +33,125 @@ } const handleSupervising = () => { - setSupervising(!supervising) + formRef.current.validate(undefined, (errors, values) => { + if (!errors) { + handleJoint({ + id, + caseId, + applyContent: values.applyContent, + applyAssistUnitId: wantUser?.map(item => item.value).join(',') || '', + applyAssistUnitName: wantUser?.map(item => item.name).join(',') || '', + }) + } + }) } + //form数据同步要提交的数据 + const handleSync = (value) => { + let newList = wantUser.filter(item => value.indexOf(item.value) != -1) + setWantUser(newList); + } + + //联合处置请求 + const handleJoint = async (data) => { + const res = await postAssistApply(data) + if (res.type) { + $$.infoSuccess({ content: '提交申请成功!' }); + handleOnCancel(); + } + } return ( - <> - <Modal visible={visible} onCancel={handleOnCancel} title='联合处置申请' centered footer={null}> - <Form - ref={formRef} - layout='vertical' - requiredSymbol={false} - scrollToFirstError={true} - initialValues={{ - suggestion: '' - }}//默认值 - > - <Row> - <Col span={24}> - <FormItem - label={<div style={{ display: 'flex' }}><div>添加配合部门</div><div style={{ color: '#86909C' }}>(可多选)</div></div>} - field='' + <Modal + visible={visible} + onCancel={handleOnCancel} + title='联合处置申请' + centered + footer={null} + unmountOnExit={true} + maskClosable={false} + autoFocus={false} + focusLock={false} + > + <Form + ref={formRef} + layout='vertical' + requiredSymbol={false} + scrollToFirstError={true} + initialValues={{ + applyContent: '在事项办理过程中:\n因[......业务]涉及白云区新市街司法所\n因[......业务]涉及白云区新市街劳监大队\n特申请将上述部门列为配合部门,请审批' + }}//默认值 + > + <Row> + <Col span={24}> + <FormItem + label={<div style={{ display: 'flex' }}><div>添加配合部门</div><div style={{ color: '#86909C' }}>(可多选)</div></div>} + field='unit' + > + <Select + mode='multiple' + placeholder='请选择配合部门' + allowClear + onFocus={(e) => { + e.stopPropagation() + setIsModalVisible(true) + }} + options={selectOptions} + onChange={handleSync} > - <Select - mode='multiple' - placeholder='请选择督办部门' - style={{}} - allowClear - > - {options.map((option) => ( - <Option key={option.value} value={option.value} onChange={(v) => console.log(v, 'vvvvvv')}> - {option.label} - </Option> - ))} - </Select> - </FormItem> - </Col> - <Col span={24}> - <FormItem - field='suggestion' - label={(<div style={{ display: 'flex' }}>添加理由<div className="must">必填</div></div>)} - > - <Input.TextArea - rows={5} - wrapperStyle={{ width: '700px' }} - value='在事项办理过程中:因[......业务]涉及白云区新市街司法所因[......业务]涉及白云区新市街劳监大队特申请将上述部门列为配合部门,请审批' - /> - </FormItem> - </Col> - <Col span={24}> - <FormItem - label={ - <div> - 附件材料 - <Tooltip onClick={() => setFileVisible(true)}> - <img src={question1} alt="" style={{ width: '13px', height: '13px', margin: '-3px 4px 0px 4px' }} /> - </Tooltip> - </div> - } - field='caseDes' - rules={[{ message: '请填写事项概况', required: true }]} - > - <ArcoUpload - params={{ - action: `${appUrl.fileUrl}/${appUrl.sys}/api/web/fileInfo/upload?mainId='24083010062110001'&&ownerId=${id}&ownerType=22_00018-508`, - }} - field='file1' - // handleChangeFile={handleChangeFile} - label='' - // editData={props.editData} - handleDelFile={handleDelFile} - /> - </FormItem> - </Col> - <Button type='primary' style={{ marginTop: '-16px' }} onClick={() => handleSupervising()}>提交申请</Button> - </Row> - </Form> - </Modal> - </> + </Select> + </FormItem> + </Col> + <Col span={24}> + <FormItem + field='applyContent' + label={(<div style={{ display: 'flex' }}>添加理由<div className="must">必填</div></div>)} + rules={[{ required: true, message: '请输入添加理由' }]} + > + <Input.TextArea + rows={5} + /> + </FormItem> + </Col> + <Col span={24}> + <ArcoUpload + params={{ + action: `${appUrl.fileUrl}/${appUrl.sys}/api/web/fileInfo/upload?mainId=${caseId}&&ownerId=${id}&ownerType=22_00018-508`, + }} + field='file' + label={ + <div> + 附件材料 + <Tooltip> + <img src={question1} alt="" style={{ width: '13px', height: '13px', margin: '-3px 4px 0px 4px' }} /> + </Tooltip> + </div> + } + handleDelFile={handleDelFile} + /> + </Col> + <div className='dialogFooter'> + <Button type='primary' style={{ marginTop: '-16px' }} onClick={handleSupervising}>提交申请</Button> + </div> + </Row> + </Form> + <SelectObjModal + visible={isModalVisible} + checkKeys={wantUser} + onOk={(value) => { + console.log(value); + setWantUser(value.items) + setSelectOptions(value.items.map(item => ({ + label: item.name, + value: item.value + }))) + formRef.current.setFieldValue('unit', value.items.map(item => item.value)) + }} + onClose={() => setIsModalVisible(false)} + type='dept' + isCheckbox={true} + /> + </Modal> ) } -- Gitblit v1.8.0