|
@@ -8,7 +8,7 @@ import { citySelect,provinceList,areaSelect} from '../../../NewDicProvinceList';
|
|
|
const { Column, ColumnGroup } = Table;
|
|
|
const TabPane = Tabs.TabPane;
|
|
|
import CustomerDetail from './myClientDesc.jsx';
|
|
|
-import {socialAttribute,newFollow,lvl,currentMember,cityArr, customerStatus,intentionalService,sex} from '../../../dataDic.js';
|
|
|
+import {socialAttribute,newFollow,lvl,currentMember,cityArr, statuslist,customerStatus,intentionalService,sex} from '../../../dataDic.js';
|
|
|
import {getCompanyIntention,beforeUploadFile,getWhether,getcityArr,getcustomerStatue,getfllowSituationOn,getCertification,getcustomerTyp,getLvl,getCurrentMember,getprovince} from '../../../tools.js';
|
|
|
|
|
|
const data = [{
|
|
@@ -232,17 +232,19 @@ const MyClient = Form.create()(React.createClass({
|
|
|
dataIndex: 'id',
|
|
|
key:'id',
|
|
|
render: (text, record, index) => {
|
|
|
- return <Select value={record.id} onChange={(e) => { record.id=e; this.setState({ data: this.state.data }); }}>
|
|
|
+ return
|
|
|
+ let contacts=record.contacts||'';
|
|
|
+ {contacts==''?<Select value={record.id} placeholder="选择高新" onChange={(e) => { record.id=e; this.setState({ data: this.state.data }); }}>
|
|
|
<Select.Option value="0" >否</Select.Option>
|
|
|
<Select.Option value="1" >是</Select.Option>
|
|
|
- </Select>
|
|
|
+ </Select>:<span>{text}</span>}
|
|
|
}
|
|
|
},{
|
|
|
title: '最新进度',
|
|
|
dataIndex: 'businessGlossoryId',
|
|
|
key: 'businessGlossoryId',
|
|
|
render: (text, record, index) => {
|
|
|
- return <Select value={record.businessGlossoryId} onChange={(e) => { record.businessGlossoryId = e; this.setState({ data: this.state.data }); }}>
|
|
|
+ return <Select placeholder="选择最新进度" value={record.businessGlossoryId} onChange={(e) => { record.businessGlossoryId = e; this.setState({ data: this.state.data }); }}>
|
|
|
{
|
|
|
newFollow.map(function (item) {
|
|
|
return <Select.Option key={item.value} >{item.key}</Select.Option>
|
|
@@ -255,7 +257,7 @@ const MyClient = Form.create()(React.createClass({
|
|
|
dataIndex: 'followSituation',
|
|
|
key: 'followSituation',
|
|
|
render: (text, record, index) => {
|
|
|
- return <Select value={record.followSituation} onChange={(e) => { record.followSituation = e; this.setState({ data: this.state.data }); }}>
|
|
|
+ return <Select value={record.followSituation} placeholder="选择最新状态" onChange={(e) => { record.followSituation = e; this.setState({ data: this.state.data }); }}>
|
|
|
{
|
|
|
customerStatus.map(function (item) {
|
|
|
return <Select.Option key={item.value} >{item.key}</Select.Option>
|
|
@@ -268,7 +270,7 @@ const MyClient = Form.create()(React.createClass({
|
|
|
dataIndex: 'remarks',
|
|
|
key: 'remarks',
|
|
|
render: (text, record, index) => {
|
|
|
- return <Input value={record.customerStatus}
|
|
|
+ return <Input value={record.customerStatus} placeholder="跟进说明"
|
|
|
onChange={(e) => { record.customerStatus = e.target.value; this.setState({ data: this.state.data }); }}
|
|
|
style={{width:'120px'}}/>
|
|
|
}
|
|
@@ -287,29 +289,29 @@ const MyClient = Form.create()(React.createClass({
|
|
|
],
|
|
|
businessIntentionList:[{
|
|
|
title: '意向时间',
|
|
|
- dataIndex: 'name',
|
|
|
- key: 'name'
|
|
|
+ dataIndex: 'createTime',
|
|
|
+ key: 'createTime'
|
|
|
},{
|
|
|
title: '客户名称',
|
|
|
- dataIndex: 'mobile2',
|
|
|
- key: 'mobile2'
|
|
|
+ dataIndex: 'identifyName',
|
|
|
+ key: 'identifyName'
|
|
|
},{
|
|
|
title: '业务名',
|
|
|
- dataIndex: 'mobile3',
|
|
|
- key: 'mobile3'
|
|
|
+ dataIndex: 'businessName',
|
|
|
+ key: 'businessName'
|
|
|
}
|
|
|
,{
|
|
|
title: '营销员',
|
|
|
- dataIndex: 'mobile4',
|
|
|
- key: 'mobile4'
|
|
|
+ dataIndex: 'adminName',
|
|
|
+ key: 'adminName'
|
|
|
},{
|
|
|
title: '业务意向进度',
|
|
|
- dataIndex: 'mobile5',
|
|
|
- key: 'mobile5'
|
|
|
+ dataIndex: 'followSituation',
|
|
|
+ key: 'followSituation'
|
|
|
},{
|
|
|
title: '客户状态',
|
|
|
- dataIndex: 'mobile6',
|
|
|
- key: 'mobile6'
|
|
|
+ dataIndex: 'customerStatus',
|
|
|
+ key: 'customerStatus'
|
|
|
},{
|
|
|
title: '操作',
|
|
|
dataIndex: 'ooo',
|
|
@@ -568,7 +570,7 @@ const MyClient = Form.create()(React.createClass({
|
|
|
key: 'abc',
|
|
|
render: (text, record, index) => {
|
|
|
return <div>
|
|
|
- <Button onClick={(e) =>{ e.stopPropagation(), this.visit(record) }} type="primary">拜访</Button>
|
|
|
+ <Button onClick={(e) =>{ e.stopPropagation(), this.visit(record)}} type="primary">拜访</Button>
|
|
|
</div>
|
|
|
}
|
|
|
}
|
|
@@ -589,7 +591,8 @@ const MyClient = Form.create()(React.createClass({
|
|
|
},
|
|
|
//进入新增拜访记录
|
|
|
visit(e){
|
|
|
- this.getNewWoman(e.uid);
|
|
|
+ this.state.keys=true;
|
|
|
+ this.getNewWoman(e.id);
|
|
|
this.setState({
|
|
|
visitModul:true,
|
|
|
loading: true
|
|
@@ -599,7 +602,7 @@ const MyClient = Form.create()(React.createClass({
|
|
|
dataType: "json",
|
|
|
url:globalConfig.context + '/api/admin/customer/toAddFollow',
|
|
|
data: {
|
|
|
- uid: e.uid,
|
|
|
+ uid: e.id,
|
|
|
},
|
|
|
success: function (data) {
|
|
|
let theArr = [];
|
|
@@ -984,7 +987,8 @@ const MyClient = Form.create()(React.createClass({
|
|
|
})
|
|
|
},
|
|
|
VisitRowClick(record, index) {
|
|
|
- this.state.RowData = record;
|
|
|
+ this.state.keys=false;
|
|
|
+ this.state.RowData = record;
|
|
|
this.visitModify(record.id);
|
|
|
this.setState({
|
|
|
selectedRowKeys:[],
|
|
@@ -1087,9 +1091,9 @@ const MyClient = Form.create()(React.createClass({
|
|
|
thisData = {};
|
|
|
};
|
|
|
let ProvinceCityArr=[];
|
|
|
- let ProvinceS=getprovince(thisData.locationProvince);
|
|
|
- let citys=getprovince(thisData.locationCity);
|
|
|
- let Areas=getprovince(thisData.locationArea);
|
|
|
+ let ProvinceS=thisData.locationProvince; //getprovince
|
|
|
+ let citys=thisData.locationCity;
|
|
|
+ let Areas=thisData.locationArea;
|
|
|
ProvinceCityArr.push(ProvinceS,citys,Areas);
|
|
|
this.setState({
|
|
|
InformationId:thisData.id,
|
|
@@ -1101,9 +1105,8 @@ const MyClient = Form.create()(React.createClass({
|
|
|
companyLogoUrl: thisData.companyLogoUrl ? splitUrl(thisData.companyLogoUrl, ',', globalConfig.avatarHost + '/upload') : [],
|
|
|
dataInformation:thisData,
|
|
|
ProvinceCity:ProvinceCityArr,
|
|
|
- industry:thisData.industry,
|
|
|
- });
|
|
|
-
|
|
|
+ industry:thisData.industry?(thisData.industry).toString():undefined,
|
|
|
+ });
|
|
|
}.bind(this),
|
|
|
}).always(function () {
|
|
|
this.setState({
|
|
@@ -1178,71 +1181,79 @@ const MyClient = Form.create()(React.createClass({
|
|
|
visitModul:false
|
|
|
});
|
|
|
},
|
|
|
- visitCancel(e) {
|
|
|
- this.setState({
|
|
|
+ visitCancel(e) {
|
|
|
+ this.setState({
|
|
|
+
|
|
|
visitModul:false
|
|
|
});
|
|
|
},
|
|
|
//拜访保存函数
|
|
|
visitSubmit(e){
|
|
|
- e.preventDefault();
|
|
|
- this.state.data=[];
|
|
|
- this.setState({
|
|
|
- selectedRowKeys: [],
|
|
|
- });
|
|
|
- this.setState({
|
|
|
- loading: true
|
|
|
- });
|
|
|
- let conName=this.state.lastname;
|
|
|
- let ocbIds='';
|
|
|
- this.state.orderStatusOption.map(function(item){
|
|
|
- if(item.name==conName){
|
|
|
- ocbIds=item.ocbId
|
|
|
- }
|
|
|
- return ocbIds;
|
|
|
- })
|
|
|
- //新增
|
|
|
- $.ajax({
|
|
|
- method: "get",
|
|
|
- dataType: "json",
|
|
|
- url:this.state.contacts?globalConfig.context + '/api/admin/customer/addFollow':globalConfig.context + '/api/admin/customer/updateFollow',
|
|
|
- data: this.state.contacts?{
|
|
|
- userBusinessList:JSON.stringify(this.state.data),
|
|
|
- uid: this.state.Accountuid,
|
|
|
- ocbId: ocbIds,
|
|
|
- result: this.state.result,
|
|
|
- followTime: this.state.followTime,
|
|
|
- }:{
|
|
|
- userBusinessList:JSON.stringify(this.state.data),
|
|
|
- uid: this.state.Accountuid,
|
|
|
- ocbId: ocbIds,
|
|
|
- result: this.state.result,
|
|
|
- followTime: this.state.followTime,
|
|
|
- userBusinessList: this.state.userBusinessList,
|
|
|
- contactType:this.state.contactType
|
|
|
- }
|
|
|
- }).done(function (data) {
|
|
|
- this.setState({
|
|
|
- loading: false
|
|
|
- });
|
|
|
- if (!data.error.length) {
|
|
|
- message.success('保存成功!');
|
|
|
- this.loadVisit(); //
|
|
|
- this.loadData();
|
|
|
- this.visitCancel()
|
|
|
- } else {
|
|
|
- message.warning(data.error[0].message);
|
|
|
- }
|
|
|
- }.bind(this));
|
|
|
+ e.preventDefault();
|
|
|
+ if(this.state.contactType==undefined){
|
|
|
+ message.warning('请选择拜访方式')
|
|
|
+ return false;
|
|
|
+ };
|
|
|
+ if(this.state.keys){
|
|
|
+
|
|
|
+ };
|
|
|
+ if(this.state.lastName==undefined){
|
|
|
+ message.warning('请选择联系人')
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ this.setState({
|
|
|
+ selectedRowKeys: [],
|
|
|
+ });
|
|
|
+ this.setState({
|
|
|
+ loading: true
|
|
|
+ });
|
|
|
+ let conts=this.state.lastName;
|
|
|
+ let contactsId= this.state.contactsIdArr[conts].id;
|
|
|
+ //新增
|
|
|
+ $.ajax({
|
|
|
+ method: "post",
|
|
|
+ dataType: "json",
|
|
|
+ url:this.state.keys?globalConfig.context + '/api/admin/customer/addFollow':globalConfig.context + '/api/admin/customer/updateFollow',
|
|
|
+ data: this.state.keys?{
|
|
|
+ userBusinessList:JSON.stringify(this.state.data),
|
|
|
+ uid: this.state.uid,
|
|
|
+ ocbId:contactsId ,
|
|
|
+ contactType:this.state.contactType,
|
|
|
+ result: this.state.result,
|
|
|
+ followTime: this.state.followTime,
|
|
|
+ }:{
|
|
|
+ userBusinessList:JSON.stringify(this.state.data),
|
|
|
+ uid: this.state.uid,
|
|
|
+ ocbId: contactsId,
|
|
|
+ contactType:this.state.contactType,
|
|
|
+ result: this.state.result,
|
|
|
+ followTime: this.state.followTime,
|
|
|
+ }
|
|
|
+ }).done(function (data) {
|
|
|
+ this.setState({
|
|
|
+ loading: false
|
|
|
+ });
|
|
|
+ if (!data.error.length) {
|
|
|
+ message.success('保存成功!');
|
|
|
+ this.loadVisit(); //
|
|
|
+ this.loadData();
|
|
|
+ this.visitCancel()
|
|
|
+ } else {
|
|
|
+ message.warning(data.error[0].message);
|
|
|
+ }
|
|
|
+ }.bind(this));
|
|
|
+
|
|
|
},
|
|
|
- //根据获取的联系人获取到电话号码函数
|
|
|
- hundleName(e){
|
|
|
- let changNub=this.state.telNumArr[e];
|
|
|
- this.setState({
|
|
|
- lastname:e,
|
|
|
- nub:changNub.mobile
|
|
|
- })
|
|
|
- },
|
|
|
+
|
|
|
+
|
|
|
+ //当选择联系人的列表变化时,则执行
|
|
|
+ hundleName(e){
|
|
|
+ let changNub=this.state.telNum[e];
|
|
|
+ this.setState({
|
|
|
+ nub:this.state.telNum[e],
|
|
|
+ lastName: e,
|
|
|
+ });
|
|
|
+ },
|
|
|
//添加新业务及单位客户详情新增
|
|
|
addNew() {
|
|
|
this.state.data.push({
|
|
@@ -1269,7 +1280,8 @@ const MyClient = Form.create()(React.createClass({
|
|
|
data: {
|
|
|
pageNo: pageNo || 1,
|
|
|
pageSize: this.state.pagination.pageSize,
|
|
|
- uid: this.state.rowId, //名称1
|
|
|
+ uid: this.state.rowId, //名称1
|
|
|
+ businessGlossoryId:'',
|
|
|
},
|
|
|
success: function (data) {
|
|
|
let theArr = [];
|
|
@@ -1350,7 +1362,6 @@ const MyClient = Form.create()(React.createClass({
|
|
|
},
|
|
|
//获取联系人下拉框
|
|
|
getNewWoman(ids) {
|
|
|
- console.log(ids);
|
|
|
this.state.data = []
|
|
|
$.ajax({
|
|
|
method: "get",
|
|
@@ -1361,23 +1372,31 @@ const MyClient = Form.create()(React.createClass({
|
|
|
uid:ids,
|
|
|
},
|
|
|
success: function (data) {
|
|
|
- let theArr = [];
|
|
|
- let thedata=data.data;
|
|
|
- if (!thedata) {
|
|
|
- if (data.error && data.error.length) {
|
|
|
- message.warning(data.error[0].message);
|
|
|
- };
|
|
|
- thedata = {};
|
|
|
- };
|
|
|
- thedata.map(function (item,index) {
|
|
|
- theArr.push(<Select.Option value={index}>{item.name}</Select.Option>)
|
|
|
- });
|
|
|
- let telNum=thedata.telNum;
|
|
|
-
|
|
|
- this.setState({
|
|
|
- telNumArr:thedata,
|
|
|
- orderStatusOption: theArr,
|
|
|
- });
|
|
|
+ let theArr = [];
|
|
|
+ let thedata=data.data;
|
|
|
+ if (!thedata) {
|
|
|
+ if (data.error && data.error.length) {
|
|
|
+ message.warning(data.error[0].message);
|
|
|
+ };
|
|
|
+ thedata = {};
|
|
|
+ };
|
|
|
+ var telNum=[];
|
|
|
+ var contactIds=[];
|
|
|
+ thedata.map(function (item,index) {
|
|
|
+ contactIds.push(thedata[index].id);
|
|
|
+ telNum.push(thedata[index].mobile);
|
|
|
+ });
|
|
|
+ for (let item in data.data) {
|
|
|
+ let theData = data.data[item];
|
|
|
+ theArr.push(
|
|
|
+ <Select.Option value={item} key={theData.name}>{theData.name}</Select.Option>
|
|
|
+ );
|
|
|
+ };
|
|
|
+ this.setState({
|
|
|
+ contactsIdArr:thedata,
|
|
|
+ telNum:telNum,
|
|
|
+ orderStatusOption: theArr,
|
|
|
+ });
|
|
|
}.bind(this),
|
|
|
}).always(function () {
|
|
|
this.setState({
|
|
@@ -1433,16 +1452,16 @@ const MyClient = Form.create()(React.createClass({
|
|
|
this.loadInformation(this.state.rowId)
|
|
|
}
|
|
|
if(e==2){
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
if(e==3){
|
|
|
this.httpAccount(this.state.rowId)
|
|
|
}
|
|
|
if(e==4){
|
|
|
- this.loadVisit()
|
|
|
+ this.loadVisit();
|
|
|
}
|
|
|
if(e==5){
|
|
|
-
|
|
|
+ this.BusinessList();
|
|
|
}
|
|
|
if(e==6){
|
|
|
|
|
@@ -1515,7 +1534,56 @@ const MyClient = Form.create()(React.createClass({
|
|
|
ContactsListSave(e){
|
|
|
console.log(e)
|
|
|
},
|
|
|
- //
|
|
|
+ //tab5业务意向
|
|
|
+ BusinessList(pageNo) {
|
|
|
+ this.setState({
|
|
|
+ loading: true
|
|
|
+ });
|
|
|
+ $.ajax({
|
|
|
+ method: "post",
|
|
|
+ dataType: "json",
|
|
|
+ crossDomain: false,
|
|
|
+ url:globalConfig.context + '/api/admin/customer/listBusiness',
|
|
|
+ data: {
|
|
|
+ pageNo: pageNo || 1,
|
|
|
+ pageSize: this.state.pagination.pageSize,
|
|
|
+ uid:this.state.rowId
|
|
|
+ },
|
|
|
+ success: function (data) {
|
|
|
+ let theArr = [];
|
|
|
+ if (data.error.length || data.data.list=="") {
|
|
|
+ if (data.error && data.error.length) {
|
|
|
+ message.warning(data.error[0].message);
|
|
|
+ };
|
|
|
+ } else {
|
|
|
+ for (let i = 0; i < data.data.list.length; i++) {
|
|
|
+ let thisdata = data.data.list[i];
|
|
|
+ theArr.push({
|
|
|
+ key: i,
|
|
|
+ id: thisdata.id,
|
|
|
+ businessId:thisdata.businessId,
|
|
|
+ businessName:thisdata.businessName,
|
|
|
+ identifyName:thisdata.identifyName,
|
|
|
+ followSituation:thisdata.followSituation,
|
|
|
+ customerStatus:thisdata.customerStatus,
|
|
|
+ adminName:thisdata.adminName,
|
|
|
+ createTime:thisdata.createTime
|
|
|
+ });
|
|
|
+ };
|
|
|
+ this.state.pagination.current = data.data.pageNo;
|
|
|
+ this.state.pagination.total = data.data.totalCount;
|
|
|
+ };
|
|
|
+ this.setState({
|
|
|
+ dataBusiness: theArr,
|
|
|
+ pagination: this.state.pagination
|
|
|
+ });
|
|
|
+ }.bind(this),
|
|
|
+ }).always(function () {
|
|
|
+ this.setState({
|
|
|
+ loading: false
|
|
|
+ });
|
|
|
+ }.bind(this));
|
|
|
+ },
|
|
|
componentWillReceiveProps(nextProps) {
|
|
|
if (!this.props.visible && nextProps.visible) {
|
|
|
if (nextProps.data && nextProps.data.id) {
|
|
@@ -2054,11 +2122,11 @@ const MyClient = Form.create()(React.createClass({
|
|
|
</FormItem>
|
|
|
<FormItem className="half-item"
|
|
|
{...formItemLayout}
|
|
|
- label="客户状态"
|
|
|
+ label="账户状态"
|
|
|
>
|
|
|
- <Select placeholder="客户状态" value={this.state.status} onChange={(e) => { this.setState({ status: e }); }} >
|
|
|
+ <Select placeholder="账户状态" value={this.state.status} onChange={(e) => { this.setState({ status: e }); }} >
|
|
|
{
|
|
|
- customerStatus.map(function (item) {
|
|
|
+ statuslist.map(function (item) {
|
|
|
return <Select.Option key={item.value} >{item.key}</Select.Option>
|
|
|
})
|
|
|
}
|
|
@@ -2137,20 +2205,19 @@ const MyClient = Form.create()(React.createClass({
|
|
|
<Table
|
|
|
pagination={this.state.paginations}
|
|
|
columns={this.state.visitsList}
|
|
|
- dataSource={this.state.data}
|
|
|
+ dataSource={this.state.visitArrList}
|
|
|
onRowClick={this.VisitRowClick}
|
|
|
/>
|
|
|
</Spin>
|
|
|
</div>
|
|
|
- </TabPane>
|
|
|
- {/*this.state.visitArrList*/}
|
|
|
+ </TabPane>
|
|
|
<TabPane tab="业务意向" key="5">
|
|
|
<div className="clearfix">
|
|
|
<Spin spinning={this.state.loading}>
|
|
|
<Table
|
|
|
pagination={this.state.paginations}
|
|
|
columns={this.state.businessIntentionList}
|
|
|
- dataSource={data}
|
|
|
+ dataSource={this.state.dataBusiness}
|
|
|
/>
|
|
|
</Spin>
|
|
|
</div>
|
|
@@ -2222,11 +2289,11 @@ const MyClient = Form.create()(React.createClass({
|
|
|
{...formItemLayout}
|
|
|
label="联系人"
|
|
|
>
|
|
|
- <Select placeholder="选择联系人" style={{ width: 140 }}
|
|
|
+ <Select placeholder="选择联系人" style={{ width: 140 }}
|
|
|
value={this.state.lastName}
|
|
|
- onChange={this.hundleName}>
|
|
|
+ onChange={this.hundleName}>
|
|
|
{this.state.orderStatusOption}
|
|
|
- </Select>
|
|
|
+ </Select>
|
|
|
</FormItem>
|
|
|
|
|
|
<FormItem className="half-item"
|
|
@@ -2247,11 +2314,8 @@ const MyClient = Form.create()(React.createClass({
|
|
|
labelCol={{ span: 4 }}
|
|
|
wrapperCol={{ span: 16 }}
|
|
|
label="拜访备注" >
|
|
|
- {getFieldDecorator('result', {
|
|
|
- initialValue: this.state.result
|
|
|
- })(
|
|
|
- <Input type="textarea" rows={4} />
|
|
|
- )}
|
|
|
+ <Input type="textarea" rows={4} value={this.state.result}
|
|
|
+ onChange={(e)=>{this.setState({result:e.target.value})}}/>
|
|
|
</FormItem>
|
|
|
</div>
|
|
|
<div className="clearfix">
|