广州市综治平台前端
liuwh
4 days ago ebc701d2374ddef3fb985be85c49c5cdcd5425a7
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
/*
 * @Author: dminyi 1301963064@qq.com
 * @Date: 2024-09-21 15:32:11
 * @LastEditors: dminyi 1301963064@qq.com
 * @LastEditTime: 2024-09-22 14:41:54
 * @FilePath: \gzDyh\gz-customerSystem\src\views\register\matterDetail\SupervisingList.jsx
 * @Description: 工作台督办信息弹窗
 */
import React, { useState, useEffect } from 'react';
import { Modal, Button } from '@arco-design/web-react';
import { Space } from 'antd';
import * as $$ from '@/utils/utility';
import TableView from '../../../components/TableView';
import ResponseDetail from './responseDetail';
//督办次数
function pageCaseSuperviseApi(data) {
  return $$.ax.request({ url: 'caseSupervise/pageCaseSupervise', type: 'get', service: 'mediate', data });
}
 
function caseSuperviseInfoApi(data) {
  return $$.ax.request({ url: `caseSupervise/getById`, type: 'get', service: 'mediate', data });
}
 
const SupervisingList = ({ supervisingId }) => {
  const [data, setData] = useState([]);
  const [detail, setDetail] = useState(false)
  const [responseDetail, setResponseDetail] = useState({})
  const [searchSupervise, setSearchSupervise] = useState({
    page: '1',
    size: 10,
    caseId: '',
    type: 0,
  })
 
  const pageCaseSupervise = async () => {
    const res = await pageCaseSuperviseApi({ ...searchSupervise, caseId: supervisingId });
    if (res.type) {
      let data = res.data.content
      setData(data)
    }
  }
 
  const caseSuperviseInfo = async (id, type) => {
    const res = await caseSuperviseInfoApi({ id: id })
    if (type === 'response') {
      if (res.type) {
        // setSuperviseInfo(res.data)
      }
    }
    if (type === 'responseDetail') {
      if (res.type) {
        setResponseDetail(res.data)
      }
    }
  }
 
  const handleDetail = (id, type) => {
    if (type === 'responseDetail') {
      caseSuperviseInfo(id, 'responseDetail')
    }
    if (type === 'response') {
      caseSuperviseInfo(id, 'response')
    }
  }
 
  const supervisingColumns = [
    {
      title: '督办时间',
      dataIndex: 'supTime',
      key: 'supTime',
      width: 150,
      render: (record) => {
        return $$.minuteFormat(record.supTime)
      }
    },
    {
      title: '回复时限',
      dataIndex: 'replyTerm',
      key: 'replyTerm',
      width: 100,
      render: (record) => {
        return $$.getDiffTime(record.replyTerm)
      }
    },
    {
      title: '督办意见',
      dataIndex: 'supContent',
      key: 'supContent',
      width: 180,
    },
    {
      title: '事项等级',
      dataIndex: 'caseSource',
      key: 'caseSource',
      width: 120,
    },
    {
      title: '回复状态',
      dataIndex: 'supStatus',
      key: 'supStatus',
      width: 150,
      render: (record) => {
        return record.supStatus === 0 ? '未回复' : '已回复'
      }
    },
    {
      title: '操作',
      dataIndex: 'defendants',
      key: 'defendants',
      width: 180,
      render: (text, record) => (
        <Space>
          <div onClick={() => handleDetail(record.id, 'responseDetail')}>详情</div>
          <div>回复</div>
        </Space>
      )
    },
  ]
 
  useEffect(() => {
    pageCaseSupervise()
  }, [])
 
 
 
  return (
    <>
      <TableView
        showHeader
        title=""
        columns={supervisingColumns}
        dataSource={data || []}
        style={{ marginTop: '-40px' }}
      />
      <ResponseDetail visible={detail} handleOnCancel={() => setDetail(false)} data={responseDetail} />
 
    </>
 
  )
}
 
export default SupervisingList;