You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
73 lines
1.3 KiB
73 lines
1.3 KiB
import React, { useEffect, useState } from 'react';
|
|
import { Table, Card } from 'antd';
|
|
import { connect } from 'umi';
|
|
|
|
import { CCQK } from '@/utils/constants';
|
|
import { getDicsName } from '@/utils/utils';
|
|
/**
|
|
*
|
|
*
|
|
*
|
|
*/
|
|
|
|
const columns = [
|
|
{
|
|
title: '抽查时间',
|
|
dataIndex: 'ccSj',
|
|
},
|
|
{
|
|
title: '抽查人',
|
|
dataIndex: 'ccrMc',
|
|
},
|
|
{
|
|
title: '抽查结果',
|
|
dataIndex: 'ccjg',
|
|
key: 'id',
|
|
render: (text) => getDicsName(CCQK, text),
|
|
},
|
|
{
|
|
title: '备注信息',
|
|
dataIndex: 'bzxx',
|
|
},
|
|
]
|
|
|
|
const CCJG = (props) => {
|
|
const { id, sysToken } = props;
|
|
const [ccjg, setCcjg] = useState(null);
|
|
|
|
const getCcjg = () => {
|
|
props.fetchCcjg({ id, sysToken }).then((data) => {
|
|
if (data) {
|
|
setCcjg(data);
|
|
}
|
|
});
|
|
}
|
|
|
|
useEffect(() => {
|
|
getCcjg();
|
|
return () => {
|
|
// cleanup
|
|
};
|
|
}, []);
|
|
|
|
if (!ccjg) return '';
|
|
|
|
return (
|
|
<Card title="抽查">
|
|
<Table
|
|
columns={columns}
|
|
dataSource={ccjg}
|
|
/>
|
|
</Card>
|
|
);
|
|
};
|
|
|
|
const mapStateToProps = ({ doing, }) => ({
|
|
doing,
|
|
});
|
|
const mapDispatchToProps = (dispatch) => ({
|
|
fetchCcjg(params) {
|
|
return dispatch({ type: 'doing/fetchCcjg', payload: params });
|
|
},
|
|
});
|
|
export default connect(mapStateToProps, mapDispatchToProps)(CCJG);
|