/*
|
* @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;
|