| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231 |
- import consts from '@/consts'
- import ProTable from '@ant-design/pro-table'
- import { queryReminderList } from '@/services/dashboard'
- import { useModal } from '@/components/ModalStore'
- import { Modal } from 'antd'
- const ReminderList = props => {
- const { dataType, reminderCyclical, ...resetModalProps } = props
- const dispatchModal = useModal()
- const clientColumns = [
- {
- title: '客户名称',
- dataIndex: 'clientName',
- ellipsis: true,
- width: '10%',
- render: (clientName, record) => (
- <span
- onClick={() => dispatchModal('D_CLIENT_DETAIL', { dataId: record.id })}
- className="text-primary cursor-pointer hover:text-hex-967bbd"
- >
- {clientName}
- </span>
- )
- },
- {
- title: '单位名称',
- dataIndex: 'companyName',
- width: '15%',
- ellipsis: true,
- render: (companyName, record) => (
- <span
- onClick={() =>
- dispatchModal('D_COMPANY_DETAIL', {
- dataId: record.companyId,
- orderIds: state.orderIds
- })
- }
- className="text-primary cursor-pointer hover:text-hex-967bbd"
- >
- {companyName}
- </span>
- )
- },
- {
- title: '地区',
- dataIndex: 'districtName',
- ellipsis: true,
- width: '15%',
- renderText: text => text?.replaceAll(' / ', ' , ')
- },
- {
- title: '手机',
- dataIndex: 'telephone',
- ellipsis: true,
- width: '10%'
- },
- {
- title: '服务日期',
- dataIndex: 'serviceDate',
- ellipsis: true,
- width: '8%'
- },
- {
- title: '服务内容',
- dataIndex: 'serviceContent',
- width: '26%',
- ellipsis: true
- },
- {
- title: '备忘时间',
- dataIndex: 'memoDate',
- width: '10%',
- ellipsis: true
- },
- {
- title: '备忘内容',
- dataIndex: 'memoContent',
- width: '27%',
- ellipsis: true
- }
- ]
- const customerColumns = [
- {
- title: '单位名称',
- dataIndex: 'companyName',
- width: '15%',
- ellipsis: true,
- render: (companyName, record) => (
- <span
- onClick={() => dispatchModal('D_COMPANY_DETAIL', { dataId: record.id })}
- className="text-primary cursor-pointer hover:text-[#967bbd]"
- >
- {companyName}
- </span>
- )
- },
- {
- title: '地区',
- dataIndex: 'districtName',
- width: '15%',
- ellipsis: true,
- renderText: text => text?.replaceAll(' / ', ' , ')
- },
- {
- title: '电话',
- dataIndex: 'phone',
- width: '10%',
- ellipsis: true
- },
- {
- title: '服务日期',
- dataIndex: 'serviceDate',
- width: '8%',
- ellipsis: true
- },
- {
- title: '服务内容',
- dataIndex: 'serviceContent',
- width: '24%',
- ellipsis: true
- },
- {
- title: '备忘时间',
- dataIndex: 'memoDate',
- width: '10%',
- ellipsis: true
- },
- {
- title: '备忘内容',
- dataIndex: 'memoContent',
- width: '22%',
- ellipsis: true
- }
- ]
- const businessColumns = [
- {
- title: '商机名称',
- dataIndex: 'name',
- width: '15%',
- ellipsis: true,
- render: (text, record) => (
- <span
- onClick={() =>
- dispatchModal('D_BUSINESS_DETAIL', { dataId: record.id, orderIds: state.orderIds })
- }
- className="text-primary cursor-pointer hover:text-[#967bbd]"
- >
- {text}
- </span>
- )
- },
- {
- title: '单位名称',
- dataIndex: 'customerName',
- width: '15%',
- ellipsis: true
- },
- {
- title: '服务日期',
- dataIndex: 'serviceDate',
- width: '8%',
- ellipsis: true
- },
- {
- title: '服务内容',
- dataIndex: 'serviceContent',
- width: '27%',
- ellipsis: true
- },
- {
- title: '备忘时间',
- dataIndex: 'memoDate',
- width: '10%',
- ellipsis: true
- },
- {
- title: '备忘内容',
- dataIndex: 'memoContent',
- width: '25%',
- ellipsis: true
- }
- ]
- const dataMap = {
- 0: {
- key: 'client',
- columns: clientColumns
- },
- 1: {
- key: 'customer',
- columns: customerColumns
- },
- 2: {
- key: 'business',
- columns: businessColumns
- }
- }
- const titleMap = {
- 0: { title: '客户' },
- 1: { title: '单位' },
- 2: { title: '商机' }
- }
- return (
- <Modal {...resetModalProps} title={titleMap[dataType].title} width="90vw" footer={false}>
- <div className="mx-4">
- <ProTable
- size="small"
- rowKey={record => record.id}
- columns={dataMap[dataType].columns}
- params={{ dataType, reminderCyclical }}
- request={async params => {
- const { code = -1, data } = await queryReminderList({ ...params })
- return {
- data: data[dataMap[dataType].key],
- success: code === consts.RET_CODE.SUCCESS,
- total: data.total
- }
- }}
- scroll={{ y: 400 }}
- pagination={{ defaultPageSize: 10 }}
- search={false}
- toolBarRender={false}
- />
- </div>
- </Modal>
- )
- }
- export default ReminderList
|