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.
144 lines
4.7 KiB
144 lines
4.7 KiB
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime"; |
|
import { useMemo } from 'react'; |
|
import { ProTable } from '@ant-design/pro-components'; |
|
import { Button } from 'antd'; |
|
import { dateFormatter, useRoutes } from '@component/utils'; |
|
import { getDictValList } from './action'; |
|
import { dangerStatus, checkStatus } from './constants'; |
|
export function HiddenListDone({ getTableList, type }) { |
|
const { historyPush } = useRoutes(); |
|
const waitColumns = useMemo(() => [ |
|
{ |
|
title: '隐患描述', |
|
dataIndex: 'description', |
|
search: false, |
|
width: 300, |
|
}, |
|
{ |
|
title: '保单号', |
|
dataIndex: 'policyNumber', |
|
ellipsis: true, |
|
order: 4, |
|
hideInTable: type, |
|
search: type && type !== 'expert', |
|
fieldProps: { |
|
placeholder: '请输入保单号', |
|
}, |
|
}, |
|
{ |
|
title: '被服务对象', |
|
dataIndex: 'customerName', |
|
ellipsis: true, |
|
order: 5, |
|
fieldProps: { |
|
placeholder: '请输入隐患/被服务对象名称', |
|
}, |
|
formItemProps: { label: '关键字', name: 'keyword' }, |
|
}, |
|
{ |
|
title: '隐患类型', |
|
dataIndex: 'classifyName', |
|
ellipsis: true, |
|
valueType: 'select', |
|
fieldProps: { |
|
placeholder: '请选择隐患类型', |
|
}, |
|
formItemProps: { |
|
name: 'classifyId', |
|
}, |
|
order: 2, |
|
request: getDictValList, |
|
params: { dictId: '20' }, |
|
}, |
|
{ |
|
title: '隐患等级', |
|
dataIndex: 'hiddenTroubleGrade', |
|
valueType: 'select', |
|
order: 3, |
|
fieldProps: { |
|
placeholder: '请选择隐患等级', |
|
}, |
|
formItemProps: { |
|
name: 'hiddenTroubleGrade', |
|
}, |
|
ellipsis: true, |
|
render: (_, record) => dangerStatus.map((item, index) => { |
|
if (item.value == record.hiddenTroubleGrade) { |
|
return (_jsx("span", Object.assign({ style: { color: item.color } }, { children: item.text }), index)); |
|
} |
|
return null; |
|
}), |
|
valueEnum: { |
|
1: { |
|
text: '一般隐患', |
|
}, |
|
2: { |
|
text: '重大隐患', |
|
}, |
|
}, |
|
}, |
|
{ |
|
title: '审核方', |
|
dataIndex: 'examineOrganName', |
|
ellipsis: true, |
|
search: false, |
|
}, |
|
{ |
|
title: '审核人', |
|
dataIndex: 'examineUserName', |
|
ellipsis: true, |
|
search: false, |
|
}, |
|
{ |
|
title: '审核状态', |
|
dataIndex: 'examineStatus', |
|
valueType: 'select', |
|
order: 1, |
|
fieldProps: { |
|
placeholder: '请选择审核状态', |
|
}, |
|
valueEnum: { |
|
2: { |
|
text: '提交上级审核', |
|
}, |
|
3: { |
|
text: '审核通过', |
|
}, |
|
4: { |
|
text: '被驳回', |
|
}, |
|
}, |
|
ellipsis: true, |
|
render: (_, record) => checkStatus.map((item, index) => { |
|
if (item.value == record.examineStatus) { |
|
return (_jsx("span", Object.assign({ style: { color: item.color } }, { children: item.text }), index)); |
|
} |
|
return null; |
|
}), |
|
}, |
|
{ |
|
title: '审核时间', |
|
dataIndex: 'examineAt', |
|
ellipsis: true, |
|
renderText: dateFormatter, |
|
search: false, |
|
}, |
|
{ |
|
title: '操作', |
|
ellipsis: true, |
|
fixed: 'right', |
|
valueType: 'option', |
|
width: 100, |
|
render: (_, record) => (_jsx(Button, Object.assign({ type: "link", onClick: () => { |
|
historyPush('detail', { |
|
hiddenDangerId: record.hiddenDangerId, |
|
}); |
|
} }, { children: "\u8BE6\u60C5" }))), |
|
}, |
|
], []); |
|
return (_jsx(_Fragment, { children: _jsx(ProTable, { columns: waitColumns, request: getTableList, params: { auditStatus: '2' }, |
|
// postData={(data) => data.filter((item) => item.examineStatus != 1)} |
|
tableClassName: "tableClassName", pagination: { |
|
pageSize: 10, |
|
}, toolBarRender: false, rowKey: "hiddenDangerId" }) })); |
|
}
|
|
|