广州市综治平台前端
xusd
2025-06-07 ee685c9f350ec9241107d4e8a05799768a0bce9a
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
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
import React, { useState, useRef, useEffect, Fragment, useMemo } from 'react';
import { Button, Modal, Tabs, Badge, Steps, Message } from '@arco-design/web-react';
import { Space } from 'antd';
import ProgressStep from '@/components/ProgressStep/VisitStep';
import BackModel from './BackModel';
import { Scrollbars } from 'react-custom-scrollbars';
import { getOffset, getSize } from '@/utils/utility';
import EscalationModel from './EscalationModel';
import AssignedModel from './AssignedModel';
import MatterDetail from '../../matterDetail';
import SupervisingView from '../../matterDetail/Supervising';
import * as $$ from '@/utils/utility';
import { useNavigate } from 'react-router-dom';
import NotEntertained from './NotEntertained';
 
const TabPane = Tabs.TabPane;
const Step = Steps.Step;
 
function getListCaseFlow(caseId) {
    return $$.ax.request({ url: `caseTask/listCaseFlow?caseId=${caseId}`, type: 'get', service: 'mediate' });
}
 
function accept(data) {
    return $$.ax.request({ url: `caseTask/accept`, type: 'post', service: 'mediate', data });
}
 
function submitDispute(data) {
    return $$.ax.request({ url: `caseInfo/caseRegister`, type: 'post', service: 'mediate', data });
}
 
function submitCaseCancel(data) {
    return $$.ax.request({ url: `casedata/cancel-case`, type: 'post', serviceType: 'thrid', service: 'sys', data });
}
 
