forked from gzzfw/frontEnd/gzDyh

zhangyongtian
2024-09-08 f7452b9d6295748c9840245d26df6514e8ed2c1d
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
import React, { useState, useEffect } from 'react';
import { Row, Col, Space, Button, Switch } from 'antd';
import PersonCard from '@/components/personCard';
import TableView from '@/components/TableView';
import * as $$ from '@/utils/utility';
import { Typography, Steps } from '@arco-design/web-react';
import { question, register, Matter, transfer } from '@/assets/images'
 
function getCaseInfoApi(id) {
  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 MatterDetail(props) {
  const [fakeData, setFakeData] = useState([]);//当事人信息数据
  const [upload, setUpLoad] = useState(false);
  const [filesCheck, setFilesCheck] = useState(false);
  const [infoData, setInfoData] = useState({});
 
  const fakeColumns = [
    {
      title: '序号',
      dataIndex: 'caseNo',
      key: 'caseNo',
      width: 100,
      render: (text, record, index) => <span>{index + 1}</span>,
    },
    {
      title: '材料类型',
      dataIndex: 'ownerTypeName',
      key: 'ownerTypeName',
      width: 60,
 
    },
    {
      title: '材料数量',
      dataIndex: 'size',
      key: 'size',
      width: 180,
      render: (text) => <span>{text}份</span>,
 
    },
    {
      title: '材料名称',
      dataIndex: 'fileNames',
      key: 'fileNames',
      width: 180,
 
    },
    {
      title: '最新上传时间',
      dataIndex: 'fileNames',
      key: 'fileNames',
      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>下载</div>
          <div onClick={() => setUpLoad(true)}>上传</div>
        </div>
      )
    },
    // 更多列配置...
  ];
 
 
  const [fakeData1, setFakeData1] = useState([
    {
      ownerTyp: "22_00018-101",
      ownerTypeName: "申请材料",
      size: '0',
      ownerId: null,
      ownerName: null,
      perType: null,
      agentStatus: null,
      fileNames: "-",
      fileList: []
    },
    {
      ownerType: "22_00018-102",
      ownerTypeName: "证据材料",
      size: '0',
      ownerId: null,
      ownerName: null,
      perType: null,
      agentStatus: null,
      fileNames: "-",
      fileList: []
    },
 
  ]);
 
  const listIdTypeInfo = async () => {
    const res = await listIdTypeInfoApi({
      mainId: props.id, //事项ID
      ownerIdList: [props.id], //具体所属编号
      typeList: []
    })
    if (res.type) {
      let data = res.data?.[0]?.fileList
      if (res.data.length > 0) {
        setFakeData1(data)
      }
    }
  }
 
  useEffect(() => {
    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
      const partyList = data.personList.concat(data.agentList)
      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(partyList.map(item => {
        const fileInfoList = item.fileInfoList
        let file = [];//身份证明材料、企业登记材料
        let file1 = [];//法人、机构身份证明材料、代理人授权委托书
        if (fileInfoList && fileInfoList.length != 0) {
          fileInfoList.forEach(item => {
            if (item.ownerType == '22_00018-202' || item.ownerType == '22_00018-203') {
              file.push({
                name: item.fileList[0].trueName,
                uid: item.fileList[0].id,
              })
            }
            if (item.ownerType == '22_00018-204' || item.ownerType == '22_00018-207') {
              file1.push({
                name: item.fileList[0].trueName,
                uid: item.fileList[0].id,
              })
            }
          })
        }
        return {
          ...item,
          file,
          file1
        }
      }))
    }
 
  }
 
  return (
    <div style={{ position: 'relative' }}>
      <Typography.Paragraph>
        <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>
            {props.hasApplet && <div>
              <Switch checkedChildren="当事人小程序可见" unCheckedChildren="当事人小程序不可见" defaultChecked />
            </div>
            }
          </Col>
          <div style={{ margin: '16px 0' }}>
            <PersonCard
              isCheck={false}
              data={fakeData}
            />
          </div>
          <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={8}>
              <div><div className="title-text">事项状态</div></div>
              <div style={{ color: '#1A6FB8' }}>{infoData?.statusName || '-'}</div>
            </Col>
            <Col span={16}>
              <div><div className="title-text">事项编号</div></div>
              <div>{infoData?.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>
            </Col>
            <Col span={8}>
              <div><div className="title-text">来访时间</div></div>
              <div>{infoData.visitTime || '-'}</div>
            </Col>
            <Col span={8}>
              <div ><div className="title-text">来访人数(人)</div></div>
              <div>{infoData.visitPeopleNum || '-'}</div>
            </Col>
            <Col span={8}>
              <div ><div className="title-text">纠纷类型</div></div>
              <div>{infoData.caseType || '-'}</div>
            </Col>
            <Col span={8}>
              <div ><div className="title-text">纠纷发生时间</div></div>
              <div>{infoData.occurTime || '-'}</div>
            </Col>
            <Col span={8}>
              <div ><div className="title-text">纠纷发生地点</div></div>
              <div>{infoData.addr || '-'}</div>
            </Col>
            <Col span={8}>
              <div ><div className="title-text">问题属地</div></div>
              <div>{infoData.questionName || '-'}</div>
            </Col>
            <Col span={8}>
              <div ><div className="title-text">涉及人数(人)</div></div>
              <div>{infoData.peopleNum || '-'}</div>
            </Col>
            <Col span={8}>
              <div ><div className="title-text">涉及金额(元)</div></div>
              <div>{$$.thousands(infoData.amount) || '-'}</div>
            </Col>
            <Col span={8}>
              <div ><div className="title-text">事项来源</div></div>
              <div>{infoData.canalName || '-'}</div>
            </Col>
            <Col span={16}>
              <div ><div className="title-text">来访形式</div></div>
              <div>{infoData.visitWayName || '-'}</div>
            </Col>
            <Col span={24}>
              <div className="title"><div className="title-text">事项概况</div></div>
              <div>{infoData.caseDes || '-'}</div>
            </Col>
            <Col span={24}>
              <div className="title"><div className="title-text">事项申请</div></div>
              <div>{infoData.caseClaim || '-'}</div>
            </Col>
            <Col span={16}>
              <div className="title"><div className="title-text">是否重大矛盾纠纷</div></div>
              <div>{infoData.majorStatus === '0' ? '否' : infoData.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><h5>事件材料</h5>
            </Space>
          </Col>
 
          <TableView
            columns={fakeColumns}
            dataSource={fakeData1}
            size="small"
            rowKey="id"
            bordered={true}
            style={{ marginBottom: '20px' }}
          />
          <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={8}>
              <div className="title"><div className="title-text">登记机构</div><img src={question} alt="" style={{ width: '14px', height: '14px', marginTop: '4px', marginLeft: '4px' }} /></div>
              <div>{infoData.inputUnitName || '-'}</div>
            </Col>
            <Col span={8}>
              <div><div className="title-text">登记人</div></div>
              <div style={{ display: 'flex' }}>
                <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>{infoData.createTime || '-'}</div>
            </Col>
          </Row>
          {props.hasEditBtn && <Button type='primary' style={{ marginTop: '20px' }}>修改</Button>}
        </div>
 
      </Typography.Paragraph>
    </div>
  )
}