/* * @Date: 2021-03-25 14:07:57 * @LastEditors: wangqiang@feewee.cn * @LastEditTime: 2021-03-29 17:58:06 */ import React, { useState } from 'react'; import { history } from 'umi'; import { Card, ConfigProvider, List, Input, message, Row, Modal, Col } from 'antd'; import zhCN from 'antd/lib/locale-provider/zh_CN'; import { PageHeaderWrapper } from '@ant-design/pro-layout'; import { getFollowDeregulationTimesApi, saveFollowDeregulationTimesApi, getFindTakeAwayTimesApi, saveFindTakeAwayTimesApi, getFindInviteTimeApi, saveFindInviteTimeApi, getLegworkVisitApi, saveLegworkVisitApi, getTestDriveDay, saveTestDriveDay, } from './api'; import Item from './components/Item'; enum Type { '邀约设置' = 1, '外勤拜访设置' } export default function Settings() { const [modalParams, setModalParams] = useState<{ title?: string, visible: boolean, type?: 1 | 2, value?: string | number }>({ visible: false }); const [confirmLoading, setConfirmLoading] = useState(false); // Modal相关 const getModalInfo = (type: 1 | 2) => { if (type === Type['邀约设置']) { getFindInviteTimeApi().then(res => { setModalParams({ ...modalParams, type, title: Type[type], visible: true, value: `${res.data || ''}` }); }).catch(error => { message.error(error.message); }); } if (type === Type['外勤拜访设置']) { getLegworkVisitApi().then(res => { setModalParams({ ...modalParams, type, title: Type[type], visible: true, value: `${res.data}` }); }).catch(error => { message.error(error.message); }); } }; const onOk = () => { if (!modalParams.value) { message.error("请填写后再进行提交!"); return false; } setConfirmLoading(true); if (modalParams.type === Type['邀约设置']) { saveFindInviteTimeApi({ inviteTime: +modalParams.value! }).then(res => { message.success(res.result); setModalParams({ ...modalParams, visible: false }); setConfirmLoading(false); }).catch(error => { message.error(error.message); setConfirmLoading(false); }); } if (modalParams.type === Type['外勤拜访设置']) { saveLegworkVisitApi({ legworkVisit: +modalParams.value! }).then(res => { message.success(res.result); setModalParams({ ...modalParams, visible: false }); setConfirmLoading(false); }).catch(error => { message.error(error.message); setConfirmLoading(false); }); } }; const onCancel = () => { setModalParams({ ...modalParams, visible: false }); }; return ( {/* */} {/* 集客跟进 */} {/* history.push('/crm/collectionFollowSetting')}>查看]}> */} {/* 潜客跟进 */} {/* history.push('/crm/potentialCollectionFollowSetting')}>查看]}> */} {/* 龚昆修改整合:集客跟进,潜客跟进到一个新的页面 */}
history.push('/crm/closeClue')}>查看]}> history.push('/crm/followUpSettings')}>查看]}> {/* 龚昆新增:员工分享成交奖励设置 */} history.push('/crm/RewardForEmployeeRecruitment')}>查看]}> {/* 龚昆新增:首客推荐奖励设置 */} history.push('/crm/FirstCustomerRecommendationReward')}>查看]}> {/* 跟进违规X次划走 */} {/* 划走X次放入公共池 */}
{/* 邀约设置 */} getModalInfo(Type['邀约设置'])}>编辑]}> {/* 外勤拜访设置 */} getModalInfo(Type['外勤拜访设置'])}>编辑]}> {/* 集客归属地设置 */} history.push('/crm/collectionRegionSetting')}>查看]}>
{/* 销售顾问站岗轮换时间 */} {/* */} {/* 直接集客销售顾问奖励设置 */} {/* */} setModalParams({ ...modalParams, title: undefined, type: undefined, value: undefined })} > {modalParams.type === Type['邀约设置'] ? ( 邀约时间设置 setModalParams({ ...modalParams, value: e.target.value })} prefix="到店前" suffix="  小时" /> ) : null} {modalParams.type === Type['外勤拜访设置'] ? ( 客户拜访次数限制 setModalParams({ ...modalParams, value: e.target.value })} suffix="  次" /> ) : null} ); }