function getCaseInfoApi(id) {
    return $$.ax.request({ url: 'caseInfo/getCaseInfo?id=' + id, type: 'get', service: 'mediate' });
}
// 删除已结案数据
function deleteCaseInfoByIdApi(data) {
    return $$.ax.request({ url: `caseInfo/deleteCaseById`, type: 'post', service: 'mediate', data });
}
 
 
export default function EventFlow(props) {
    const myButton = [
        {
            label: '受理',
            type: 'primary',
            click: () => {
                Modal.confirm({
                    title: '受理确认',
                    content: '确认受理该事件?',
                    onOk: async () => {
                        const res = await accept({
                            caseTaskId: props.caseTaskId,
                        });
                        if (res.type) {
                            Message.success({
                                content: (
                                    <div className="myMessageBox">
                                        <div className="messageTop">受理成功</div>
                                        <div className="messageBottom">请及时跟进办理</div>
                                    </div>
                                ),
                                showIcon: true,
                                className: 'acro-myMessage',
                                position: 'bottom',
                            });
                            navigate(`/mediate/visit/handleFeedback?caseTaskId=${res.data}&caseId=${props.caseId}&moutedTab=sxbl`);
                        }
                    },
                });
            },
            key: 'sl',
        },
        {
            label: '自行受理',
            type: 'primary',
            click: () => {
                Modal.confirm({
                    title: '自行受理确认',
                    content: '确定自行受理吗?',
                    onOk: () => {
                        handleSelfAccet();
                    },
                });
            },
            key: 'zxsl',
        },
        {
            label: '交办',
            type: 'outline',
            click: () => setAssignedVisible(true),
            key: 'jb',
        },
        {
            label: '上报',
            type: 'outline',
            click: () => setEscalationVisible(true),
            key: 'sb',
        },
        {
            label: '回退',
            type: 'outline',
            click: () => setBackVisible(true),
            key: 'ht',
            status: 'danger',
        },
        {
            label: '不予受理',
            type: 'outline',
            click: () => {
                // if (detailData?.canal === '22_00001-4') {
                //     Message.warning('该案件不能不予受理');
                //     return;
                // }
                setNotVisible(true);
            },
            key: 'bysl',
            status: 'danger',
        },
        {
            label: '处理',
            type: 'primary',
            click: () => {
                navigate(`/mediate/visit/eventFlow?caseTaskId=${props.caseTaskId}&caseId=${props.caseId}`);
            },
            key: 'xqcl',
        },
        {
            label: '处理',
            type: 'primary',
            click: () => {
                switch (props.moutedTab) {
                    case 'sxbl':
                        navigate(`/mediate/visit/handleFeedback?caseTaskId=${props.caseTaskId}&caseId=${props.caseId}&moutedTab=sxbl`);
                        break;
                    case 'htsh':
                        navigate(`/mediate/visit/eventFlow?caseTaskId=${props.caseTaskId}&caseId=${props.caseId}&moutedTab=htsh`);
                        break;
                    case 'sbsh':
                        navigate(`/mediate/visit/eventFlow?caseTaskId=${props.caseTaskId}&caseId=${props.caseId}&moutedTab=sbsh`);
                        break;
                    case 'jash':
                        navigate(`/mediate/visit/closingReview?caseTaskId=${props.caseTaskId}&caseId=${props.caseId}&moutedTab=jash`);
                        break;
                    case 'lhczsh':
                        navigate(`/mediate/visit/handleFeedback?caseTaskId=${props.caseTaskId}&caseId=${props.caseId}&moutedTab=lhczsh`);
                        break;
                    default:
                        break;
                }
            },
            key: 'tabcl',
        },
        {
            label: '拒收',
            type: 'outline',
            click: () => {
                Modal.confirm({
                    title: '拒收确认',
                    content: '确定拒收吗?',
                    onOk: () => {
                        handleCaseCancel();
                    },
                });
            },
            key: 'js',
            status: 'danger',
        },
    ];
 
    const scrollRef = useRef(null);
    const navigate = useNavigate();
    const [backVisible, setBackVisible] = useState(false); //回退弹窗控制
    const [height, setHeight] = useState(500);
    const [escalationVisible, setEscalationVisible] = useState(false); //上报弹窗控制
    const [assignedVisible, setAssignedVisible] = useState(false); //交办弹窗控制
    const [staticButtonList, setStaticButtonList] = useState([]);
    const [progressData, setProgressData] = useState({});
    const [notVisible, setNotVisible] = useState(false); //不予受理弹窗控制
    const [detailData, setDetailData] = useState({});
 
    useEffect(() => {
        if (props.authorData) {
            const { buttonList } = props.authorData;
            setStaticButtonList(
                myButton
                    .filter((item) => {
                        const flag = buttonList.some((result) => {
                            if (result.id === item.key) {
                                return true;
                            }
                        });
                        return flag;
                    })
                    .map((item) => {
                        const data = buttonList.find((res) => res.id == item.key);
                        return {
                            ...item,
                            label: data.name,
                        };
                    })
            );
        }
    }, [props.authorData, detailData]);
 
    useEffect(() => {
        getData();
        getCaseInfo(props.caseId);
        onWindowResize();
        window.addEventListener('resize', onWindowResize);
        // 返回一个函数,该函数会在组件卸载前执行
        return () => {
            // 组件销毁时执行
            window.removeEventListener('resize', onWindowResize);
        };
    }, []);
 
    const onWindowResize = () => {
        let offsetTop = 0;
        if (scrollRef.current.container) {
            offsetTop = getOffset(scrollRef.current.container).top;
        }
        setHeight(getSize().windowH - offsetTop - 16);
    };
 
    //获取流程信息
    const getData = async () => {
        const res = await getListCaseFlow(props.caseId);
        if (res.type) {
            setProgressData(res.data);
        }
    };
 
    //获取详情数据
    const getCaseInfo = async (id) => {
        const res = await getCaseInfoApi(id);
        if (res.type) {
            setDetailData(res.data);
        }
    };
 
    //自行受理
    const handleSelfAccet = async () => {
        const res = await submitDispute({
            ...detailData,
            isSelfAccept: 1,
            isDraft: 0,
            operateType: 0,
        });
        if (res.type) {
            navigate(`/mediate/visit/handleFeedback?caseTaskId=${res.data}&caseId=${props.caseId}&moutedTab=sxbl`);
        }
    };
 
    //拒收案件
    const handleCaseCancel = async () => {
        const res = await submitCaseCancel({
            ids: [props.caseId],
            userId: $$.getSessionStorage('customerSystemUser')?.userId,
        });
        console.log('res', res);
        if (res.type) {
            const deleteRes = await deleteCaseInfoByIdApi({ id: props.caseId });
            if (deleteRes.type) {
                Message.success('拒收成功');
                navigate(`/mediate/visit/handleFeedback?caseTaskId=${res.data}&caseId=${props.caseId}&moutedTab=sxbl`);
            }
        }
    };
 
    return (
        <Fragment>
            <div className="dataSync">
                <Scrollbars style={{ height: height }} ref={scrollRef} autoHide>
                    {props.authorType != 'sxxq' && (
                        <div style={{ backgroundColor: '#fff', margin: '0 16px 8px 16px', paddingTop: '16px', paddingLeft: '91px' }}>
                            <Steps type="navigation" current={2}>
                                <Step title="来访登记" disabled />
                                <Step title="事件流转" disabled />
                                <Step title="办理反馈" disabled />
                                <Step title="结案审核" disabled />
                                <Step title="当事人评价" disabled />
                                <Step title="结案归档" disabled />
                            </Steps>
                        </div>
                    )}
 
                    <MatterDetail listFeedback={props.listFeedback} caseId={props.caseId} detailData={detailData} windowDetail={props.windowDetail} gridDetail={props.gridDetail} />
 
                    {props.authorType != 'sxxq' && (
                        <div className="dataSync-hasTabPage" style={{ marginTop: '-8px' }}>
                            <Tabs defaultActiveTab="1">
                                <TabPane key="1" title={<span style={{ fontSize: '15px' }}>流转进度</span>}>
                                    <ProgressStep progressData={progressData} />
                                </TabPane>
                                <TabPane
                                    key="2"
                                    title={
                                        <span style={{ fontSize: '15px' }}>
                                            督办信息
                                            {/* <Badge maxCount={99} count={1000} /> */}
                                        </span>
                                    }
                                >
                                    <div style={{ marginBottom: '20px' }}>
                                        <SupervisingView caseId={props.caseId} />
                                    </div>
                                </TabPane>
                            </Tabs>
                        </div>
                    )}
                    <div style={{ height: '64px', marginTop: '-16px' }}></div>
                </Scrollbars>
                <Modal
                    title="回退"
                    visible={backVisible}
                    onOk={() => setBackVisible(false)}
                    onCancel={() => {
                        setBackVisible(false);
                    }}
                    footer={null}
                    unmountOnExit={true}
                    maskClosable={false}
                >
                    <BackModel
                        caseId={props.caseId}
                        caseTaskId={props.caseTaskId}
                        onCancel={() => {
                            setBackVisible(false);
                        }}
                    />
                </Modal>
                <Modal
                    title="上报"
                    visible={escalationVisible}
                    onOk={() => setEscalationVisible(false)}
                    onCancel={() => {
                        setEscalationVisible(false);
                    }}
                    footer={null}
                    unmountOnExit={true}
                    maskClosable={false}
                >
                    <EscalationModel
                        caseId={props.caseId}
                        caseTaskId={props.caseTaskId}
                        onCancel={() => {
                            setEscalationVisible(false);
                        }}
                    />
                </Modal>
                <Modal
                    title="交办"
                    visible={assignedVisible}
                    onOk={() => setAssignedVisible(false)}
                    onCancel={() => {
                        setAssignedVisible(false);
                    }}
                    footer={null}
                    unmountOnExit={true}
                    maskClosable={false}
                    autoFocus={false}
                    focusLock={false}
                >
                    <AssignedModel
                        caseId={props.caseId}
                        caseTaskId={props.caseTaskId}
                        onCancel={() => {
                            setAssignedVisible(false);
                        }}
                    />
                </Modal>
                <Modal
                    title={detailData.canalSecond === '22_00003-1' ? '回退' : '不予受理'}
                    visible={notVisible}
                    onOk={() => setNotVisible(false)}
                    onCancel={() => {
                        setNotVisible(false);
                    }}
                    footer={null}
                    unmountOnExit={true}
                    maskClosable={false}
                >
                    <NotEntertained
                        caseId={props.caseId}
                        caseTaskId={props.caseTaskId}
                        canalSecond={detailData.canalSecond}
                        onCancel={() => {
                            setNotVisible(false);
                        }}
                    />
                </Modal>
                {(!props?.windowDetail && !props?.gridDetail) && (
                    <div className="dataSync-excel">
                        <Space size="middle" style={{ margin: '4px 14px' }}>
                            {staticButtonList?.map((item) => {
                                const { label, key, click, ...rest } = item;
                                return (
                                    <Button key={key} onClick={click} {...rest}>
                                        {label}
                                    </Button>
                                );
                            })}
 
                            <Button type="secondary" onClick={() => navigate(-1)}>
                                返回上级页面
                            </Button>
 
                        </Space>
                    </div>
                )}
            </div>
        </Fragment>
    );
}