forked from gzzfw/frontEnd/gzDyh

zhangyongtian
2024-08-31 c41e9c7bd6fedf4e480d4737f94d13a2b9ddf5eb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
/*
 * @Company: hugeInfo
 * @Author: ldh
 * @Date: 2022-03-18 21:14:17
 * @LastEditTime: 2023-05-13 15:44:35
 * @LastEditors: lwh
 * @Version: 1.0.0
 * @Description: 调解信息
 */
import React, { useState, useEffect } from 'react';
import { Row, Col, Typography, Space, Button, Anchor } from 'antd';
import { ShareAltOutlined } from '@ant-design/icons';
import FilesTable from '../../../components/FilesTable';
import PartyMsgTable from '../../../components/PartyMsgTable';
import PartyCheck from '../../../components/PartyCheck';
import MyDrawer from '../../../components/MyDrawer';
import NameCard from '../../../components/NameCard';
import ProgressStep from '../../../components/ProgressStep';
import FilesDrawer from '../../../components/FilesDrawer';
import * as $$ from '../../../utils/utility';
import CaseFolderCheck from '../../../components/CaseFolderCheck';
import { mediator2, mediateRecord_3 } from '../../../assets/images/icon';
import { DispatchRecord, MediationResult, Archives } from './index';
const { Paragraph } = Typography;
const { Link } = Anchor;
 
// 根据调解案号获取纠纷登记信息
function getCaseDataApi(submitData) {
  return $$.ax.request({ url: `caseInfo/getCaseInfo?id=${submitData}`, type: 'get', service: 'mediate' });
}
 
// 一本账案号获取纠纷登记信息
function getBookCaseDataApi(submitData) {
  return $$.ax.request({ url: `caseBook/getCaseInfo?id=${submitData}`, type: 'get', service: 'mediate' });
}
 
// 获取处理的详情
function getByIdApi(caseId) {
  return $$.ax.request({ url: 'caseDisp/getByCaseId?caseId=' + caseId, type: 'get', service: 'disp' });
}
 
 
// 案件信息
// isModal: 在modal内展示
const DisputeCheck = ({ data = {}, isModal }) => {
  // 当事人信息Drawer
  const [partyDrawer, setPartyDrawer] = useState({ type: '', visible: false, data: {} });
 
  // 查看当事人信息
  function handleCheckParty({ type, values }) {
    setPartyDrawer({ type, visible: true, data: values });
  }
 
  const msg = [
    { title: '调解案号', key: 'caseNo', span: 24 },
    { title: '纠纷发生时间', content: $$.dateFormat(data.occurTime) },
    { title: '申请调解时间', content: $$.dateFormat(data.createTime) },
    { title: '调解类型', key: 'mediTypeName' },
    { title: '登记人', key: 'inputUserName' },
    { title: '纠纷类型', key: 'caseTypeName' },
    {
      title: '纠纷来源',
      content: (
        <>
          <span>{data['sourceName'] || '-'}</span>
          <span className="public-rightBorder">{data['canalName'] || '-'}</span>
        </>
      ),
    },
    {
      title: '涉及人数',
      content: (
        <>
          <span>{data['peopleNum'] || '-'}</span>
          <span className="public-rightBorder">{data['crowdName'] || '-'}</span>
        </>
      ),
    },
    { title: '涉及金额', content: `${data.amount || 0}万元` },
    {
      title: '纠纷发生地',
      content: ['provName', 'cityName', 'areaName', 'roadName', 'villageName'].map((x) => {
        return `${data[x] || ''}`;
      }),
      tooltip: ['provName', 'cityName', 'areaName', 'roadName', 'villageName'].map((x) => {
        return `${data[x] || ''}`;
      }),
    },
    { title: '纠纷发生地详细地址', key: 'addr' },
    { title: '意向调解组织', key: 'wantUnitName' },
    { title: '意向调解员', key: 'wantUserName' },
    { title: '纠纷描述', key: 'caseDes', span: 24 },
    { title: '调解请求', key: 'caseClaim', span: 24 },
  ];
 
  return (
    <>
      <div className="disputeMsg">
        <Row gutter={[16, 12]}>
          <Col span={24} style={{ display: 'flex', alignItems: 'center' }}>
            <Space size='small'>
              <div className='MediationInfo-subTitle'></div><h5> 案情描述</h5>
            </Space>
          </Col>
          {msg.map((x, t) => {
            return (
              <Col span={x.span || 6} key={t} style={{ display: 'flex' }}>
                <div>{x.title}:</div>
                <Paragraph
                  className="caseDetail-paragraph"
                  ellipsis={{
                    expandable: x.span === 24 ? true : null,
                    tooltip: x.span === 24 ? false : x.tooltip || data[x.key],
                    rows: x.span === 24 ? 2 : 1,
                  }}
                >
                  {x.content || data[x.key] || '-'}
                </Paragraph>
              </Col>
            );
          })}
          <Col span={24}>
            <div className="caseDetail-divider" />
          </Col>
          <Col span={24}>
            <h5>案件材料</h5>
          </Col>
          <Col span={24}>
            <FilesTable isCheck={true} data={data.fileInfoList || []} />
          </Col>
          <Col span={24}>
            <div className="caseDetail-divider" />
          </Col>
          <Col span={24}>
            <h5>申请人信息</h5>
          </Col>
          <Col span={24}>
            <PartyMsgTable partyType="applicant" data={data.plaintiffList || []} handleCheckParty={handleCheckParty} isCheck={true} />
          </Col>
          <Col span={24}>
            <div className="caseDetail-divider" />
          </Col>
          <Col span={24}>
            <h5>被申请人信息</h5>
          </Col>
          <Col span={24}>
            <PartyMsgTable partyType="respondent" data={data.defendantList || []} handleCheckParty={handleCheckParty} isCheck={true} />
          </Col>
        </Row>
      </div>
      {/* 当事人详情查看 */}
      <MyDrawer
        title={partyDrawer.type === 'applicant' ? '申请人' : '被申请人'}
        visible={partyDrawer.visible}
        style={{ position: 'absolute' }}
        onClose={() => setPartyDrawer({ visible: false })}
        container={isModal}
        zIndex={isModal ? 1001 : 1000}
      >
        <PartyCheck data={partyDrawer.data} />
      </MyDrawer>
    </>
  );
};
 
const MediationInfoLedger = ({ caseId, dispId, headerData, isModal }) => {
  const [data, setData] = useState({});
  const [targetOffset, setTargetOffset] = useState(undefined);
 
  useEffect(() => {
    setTargetOffset(window.innerHeight / 2);
    // 获取已经提交过的案件
    async function getCaseData(caseId) {
      global.setSpinning(true);
      const res = await getBookCaseDataApi(caseId);
      global.setSpinning(false);
      if (res.type) {
        setData(res.data || {});
      }
    }
    getCaseData(caseId);
  }, [caseId]);
 
  return (
    <div className='mediationInfo'>
      <Space direction="vertical" size={12}>
        {data.serieStatus === '2' ? (
          <CaseFolderCheck caseData={data.content || []} childrenDom={(x) => <DisputeCheck data={x} isModal={isModal} />} />
        ) : (
          <DisputeCheck data={data.content} isModal={isModal} />
        )}
        {/* 调解结果 */}
        <MediationResult caseId={caseId} mediationType='ledger' />
      </Space>
    </div>
  );
};
 
export default MediationInfoLedger;