|
@@ -1,11 +1,13 @@
|
|
|
import React from 'react';
|
|
|
-import {Form, Button, Spin, message, Table, Popconfirm, Input, Modal} from 'antd';
|
|
|
+import {Form, Button, Spin, message, Table, Tooltip, Input, Modal} from 'antd';
|
|
|
import ajax from 'jquery/src/ajax/xhr.js';
|
|
|
import $ from 'jquery/src/ajax';
|
|
|
import FollowDetail from '../../followDetail.jsx'
|
|
|
import {getContactType} from '@/tools.js';
|
|
|
import VisitDetail from './visitDetail.jsx';
|
|
|
|
|
|
+const confirm = Modal.confirm;
|
|
|
+
|
|
|
const Visit = React.createClass({
|
|
|
getInitialState(){
|
|
|
return {
|
|
@@ -13,6 +15,8 @@ const Visit = React.createClass({
|
|
|
loading: false,
|
|
|
visitModul: false,
|
|
|
visitModuls: false,
|
|
|
+ followId:0,
|
|
|
+ ispage:1,
|
|
|
paginations: {
|
|
|
defaultCurrent: 1,
|
|
|
defaultPageSize: 10,
|
|
@@ -88,7 +92,65 @@ const Visit = React.createClass({
|
|
|
title: "跟进时间",
|
|
|
dataIndex: "followTime",
|
|
|
key: "followTime",
|
|
|
- }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "指导意见",
|
|
|
+ dataIndex: "abc",
|
|
|
+ key: "abc",
|
|
|
+ render: (text, record) => {
|
|
|
+ return (
|
|
|
+ <div>
|
|
|
+ {record.guidance ?
|
|
|
+ <div style={{
|
|
|
+ cursor:"pointer",
|
|
|
+ width: '150px',
|
|
|
+ whiteSpace: 'nowrap',
|
|
|
+ overflow: 'hidden',
|
|
|
+ textOverflow: 'ellipsis',
|
|
|
+ }}
|
|
|
+ onClick={(e)=>{
|
|
|
+ e.stopPropagation();
|
|
|
+ Modal.info({
|
|
|
+ title: '指导意见',
|
|
|
+ content: (
|
|
|
+ <div style={{
|
|
|
+ wordWrap:"break-word"
|
|
|
+ }}>
|
|
|
+ {record.guidance}
|
|
|
+ </div>
|
|
|
+ ),
|
|
|
+ onOk() {},
|
|
|
+ });
|
|
|
+ }}>
|
|
|
+ <span>
|
|
|
+ {record.guidance}
|
|
|
+ </span>
|
|
|
+ </div> : (this.props.isEditGuidanceLv ? <Button
|
|
|
+ onClick={(e) => {
|
|
|
+ e.stopPropagation();
|
|
|
+ this.setState({
|
|
|
+ guidanceVisible: true,
|
|
|
+ followId: record.followId
|
|
|
+ })
|
|
|
+ }}
|
|
|
+ type="primary"
|
|
|
+ >
|
|
|
+ 立即指导
|
|
|
+ </Button> : <span>暂未指导</span>)}
|
|
|
+ </div>
|
|
|
+ );
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "指导时间",
|
|
|
+ dataIndex: "guidanceTime",
|
|
|
+ key: "guidanceTime",
|
|
|
+ render: (text, record) => {
|
|
|
+ return (
|
|
|
+ <span>{text ? text : '无'}</span>
|
|
|
+ )
|
|
|
+ }
|
|
|
+ }
|
|
|
],
|
|
|
guidanceVisible: false,
|
|
|
guidance: ''
|
|
@@ -144,22 +206,13 @@ const Visit = React.createClass({
|
|
|
} else {
|
|
|
for(let i = 0; i < data.data.list.length; i++) {
|
|
|
let thisdata = data.data.list[i];
|
|
|
- theArr.push({
|
|
|
- readOnly:thisdata.readOnly,
|
|
|
- followId: thisdata.followId,
|
|
|
- followTime: thisdata.followTime,
|
|
|
- identifyName: thisdata.identifyName,
|
|
|
- contacts: thisdata.contacts,
|
|
|
- contactMobile: thisdata.contactMobile,
|
|
|
- result: thisdata.result,
|
|
|
- adminName: thisdata.adminName,
|
|
|
- followSituation: thisdata.followSituation,
|
|
|
- customerStatus: thisdata.customerStatus,
|
|
|
- contactType: thisdata.contactType
|
|
|
- });
|
|
|
+ theArr.push(thisdata);
|
|
|
};
|
|
|
this.state.paginations.current = data.data.pageNo;
|
|
|
this.state.paginations.total = data.data.totalCount;
|
|
|
+ this.setState({
|
|
|
+ ispage: data.data.pageNo
|
|
|
+ })
|
|
|
};
|
|
|
if(data.data.list&&!data.data.list.length){
|
|
|
this.state.paginations.current =0;
|
|
@@ -178,37 +231,6 @@ const Visit = React.createClass({
|
|
|
},
|
|
|
componentWillMount(){
|
|
|
this.loadVisit();
|
|
|
- if(this.props.isGuidanceLv){ //是否可指导
|
|
|
- let arr = this.state.visitsList.concat();
|
|
|
- arr.push({
|
|
|
- title: "指导意见",
|
|
|
- dataIndex: "abc",
|
|
|
- key: "abc",
|
|
|
- render: (text, record) => {
|
|
|
- return (
|
|
|
- <div>
|
|
|
- {/*<div style={{width:'200px'}}>*/}
|
|
|
- {/* <span style={{wordWrap:"break-word"}}>*/}
|
|
|
- {/* 11*/}
|
|
|
- {/* </span>*/}
|
|
|
- {/*</div>*/}
|
|
|
- <Button
|
|
|
- onClick={(e) => {
|
|
|
- e.stopPropagation();
|
|
|
-
|
|
|
- }}
|
|
|
- type="primary"
|
|
|
- >
|
|
|
- 立即指导
|
|
|
- </Button>
|
|
|
- </div>
|
|
|
- );
|
|
|
- },
|
|
|
- })
|
|
|
- this.setState({
|
|
|
- visitsList: arr
|
|
|
- });
|
|
|
- }
|
|
|
},
|
|
|
detailsModal(){
|
|
|
this.props.closeDetail(false, false)
|
|
@@ -237,6 +259,38 @@ const Visit = React.createClass({
|
|
|
this.loadVisit()
|
|
|
}
|
|
|
},
|
|
|
+ //发布指导意见
|
|
|
+ releaseGuidance(e){
|
|
|
+ e.stopPropagation();
|
|
|
+ if(!this.state.guidance){
|
|
|
+ message.info('指导意见不能为空')
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.setState({
|
|
|
+ loading: true,
|
|
|
+ });
|
|
|
+ $.ajax({
|
|
|
+ method: "post",
|
|
|
+ dataType: "json",
|
|
|
+ crossDomain: false,
|
|
|
+ url: globalConfig.context + "/api/admin/customer/addGuidance",
|
|
|
+ data: {
|
|
|
+ guidance: this.state.guidance,
|
|
|
+ followId: this.state.followId,
|
|
|
+ },
|
|
|
+ }).done(function(data) {
|
|
|
+ if(!data.error.length) {
|
|
|
+ message.success("发布成功");
|
|
|
+ this.loadVisit(this.state.ispage);
|
|
|
+ this.setState({
|
|
|
+ loading: false,
|
|
|
+ guidanceVisible: false,
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ message.warning(data.error[0].message);
|
|
|
+ }
|
|
|
+ }.bind(this));
|
|
|
+ },
|
|
|
componentWillReceiveProps(nextProps) {
|
|
|
if(nextProps.data.id&&nextProps.visitState){
|
|
|
this.loadVisit()
|
|
@@ -248,18 +302,19 @@ const Visit = React.createClass({
|
|
|
render(){
|
|
|
return(
|
|
|
<div className="clearfix">
|
|
|
- <Button
|
|
|
+ {!this.props.isGuidanceLv ? <Button
|
|
|
onClick={(e) => {
|
|
|
- e.stopPropagation(), this.visit();
|
|
|
+ e.stopPropagation();
|
|
|
+ this.visit();
|
|
|
}}
|
|
|
type="primary"
|
|
|
style={{marginTop:'10px',float: 'right'}}
|
|
|
>
|
|
|
客户跟进
|
|
|
- </Button>
|
|
|
+ </Button> : <div/>}
|
|
|
<Spin spinning={this.state.loading}>
|
|
|
- <Table
|
|
|
- style={{marginTop:'60px'}}
|
|
|
+ <Table
|
|
|
+ style={{marginTop:this.props.isGuidanceLv ? '0px' : '60px'}}
|
|
|
pagination={this.state.paginations}
|
|
|
columns={this.state.visitsList}
|
|
|
dataSource={this.state.visitArrList}
|
|
@@ -280,6 +335,65 @@ const Visit = React.createClass({
|
|
|
closeDesc={this.closeDesc}
|
|
|
loadData={this.loadVisit}
|
|
|
/>
|
|
|
+ {/*指导意见*/}
|
|
|
+ {this.state.guidanceVisible ? <Modal
|
|
|
+ className="customeDetails"
|
|
|
+ title="指导意见"
|
|
|
+ width='500px'
|
|
|
+ visible={this.state.guidanceVisible}
|
|
|
+ onOk={()=>{
|
|
|
+ this.setState({
|
|
|
+ guidanceVisible: false,
|
|
|
+ guidance: '',
|
|
|
+ },()=>{
|
|
|
+ this.loadVisit();
|
|
|
+ })
|
|
|
+ }}
|
|
|
+ onCancel={()=>{
|
|
|
+ this.setState({
|
|
|
+ guidanceVisible: false,
|
|
|
+ guidance: '',
|
|
|
+ },()=>{
|
|
|
+ this.loadVisit();
|
|
|
+ })
|
|
|
+ }}
|
|
|
+ footer=''
|
|
|
+ >
|
|
|
+ <Spin spinning={this.state.loading}>
|
|
|
+ <div style={{
|
|
|
+ display:'flex',
|
|
|
+ flexFlow:'column',
|
|
|
+ }}>
|
|
|
+ <Input
|
|
|
+ style={{ width: '400px',height:'50px' }}
|
|
|
+ placeholder="请输入指导意见"
|
|
|
+ type={'textarea'}
|
|
|
+ onChange={(e)=>{
|
|
|
+ this.setState({
|
|
|
+ guidance: e.target.value,
|
|
|
+ })
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ <Button
|
|
|
+ type="primary"
|
|
|
+ style={{ marginTop: "10px", marginBottom: '10px' }}
|
|
|
+ onClick={(e)=>{
|
|
|
+ let _this = this;
|
|
|
+ confirm({
|
|
|
+ title: '确定要提交本次指导意见吗?',
|
|
|
+ content: '指导意见提交成功后无法修改',
|
|
|
+ onOk() {
|
|
|
+ _this.releaseGuidance(e);
|
|
|
+ },
|
|
|
+ onCancel() {},
|
|
|
+ });
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ 保存
|
|
|
+ </Button>
|
|
|
+ </div>
|
|
|
+ </Spin>
|
|
|
+ </Modal> : <div/>}
|
|
|
</div>
|
|
|
)
|
|
|
}
|