From a638a7918a2d05e343253dff9158ce0379a47bd4 Mon Sep 17 00:00:00 2001
From: dminyi <1301963064@qq.com>
Date: Sun, 08 Sep 2024 11:26:27 +0800
Subject: [PATCH] ai接口对接

---
 gz-customerSystem/src/views/register/matterDetail/index.jsx |  184 ++++++++++++++++++++++------------------------
 1 files changed, 88 insertions(+), 96 deletions(-)

diff --git a/gz-customerSystem/src/views/register/matterDetail/index.jsx b/gz-customerSystem/src/views/register/matterDetail/index.jsx
index 7c124e6..4767604 100644
--- a/gz-customerSystem/src/views/register/matterDetail/index.jsx
+++ b/gz-customerSystem/src/views/register/matterDetail/index.jsx
@@ -10,8 +10,12 @@
   return $$.ax.request({ url: 'caseInfo/getCaseInfo?id=' + id, type: 'get', service: 'mediate' });
 }
 
+function listIdTypeInfoApi(data) {
+  return $$.ax.request({ url: `fileInfo/listIdTypeInfo`, type: 'post', service: 'sys', data });
+}
 
-export default function MatterDetali() {
+
+export default function MatterDetail(props) {
   const [fakeData, setFakeData] = useState([{
     "trueName": "王大锤",
     "mobile": "13380313412",
@@ -49,35 +53,30 @@
     },
     {
       title: '材料类型',
-      dataIndex: 'judicNo',
-      key: 'judicNo',
+      dataIndex: 'ownerTypeName',
+      key: 'ownerTypeName',
       width: 60,
 
     },
     {
       title: '材料数量',
-      dataIndex: 'inputUserName',
-      key: 'perClassName',
+      dataIndex: 'size',
+      key: 'size',
       width: 180,
-      render: (text) => (
-        <>
-          {text}份
-        </>
-      )
-
+      render: (text) => <span>{text}份</span>,
 
     },
     {
       title: '材料名称',
-      dataIndex: 'perClassName',
-      key: 'perClassName',
+      dataIndex: 'fileNames',
+      key: 'fileNames',
       width: 180,
 
     },
     {
       title: '最新上传时间',
-      dataIndex: 'mediateUserName',
-      key: 'mediateUserName',
+      dataIndex: 'fileNames',
+      key: 'fileNames',
       width: 180,
 
     },
@@ -97,90 +96,83 @@
     },
     // 更多列配置...
   ];
-  const fakeData1 = [
+
+
+  const [fakeData1, setFakeData1] = useState([
     {
-      id: 1,
-      caseNo: 'A20230101',
-      judicNo: '申请材料',
-      perClassName: '李晓明的纠纷化解申请表、身份证...',
-      inputUserName: '0',
-      mediateUserName: '2024-7-12 12:00',
-      judgeName: '王五',
-      mediator: '赵六',
-      handlerUserName: '钱七',
-      returnUserName: '孙八',
-      expireTime: '2023-08-10T08:00:00.000Z',
-      processName: '进行中',
-      otherMediator: '周九',
-      canalName: '网络',
-      judicResult: '通过',
-      assistName: '吴十',
-      mediTypeName: '民事调解',
-      serieStatus: '1', // 1 表示非系列案,2 表示系列案
-      // 更多字段...
+      ownerTyp: "22_00018-101",
+      ownerTypeName: "申请材料",
+      size: '0',
+      ownerId: null,
+      ownerName: null,
+      perType: null,
+      agentStatus: null,
+      fileNames: "-",
+      fileList: []
     },
     {
-      id: 2,
-      caseNo: 'A20230101',
-      judicNo: '证据材料',
-      perClassName: '李晓明的纠纷化解申请表、身份证...',
-      inputUserName: '0',
-      mediateUserName: '2024-7-12 12:00',
-      judgeName: '王五',
-      mediator: '赵六',
-      handlerUserName: '钱七',
-      returnUserName: '孙八',
-      expireTime: '2023-08-10T08:00:00.000Z',
-      processName: '进行中',
-      otherMediator: '周九',
-      canalName: '网络',
-      judicResult: '通过',
-      assistName: '吴十',
-      mediTypeName: '民事调解',
-      serieStatus: '1', // 1 表示非系列案,2 表示系列案
-      // 更多字段...
+      ownerType: "22_00018-102",
+      ownerTypeName: "证据材料",
+      size: '0',
+      ownerId: null,
+      ownerName: null,
+      perType: null,
+      agentStatus: null,
+      fileNames: "-",
+      fileList: []
     },
 
-    // 更多数据...
-  ];
+  ]);
 
-
-  //获取id
-  const getCaseInfo = async () => {
-    const res = await getCaseInfoApi('24083010062110001')
+  const listIdTypeInfo = async () => {
+    const res = await listIdTypeInfoApi({
+      mainId: props.id, //事项ID
+      ownerIdList: [props.id], //具体所属编号
+      typeList: []
+    })
     if (res.type) {
-      let data = res.data
-      setInfoData([...fakeData1, {
-        ...data,
-        // status:
-        // data.status === '1' ? '待签收' :
-        // data.status === '2' ? '待受理' :
-        // data.status === '3' ? '办理中' :
-        // data.status === '4' ? '结案审核' :
-        // data.status === '5' ? '待评价' :
-        // data.status === '6' ? '已归档' : '未知状态'
-      }])
-
-      setInfoData(res.data)
+      let data = res.data?.[0]?.fileList
+      if (res.data.length > 0) {
+        setFakeData1(data)
+      }
     }
   }
 
   useEffect(() => {
-    getCaseInfo()
-  }, [])
+    console.log(props);
+    getCaseInfo(props.id)
+    listIdTypeInfo()
+  }, [props.id])
+
+  //获取id
+  const getCaseInfo = async (id) => {
+    const res = await getCaseInfoApi('24083010062110001')
+
+    if (res.type) {
+      let data = res.data
+      setInfoData({
+        ...data,
+        questionName: data.queProvName === null ? '-' : data.queProvName + '/' + data.queCityName + '/' + data.queAreaName + '/' + data.queRoadName + '/' + data.queVillageName,
+        caseType: data.caseTypeFirstName === null ? '-' : data.caseTypeFirstName + '/' + data.caseTypeName
+      })
+      setFakeData(data.personList.concat(data.agentList))
+    }
+
+  }
 
   return (
     <div style={{ position: 'relative' }}>
       <Typography.Paragraph>
-        <div className='dataSync-page'>
+        <div className='dataSync-noScrollPage'>
 
           <Col span={24} style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
             <Space size='small'>
               <div className='MediationInfo-subTitle' style={{ marginTop: '-9px' }}></div><h5>当事人信息</h5>
             </Space>
-            <div>
+            {props.hasApplet && <div>
               <Switch checkedChildren="当事人小程序可见" unCheckedChildren="当事人小程序不可见" defaultChecked />
             </div>
+            }
           </Col>
           <div style={{ margin: '16px 0' }}>
             <PersonCard
@@ -188,7 +180,7 @@
               data={fakeData}
             />
           </div>
-          <Col span={24} style={{ display: 'flex', alignItems: 'center', marginBottom: '4px' }}>
+          <Col span={24} className='title'>
             <Space size='small'>
               <div className='MediationInfo-subTitle' style={{ marginTop: '-9px' }}></div><h5>纠纷基本情况</h5>
             </Space>
@@ -196,11 +188,11 @@
           <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' }}>{infoData?.statusName || '-'}</div>
             </Col>
             <Col span={16}>
               <div><div className="title-text">事项编号</div></div>
-              <div>{infoData.caseId || '-'}</div>
+              <div>{infoData?.caseRef || '-'}</div>
             </Col>
             {/*事项等级分为三级,颜色需要做判断*/}
             <Col span={8}>
@@ -217,47 +209,47 @@
             </Col>
             <Col span={8}>
               <div ><div className="title-text">纠纷类型</div></div>
-              <div>{infoData.caseTypeFirstName}/{infoData.caseTypeName}</div>
+              <div>{infoData.caseType || '-'}</div>
             </Col>
             <Col span={8}>
               <div ><div className="title-text">纠纷发生时间</div></div>
-              <div>{infoData.occurTime}</div>
+              <div>{infoData.occurTime || '-'}</div>
             </Col>
             <Col span={8}>
               <div ><div className="title-text">纠纷发生地点</div></div>
-              <div>广州市天河区中山七路康王柏德来商业城</div>
+              <div>{infoData.addr || '-'}</div>
             </Col>
             <Col span={8}>
               <div ><div className="title-text">问题属地</div></div>
-              {/* <div>{queProvName}/{queCityName}/{queAreaName}/{queRoadName}</div> */}
+              <div>{infoData.questionName || '-'}</div>
             </Col>
             <Col span={8}>
               <div ><div className="title-text">涉及人数(人)</div></div>
-              <div>2</div>
+              <div>{infoData.peopleNum || '-'}</div>
             </Col>
             <Col span={8}>
               <div ><div className="title-text">涉及金额(元)</div></div>
-              <div>{$$.thousands(20000)}</div>
+              <div>{$$.thousands(infoData.amount) || '-'}</div>
             </Col>
             <Col span={8}>
               <div ><div className="title-text">事项来源</div></div>
-              <div>大厅来访</div>
+              <div>{infoData.canalName || '-'}</div>
             </Col>
             <Col span={16}>
               <div ><div className="title-text">来访形式</div></div>
-              <div>来访</div>
+              <div>{infoData.visitWayName || '-'}</div>
             </Col>
             <Col span={24}>
               <div className="title"><div className="title-text">事项概况</div></div>
-              <div>张先生与李先生是多年的朋友关系。2023年4月,李先生因生意周转需要向张先生借款人民币20万元,并口头承诺于一年内还清。出于信任,张先生未要求签订书面借条或借款合同。然而,到了2024年4月,李先生并未如约归还借款。张先生多次通过电话、微信等方式催促还款,但李先生先是拖延,后干脆以各种理由拒绝偿还,甚至声称该笔款项属于赠予而非借款,这使得张先生感到十分无奈。 </div>
+              <div>{infoData.caseDes || '-'}</div>
             </Col>
             <Col span={24}>
               <div className="title"><div className="title-text">事项申请</div></div>
-              <div>张先生与李先生是多年的朋友关系。2023年4月,李先生因生意周转需要向张先生借款人民币20万元,并口头承诺于一年内还清。出于信任,张先生未要求签订书面借条或借款合同。然而,到了2024年4月,李先生并未如约归还借款。张先生多次通过电话、微信等方式催促还款,但李先生先是拖延,后干脆以各种理由拒绝偿还,甚至声称该笔款项属于赠予而非借款,这使得张先生感到十分无奈。 </div>
+              <div>{infoData.caseClaim || '-'}</div>
             </Col>
             <Col span={16}>
               <div className="title"><div className="title-text">是否重大矛盾纠纷</div></div>
-              <div>否</div>
+              <div>{infoData.majorStatus === '0' ? '否' : infoData.majorStatus === '1' ? '是' : '-'}</div>
             </Col>
           </Row>
           <Col span={24} style={{ display: 'flex', alignItems: 'center', marginBottom: '8px', marginTop: '20px' }}>
@@ -274,7 +266,7 @@
             bordered={true}
             style={{ marginBottom: '20px' }}
           />
-          <Col span={24} style={{ display: 'flex', alignItems: 'center', marginBottom: '4px' }}>
+          <Col span={24} className='title'>
             <Space size='small'>
               <div className='MediationInfo-subTitle' style={{ marginTop: '-9px' }}></div><h5>登记信息</h5>
             </Space>
@@ -283,21 +275,21 @@
             {/*事项等级分为三级,颜色需要做判断*/}
             <Col span={8}>
               <div className="title"><div className="title-text">登记机构</div><img src={question} alt="" style={{ width: '14px', height: '14px', marginTop: '4px', marginLeft: '4px' }} /></div>
-              <div>天河区棠下街道综治中心</div>
+              <div>{infoData.inputUnitName || '-'}</div>
             </Col>
             <Col span={8}>
               <div><div className="title-text">登记人</div></div>
               <div style={{ display: 'flex' }}>
-                <div>李晓明</div>
+                <div>{infoData.inputUserName || '-'}</div>
                 <img src={register} alt='' style={{ width: '14px', height: '14px', marginLeft: '8px', marginTop: '4px' }} />
               </div>
             </Col>
             <Col span={8}>
               <div ><div className="title-text">登记时间</div></div>
-              <div>2024-7-8 10:00</div>
+              <div>{infoData.createTime || '-'}</div>
             </Col>
           </Row>
-          <Button type='primary' style={{ marginTop: '20px' }}>修改</Button>
+          {props.hasEditBtn && <Button type='primary' style={{ marginTop: '20px' }}>修改</Button>}
         </div>
 
       </Typography.Paragraph>

--
Gitblit v1.8.0