forked from gzzfw/frontEnd/gzDyh

dminyi
2024-09-04 27fb65ba5c31fbbad4c17166a72901d8db80ae03
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
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
/*
 * @Author: dminyi 1301963064@qq.com
 * @Date: 2024-08-13 15:19:57
 * @LastEditors: dminyi 1301963064@qq.com
 * @LastEditTime: 2024-09-04 15:00:02
 * @FilePath: \gzDyh\gz-customerSystem\src\views\basicInformation\organization\preview.jsx
 * @Description: 预览信息
 */
import React, { useState } from "react";
import { Row, Col, Space } from 'antd';
import { person, question, link } from '../../../assets/images'
import '../index.less';
import TableView from '../../../components/TableView';
import { Modal } from '@arco-design/web-react';
import NewFileCheck from '../../filesCheck/newFileCheck';
import * as $$ from '../../../utils/utility';
import { ApplyDialog, AgentDialog, Respondent, Company } from './component/previewTable'
 
const Preview = (props) => {
    const [filesCheck, setFilesCheck] = useState(false);
    const [apply, setApply] = useState(false);
    const [visible, setVisible] = useState(false);
 
    const fakeData1 = [
        {
            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 表示系列案
            // 更多字段...
        },
        {
            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 表示系列案
            // 更多字段...
        },
 
        // 更多数据...
    ];
 
    // 列配置
    const fakeColumns = [
        {
            title: '序号',
            dataIndex: 'caseNo',
            key: 'caseNo',
            width: 100,
            render: (text, record, index) => <span>{index + 1}</span>,
        },
        {
            title: '材料类型',
            dataIndex: 'judicNo',
            key: 'judicNo',
            width: 60,
 
        },
        {
            title: '材料数量',
            dataIndex: 'inputUserName',
            key: 'perClassName',
            width: 180,
            render: (text) => (
                <>
                    {text}份
                </>
            )
 
        },
        {
            title: '材料名称',
            dataIndex: 'perClassName',
            key: 'perClassName',
            width: 180,
 
        },
        {
            title: '上传时间',
            dataIndex: 'mediateUserName',
            key: 'mediateUserName',
            width: 180,
 
        },
        {
            title: '操作',
            dataIndex: 'perClassName',
            key: 'perClassName',
            width: 200,
            render: (text) => (
                <div style={{ display: 'flex', color: '#1A6FB8', gap: '16px' }}>
                    <div onClick={() => setFilesCheck(true)}>查看</div>
                    <div>下载</div>
                </div>
            )
        },
        // 更多列配置...
    ];
 
 
    const applyData = props.data?.fakeData?.filter(item => item.perTypeName === "申请方当事人" && item.perClassName === "自然人");
    const agentData = props.data?.fakeData?.filter(item => item.perTypeName === "申请方代理人");
    const company = props.data?.fakeData?.filter(item => item.perTypeName === "申请方当事人" && item.perClassName === "非法人组织");
    const respondentData = props.data?.fakeData?.filter(item => item.perTypeName === "申请方当事人" && item.perClassName === "法人");
 
    const applyData1 = props.data?.fakeData?.filter(item => item.perTypeName === "被申请方当事人" && item.perClassName === "自然人");
    const agentData1 = props.data?.fakeData?.filter(item => item.perTypeName === "被申请方代理人");
    const company1 = props.data?.fakeData?.filter(item => item.perTypeName === "被申请方当事人" && item.perClassName === "非法人组织");
    const respondentData1 = props.data?.fakeData?.filter(item => item.perTypeName === "被申请方当事人" && item.perClassName === "法人");
 
    console.log(props.data, 'props.data')
 
 
 
 
 
    return (
        <div style={{ backgroundColor: '#ffff', margin: '8px 8px 0px 16px', padding: '12px 18px 16px 16px', height: 'calc(100vh - 228px)', overflowY: 'scroll', ...props.style }}>
            <Col span={24} style={{ display: 'flex', alignItems: 'center', marginBottom: '8px' }}>
                <Space size='small'>
                    <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 只有在 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>
            {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: '8px' }}>
                <Space size='small'>
                    <div className='MediationInfo-subTitle' style={{ marginTop: '-9px' }}></div><h4>纠纷基本情况</h4>
                </Space>
            </Col>
            <Row gutter={[16, 16]}>
                <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' }}>{props.data?.caseLevel || '-'}</div></div>级</div>
                </Col>
                <Col span={8}>
                    <div><div className="title-text">来访时间</div></div>
                    <div>{props.data?.visitTime || '-'}</div>
                </Col>
                <Col span={8}>
                    <div ><div className="title-text">来访人数(人)</div></div>
                    <div>{props.data?.visitPeopleNum || '-'}</div>
                </Col>
                <Col span={8}>
                    <div ><div className="title-text">纠纷类型</div></div>
                    <div>
                        {props.data?.caseTypeFirstName ?
                            `${props.data.caseTypeFirstName}/${props.data.caseTypeName}`
                            : '-'
                        }
                    </div>
                </Col>
                <Col span={8}>
                    <div ><div className="title-text">纠纷发生时间</div></div>
                    <div>{props.data?.occurTime || '-'}</div>
                </Col>
                <Col span={8}>
                    <div ><div className="title-text">纠纷发生地点</div></div>
                    <div>{props.data?.addr || '-'}</div>
                </Col>
                <Col span={8}>
                    <div ><div className="title-text">问题属地</div></div>
                    <div>
                        {props.data?.queProvName ?
                            `${props.data.queProvName}/${props.data.queCityName}/${props.data.queAreaName}/${props.data.queRoadName}`
                            : '-'
                        }
                    </div>
                </Col>
                <Col span={8}>
                    <div ><div className="title-text">涉及人数(人)</div></div>
                    <div>{props.data?.peopleNum || '-'}</div>
                </Col>
                <Col span={8}>
                    <div ><div className="title-text">涉及金额(元)</div></div>
                    <div>{$$.thousands(props.data?.amount) || '-'}</div>
                </Col>
                <Col span={8}>
                    <div ><div className="title-text">事项来源</div></div>
                    <div>大厅来访</div>
                </Col>
                <Col span={16}>
                    <div ><div className="title-text">来访形式</div></div>
                    <div>来访</div>
                </Col>
                <Col span={24}>
                    <div className="title"><div className="title-text">事项概况</div></div>
                    <div>{props.data?.caseDes || '-'} </div>
                </Col>
                <Col span={24}>
                    <div className="title"><div className="title-text">事项申请</div></div>
                    <div>{props.data?.caseClaim || '-'}</div>
                </Col>
                <Col span={16}>
                    <div className="title"><div className="title-text">是否重大矛盾纠纷</div></div>
                    <div>{props.data?.majorStatus === 1 ? '是' : '否'}</div>
                </Col>
            </Row>
            <Col span={24} style={{ display: 'flex', alignItems: 'center', marginBottom: '8px', marginTop: '20px' }}>
                <Space size='small'>
                    <div className='MediationInfo-subTitle' style={{ marginTop: '-9px' }}></div><h4>事件材料</h4>
                </Space>
            </Col>
 
            <TableView
                columns={fakeColumns}
                dataSource={fakeData1}
                size="small"
                rowKey="id"
                bordered={true}
                style={{ marginBottom: '65px' }}
            />
 
            <Modal style={{ width: '1200px' }} visible={filesCheck} onCancel={() => setFilesCheck(false)} footer={null} title='查看事件材料' centered>
                {/* <div className="mediationWindow-modal-main" style={{ display: 'flex' }}> */}
                <div style={{ marginTop: '-16px' }}>
                    <NewFileCheck />
                </div>
 
                {/* </div> */}
            </Modal>
 
 
 
        </div>
    )
}
 
export default Preview