From 4e3b493f07b4bc7f325a4b8ebc91704ec8e902a9 Mon Sep 17 00:00:00 2001
From: liuwh <964324856@qq.com>
Date: Tue, 10 Sep 2024 16:54:43 +0800
Subject: [PATCH] PC端来访登记

---
 gz-customerSystem/src/views/register/matterDetail/fileMessage.jsx |  270 +++++++++++++++++++++++++++++++++--------------------
 1 files changed, 167 insertions(+), 103 deletions(-)

diff --git a/gz-customerSystem/src/views/register/matterDetail/fileMessage.jsx b/gz-customerSystem/src/views/register/matterDetail/fileMessage.jsx
index 2bb5a4f..13869c8 100644
--- a/gz-customerSystem/src/views/register/matterDetail/fileMessage.jsx
+++ b/gz-customerSystem/src/views/register/matterDetail/fileMessage.jsx
@@ -1,28 +1,51 @@
-import React, { useState } from 'react';
+import React, { useEffect, useState } from 'react';
 import NewPage from '@/components/NewPage';
 import { Row, Col, Space } from 'antd';
-import { Steps, Tabs, Typography, Rate,Button } from '@arco-design/web-react';
-import { apply } from '@/assets/images';
+import { Steps, Tabs, Typography, Rate, Button } from '@arco-design/web-react';
+import { apply,floating } from '@/assets/images';
 import { result } from '@/assets/images/icon';
 import * as $$ from '@/utils/utility';
-import { ApplyDialog, AgentDialog, Respondent } from '../visit/component/previewTable';
 import TableView from '../../../components/TableView';
 import { register, fold, down, empty, link } from '@/assets/images';
 import ProgressStep from '@/components/ProgressStep/VisitStep';
-
-
+import { ApplyDialog, AgentDialog, Respondent, Company } from '../visit/component/previewTable';
+import HandleRecord from './HandleRecord';
+import { useParams } from 'react-router-dom';
+import ApplyInfo from './ApplyInfo'
 
 
 const Step = Steps.Step;
 const TabPane = Tabs.TabPane;
 
+function getTransactResultApi(caseId) {
+  return $$.ax.request({ url: `caseInfoUnfold/getTransactResult?caseId=${caseId}`, type: 'get', service: 'mediate' });
+}
+
+function getByCaseIdApi(caseId) {
+  return $$.ax.request({ url: `caseEvaluate/getByCaseId?caseId=${caseId}`, type: 'get', service: 'mediate' });
+}
+
+function getCaseInfoApi(id) {
+  return $$.ax.request({ url: 'caseInfo/getCaseInfo?id=' + id, type: 'get', service: 'mediate' });
+}
+
+function listFeedbackApi(id) {
+  return $$.ax.request({ url: `caseFeedback/listFeedback?id=` + id, type: 'get', service: 'mediate' });
+}
+
+function getListCaseFlow(data) {
+  return $$.ax.request({ url: `caseTask/listCaseFlow`, type: 'get', service: 'mediate', data });
+}
+
 
 const FileMessage = (props) => {
-
+	const routeData = useParams();
   const [tabsActive, setTabsActive] = useState('1');
   const [current, setCurrent] = useState(7);
+  const [grade, setGrade] = useState(0);
+  const [caseInfo, setCaseInfo] = useState({})
+  const [TransactResult, setTransactResult] = useState({})
   const [filesCheck, setFilesCheck] = useState(false);
-  const [infoData, setInfoData] = useState({});
   const [tabsList, setTabList] = useState([
     {
       img: result,
@@ -31,13 +54,19 @@
       isNeedStep: true
     },
     {
+      img: floating,
+      label: '流转督办',
+      key: '2',
+    },
+    {
       img: apply,
       label: '申请记录',
-      key: '2',
-      isNeedStep: true,//加上这个就有进度条
+      key: '3',
     },
   ])
   const [selectedTab, setSelectedTab] = useState('1'); // 默认选中第一个 tab
+  const [list, setList] = useState([])
+  const [progressData, setProgressData] = useState({})
 
 
   const tabs = [
@@ -100,59 +129,42 @@
     setSelectedTab(newTabIndex);
   };
 
-  const applyDialog = [
-    {
-      trueName: '李四',
-      perClassName: '高级',
-      phone: '13700137000',
-      sex: '女',
-      certiTypeName: '护照',
-      certiNo: 'G12345678',
-      nationName: '满',
-      addr: '上海市浦东新区某公寓2号楼2单元202室',
-      placeAddr: '上海市黄浦区某路3号',
-      extreme: '否',
-      workUnit: '上海某金融公司',
-      person: '/path/to/anotherPerson.jpg', // 这应该是图片的实际路径
-      link: '/path/to/anotherLink.png',     // 这应该是链接图标的实际路径
+  const getTransactResult = async () => {
+    const res = await getTransactResultApi('24083010062110001')
+    if (res.type) {
+      setTransactResult({ ...res.data, fileName: res.data.fileInfoBaseDTOList.map(item => item.trueName) })
     }
-    // 可以根据需要添加更多的对象来模拟更多条目的数据
-  ];
+  }
 
-  const agentDialog = [
-    {
-      trueName: '王五',
-      perClassName: '自然人',
-      phone: '13600136000',
-      sex: '男',
-      certiTypeName: '身份证',
-      certiNo: '110101199501012345',
-      nationName: '汉',
-      addr: '广州市天河区某大厦A座501室',
-      placeAddr: '广州市越秀区某街4号',
-      extreme: '否',
-      workUnit: '广州某贸易公司',
-      agentRelateName: '配偶',
-      agentTypeName: '法定代理人',
-      perTypeName: '成年人',
-      person: '/path/to/person.jpg', // 应该是图片的实际路径
-      link: '/path/to/link.png',     // 应该是链接图标的实际路径
-    },
-  ];
+  const getByCaseId = async () => {
+    const res = await getByCaseIdApi('24083010062110001')
+    setGrade(res.data)
+    console.log(res, 'resrs')
+  }
 
-  const respondent = [
-    {
-      orgaType: '广东好又多贸易有限公司',
-      perClassName: '企业法人',
-      phone: '020-12345678',
-      address: '广州市天河区珠江新城花城大道66号',
-      companyType: '有限责任公司',
-      legalPerson: '江照月',
-      creditCode: '914401011234567890',
-      president: '广州市天河区珠江新城花城大道66号A座20层',
-      link: '/path/to/link.png', // 应该是链接图标的实际路径
-    },
-  ];
+  const getCaseInfo = async () => {
+    const res = await getCaseInfoApi('24083010062110001')
+    if (res.type) {
+      setCaseInfo(res.data)
+    }
+  }
+
+  const listFeedback = async (id) => {
+    const res = await listFeedbackApi(id)
+    if (res.type) {
+      let data = res.data.caseFeedbackList
+      setList(data)
+    }
+  }
+
+  const getData = async () => {
+    const res = await getListCaseFlow({
+      caseId: routeData.caseId
+    })
+    if (res.type) {
+      setProgressData(res.data)
+    }
+  }
 
   const fakeColumns = [
     {
@@ -327,7 +339,24 @@
   };
 
 
+  useEffect(() => {
+    getByCaseId();
+    getTransactResult();
+    getCaseInfo();
+    listFeedback('24083010062110001');
+    getData()
+  }, [])
 
+
+  const applyData = caseInfo?.personList?.filter(item => item.perTypeName === "申请方当事人" && item.perClassName === "自然人");
+  const agentData = caseInfo?.personList?.filter(item => item.perTypeName === "申请方代理人");
+  const company = caseInfo?.personList?.filter(item => item.perTypeName === "申请方当事人" && item.perClassName === "非法人组织");
+  const respondentData = caseInfo?.personList?.filter(item => item.perTypeName === "申请方当事人" && item.perClassName === "法人");
+
+  const applyData1 = caseInfo?.personList?.filter(item => item.perTypeName === "被申请方当事人" && item.perClassName === "自然人");
+  const agentData1 = caseInfo?.personList?.filter(item => item.perTypeName === "被申请方代理人");
+  const company1 = caseInfo?.personList?.filter(item => item.perTypeName === "被申请方当事人" && item.perClassName === "非法人组织");
+  const respondentData1 = caseInfo?.personList?.filter(item => item.perTypeName === "被申请方当事人" && item.perClassName === "法人");
 
 
 
@@ -374,22 +403,52 @@
                         <div className='MediationInfo-subTitle' style={{ marginTop: '-9px' }}></div><h4>当事人信息</h4>
                       </Space>
                     </Col>
-
                     <div style={{ marginBottom: '8px' }}>申请方</div>
                     <div className="line-container" style={{ marginBottom: '20px' }}>
                       <div className="line left-line"></div>
                       <div className="line middle-line"></div>
                       <div className="line right-line"></div>
                     </div>
-                    <ApplyDialog applyDialog={applyDialog} />
-                    <AgentDialog agentDialog={agentDialog} />
+                    {/* ApplyDialog 只有在 applyData 存在且不为空时才渲染 */}
+                    {applyData && applyData.length > 0 ? (
+                      <ApplyDialog applyDialog={applyData} />
+                    ) : null}
+
+                    {/* AgentDialog 只有在 agentData 存在且不为空时才渲染 */}
+                    {agentData && agentData.length > 0 ? (
+                      <AgentDialog agentDialog={agentData} />
+                    ) : null}
+
+                    {/* Respondent 只有在 respondentData 存在且不为空时才渲染 */}
+                    {respondentData && respondentData.length > 0 ? (
+                      <Respondent respondent={respondentData} />
+                    ) : null}
+
+                    {company && company.length > 0 ? (
+                      <Company company={company} />
+                    ) : null}
+
                     <div style={{ marginBottom: '8px' }}>被申请方</div>
                     <div className="line-container" style={{ marginBottom: '20px' }}>
                       <div className="line left-line"></div>
                       <div className="line middle-line"></div>
                       <div className="line right-line"></div>
                     </div>
-                    <Respondent respondent={respondent} />
+                    {applyData1 && applyData1.length > 0 ? (
+                      <ApplyDialog applyDialog={applyData1} />
+                    ) : null}
+
+                    {agentData1 && agentData1.length > 0 ? (
+                      <AgentDialog agentDialog={agentData1} />
+                    ) : null}
+
+                    {respondentData1 && respondentData1.length > 0 ? (
+                      <Respondent respondent={respondentData1} />
+                    ) : null}
+
+                    {company1 && company1.length > 0 ? (
+                      <Company company={company1} />
+                    ) : null}
                     <Col span={24} style={{ display: 'flex', alignItems: 'center', marginBottom: '4px' }}>
                       <Space size='small'>
                         <div className='MediationInfo-subTitle' style={{ marginTop: '-9px' }}></div><h5>纠纷基本情况</h5>
@@ -398,68 +457,68 @@
                     <Row gutter={[16, 16]}>
                       <Col span={8}>
                         <div><div className="title-text">事项状态</div></div>
-                        <div style={{ color: '#1A6FB8' }}>{infoData?.statusName || '-'}</div>
+                        <div style={{ color: '#1A6FB8' }}>{caseInfo?.statusName || '-'}</div>
                       </Col>
                       <Col span={16}>
                         <div><div className="title-text">事项编号</div></div>
-                        <div>{infoData?.caseRef || '-'}</div>
+                        <div>{caseInfo?.caseRef || '-'}</div>
                       </Col>
                       {/*事项等级分为三级,颜色需要做判断*/}
                       <Col span={8}>
                         <div className="title"><div className="title-text">事项等级</div></div>
-                        <div style={{ display: 'flex' }}><div style={{ backgroundColor: '#00B42A', marginRight: '4px', borderRadius: '4px' }}><div style={{ color: '#FFFFFF', padding: '0px 6px' }}>{infoData.caseLevel || '-'}</div></div>级</div>
+                        <div style={{ display: 'flex' }}><div style={{ backgroundColor: '#00B42A', marginRight: '4px', borderRadius: '4px' }}><div style={{ color: '#FFFFFF', padding: '0px 6px' }}>{caseInfo?.caseLevel || '-'}</div></div>级</div>
                       </Col>
                       <Col span={8}>
                         <div><div className="title-text">来访时间</div></div>
-                        <div>{infoData.visitTime || '-'}</div>
+                        <div>{caseInfo?.visitTime || '-'}</div>
                       </Col>
                       <Col span={8}>
                         <div ><div className="title-text">来访人数(人)</div></div>
-                        <div>{infoData.visitPeopleNum || '-'}</div>
+                        <div>{caseInfo?.visitPeopleNum || '-'}</div>
                       </Col>
                       <Col span={8}>
                         <div ><div className="title-text">纠纷类型</div></div>
-                        <div>{infoData.caseType || '-'}</div>
+                        <div>{caseInfo?.caseType || '-'}</div>
                       </Col>
                       <Col span={8}>
                         <div ><div className="title-text">纠纷发生时间</div></div>
-                        <div>{infoData.occurTime || '-'}</div>
+                        <div>{caseInfo?.occurTime || '-'}</div>
                       </Col>
                       <Col span={8}>
                         <div ><div className="title-text">纠纷发生地点</div></div>
-                        <div>{infoData.addr || '-'}</div>
+                        <div>{caseInfo?.addr || '-'}</div>
                       </Col>
                       <Col span={8}>
                         <div ><div className="title-text">问题属地</div></div>
-                        <div>{infoData.questionName || '-'}</div>
+                        <div>{caseInfo?.questionName || '-'}</div>
                       </Col>
                       <Col span={8}>
                         <div ><div className="title-text">涉及人数(人)</div></div>
-                        <div>{infoData.peopleNum || '-'}</div>
+                        <div>{caseInfo?.peopleNum || '-'}</div>
                       </Col>
                       <Col span={8}>
                         <div ><div className="title-text">涉及金额(元)</div></div>
-                        <div>{$$.thousands(infoData.amount) || '-'}</div>
+                        <div>{$$.thousands(caseInfo?.amount) || '-'}</div>
                       </Col>
                       <Col span={8}>
                         <div ><div className="title-text">事项来源</div></div>
-                        <div>{infoData.canalName || '-'}</div>
+                        <div>{caseInfo?.canalName || '-'}</div>
                       </Col>
                       <Col span={16}>
                         <div ><div className="title-text">来访形式</div></div>
-                        <div>{infoData.visitWayName || '-'}</div>
+                        <div>{caseInfo?.visitWayName || '-'}</div>
                       </Col>
                       <Col span={24}>
                         <div className="title"><div className="title-text">事项概况</div></div>
-                        <div>{infoData.caseDes || '-'}</div>
+                        <div>{caseInfo?.caseDes || '-'}</div>
                       </Col>
                       <Col span={24}>
                         <div className="title"><div className="title-text">事项申请</div></div>
-                        <div>{infoData.caseClaim || '-'}</div>
+                        <div>{caseInfo?.caseClaim || '-'}</div>
                       </Col>
                       <Col span={16}>
                         <div className="title"><div className="title-text">是否重大矛盾纠纷</div></div>
-                        <div>{infoData.majorStatus === '0' ? '否' : '是'}</div>
+                        <div>{caseInfo?.majorStatus === '0' ? '否' : '是'}</div>
                       </Col>
                     </Row>
                     <Col span={24} style={{ display: 'flex', alignItems: 'center', marginBottom: '16px', marginTop: '20px' }}>
@@ -470,33 +529,33 @@
                     <table border="1" align="center" cellpadding="8" className="table" >
                       <tr>
                         <th bgcolor="#F7F8FA" className="table-title" width="120">化解结果</th>
-                        <td width='380'>化解成功</td>
+                        <td width='380'>{TransactResult.mediResultName || '-'}</td>
                         <th bgcolor="#F7F8FA" className="table-title" width="120">经办人</th>
-                        <td width='380'>李晓明</td>
+                        <td width='380'>{TransactResult.mediator || '-'}</td>
                       </tr>
                       <tr>
                         <th bgcolor="#F7F8FA" className="table-title">承办部门</th>
-                        <td>天河区棠下街综治中心</td>
+                        <td>{TransactResult.mediateUnitName || '-'}</td>
                         <th bgcolor="#F7F8FA" className="table-title">配合部门</th>
-                        <td>-</td>
+                        <td>{TransactResult.applyAssistUnitName || '-'}</td>
                       </tr>
                       <tr>
                         <th bgcolor="#F7F8FA" className="table-title" width="120">受理时间</th>
                         <td width='380'>2024-7-1 10:00</td>
                         <th bgcolor="#F7F8FA" className="table-title" width="120">办结时间</th>
-                        <td width='380'>2024-7-15 11:45</td>
+                        <td width='380'>{TransactResult?.fileTime || '-'}</td>
                       </tr>
                       <tr>
                         <th bgcolor="#F7F8FA" className="table-title" width="120">办理意见</th>
-                        <td width='380' colspan='3'>调解开始,我首先安抚双方情绪,确保对话在一个平和的氛围中展开。随后,我引导被申请人详细说明了他的财务困境及还款意愿,同时让银行代表理解其处境,强调长期合作的重要性。经过反复沟通,被申请人理解了自身行为给申请人带来的不便,在相关证据的出示下,被申请人同意了申请方的申请请求,双方最终达成一致,签署了调解协议。</td>
+                        <td width='380' colspan='3'>{TransactResult?.windupContent || '-'}</td>
                       </tr>
                       <tr>
                         <th bgcolor="#F7F8FA" className="table-title" width="120">协议要点</th>
-                        <td width='380' colspan='3'>经过协商,李女士同意承担主要维修费用,但考虑到水管老化属自然磨损,张先生也表示愿意承担一小部分费用以示友好特申请结案。</td>
+                        <td width='380' colspan='3'>{TransactResult?.agreeContent || '-'}</td>
                       </tr>
                       <tr>
                         <th bgcolor="#F7F8FA" className="table-title" width="120">结案意见</th>
-                        <td width='380' colspan='3'>考虑到事项已经得到平息,过程材料也都比较完善,现申请结案</td>
+                        <td width='380' colspan='3'>{TransactResult?.windupContent || '-'}</td>
                       </tr>
                       <tr>
                         <th bgcolor="#F7F8FA" className="table-title" width="120">协议文书</th>
@@ -518,12 +577,14 @@
                       size="small"
                       rowKey="id"
                       bordered={true}
-                      style={{marginBottom:'16px'}}
+                      style={{ marginBottom: '16px' }}
                     />
                     <div className='gap'></div>
-                    <Col span={24} style={{marginTop:'12px'}}>
+                    <Col span={24} style={{ marginTop: '12px' }}>
                       <div style={{ color: 'rgb(134, 144, 156)' }}>办理记录</div>
-                      <div>
+                      <HandleRecord isReview={false} data={list} />
+
+                      {/* <div>
                         {records.map(record => (
                           <div key={record.id} className='container-bottom-left-record'>
                             <div className='container-bottom-left-record-top'>
@@ -549,7 +610,7 @@
                             </div>
                           </div>
                         ))}
-                      </div>
+                      </div> */}
                     </Col>
                     <div className='gap'></div>
                     <div style={{ marginLeft: '-16px' }}>
@@ -601,7 +662,7 @@
 
                     </div>
                     <div className='gap'></div>
-                    <Col span={24} style={{ display: 'flex', alignItems: 'center', margin:'12px 0px 4px 0px'}}>
+                    <Col span={24} style={{ display: 'flex', alignItems: 'center', margin: '12px 0px 4px 0px' }}>
                       <Space size='small'>
                         <div className='MediationInfo-subTitle' style={{ marginTop: '-9px' }}></div><h4>当事人评价</h4>
                       </Space>
@@ -611,46 +672,46 @@
                         <div className="title">
                           <div className="title-text">评价等级</div>
                         </div>
-                        <div style={{ display: 'flex' }}><Rate defaultValue={3} disabled /></div>
+                        <div style={{ display: 'flex' }}><Rate value={grade?.evaluateGrade} disabled /></div>
                       </Col>
                       <Col span={8}>
                         <div className="title">
                           <div className="title-text">评价时间</div>
                         </div>
-                        <div>2024-8-1 12:00</div>
+                        <div>{grade?.createTime || '-'}</div>
                       </Col>
                       <Col span={8}>
                         <div className="title">
                           <div className="title-text">评价人</div>
                         </div>
-                        <div>张梦雨</div>
+                        <div>{grade?.evaluateUserName || '-'}</div>
                       </Col>
                       <Col span={12}>
                         <div className="title">
                           <div className="title-text">评语</div>
                         </div>
-                        <div>实名表扬天河区棠下街综治中心,真的很有耐心处置我提出的问题,得到满意的答复。</div>
+                        <div>{grade?.evaluateContent}</div>
                       </Col>
                     </Row>
                     <div className='gap'></div>
-                    <Col span={24} style={{ display: 'flex', alignItems: 'center', margin:'12px 0px 4px 0px' }}>
+                    <Col span={24} style={{ display: 'flex', alignItems: 'center', margin: '12px 0px 4px 0px' }}>
                       <Space size='small'>
                         <div className='MediationInfo-subTitle' style={{ marginTop: '-9px' }}></div><h4>登记信息</h4>
                       </Space>
                     </Col>
-                    <Row gutter={[16, 16]} style={{marginBottom:'90px'}}>
+                    <Row gutter={[16, 16]} style={{ marginBottom: '90px' }}>
                       <Col span={8}>
                         <div className="title">
                           <div className="title-text">登记机构</div>
                         </div>
-                        <div>天河区棠下街道综治中心</div>
+                        <div>{caseInfo?.inputUnitName || '-'}</div>
                       </Col>
                       <Col span={8}>
                         <div className="title">
                           <div className="title-text">登记人</div>
                         </div>
                         <div>
-                          李晓明
+                          {caseInfo.inputUserName}
                           <img src={register} alt='' style={{ width: '14px', height: '14px', marginLeft: '8px', marginTop: '4px' }} />
                         </div>
                       </Col>
@@ -658,7 +719,7 @@
                         <div className="title">
                           <div className="title-text">登记时间</div>
                         </div>
-                        <div>2024-7-8 10:00</div>
+                        <div>{caseInfo?.visitTime || '-'}</div>
                       </Col>
                     </Row>
                   </div>
@@ -672,7 +733,10 @@
               }
               {
                 tabsActive === '2' &&
-                <></>
+                <ProgressStep progressData={progressData} />
+              }
+              {tabsActive === '3' &&
+                <ApplyInfo />
               }
             </TabPane>
           })}

--
Gitblit v1.8.0