Commit 36f75b28 authored by baixian's avatar baixian

优化

parent 9082d681
......@@ -13,10 +13,10 @@
<script charset="utf-8" src="https://map.qq.com/api/js?v=2.exp&key=XSZBZ-5LHCV-5I2P7-UQHPW-6456F-JBB3B"></script>
<script src="/js/ueeditor/ueditor.config.js?20200107" charset="utf-8"></script><script src="/js/ueeditor/ueditor.all.js?20200107" charset="utf-8"></script>
<script src="https://cdn.img.shangjiadao.cn/qingxiao/biz/js/console-polyfill.js?20200107" charset="utf-8"></script><script src="https://cdn.img.shangjiadao.cn/qingxiao/biz/js/es6-shim.min.js?20200107" charset="utf-8"></script><script src="https://cdn.img.shangjiadao.cn/qingxiao/biz/js/es5-shim.js?20200107" charset="utf-8"></script><script src="https://cdn.img.shangjiadao.cn/qingxiao/biz/js/es5-sham.min.js?20200107" charset="utf-8"></script><script src="https://cdn.img.shangjiadao.cn/qingxiao/biz/js/json3.min.js?20200107" charset="utf-8"></script><script src="https://cdn.img.shangjiadao.cn/qingxiao/biz/js/html5shiv.min.js?20200107" charset="utf-8"></script><script src="https://cdn.img.shangjiadao.cn/qingxiao/biz/js/polyfill.js?20200107" charset="utf-8"></script><script src="https://cdn.img.shangjiadao.cn/qingxiao/biz/lib/vendor.dll.js?20200107" charset="utf-8"></script>
<script src="js/console-polyfill.js?20200107" charset="utf-8"></script><script src="js/es6-shim.min.js?20200107" charset="utf-8"></script><script src="js/es5-shim.js?20200107" charset="utf-8"></script><script src="js/es5-sham.min.js?20200107" charset="utf-8"></script><script src="js/json3.min.js?20200107" charset="utf-8"></script><script src="js/html5shiv.min.js?20200107" charset="utf-8"></script><script src="js/polyfill.js?20200107" charset="utf-8"></script><script src="lib/vendor.dll.js?20200107" charset="utf-8"></script>
</head>
</head>
<body>
<div id="root"></div>
<script type="text/javascript" src="https://cdn.img.shangjiadao.cn/qingxiao/biz/dist/main.1b6459.js"></script></body>
<script type="text/javascript" src="/dist/main.a7d695.js"></script></body>
</html>
\ No newline at end of file
......@@ -173,6 +173,24 @@ export default {
}
yield delay(100);
yield put(routerRedux.goBack());
yield put({
type: 'updateState',
payload: {
saveLoading: false,
editCrmInfo: {
reserve_mobile: [''],
name: '',
mobile: '',
source_type: '',
intent_course_id: '',
remark: '',
birthday: '',
gender: 1,
customers: [],
id: 0,
},
},
});
} else {
yield put({
type: 'webapp/errorrequestresolve',
......
......@@ -390,7 +390,7 @@ export default {
const loadmessage = message.loading('购买中...', 0);
const data = yield call(studentsAjax.studentsAdd, {
school_id: sid,
name: studentInfo.name,
name: values.name,
birthday: studentInfo.birthday,
mobile: studentInfo.mobile,
avatar: '',
......
......@@ -266,7 +266,7 @@ export default {
const loadmessage = message.loading('购买中...', 0);
const data = yield call(studentsAjax.studentsAdd, {
school_id: sid,
name: studentInfo.name,
name: values.name,
birthday: studentInfo.birthday,
mobile: studentInfo.mobile,
avatar: '',
......
......@@ -371,6 +371,43 @@ export default {
title: '数据中心',
key: 10,
},
{
title: '潜客管理',
key: 60,
children: [{
title: '潜客管理权限',
key: 600,
ffid: 60,
children: [{
isbtn: true,
title: '我是按钮的',
key: 6000,
children: [{
key: 60000,
name: '新增潜在学员',
fid: 600,
ffid: 60,
}, {
key: 60001,
name: '一键导入',
fid: 600,
ffid: 60,
},
{
key: 60002,
name: '编辑学员信息',
fid: 600,
ffid: 60,
}, {
key: 60003,
name: '购课',
fid: 600,
ffid: 60,
},
],
}],
}],
},
{
title: '在线课堂',
key: 11,
......
......@@ -174,8 +174,7 @@ class AddCrmForm extends React.Component {
{getFieldDecorator('name', {
initialValue: editCrmInfo.name,
rules: [
{ required: true, message: '学员姓名不能为空' },
{ max: 20, message: '学员姓名不能超过20位!' },
{ max: 20, message: '学员姓名字数不能超过20位!' },
],
})(
<Input style={{ width: 260 }} placeholder="请填写学员姓名" />,
......
import { connect } from 'dva';
import React from 'react';
import { Icon, Button, Row, Col, Input, InputNumber, Select, Checkbox, Table, Modal, Form, Alert } from 'antd';
import pageStyle from './RenewEdit.less';
import { pageIn } from '../../utils/index';
const { Option } = Select;
const { TextArea } = Input;
class RenewEdit extends React.Component {
state = {
modeType: 0,
selectedCourse: {},
mybuyCourse: {},
};
componentDidMount() { // 挂载
}
componentWillUnmount() { // 卸载
}
renewCourse = (e) => {
const { save, form } = this.props;
e.preventDefault();
this.props.form.validateFields((err, values) => {
if (!err) {
save(values, () => {
form.resetFields();
});
}
});
}
courseChange = (value) => {
const { renewCourses, searchCourseRelateClass, studentinfo } = this.props;
if (value == '') {
this.setState({
modeType: 0,
selectedCourse: {},
});
return;
}
const selectedCourse = renewCourses.find(ele => ele.id == value) || {};
if (selectedCourse.isMy) {
this.setState({
selectedCourse,
});
if (selectedCourse.course_mode == 3) {
searchCourseRelateClass(selectedCourse.id || 0);
}
this.setState({
modeType: selectedCourse.course_mode,
});
this.props.form.setFieldsValue({
mode_type: selectedCourse.course_mode,
});
} else {
this.setState({
selectedCourse,
});
if (selectedCourse.mode_time == 1) {
this.setState({
modeType: 1,
});
this.props.form.setFieldsValue({
mode_type: 1,
});
return;
}
if (selectedCourse.mode_interval == 1) {
this.setState({
modeType: 2,
});
this.props.form.setFieldsValue({
mode_type: 2,
});
return;
}
if (selectedCourse.mode_class == 1) {
this.props.form.setFieldsValue({
mode_type: 3,
});
this.setState({
modeType: 3,
});
searchCourseRelateClass(selectedCourse.id || 0);
}
}
}
modeTypeChange = (value) => {
const { searchCourseRelateClass } = this.props;
const { selectedCourse } = this.state;
this.setState({
modeType: value,
});
this.props.form.setFieldsValue({
mode_type: value,
});
if (value == 3) {
searchCourseRelateClass(selectedCourse.id || 0);
}
}
close = () => {
const { form, close } = this.props;
form.resetFields();
close();
}
checkData = (value) => {
let str = value.replace(/[^\d\.]/g, '');
const pointIndex = str.search(/\./);
if (pointIndex !== -1) {
str = str.substr(0, pointIndex + 1).replace(/\./, '.5');
}
return str;
}
changeValue = (e, type) => {
this.props.form.setFieldsValue({
[type]: this.checkData(e.target.value),
});
}
render() {
const {
visible,
close,
courseList,
classList,
renewCourses,
operator,
toChangeOperator,
studentInfo,
} = this.props;
const { selectedCourse, modeType, mybuyCourse } = this.state;
const { getFieldDecorator } = this.props.form;
return (
<Modal
visible={visible}
title="购买课程"
okText="确定"
onCancel={() => this.close()}
onOk={this.renewCourse}
className="modifyclassModal"
zIndex={110}
maskClosable={false}
>
<Form className="modalform" hideRequiredMark>
<div className={pageStyle.courseinfo}>
<Row>
<Col className={pageStyle.course}>
<Form.Item
label="学员姓名"
labelCol={{
xs: { span: 24 },
sm: { span: 4 },
}}
wrapperCol={{
xs: { span: 24 },
sm: { span: 20 },
}}
>
{getFieldDecorator('name', {
rules: [
{ required: true, message: '学员姓名不能为空' },
{ max: 20, message: '字数不能超过20个!' },
],
initialValue: studentInfo.name,
})(
<Input maxLength={25} placeholder="请输入学员姓名" style={{ width: 200 }} />,
)}
</Form.Item>
</Col>
<Col className={pageStyle.course}>
<Form.Item
label="购买课程"
labelCol={{
xs: { span: 24 },
sm: { span: 4 },
}}
wrapperCol={{
xs: { span: 24 },
sm: { span: 20 },
}}
>
{getFieldDecorator('course_id', {
rules: [{ required: true, message: '课程不能为空' }],
initialValue: '',
})(
<Select style={{ width: 200 }} onChange={this.courseChange}>
<Option value="">请选择课程</Option>
{renewCourses.map(ele => <Option key={ele.id} value={ele.id}>{ele.title}</Option>)}
</Select>)}
</Form.Item>
</Col>
<Col className={pageStyle.course}>
<Form.Item
label="收费模式"
labelCol={{
xs: { span: 24 },
sm: { span: 4 },
}}
wrapperCol={{
xs: { span: 24 },
sm: { span: 20 },
}}
>
{getFieldDecorator('mode_type', {
// initialValue: editClassInfo.title,
rules: [
{ required: true, message: '收费模式不能为空' },
],
})(
<Select placeholder="请选择收费模式" style={{ width: 200 }} onChange={this.modeTypeChange}>
{selectedCourse.mode_time == 1 && <Option value={1}>按课时</Option>}
{selectedCourse.mode_interval == 1 && <Option value={2}>按时段</Option>}
{selectedCourse.mode_class == 1 && <Option value={3}>按班级</Option>}
</Select>,
)}
</Form.Item>
</Col>
<Col>
{modeType == 1 &&
<div className={pageStyle.buytimebox}>
<Col className={pageStyle.course}>
<Form.Item
label="付费课时"
labelCol={{
xs: { span: 24 },
sm: { span: 4 },
}}
wrapperCol={{
xs: { span: 24 },
sm: { span: 20 },
}}
>
{getFieldDecorator('buy', {
rules: [
{
required: true,
message: '请输入购买课时',
},
],
})(
<InputNumber min={0} onBlur={e => this.changeValue(e, 'buy')} placeholder="请输入购买课时" style={{ width: 200 }} />,
)}
</Form.Item>
</Col>
<Col className={pageStyle.course}>
<Form.Item
label="赠送课时"
labelCol={{
xs: { span: 24 },
sm: { span: 4 },
}}
wrapperCol={{
xs: { span: 24 },
sm: { span: 20 },
}}
>
{getFieldDecorator('give', {
rules: [
{
required: false,
message: '请输入赠送课时',
},
],
})(
<InputNumber onBlur={e => this.changeValue(e, 'give')} placeholder="请输入赠送课时" style={{ width: 200 }} />,
)}
<div>赠送课时只能单独消课,点名不会自动扣除赠送课时喔</div>
</Form.Item>
</Col>
</div>
}
{modeType == 2 &&
<div className={pageStyle.buytimebox}>
<Col className={pageStyle.course}>
<Form.Item
label="购买天数"
labelCol={{
xs: { span: 24 },
sm: { span: 4 },
}}
wrapperCol={{
xs: { span: 24 },
sm: { span: 20 },
}}
>
{getFieldDecorator('buy', {
rules: [
{
required: true,
message: '请输入购买天数',
},
{
pattern: /^[1-9]\d*$/,
message: '请输入大于0的整数',
},
],
})(
<InputNumber placeholder="请输入购买天数" style={{ width: 200 }} />,
)}
&nbsp;&nbsp;
</Form.Item>
</Col>
<Col className={pageStyle.course}>
<Form.Item
label="赠送天数"
labelCol={{
xs: { span: 24 },
sm: { span: 4 },
}}
wrapperCol={{
xs: { span: 24 },
sm: { span: 20 },
}}
>
{getFieldDecorator('give', {
rules: [
{
required: false,
message: '请输入在赠送天数',
},
{
pattern: /^[1-9]\d*$/,
message: '请输入大于0的整数',
},
],
})(
<InputNumber placeholder="请输入赠送天数" style={{ width: 200 }} />,
)}
&nbsp;&nbsp;
</Form.Item>
</Col>
</div>
}
{modeType == 3 &&
<div className={pageStyle.buytimebox}>
<Col className={pageStyle.course}>
<Form.Item
label="班级列表"
labelCol={{
xs: { span: 24 },
sm: { span: 4 },
}}
wrapperCol={{
xs: { span: 24 },
sm: { span: 20 },
}}
>
{getFieldDecorator('class_ids', {
rules: [
{
required: true,
message: '请选择班级',
},
],
})(
<Select
mode="multiple"
placeholder="请选择班级"
// onChange={handleChange}
style={{ width: '55%' }}
>
{classList.map(ele => <Option key={ele.id} value={ele.id}>{ele.title}</Option>)}
</Select>,
)}
</Form.Item>
</Col>
</div>
}
</Col>
<Col className={pageStyle.course}>
<Form.Item
label={<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>}
labelCol={{
xs: { span: 24 },
sm: { span: 4 },
}}
wrapperCol={{
xs: { span: 24 },
sm: { span: 20 },
}}
>
{getFieldDecorator('remark', {
initialValue: '',
})(
<TextArea placeholder="请输入备注" rows={4} />,
)}
</Form.Item>
</Col>
<Col className={pageStyle.course}>
<Form.Item
label={<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>}
labelCol={{
xs: { span: 24 },
sm: { span: 4 },
}}
wrapperCol={{
xs: { span: 24 },
sm: { span: 20 },
}}
>
{getFieldDecorator('operator_id', {
initialValue: operator.id,
})(
<span>{operator.nickname}</span>,
)}
</Form.Item>
</Col>
</Row>
</div>
</Form>
</Modal>
);
}
}
RenewEdit.propTypes = {
};
const ClassMgt = Form.create()(RenewEdit);
export default ClassMgt;
.teacher{
padding-top: 60px;
text-align: right;
}
.changeOperate {
margin-left: 10px;
}
\ No newline at end of file
......@@ -23,7 +23,7 @@ import { routerRedux } from 'dva/router';
import pageStyle from './index.less';
import { pageIn, hasBtnPower, btnPermission } from '../../utils/index';
import ChangeStatusModal from './ChangeStatusModal';
import RenewEdit from '../student/RenewEdit';
import RenewEdit from './RenewEdit';
import BtnPermission from '../../components/BtnPermission';
import ClueImport from './ClueImport';
import BindSjdAccount from './BindSjdAccount';
......@@ -344,6 +344,7 @@ class Crm extends React.Component {
courseList,
operator,
schoolUserInfo,
studentInfo,
} = this.props;
const { isExpendMore } = this.state;
const columns = [
......@@ -372,22 +373,11 @@ class Crm extends React.Component {
dataIndex: 'source_type',
key: 'source_type',
render: (text, record) => {
// <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>
// <Option value={9}>小程序线索</Option>
// <Option value={10}>商家岛活动</Option>
// <Option value={11}>导入</Option>
switch (text) {
case 1:
return '在线招生';
return '在线购买';
case 2:
return '来电咨询';
return '在线招生';
case 3:
return '来电咨询';
case 4:
......@@ -471,7 +461,9 @@ class Crm extends React.Component {
render: (text, record) => {
return (
<div className={pageStyle.tableoperatebox}>
<span className="hreflink" onClick={() => this.goBuyCourse(record)}>购课</span>
<BtnPermission btnId="60003">
<span className="hreflink" onClick={() => this.goBuyCourse(record)}>购课</span>
</BtnPermission>
<Divider type="vertical" />
<span className="hreflink" onClick={() => this.handleChangeStatus(record)}>跟进</span>
</div>
......@@ -482,8 +474,12 @@ class Crm extends React.Component {
return (
<div className={pageStyle.container}>
<div className={pageStyle.headerbox}>
<Button size="small" className={pageStyle.headerbtn} type="primary" onClick={this.goAddCrm}>添加潜在学员</Button>
<Button size="small" className={pageStyle.headerbtn} onClick={this.toImportClue}>一键导入</Button>
<BtnPermission btnId="60000">
<Button size="small" className={pageStyle.headerbtn} type="primary" onClick={this.goAddCrm}>添加潜在学员</Button>
</BtnPermission>
<BtnPermission btnId="60001">
<Button size="small" className={pageStyle.headerbtn} onClick={this.toImportClue}>一键导入</Button>
</BtnPermission>
</div>
<div className={pageStyle.searchbox}>
<Row
......@@ -610,9 +606,9 @@ class Crm extends React.Component {
classList={courseRelateClassList}
renewCourses={courseList}
operator={operator}
studentInfo={studentInfo}
close={this.closeEditClassModal}
save={this.sureRenewCourse}
isOperator
/>
</div>
);
......@@ -645,6 +641,7 @@ function mapStateToProps(state) {
courseRelateClassList,
courseList,
operator,
studentInfo,
} = state.crm;
const {
guideStep,
......@@ -679,6 +676,7 @@ function mapStateToProps(state) {
courseList,
operator,
schoolUserInfo,
studentInfo,
};
}
export default connect(mapStateToProps)(CrmForm);
......
......@@ -67,9 +67,12 @@ class AddLogModal extends React.Component {
<FormItem label="结果情况" {...formItemModalLineLayout}>
{getFieldDecorator('content', {
initialValue: '',
rules: [{ required: true, message: '结果情况不能为空' }],
rules: [
{ required: true, message: '结果情况不能为空' },
{ max: 200, message: '字数不能超过200个!' },
],
})(
<TextArea rows={4} placeholder="请输入跟进的结果情况" />,
<TextArea maxLength={210} rows={4} placeholder="请输入跟进的结果情况" />,
)}
</FormItem>
<FormItem label="沟通方式" {...formItemModalLineLayout}>
......
......@@ -22,7 +22,7 @@ import pageStyle from './index.less';
import { pageIn, hasBtnPower, btnPermission, translateType, formatDate } from '../../utils/index';
import AddLogModal from './AddLogModal';
import BtnPermission from '../../components/BtnPermission';
import RenewEdit from '../student/RenewEdit';
import RenewEdit from '../crm/RenewEdit';
const { Option } = Select;
const { TextArea } = Input;
const { Search } = Input;
......@@ -198,6 +198,7 @@ class Crm extends React.Component {
courseRelateClassList,
courseList,
operator,
studentInfo,
} = this.props;
const { tabIndex } = this.state;
const activityColumns = [
......@@ -346,13 +347,17 @@ class Crm extends React.Component {
<div className={pageStyle.rightTop}>
<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>
<BtnPermission btnId="60003">
<Button className={pageStyle.btn} size="small" type="primary" onClick={() => this.goBuyCourse(crmDetail)}>购课</Button>
</BtnPermission>
<BtnPermission btnId="60002">
<Button className={pageStyle.btn} size="small" onClick={() => this.goEditCrm(crmDetail.id)}>编辑</Button>
</BtnPermission>
</div>
</div>
<Descriptions>
<Descriptions.Item label="备用电话">
{crmDetail && crmDetail.reserve_mobile && crmDetail.reserve_mobile.map(item => item).join('')
{crmDetail && crmDetail.reserve_mobile && crmDetail.reserve_mobile.map(item => item).join(' ')
}
</Descriptions.Item>
<Descriptions.Item label="意向课程">{crmDetail.intent_course && crmDetail.intent_course.title}</Descriptions.Item>
......@@ -462,7 +467,7 @@ class Crm extends React.Component {
operator={operator}
close={this.closeEditClassModal}
save={this.sureRenewCourse}
isOperator
studentInfo={studentInfo}
/>
</div>
);
......@@ -487,6 +492,7 @@ function mapStateToProps(state) {
courseRelateClassList,
courseList,
operator,
studentInfo,
} = state.crmdetail;
const {
guideStep,
......@@ -513,6 +519,7 @@ function mapStateToProps(state) {
courseList,
operator,
schoolUserInfo,
studentInfo,
};
}
export default connect(mapStateToProps)(CrmForm);
......
......@@ -129,7 +129,6 @@ class RenewEdit extends React.Component {
renewCourses,
operator,
toChangeOperator,
isOperator,
} = this.props;
const { selectedCourse, modeType, mybuyCourse } = this.state;
const { getFieldDecorator } = this.props.form;
......@@ -383,7 +382,7 @@ class RenewEdit extends React.Component {
})(
<span>{operator.nickname}</span>,
)}
{!isOperator && <span className={`hreflink ${pageStyle.changeOperate}`} onClick={() => toChangeOperator(true)}>修改</span>}
<span className={`hreflink ${pageStyle.changeOperate}`} onClick={() => toChangeOperator(true)}>修改</span>
</Form.Item>
</Col>
</Row>
......
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