1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477 |
- import React from 'react';
- import { Radio,Icon, Popconfirm,Button, AutoComplete ,Cascader,Input, Tabs,Select,Spin,Table, Switch, message, DatePicker, Modal, Upload,Form ,Row,Col,TimePicker} from 'antd';
- import ajax from 'jquery/src/ajax/xhr.js';
- import $ from 'jquery/src/ajax';
- import moment from 'moment';
- const Option = AutoComplete.Option;
- const OptGroup = AutoComplete.OptGroup;
- import './myClient.less';
- import { areaSelect} from '../../../NewDicProvinceList';
- const { Column, ColumnGroup } = Table;
- const TabPane = Tabs.TabPane;
- import {socialAttribute,newFollow,lvl, customerStatus,intentionalService} from '../../../dataDic.js';
- import {getcustomerStatue,getprovince,getCompanyIntention,getfllowSituation} from '../../../tools.js';
- const dataSource = [{
- name: 'AntDesign',
- id: '10000',
- }, {
- name: 'AntDesign UI',
- id: '10600',
-
- }, {
-
- name: 'AntDesign UI 有多好',
- id: '60100',
- }, {
- name: 'AntDesign 是啥',
- id: '30010',
-
- }, {
-
- name: 'AntDesign 是一个设计语言',
- id: '100000',
-
- }];
- const data = [{
- id: '1',
- name: '长沙科技1',
- contacts: '午安行',
- contactMobile: '321312311',
- expert:'0',
- serviceCertification:'0',
- userCertification:'0',
- locationProvince:'广州',
- }, {
- id: '2',
- name: '上海科技',
- contacts: '老王',
- contactMobile: '231321311',
- expert:'1',
- serviceCertification:'1',
- userCertification:'0',
- locationProvince:'湖南-湘潭',
- Province:'1',
- city:'38',
- eare:'500',
- }, {
- id: '3',
- name: '广州科技',
- contacts: '老李',
- contactMobile: '1123213123',
- expert:'1',
- serviceCertification:'0',
- userCertification:'1',
- locationProvince:'北京',
- Province:'6',
- city:'24',
- eare:'12',
- }
- ];
- //图片组件
- const PicturesWall = React.createClass({
- getInitialState() {
- return {
- previewVisible: false,
- previewImage: '',
- fileList: [],
- }
- },
- handleCancel() {
- this.setState({ previewVisible: false })
- },
- handlePreview(file) {
- this.setState({
- previewImage: file.url || file.thumbUrl,
- previewVisible: true,
- });
- },
- handleChange(info) {
- let fileList = info.fileList;
- this.setState({ fileList });
- this.props.fileList(fileList);
- },
- componentWillReceiveProps(nextProps) {
- this.state.fileList = nextProps.pictureUrl;
- },
- render() {
- const { previewVisible, previewImage, fileList } = this.state;
- const uploadButton = (
- <div>
- <Icon type="plus" />
- <div className="ant-upload-text">点击上传</div>
- </div>
- );
- return (
- <div style={{display:"inline-block"}}>
- <Upload
- action={globalConfig.context + "/api/admin/customer/attachmentUpload"}
- data={{ 'sign': this.props.pictureSign }}
- listType="picture-card"
- fileList={fileList}
- onPreview={this.handlePreview}
- onChange={this.handleChange} >
- {fileList.length >= 1 ? null : uploadButton}
- </Upload>
- <Modal maskClosable={false} visible={previewVisible} footer={null} onCancel={this.handleCancel}>
- <img alt="example" style={{ width: '100%' }} src={previewImage} />
- </Modal>
- </div>
- );
- }
- });
- const MyBusiness = Form.create()(React.createClass({
- loadData(pageNo, apiUrl) {
- this.state.data = [];
- 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,
- businessGlossoryId: this.state.businessIdS, //业务意向
- identifyName:this.state.identifyNameS,
- followSituation:this.state.followSituationS,
- customerStatus:this.state.customerStatusS,
- adminName: this.state.adminNameS,
- startDate: this.state.releaseDate[0],
- endDate: this.state.releaseDate[1],
- },
- 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({
- dataSource: theArr,
- pagination: this.state.pagination
- });
- }.bind(this),
- }).always(function () {
- this.setState({
- loading: false
- });
- }.bind(this));
- },
-
- //点击出现函数
- setModal2VisibleOk(e) {
- this.setState({
- modal2Visible:true
- });
- },
- //点击消失函数
- setModal2Visiblecancel(e) {
- this.setState({
- modal2Visible:false
- });
- },
- getPictureUrl(e) {
- this.setState({pictureUrl: e });
- },
-
- handleOk(e){
- this.setState({
- visible: false,
- });
- },
- handleCancel(e){
- this.setState({
- visible: false,
- });
- },
- getInitialState() {
- return {
- dataSources:[],
- customerName:[],
- orgCodeUrl:[],
- companyLogoUrl:[],
- visible: false ,
- searchMore: true,
- releaseDate: [],
- releaseDate: [],
- selectedRowKeys: [],
- selectedRowKey: [],
- selectedRows: [],
- loading: false,
- pagination: {
- defaultCurrent: 1,
- defaultPageSize: 10,
- showQuickJumper: true,
- pageSize: 10,
- onChange: function (page) {
- this.loadData(page);
- }.bind(this),
- showTotal: function (total) {
- return '共' + total + '条数据';
- }
- },
- businessFollowList: [
- {
- title: '跟进时间',
- dataIndex: 'name',
- key: 'name',
- }, {
- title: '营销员',
- dataIndex: 'type',
- key: 'type',
- }, {
- title: '业务意向进度',
- dataIndex: 'locationProvince',
- key: 'locationProvince',
- }, {
- title: '客户状态',
- dataIndex: 'contacts',
- key: 'contacts',
- },
- {
- title: '拜访方式',
- dataIndex: 'contactMobile',
- key:'contactMobile',
- }, {
- title: '联系人',
- dataIndex: 'contacts22',
- key: 'contacts22',
- },
- {
- title: '联系电话',
- dataIndex: 'contactMobile22',
- key:'contactMobile22',
- },
- {
- title: '操作',
- dataIndex: 'ccc',
- key:'ccc',
- render: (text, record, index) => {
- return <div>
- <Popconfirm title="是否删除?" onConfirm={(e)=>{this.intentionDelet(record)}} okText="删除" cancelText="不删除">
- <Button style={{marginRight:'10px',color:'#ffffff',background:'#f00',border:'none'}}>删除</Button>
- </Popconfirm>
- </div>
- }
- }
- ],
- columns: [
- {
- title: '业务名称',
- dataIndex: 'businessName',
- key: 'businessName',
- }, {
- title: '意向时间',
- dataIndex: 'createTime',
- key: 'createTime',
- }, {
- title: '客户名称',
- dataIndex: 'identifyName',
- key: 'identifyName',
- }, {
- title: '营销员',
- dataIndex: 'adminName',
- key: 'adminName',
- },
- {
- title: '业务意向进度',
- dataIndex: 'followSituation',
- key:'followSituation',
- render: text => { return getfllowSituation(text) }
- },
- {
- title: '客户状态',
- dataIndex: 'customerStatus',
- key: 'customerStatus',
- render: text => { return getcustomerStatue(text) }
- },
- {
- title: '操作',
- dataIndex: 'abc',
- key: 'abc',
- render: (text, record, index) => {
- return <div>
- <Button onClick={(e) =>{ e.stopPropagation(), this.addModify(record); }} type="primary" style={{marginRight:'10px'}}>跟进</Button>
- <Button onClick={(e) =>{ e.stopPropagation(), this.followStop(record) }} type="primary">停止</Button>
- </div>
- }
- }
- ],
- dataSource: [],
- searchTime: [,]
- };
- },
- //删除跟进记录
- intentionDelet(e){
- console.log(e)
- },
- //更多操作
- ModalOperation(){
- this.setState({
- visible: true,
- });
- },
- //拜访
- visit(e){
- this.setState({
- visitModul:true
- })
- console.log(e)
- },
-
- //列表删除功能
- delectRow() {
- let deletedIds;
- for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
- let rowItem = this.state.selectedRows[idx];
- if (rowItem.id) {
- deletedIds=rowItem.id;
- };
- };
- this.setState({
- selectedRowKeys: [],
- });
- $.ajax({
- method: "get",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + "/api/admin/customer/deleteCustomer",
- data: {
- id: deletedIds,//删除的ID
- }
- }).done(function (data) {
- if (!data.error.length) {
- message.success('删除成功!');
- this.setState({
- loading: false,
- });
- } else {
- message.warning(data.error[0].message);
- };
- this.loadData();
- }.bind(this));
- },
-
- getOrgCodeUrl(e) {
- this.setState({ orgCodeUrl: e });
- },
- getCompanyLogoUrl(e) {
- this.setState({ companyLogoUrl: e });
- },
- componentWillMount() {
- //意向服务
- let intentionalArr = [];
- newFollow.map(function (item) {
- intentionalArr.push(
- <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
- )
- });
- //客户状态
- let customerStatusArr = [];
- customerStatus.map(function (item) {
- customerStatusArr.push(
- <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
- )
- });
- this.state.intentionalOption = intentionalArr;
- this.state.customerStatusArrOption = customerStatusArr;
- this.loadData();
- },
- //新建
- addClick() {
- this.state.businessGlossoryId=undefined;
- this.state.followSituation='0';
- this.state.customerStatus='0';
- this.state.contactType=undefined;
- this.state.remarks='';
- this.state.result='';
- this.addTime();
- this.setState({
- showDesc: true,
- });
- },
- //跟进
- addModify(e) {
- this.addTime();
- this.HttpFollowUp(e.businessId)
- this.setState({
- showDesc: true,
- });
- },
- addClickOk(){
- this.setState({
- businessId:'',
- showDesc: false,
- });
- },
- addClickCancel(){
- this.setState({
- businessId:'',
- showDesc: false,
- });
- },
- search() {
- this.loadData();
- },
- reset() {
- this.state.businessIdS=undefined; //名称1
- this.state.identifyNameS='';
- this.state.followSituationS=undefined;
- this.state.customerStatusS=undefined;
- this.state.adminNameS='';
- this.state.releaseDate[0]=undefined;
- this.state.releaseDate[1]=undefined;
- this.loadData();
- },
- searchSwitch() {
- this.setState({
- searchMore: !this.state.searchMore
- });
- },
- //详情保存函数
- detailsSubmint(){
- this.setState({
- modal5Visible:false,
- })
- },
- //基本信息提交
- newSubmit(e){
- e.preventDefault();
- this.setState({
- selectedRowKeys: [],
- });
- this.props.form.validateFields((err, values) => {
- if (!err) {
- this.setState({
- loading: true
- });
- $.ajax({
- method: "get",
- dataType: "json",
- url:globalConfig.context + '/api/admin/customer/toUpdateBusiness',
- data: {
- businessId:this.state.rowId
- }
- }).done(function (data) {
- let thisData=data.data;
- if (!thisData) {
- if (data.error && data.error.length) {
- message.warning(data.error[0].message);
- };
- thisData = {};
- };
- this.setState({
- businessId:thisData.businessId,
- identifyName:thisData.identifyName,
- businessGlossoryId:thisData.businessGlossoryId,
- followSituation:thisData.followSituation,
- customerStatus:thisData.customerStatus,
- createTime:thisData.createTime,
- adminName:thisData.adminName,
- remarks:thisData.remarks,
- });
- }.bind(this),
- ).always(function () {
- this.setState({
- loading: false
- });
- }.bind(this));
- }
- })
- },
- //查看基本详情基本信息
- loadInformation(record){
- console.log(record)
- $.ajax({
- method: "get",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + '/api/admin/customer/findOrganizationCustomerDetail',
- data: {
- uid: record
- },
- success: function (data) {
- let thisData = data.data;
- if (!thisData) {
- if (data.error && data.error.length) {
- message.warning(data.error[0].message);
- };
- thisData = {};
- };
- let ProvinceCityArr=[];
- let ProvinceS=getprovince(thisData.locationProvince);
- let citys=getprovince(thisData.locationCity);
- let Areas=getprovince(thisData.locationArea);
- ProvinceCityArr.push(ProvinceS,citys,Areas)
-
- console.log(ProvinceCityArr)
- this.setState({
- InformationId:thisData.id,
- InformationUid:thisData.uid,
- unitName:thisData.unitName,
- listed:thisData.listed,
- highTechZone:thisData.highTechZone,
- orgCodeUrl: thisData.orgCodeUrl ? splitUrl(thisData.orgCodeUrl, ',', globalConfig.avatarHost + '/upload') : [],
- companyLogoUrl: thisData.companyLogoUrl ? splitUrl(thisData.companyLogoUrl, ',', globalConfig.avatarHost + '/upload') : [],
- dataInformation:thisData,
- ProvinceCity:ProvinceCityArr,
- industry:thisData.industry,
- });
- }.bind(this),
- }).always(function () {
- this.setState({
- loading: false
- });
- }.bind(this));
- },
- detailsModalOk(e) {
- this.setState({ modal5Visible:true });//需要一个请求数据
- this.loadInformation(e.id)
- },
- //点击消失函数
- detailsModal(e) {
- this.setState({
- modal5Visible:false
- });
- },
- //拜访保存函数
- visitSubmit(){
- this.setState({
- visitModul:false,
- })
- },
-
-
- //新增联系人
- addcontactModulOK(){
- this.setState({
- addcontactModul:false
- });
- },
- addcontactModulcancel(){
- this.setState({
- addcontactModul:false
- });
- },
- businessFollowOk(){
- this.setState({
- businessFollowModul:false
- });
- },
- businessFollowCancel(){
- this.setState({
- businessFollowModul:false
- });
- },
- //点击新增详情
- newContacts(){
- this.setState({
- addcontactModul:true
- });
- },
- //新增联系人保存函数
- submitcontactman(e){
- e.preventDafault();
- this.props.form.validateFields((err, values) => {
- if (!err) {
- this.setState({
- loading: true
- });
- $.ajax({
- method: "POST",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + '/api/admin/customer/addContacter',
- data: {
- cid: deletedIds,//编号id
- sex:this.state.hott,//性别
- primaryFlg:this.state.hotst,//是否是主要联系人
- name:this.state.paymentIdt,//联系人姓名
- mobile:this.state.paymt,//座机
- telNum:this.state.payt,//电话
- qq:this.state.entIdt,//qq
- wechat:this.state.payIdt,//微信
- customerPosition:this.state.paentIdt,//职位
- depatrment:this.state.paytIdtt,//部门
- email:this.state.emailst,//邮箱
- }
- }).done(function (data) {
- this.setState({
- loading: false
- });
- if (!data.error.length) {
- message.success('保存成功!');
- this.setModal2Visiblecancel()
- } else {
- message.warning(data.error[0].message);
- }
- this.getNewWoman(this.state.khId);
- }.bind(this));
- }
- });
- },
- //获取联系人下拉框
- getNewWoman(ids) {
- console.log(ids);
- $.ajax({
- method: "get",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + "/api/admin/customer/findCustomerContacts",
- data:{
- 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({
- lastname:thedata[0].name||'',
- telNumArr:thedata,
- nub:thedata[0].mobile,
- orderStatusOption: theArr,
- });
- }.bind(this),
- }).always(function () {
- this.setState({
- loading: false
- });
- }.bind(this));
- },
- //根据获取的联系人获取到电话号码函数
- hundleName(e){
- let changNub=this.state.telNumArr[e];
- this.setState({
- lastname:e,
- nub:changNub.mobile
- })
- },
- //新建保存
- addSubmit(e){
- e.preventDefault();
- this.props.form.validateFields((err, values) => {
- if (!err) {
- this.setState({
- loading: true
- });
- let thed='';
- let conts=this.state.lastname;
- if(this.state.orderStatusOption){
- this.state.orderStatusOption.map(function(itam){
- if(itam.name==conts){
- thed=itam.ocbId
- }
- return thed;
- })
- }
-
- $.ajax({
- method: "post",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + '/api/admin/customer/addBusinessAndFollow',
- data: {
- uid:this.state.khId,
- businessGlossoryId: this.state.businessGlossoryId,
- followSituation:this.state.followSituation,
- customerStatus: this.state.customerStatus,
- createTime:this.state.createYear+''+this.state.creatMent,
- contactType: this.state.contactType,
- ocbId: thed,
- followTime:this.state.followTime,
- remarks: this.state.remarks,
- result: this.state.result,
- }
- }).done(function (data) {
- this.setState({
- loading: false
- });
- if (!data.error.length) {
- message.success('保存成功!');
- this.addClickCancel();
- this.loadData();
- this.state.businessId='';
- } else {
- message.warning(data.error[0].message);
- }
- }.bind(this));
- }
- });
- },
- //新建HTTP获取数据
- addTime(){
- $.ajax({
- method: "get",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + "/api/admin/customer/toAddBusinessAndFollow",
- data:{
-
- },
- 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.adminName.map(function (item,index) {
- // theArr.push(<Select.Option value={index}>{item.name}</Select.Option>)
- // });
- let creatMent=thedata.createTime.substr(10,9);
- let createYear=thedata.createTime.substr(0,10);
- this.setState({
- creatMent:creatMent,
- createYear:createYear,
- followTime:thedata.followTime,
- adminName: thedata.adminName,
- });
- }.bind(this),
- }).always(function () {
- this.setState({
- loading: false
- });
- }.bind(this));
- },
-
- //客户名称初始加载
- customerList(e){
- $.ajax({
- method: "get",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + "/api/admin/customer/findCustomerByName",
- data:{
- name:e
- },
- success: function (data) {
- let thedata=data.data;
- if (!thedata) {
- if (data.error && data.error.length) {
- message.warning(data.error[0].message);
- };
- thedata = {};
- };
- this.setState({
- customerArr:thedata,
- });
- }.bind(this),
- }).always(function () {
- this.setState({
- loading: false
- });
- }.bind(this));
- },
- //值改变时请求客户名称
- httpChange(e){
- if(e.length>=2){
- this.customerList(e);
- }
- },
- //选择值时值匹配及联系人函数加载
- autoChange(e){
- let theType='';
- let contactLists=this.state.customerArr||[];
- //let contactLists=dataSource;
- if (e) {
- contactLists.map(function (item) {
- if (item.name == e.toString()) {
- theType = item.id;
- }
- });
- }
- this.setState({
- khId:theType
- })
- this.getNewWoman(theType)
- },
- //客户输入框失去焦点是判断客户是否存在
- blurChange(e){
- let theType='';
- let contactLists=this.state.customerArr||[];
- //let contactLists=dataSource;
- if (e) {
- contactLists.map(function (item) {
- if (item.name == e.toString()) {
- theType = item.id;
- }
- });
- }
- if(!theType){
- return message.warning('当前客户名不存在')
- };
- },
- //点击跟进时数据处理
- HttpFollowUp(e){
- $.ajax({
- method: "get",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + "/api/admin/customer/toFollowOneBusiness",
- data:{
- businessId:e
- },
- success: function (data) {
- let thedata=data.data;
- if (!thedata) {
- if (data.error && data.error.length) {
- message.warning(data.error[0].message);
- };
- thedata = {};
- };
- this.setState({
- businessId:thedata.businessId,
- businessGlossoryId:thedata.businessGlossoryId,
- followSituation:thedata.followSituation,
- customerStatus:thedata.customerStatus,
- createTime:thedata.createTime,
- identifyName:thedata.identifyName,
- remarks:thedata.remarks,
- });
- }.bind(this),
- }).always(function () {
- this.setState({
- loading: false
- });
- }.bind(this));
- },
- componentWillReceiveProps(nextProps) {
- if (!this.props.visible && nextProps.visible) {
- if (nextProps.data && nextProps.data.id) {
- this.loadData(nextProps.data.id, nextProps.detailApiUrl);
- };
- this.state.data = {};
- this.state.companyLogoUrl = [];
- this.state.orgCodeUrl = [];
- };
- },
- tableRowClick(record, index) {
- console.log(record)
- this.state.RowData = record;
- console.log(record)
- this.detailsModalOk(record);
- this.setState({
- selectedRowKeys:[],
- rowId:record.id,
- })
- },
- followRowClick(record, index) {
- this.state.RowData = record;
- this.addTime();
- this.customerList();
- this.setState({
- businessFollowModul: true,
- selectedRowKeys:[],
- rowId:record.id,
- });
- },
- render() {
- const FormItem = Form.Item
- const rowSelection = {
- selectedRowKeys: this.state.selectedRowKeys,
- onChange: (selectedRowKeys, selectedRows) => {
- this.setState({
- selectedRows: selectedRows.slice(-1),
- selectedRowKeys: selectedRowKeys.slice(-1)
- });
- },
- onSelect: (recordt, selected, selectedRows) => {
- this.setState({
- recordt:recordt.id
- })
- },
- };
- const rowSelections = {
- selectedRowKeys: this.state.selectedRowKey,
- onChange: (selectedRowKey, selectedRow) => {
- this.setState({
- selectedRow: selectedRow.slice(-1),
- selectedRowKey: selectedRowKey.slice(-1)
- });
- },
- onSelect: (records, selected, selectedRow) => {
- this.setState({
- selectedRow: selectedRow.slice(-1),
- records:records.id,
- })
- },
-
- };
-
- const hasSelected = this.state.selectedRowKeys.length > 0;
- const { RangePicker } = DatePicker;
- const { getFieldDecorator } = this.props.form;
- const formItemLayout = {
- labelCol: { span: 8 },
- wrapperCol: { span: 14 },
- };
- //const theDatak = this.state.datak || {};
- const theInformation=this.state.dataInformation || {}
- const contactsOption="";
- const formItemLayput = {
- labelCol: { span: 10 },
- wrapperCol: { span: 14 },
- };
- const businessIds=this.state.businessId||'';
- const dataSources=this.state.customerArr || [];
- const options = dataSources.map((group) =>
- <Option key={group.id} value={group.name}>{group.name}</Option>
- )
- return (
- <div className="user-content" >
- <div className="content-title">
- <span>我的业务</span>
- </div>
- <div className="user-search">
- <Input placeholder="客户名称"
- value={this.state.identifyNameS}
- onChange={(e) => { this.setState({ identifyNameS: e.target.value }); }} />
- <Select placeholder="服务意向" value={this.state.businessIdS} onChange={(e) => {
- this.setState({businessIdS:e})}} style={{width:'150px'}}>
- {
- intentionalService.map(function (item) {
- return <Select.Option key={item.value} >{item.key}</Select.Option>
- })
- }
- </Select>
- <Button type="primary" onClick={this.search}>搜索</Button>
- <Button onClick={this.reset}>重置</Button>
- <Button style={{ background: "#ea0862", border: "none", color: "#fff",marginRight:'10px' ,marginLeft:'10px'}}
- disabled={!hasSelected}
- onClick={this.delectRow}>删除<Icon type="minus" />
- </Button>
- <span style={{marginLeft:'10px',marginRight:'20px'}}>更多搜索<Switch defaultChecked={false} onChange={this.searchSwitch} /></span>
- <Button type="primary" className="addButton" onClick={this.addClick}>新增业务<Icon type="plus" /></Button>
- <div className='clearfix' style={{marginTop:'5px'}}>
- <div className="search-more" style={this.state.searchMore ? { display: 'none' } : {}}>
- <RangePicker
- value={[this.state.releaseDate[0] ? moment(this.state.releaseDate[0]) : null,
- this.state.releaseDate[1] ? moment(this.state.releaseDate[1]) : null]}
- onChange={(data, dataString) => { this.setState({ releaseDate: dataString }); }} />
- <Select placeholder="客户状态"
- style={{ width: 150 }}
- value={this.state.customerStatusS}
- onChange={(e) => { this.setState({ customerStatusS: e }) }}>
- {this.state.customerStatusArrOption}
- </Select>
- <Select placeholder="业务进度"
- style={{ width: 150 }}
- value={this.state.followSituationS}
- onChange={(e) => { this.setState({ followSituationS: e }) }}>
- {this.state.intentionalOption}
- </Select>
- <Input placeholder="营销员" style={{width:'150px'}}
- value={this.state.adminNameS}
- onChange={(e) => { this.setState({ adminNameS: e.target.value }); }} />
- </div>
- </div>
- </div>
- <div className="patent-table">
- <Spin spinning={this.state.loading}>
- <Table columns={this.state.columns}
- dataSource={this.state.dataSource}
- rowSelection={rowSelection}
- pagination={this.state.pagination}
- onRowClick={this.tableRowClick}
- />
- </Spin>
- </div>
- <Modal
- footer=''
- title="我的业务"
- width='1000px'
- visible={this.state.showDesc}
- onOk={this.addClickOk}
- onCancel={this.addClickCancel}
- >
- <Form horizontal id="demand-form" onSubmit={this.addSubmit}>
- <Spin spinning={this.state.loading}>
- <div className="clearfix">
- {businessIds!=''?<div><FormItem className="half-item"
- {...formItemLayout}
- label="业务意向名称"
- >
- <span>{getCompanyIntention(this.state.businessGlossoryId)}</span>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- >
- <Button type="primary" onClick={this.newContacts} style={{marginLeft:'160px'}}>添加新联系人</Button>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="意向时间"
- >
- <span>{this.state.createTime}</span>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="客户名称"
- >
- <span>{this.state.businessGlossoryId}</span>
- </FormItem></div>
- :<div><FormItem className="half-item"
- {...formItemLayout}
- label="业务意向名称"
- >
- <Select placeholder="服务意向名称" value={this.state.businessGlossoryId} onChange={(e) => {
- this.setState({businessGlossoryId:e})}} style={{width:'150px'}}>
- {
- intentionalService.map(function (item) {
- return <Select.Option key={item.value} >{item.key}</Select.Option>
- })
- }
- </Select>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- >
- <Button type="primary" onClick={this.newContacts} style={{marginLeft:'160px'}}>添加新联系人</Button>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="意向时间" >
- <DatePicker placeholder="更新日期" value={moment(this.state.createYear,'YYYY-MM-DD')} onChange={(time) => {this.setState({createYear: time});}}/>
- <TimePicker placeholder="更新时间" value={moment(this.state.creatMent, 'HH:mm:ss')} onChange={(time) => { this.setState({creatMent: time}); }}/>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="客户名称"
- >
- <AutoComplete
- className="certain-category-search"
- dropdownClassName="certain-category-search-dropdown"
- dropdownMatchSelectWidth={false}
- dropdownStyle={{ width: 300 }}
- size="large"
- style={{ width: '100%' }}
- dataSource={options}
- placeholder="输入名称"
- optionLabelProp="value"
- onChange={this.httpChange}
- onSelect={this.autoChange}
- filterOption={true}
- onBlur={this.blurChange}
- >
- <Input />
- </AutoComplete>
- </FormItem></div>
- }
- <FormItem className="half-item"
- {...formItemLayout}
- label="营销员"
- >
- <span>{this.state.adminName}</span>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="业务意向进度"
- >
- <Select placeholder="业务意向进度" value={this.state.followSituation}
- onChange={(e) => { this.setState({ followSituation: e }) }}>
- {
- intentionalService.map(function (item) {
- return <Select.Option key={item.value} >{item.key}</Select.Option>
- })
- }
- </Select>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="业务客户状态"
- >
- <Select placeholder="业务客户状态" value={this.state.customerStatus}
- onChange={(e) => { this.setState({ customerStatus: e }) }}>
- {
- customerStatus.map(function (item) {
- return <Select.Option key={item.value} >{item.key}</Select.Option>
- })
- }
- </Select>
- </FormItem>
- <div className="clearfix">
- <FormItem
- labelCol={{ span: 4 }}
- wrapperCol={{ span: 16 }}
- label="业务意向说明" >
- <Input type="textarea" rows={4} placeholder="业务意向说明" value={this.state.remarks}
- onChange={(e) => { this.setState({ remarks: e.target.value }) }}/>
- </FormItem>
- </div>
- <div style={{fontSize:'18px',marginLeft:'30px'}}>拜访情况</div>
- <div className="clearfix">
- <FormItem className="half-item"
- labelCol={{ span: 8 }}
- wrapperCol={{ span: 16 }}
- label="拜访方式" >
- <Radio.Group value={this.state.contactType} onChange={(e) => {
- this.setState({ contactType: e.target.value })
- }}>
- <Radio value={0}>外出</Radio>
- <Radio value={1}>电话</Radio>
- <Radio value={2}>QQ</Radio>
- <Radio value={3}>微信</Radio>
- <Radio value={4}>邮箱</Radio>
- </Radio.Group>
- </FormItem>
- </div>
-
- <FormItem className="half-item"
- {...formItemLayout}
- label="联系人"
- >
- <Select placeholder="联系人姓名" style={{ width: 140 }}
- value={this.state.lastname}
- onChange={this.hundleName}>
- {this.state.orderStatusOption}
- </Select>
- </FormItem>
-
- <FormItem className="half-item"
- {...formItemLayout}
- label="联系电话"
- >
- <span>{this.state.nub}</span>
- </FormItem>
- <div className="clearfix">
- <FormItem className="half-item"
- {...formItemLayout}
- label="拜访人"
- >
- <span>{this.state.adminName}</span>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="拜访时间" >
- <span>{this.state.followTime}</span>
- </FormItem>
- </div>
-
- <div className="clearfix">
- <FormItem
- labelCol={{ span: 4 }}
- wrapperCol={{ span: 16 }}
- label="拜访备注" >
- <Input type="textarea" rows={4} value={this.state.result} placeholder="来电备注"
- onChange={(e) => { this.setState({ result: e.target.value }); }}/>
- </FormItem>
- </div>
- </div>
- <Button type="primary" size="large" htmlType="submit" style={{margin:'15px 15px 20px 160px'}}>保存</Button>
- <Button size="large" onClick={this.addClickCancel}>取消</Button>
- </Spin>
- </Form>
- </Modal>
- <Modal
- className="customeDetails"
- title="我的业务详情"
- width='1000px'
- visible={this.state.modal5Visible}
- onOk={this.detailsModal}
- onCancel={this.detailsModal}
- footer=''
- >
- <Form horizontal onSubmit={this.newSubmit} id="demand-form">
- <Spin spinning={this.state.loading}>
- <div className="clearfix">
- <FormItem className="half-item"
- {...formItemLayout}
- label="业务意向名称"
- >
- <span>{getCompanyIntention(theInformation.businessGlossoryId)}</span>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="意向时间"
- >
- <span>{theInformation.createTime}</span>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="客户名称"
- >
- <span>{theInformation.identifyName}</span>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="营销员"
- >
- <span>{theInformation.adminName}</span>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="业务意向进度"
- >
- <Select placeholder="业务意向进度" value={this.state.followSituation}
- onChange={(e) => { this.setState({ followSituation: e }) }}>
- {
- newFollow.map(function (item) {
- return <Select.Option key={item.value} >{item.key}</Select.Option>
- })
- }
- </Select>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="业务客户状态"
- >
- <Select placeholder="业务客户状态" value={this.state.customerStatus}
- onChange={(e) => { this.setState({ customerStatus: e }) }}>
- {
- intentionalService.map(function (item) {
- return <Select.Option key={item.value} >{item.key}</Select.Option>
- })
- }
- </Select>
- </FormItem>
- <div className="clearfix">
- <FormItem
- labelCol={{ span: 4 }}
- wrapperCol={{ span: 16 }}
- label="业务意向说明" >
- <Input type="textarea" rows={4} placeholder="业务意向说明" value={this.state.remarks}
- onChange={(e) => { this.setState({ remarks: e.target.value }) }}/>
- </FormItem>
- </div>
- <Button className="set-submit" type="primary" htmlType="submit" style={{marginLeft:'160px',marginBottom:'30px'}}>保存</Button>
- <Button className="set-submit" type="ghost" onClick={this.detailsModal}>取消</Button>
- </div>
- <div className="clearfix">
- <div style={{fontSize:'18px',marginLeft:'40px',marginBottom:'20px'}}>业务跟进</div>
- <div className="clearfix" style={{paddingLeft:'40px',paddingRight:'40px'}}>
- <Spin spinning={this.state.loading}>
- <Table
- pagination={this.state.paginations}
- columns={this.state.businessFollowList}
- dataSource={data}
- onRowClick={this.followRowClick}
- />
- </Spin>
- </div>
- </div>
- </Spin>
- </Form>
- </Modal>
- <Modal
- footer=''
- width='800px'
- title="新增联系人"
- visible={this.state.addcontactModul}
- onOk={this.addcontactModulOK}
- onCancel={this.addcontactModulcancel}
- >
- <Form horizontal onSubmit={this.submitcontactman} id="demand-form">
- <Spin spinning={this.state.loading}>
- <Row>
- <FormItem
- labelCol={{ span: 4 }}
- wrapperCol={{ span: 14 }}
- label="是否是主要联系人:" style={{marginRight:'10px'}}>
- <Radio.Group value={this.state.hotst} onChange={(e) => {
- this.setState({ hotst: e.target.value })
- }}>
- <Radio value={0}>是</Radio>
- <Radio value={1}>否</Radio>
- </Radio.Group>
- </FormItem>
- <FormItem
- labelCol={{ span: 4 }}
- wrapperCol={{ span: 14 }}
- label="性别:" style={{marginRight:'10px',marginTop: '-15px'}}>
- <Radio.Group value={this.state.hott} onChange={(e) => {
- this.setState({ hott: e.target.value })
- }}>
- <Radio value={0}>男</Radio>
- <Radio value={1}>女</Radio>
- </Radio.Group>
- </FormItem>
- </Row>
- <Row style={{ paddingLeft:'50px' }}>
- <Col span={2}>姓名:</Col>
- <Col span={8}>
- <Input value={this.state.paymentIdt} required="required"
- onChange={(e) => { this.setState({ paymentIdt: e.target.value }) }} />
- </Col>
- <Col span={2} style={{ marginLeft: '50px' }}>QQ号:</Col>
- <Col span={8}>
- <Input value={this.state.entIdt}
- onChange={(e) => { this.setState({ entIdt: e.target.value }) }} />
- </Col>
- </Row>
- <Row style={{ marginTop: '20px',paddingLeft:'50px' }}>
- <Col span={2}>手机号:</Col>
- <Col span={8}>
- <Input value={this.state.payt} required="required"
- onChange={(e) => { this.setState({ payt: e.target.value }) }} />
- </Col>
- <Col span={2} style={{ marginLeft: '50px' }}>座机号:</Col>
- <Col span={8}>
- <Input value={this.state.paymt}
- onChange={(e) => { this.setState({ paymt: e.target.value }) }} />
- </Col>
- </Row>
- <Row style={{ marginTop: '20px' ,paddingLeft:'50px'}}>
- <Col span={2}>部门:</Col>
- <Col span={8}>
- <Input value={this.state.paytIdtt}
- onChange={(e) => { this.setState({ paytIdtt: e.target.value }) }} />
- </Col>
- <Col span={2} style={{ marginLeft: '50px' }}>职位:</Col>
- <Col span={8}>
- <Input value={this.state.paentIdt}
- onChange={(e) => { this.setState({ paentIdt: e.target.value }) }} />
- </Col>
- </Row>
- <Row style={{ marginTop: '20px',paddingLeft:'50px' }}>
- <Col span={2}>微信号:</Col>
- <Col span={8}>
- <Input value={this.state.payIdt}
- onChange={(e) => { this.setState({ payIdt: e.target.value }) }} />
- </Col>
- <Col span={2} style={{ marginLeft: '50px' }}>邮箱:</Col>
- <Col span={8}>
- <Input value={this.state.emailst}
- onChange={(e) => { this.setState({ emailst: e.target.value }) }} />
- </Col>
- </Row>
- <Row style={{ marginTop: '20px',paddingLeft:'50px' ,marginBottom:'50px'}}>
- <Button className="set-submit" type="primary" htmlType="submit" id="change_keep" style={{marginLeft:'60px'}}>保存</Button>
- <Button className="set-submit" type="ghost" onClick={this.addcontactModulcancel} id='change_rem'>取消</Button>
- </Row>
- </Spin>
- </Form>
- </Modal>
- <Modal
- footer=''
- title="业务跟进详情"
- width='600px'
- visible={this.state.businessFollowModul}
- onOk={this.businessFollowOk}
- onCancel={this.businessFollowCancel}
- >
- <div className="clearfix">
- <Form horizontal id="demand-form" onSubmit={this.passworldSubmit} style={{paddingLeft:'30px'}}>
- <Spin spinning={this.state.loading}>
- <div className="clearfix" >
- <FormItem className="half-item"
- {...formItemLayout}
- label="意向业务名称" >
- <span>{this.state.a}</span>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="意向时间" >
- <span>{this.state.a1}</span>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="客户名称" >
- <span>{this.state.a}</span>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="营销员" >
- <span>{this.state.a}</span>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="意向业务进度" >
- <span>{this.state.a}</span>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="业务客户状态" >
- <span>{this.state.a}</span>
- </FormItem>
- </div>
- <div className="clearfix">
- <FormItem className="half-item"
- {...formItemLayout}
- label="业务意向说明" >
- <span>{this.state.a}</span>
- </FormItem>
- </div>
- <div className="clearfix">
- <div style={{fontSize:'18px'}}>拜访情况</div>
- <div className="clearfix">
- <FormItem className="half-item"
- {...formItemLayout}
- label="拜访方式" >
- <span>{this.state.a}</span>
- </FormItem>
- </div>
- <FormItem className="half-item"
- {...formItemLayout}
- label="联系人" >
- <span>{this.state.a}</span>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="联系电话" >
- <span>{this.state.a}</span>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="拜访时间" >
- <span>{this.state.a}</span>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="拜访人" >
- <span>{this.state.a}</span>
- </FormItem>
- <div className="clearfix">
- <FormItem className="half-item"
- {...formItemLayout}
- label="拜访备注" >
- <span>{this.state.a}</span>
- </FormItem>
- </div>
- </div>
- </Spin>
- </Form>
- </div>
- </Modal>
- </div >
- );
- }
- }));
- export default MyBusiness;
|