forked from gzzfw/frontEnd/gzDyh

liuwh
2024-09-10 86df8c2c269721e5ac76b41e740fb0647eda1f27
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
import React, { useEffect, useState } from 'react';
import NewPage from '@/components/NewPage';
import { Steps, Tabs, Button, Badge } from '@arco-design/web-react';
import { apply, floating } from '@/assets/images';
import { result } from '@/assets/images/icon';
import * as $$ from '@/utils/utility';
import { Space } from 'antd';
import ProgressStep from '@/components/ProgressStep/VisitStep';
import ApplyInfo from './ApplyInfo';
import Preview from '../visit/preview';
import HandleRecord from './HandleRecord';
import { Scrollbars } from "react-custom-scrollbars";
import RateModule from './RateModule';
import RegisInfoModule from './RegisInfoModule';
import SupervisingView from "./Supervising";
 
const Step = Steps.Step;
const TabPane = Tabs.TabPane;
 
function getTransactResultApi(caseId) {
  return $$.ax.request({ url: `caseInfoUnfold/getTransactResult?caseId=${caseId}`, type: 'get', service: 'mediate' });
}
 
function getByCaseIdApi(caseId) {
  return $$.ax.request({ url: `caseEvaluate/getByCaseId?caseId=${caseId}`, type: 'get', service: 'mediate' });
}
 
function getCaseInfoApi(id) {
  return $$.ax.request({ url: 'caseInfo/getCaseInfo?id=' + id, type: 'get', service: 'mediate' });
}
 
function listFeedbackApi(id) {
  return $$.ax.request({ url: `caseFeedback/listFeedback?id=` + id, type: 'get', service: 'mediate' });
}
 
function getListCaseFlow(caseId) {
  return $$.ax.request({ url: `caseTask/listCaseFlow?caseId=` + caseId, type: 'get', service: 'mediate' });
}
 
const FileMessage = (props) => {
  const caseTaskId = $$.getQueryString('caseTaskId')
  const caseId = $$.getQueryString('caseId')
  const [tabsActive, setTabsActive] = useState('1');
  const [current, setCurrent] = useState(7);
  const [grade, setGrade] = useState(null);
  const [caseInfo, setCaseInfo] = useState({})
  const [TransactResult, setTransactResult] = useState({})
  const [tabsList, setTabList] = useState([
    {
      img: result,
      label: '档案信息',
      key: '1',
      isNeedStep: true
    },
    {
      img: floating,
      label: '流转督办',
      key: '2',
    },
    {
      img: apply,
      label: '申请记录',
      key: '3',
    },
  ])
  const [list, setList] = useState([])
  const [progressData, setProgressData] = useState({});
 
  useEffect(() => {
    console.log(caseId, 'caseId')
    getByCaseId(caseId);
    getTransactResult(caseId);
    getCaseInfo(caseId);
    listFeedback(caseId);
    getData(caseId)
  }, [])
 
  const getTransactResult = async (id) => {
    const res = await getTransactResultApi(id)
    if (res.type) {
      setTransactResult({ ...res.data, fileName: res.data.fileInfoBaseDTOList.map(item => item.trueName) })
    }
  }
 
  const getByCaseId = async (id) => {
    const res = await getByCaseIdApi(id)
    if (res.type) {
      setGrade(res.data)
    }
  }
 
  const getCaseInfo = async (id) => {
    const res = await getCaseInfoApi(id)
    if (res.type) {
      const { agentList, personList, ...rest } = res.data
      const parList = agentList.concat(personList)
      const obj = {
        ...rest,
        fakeData: parList,
      }
      setCaseInfo(obj)
    }
  }
 
  const listFeedback = async (id) => {
    const res = await listFeedbackApi(id)
    if (res.type) {
      let data = res.data.caseFeedbackList
      setList(data)
    }
  }
 
  const getData = async (id) => {
    const res = await getListCaseFlow(id)
    if (res.type) {
      setProgressData(res.data)
    }
  }
 
  return (
    <NewPage
      pageHead={
        { breadcrumbData: [{ title: '工作台' }, { title: '事件中心' }], title: '详情' }
      }
    >
      <Tabs
        defaultActiveTab='1'
        onChange={(v) => setTabsActive(v)}
        className='myTabContent'
      >
        {tabsList?.map(item => {
          return <TabPane
            key={item.key}
            title={
              <span>
                {tabsActive === item.key && <img src={item.img} alt="" style={{ width: '16px', height: '16px', margin: '-5px 12px 0px 0px' }} />}
                <span style={{ fontSize: '16px' }}>{item.label}</span>
              </span>
            }
          >
            {
              item.isNeedStep && <div style={{ backgroundColor: '#fff', margin: '0 16px', paddingTop: '16px', paddingLeft: '91px' }}>
                <Steps type='navigation' current={current}>
                  <Step title='来访登记' disabled />
                  <Step title='事件流转' disabled />
                  <Step title='办理反馈' disabled />
                  <Step title='结案审核' disabled />
                  <Step title='当事人评价' disabled />
                  <Step title='结案归档' disabled />
                </Steps>
              </div>
            }
            {
              tabsActive === '1' &&
              <>
                <Scrollbars style={{ height: 'calc(100vh - 291px)', marginTop: '8px' }} autoHide>
                  <div style={{ backgroundColor: '#ffff', margin: '0 16px 0px 16px', padding: '12px' }}>
                    <Preview mainId={caseId} data={caseInfo} transactResult={TransactResult} isDoc={true} />
                  </div>
                  {list.length != 0 &&
                    <div style={{ backgroundColor: '#ffff', margin: '8px 16px 0px 16px', padding: '12px' }}>
                      <Space size='small'>
                        <div className='MediationInfo-subTitle' style={{ marginTop: '-9px' }}></div><h4>办理记录({list.length})</h4>
                      </Space>
                      <HandleRecord isReview={true} data={list} />
                    </div>
                  }
                  {grade &&
                    <div style={{ backgroundColor: '#ffff', margin: '8px 16px 0px 16px', padding: '12px' }}>
                      <RateModule grade={grade} />
                    </div>
                  }
                  <div style={{ backgroundColor: '#ffff', margin: '8px 16px 65px 16px', padding: '12px' }}>
                    <RegisInfoModule caseInfo={caseInfo} />
                  </div>
                </Scrollbars>
                <div className="dataSync-excel">
                  <Space size="large" style={{ margin: '4px 14px' }}>
                    <Button type='primary' >导出</Button>
                    <Button type='secondary' >返回上级页面</Button>
                  </Space>
                </div>
              </>
            }
            {
              tabsActive === '2' &&
              <div className='dataSync-hasTabPage' style={{ marginTop: '-8px' }}>
                <Tabs defaultActiveTab='1' >
                  <TabPane
                    key='1'
                    title={
                      <span style={{ fontSize: '15px' }}>
                        流转进度
                      </span>
                    }
                  >
                    <ProgressStep progressData={progressData} hasTab={true} />
                  </TabPane>
                  <TabPane
                    key='2'
                    title={
                      <span style={{ fontSize: '15px' }}>
                        督办信息
                        <Badge maxCount={99} count={1000} />
                      </span>
                    }
                  >
                    <div style={{ marginBottom: '20px' }}>
                      <SupervisingView id={''} />
                    </div>
                  </TabPane>
                </Tabs>
              </div>
            }
            {
              tabsActive === '3' &&
              <ApplyInfo />
            }
          </TabPane>
        })}
      </Tabs>
    </NewPage>
  )
}
 
export default FileMessage;