Commit 46e2eb18 authored by baixian's avatar baixian

优化

parent 97caaa5b
......@@ -32,6 +32,7 @@ export default {
birthday: '',
gender: 1,
customers: [],
id: 0,
},
},
subscriptions: {
......@@ -230,6 +231,7 @@ export default {
birthday: '',
gender: 1,
customers: [],
id: 0,
},
courseList: [],
operator: {
......
......@@ -146,6 +146,7 @@ export default {
yield put({
type: 'updateState',
payload: {
activeIndex: Number(data.data.source_type) === 10 ? 1 : 2,
crmDetail: { ...data.data },
},
});
......
......@@ -223,26 +223,47 @@ class AddCrmForm extends React.Component {
)}
</FormItem>
<div className={pageStyle.commonTitle}>售卖信息</div>
<FormItem {...formItemLayout} label="来源渠道">
{getFieldDecorator('source_type', {
initialValue: editCrmInfo.source_type ? editCrmInfo.source_type : undefined,
rules: [{ required: true, message: '来源渠道不能为空' }],
})(
<Select disabled={editCrmInfo.id} style={{ width: 260 }} placeholder="请选择">
<Option value={1}>在线购买</Option>
<Option value={2}>在线招生</Option>
<Option value={3}>来电咨询</Option>
<Option value={4}>地推</Option>
<Option value={5}>外呼电话</Option>
<Option value={6}>转介绍</Option>
<Option value={7}>客户直访</Option>
<Option value={9}>小程序线索</Option>
<Option value={10}>商家岛活动</Option>
<Option value={11}>导入</Option>
<Option value={8}>其他</Option>
</Select>,
)}
</FormItem>
{
Number(editCrmInfo.id) === 0 ?
<FormItem {...formItemLayout} label="来源渠道">
{getFieldDecorator('source_type', {
initialValue: editCrmInfo.source_type ? editCrmInfo.source_type : undefined,
rules: [{ required: true, message: '来源渠道不能为空' }],
})(
<Select disabled={editCrmInfo.id} style={{ width: 260 }} placeholder="请选择">
<Option value={1}>在线购买</Option>
<Option value={2}>在线招生</Option>
<Option value={3}>来电咨询</Option>
<Option value={4}>地推</Option>
<Option value={5}>外呼电话</Option>
<Option value={6}>转介绍</Option>
<Option value={7}>客户直访</Option>
<Option value={8}>其他</Option>
</Select>,
)}
</FormItem>
:
<FormItem {...formItemLayout} label="来源渠道">
{getFieldDecorator('source_type', {
initialValue: editCrmInfo.source_type ? editCrmInfo.source_type : undefined,
rules: [{ required: true, message: '来源渠道不能为空' }],
})(
<Select disabled={editCrmInfo.id} style={{ width: 260 }} placeholder="请选择">
<Option value={1}>在线购买</Option>
<Option value={2}>在线招生</Option>
<Option value={3}>来电咨询</Option>
<Option value={4}>地推</Option>
<Option value={5}>外呼电话</Option>
<Option value={6}>转介绍</Option>
<Option value={7}>客户直访</Option>
<Option value={9}>小程序线索</Option>
<Option value={10}>商家岛活动</Option>
<Option value={11}>导入</Option>
<Option value={8}>其他</Option>
</Select>,
)}
</FormItem>
}
<FormItem {...formItemLayout} label="意向课程">
{getFieldDecorator('intent_course_id', {
initialValue: editCrmInfo.intent_course_id ? editCrmInfo.intent_course_id : undefined,
......
......@@ -111,8 +111,6 @@ class Crm extends React.Component {
reset = () => {
const { dispatch } = this.props;
// eslint-disable-next-line react/no-string-refs
this.refs.searchBarName.input.state.value = '';
// eslint-disable-next-line react/no-string-refs
this.refs.searchBarMobile.input.state.value = '';
dispatch({
type: 'crm/reset',
......@@ -275,7 +273,6 @@ class Crm extends React.Component {
}
goBuyCourse = (record) => {
const { dispatch, schoolUserInfo } = this.props;
console.log(record, 'record');
dispatch({
type: 'crm/updateState',
payload: {
......@@ -500,11 +497,6 @@ class Crm extends React.Component {
}}
className={pageStyle.formList}
>
<Col className={pageStyle.formitem} xs={{ span: 12 }} sm={{ span: 12 }} md={{ span: 12 }} lg={{ span: 8 }} xl={{ span: 8 }}>
<div className={pageStyle.formitemlabel}>学员姓名:</div>
{/* eslint-disable-next-line react/no-string-refs */}
<Search allowClear style={{ width: '100%' }} ref="searchBarName" placeholder="请填写学员姓名" onSearch={e => this.searchParamsChange(e, 'Input', 'name')} />
</Col>
<Col className={pageStyle.formitem} xs={{ span: 12 }} sm={{ span: 12 }} md={{ span: 12 }} lg={{ span: 8 }} xl={{ span: 8 }}>
<div className={pageStyle.formitemlabel}>联系方式:</div>
{/* eslint-disable-next-line react/no-string-refs */}
......@@ -512,7 +504,7 @@ class Crm extends React.Component {
</Col>
<Col className={pageStyle.formitem} xs={{ span: 12 }} sm={{ span: 12 }} md={{ span: 12 }} lg={{ span: 8 }} xl={{ span: 8 }}>
<div className={pageStyle.formitemlabel} >跟进状态:</div>
<Select allowClear style={{ width: '100%', overflow: 'hidden' }} className={pageStyle.selectitem} onChange={e => this.searchParamsChange(e, 'Select', 'status')} placeholder="全部">
<Select allowClear style={{ width: '100%', overflow: 'hidden' }} value={crmParams.status ? crmParams.status : undefined} className={pageStyle.selectitem} onChange={e => this.searchParamsChange(e, 'Select', 'status')} placeholder="全部">
<Option value="">全部</Option>
<Option value={1}>待跟进</Option>
<Option value={2}>跟进中</Option>
......@@ -520,36 +512,32 @@ class Crm extends React.Component {
<Option value={4}>无效</Option>
</Select>
</Col>
{
isExpendMore &&
<div>
<Col className={pageStyle.formitem} xs={{ span: 12 }} sm={{ span: 12 }} md={{ span: 12 }} lg={{ span: 8 }} xl={{ span: 8 }}>
<div className={pageStyle.formitemlabel}>录入时间:</div>
<RangePicker
style={{ width: '100%' }}
format="YYYY-MM-DD"
disabledDate={this.disabledDate}
onChange={e => this.searchTimeItemChange(e, 'time')}
/>
</Col>
<Col className={pageStyle.formitem} xs={{ span: 12 }} sm={{ span: 12 }} md={{ span: 12 }} lg={{ span: 8 }} xl={{ span: 8 }}>
<div className={pageStyle.formitemlabel}>来源渠道:</div>
<Select allowClear style={{ width: '100%', overflow: 'hidden' }} className={pageStyle.selectitem} onChange={e => this.searchParamsChange(e, 'Select', 'source_type')} placeholder="全部">
<Option value={1}>在线购买</Option>
<Option value={2}>在线招生</Option>
<Option value={3}>来电咨询</Option>
<Option value={4}>地推</Option>
<Option value={5}>外呼电话</Option>
<Option value={6}>转介绍</Option>
<Option value={7}>客户直访</Option>
<Option value={9}>小程序线索</Option>
<Option value={10}>商家岛活动</Option>
<Option value={11}>导入</Option>
<Option value={8}>其他</Option>
</Select>
</Col>
</div>
}
<Col className={pageStyle.formitem} xs={{ span: 12 }} sm={{ span: 12 }} md={{ span: 12 }} lg={{ span: 8 }} xl={{ span: 8 }}>
<div className={pageStyle.formitemlabel}>录入时间:</div>
<RangePicker
style={{ width: '100%' }}
format="YYYY-MM-DD"
disabledDate={this.disabledDate}
onChange={e => this.searchTimeItemChange(e, 'time')}
value={[crmParams.start_date == '' ? null : moment(crmParams.start_date), crmParams.end_date == '' ? null : moment(crmParams.end_date)]}
/>
</Col>
<Col className={pageStyle.formitem} xs={{ span: 12 }} sm={{ span: 12 }} md={{ span: 12 }} lg={{ span: 8 }} xl={{ span: 8 }}>
<div className={pageStyle.formitemlabel}>来源渠道:</div>
<Select allowClear style={{ width: '100%', overflow: 'hidden' }} className={pageStyle.selectitem} value={crmParams.source_type ? crmParams.source_type : undefined} onChange={e => this.searchParamsChange(e, 'Select', 'source_type')} placeholder="全部">
<Option value={1}>在线购买</Option>
<Option value={2}>在线招生</Option>
<Option value={3}>来电咨询</Option>
<Option value={4}>地推</Option>
<Option value={5}>外呼电话</Option>
<Option value={6}>转介绍</Option>
<Option value={7}>客户直访</Option>
<Option value={9}>小程序线索</Option>
<Option value={10}>商家岛活动</Option>
<Option value={11}>导入</Option>
<Option value={8}>其他</Option>
</Select>
</Col>
</Row>
</Col>
<Col xs={{ span: 4 }} sm={{ span: 4 }} md={{ span: 4 }} lg={{ span: 4 }} xl={{ span: 4 }}>
......@@ -557,7 +545,6 @@ class Crm extends React.Component {
<Tooltip title="清空筛选">
<img onClick={this.reset} className={pageStyle.resetIcon} src={`${__IMGCDN__}common/reset.png`} alt="" />
</Tooltip>
<span className={pageStyle.expend} onClick={this.expendMore}>{isExpendMore ? '收起' : '展开'}<Icon style={{ marginLeft: 5 }} type={isExpendMore ? 'up' : 'down'} /></span>
</div>
</Col>
</Row>
......
......@@ -32,6 +32,7 @@ class Crm extends React.Component {
constructor(props) {
super(props);
this.state = {
tabIndex: 2,
};
}
componentDidMount() { // 挂载
......@@ -198,6 +199,7 @@ class Crm extends React.Component {
courseList,
operator,
} = this.props;
const { tabIndex } = this.state;
const activityColumns = [
{
title: '活动类型',
......@@ -270,7 +272,7 @@ class Crm extends React.Component {
</div>
<div className={pageStyle.rightBox}>
<div className={pageStyle.rightTop}>
<div className={pageStyle.rightName}><span>{crmDetail.mobile}</span>{crmDetail.name || '-'}</div>
<div className={pageStyle.rightName}><span>{crmDetail.mobile}</span>{crmDetail.name && crmDetail.name}</div>
<div className={pageStyle.btnList}>
<Button className={pageStyle.btn} size="small" type="primary" onClick={() => this.goBuyCourse(crmDetail)}>购课</Button>
<Button className={pageStyle.btn} size="small" onClick={() => this.goEditCrm(crmDetail.id)}>编辑</Button>
......@@ -293,8 +295,16 @@ class Crm extends React.Component {
</div>
</Card>
<Card bordered={false} bodyStyle={{ padding: 20, marginTop: 20 }}>
<Tabs activeKey={`${activeIndex}`} onChange={this.handleChangeTab}>
<TabPane tab="活动信息" key="1">
<div className={pageStyle.tabList}>
{
Number(crmDetail.source_type) == 10 &&
<div className={Number(activeIndex) === 1 ? pageStyle.tabItemActive : pageStyle.tabItem} onClick={() => this.handleChangeTab(1)}>活动信息</div>
}
<div className={Number(activeIndex) === 2 ? pageStyle.tabItemActive : pageStyle.tabItem} onClick={() => this.handleChangeTab(2)}>沟通动态</div>
<div className={Number(activeIndex) === 3 ? pageStyle.tabItemActive : pageStyle.tabItem} onClick={() => this.handleChangeTab(3)}>修改日志</div>
</div>
<React.Fragment>
<div hidden={activeIndex != 1}>
<div className={pageStyle.tableWrap}>
<Table
dataSource={crmDetail.customers}
......@@ -305,8 +315,8 @@ class Crm extends React.Component {
bordered
/>
</div>
</TabPane>
<TabPane tab="沟通动态" key="2">
</div>
<div hidden={activeIndex != 2}>
<div className={pageStyle.dynamicHead}>
<Button size="small" type="primary" onClick={this.addLog}>添加跟进记录</Button>
</div>
......@@ -333,8 +343,8 @@ class Crm extends React.Component {
/>
</div>
</div>
</TabPane>
<TabPane tab="修改日志" key="3">
</div>
<div hidden={activeIndex != 3}>
<div className={pageStyle.tablebox}>
<div className={pageStyle.members}>
{logList.length > 0 &&
......@@ -363,8 +373,8 @@ class Crm extends React.Component {
}
</div>
</div>
</TabPane>
</Tabs>
</div>
</React.Fragment>
</Card>
<AddLogModal
visible={addLogVisible}
......
......@@ -114,3 +114,41 @@
color: #108EE9;
font-weight: 700;
}
.tabList {
display: flex;
border-bottom: 1px solid #E8E8E8;
margin-bottom: 18px;
.tabItem {
font-size:13px;
font-weight:400;
color:rgba(102,102,102,1);
line-height:18px;
padding: 0 20px 10px;
cursor: pointer;
position: relative;
&:hover {
font-weight:600;
color:#1890FF;
}
}
.tabItemActive {
font-size:13px;
font-weight:600;
color:#1890FF;
line-height:18px;
padding: 0 20px 10px;
cursor: pointer;
position: relative;
font-family:PingFangSC-Semibold,PingFang SC;
&:after {
content: '';
display: block;
width: 30%;
height: 2px;
background-color: #1890FF;
position: absolute;
bottom: 0;
left: 35%;
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment