1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765 |
- import React from 'react';
- import { Radio, Icon, Button, Input, Select, Spin,Popconfirm, 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';
- import './myClient.less';
- const { Column, ColumnGroup } = Table;
- import TechAchievementDesc from './myClientDesc.jsx';
- import { achievementCategoryList, techAuditStatusList,cityArr,tag,customerStatus,intentionalService,newFollow ,newFollowOn,contact,sex,intentionalServiceOn} from '../../dataDic.js';
- import { beforeUploadFile, companySearch, getAchievementCategory,getsex,getSearchUrl,getTechAuditStatus,getcustomerTyp,getcityArr,getCompanyIntentionOn,getcustomerStatue,getCompanyIntention,getfllowSituation,getcontact,getfllowSituationOn} from '../../tools.js';
- import BatchImport from './batchImport';
- //历史记录
- const datas = [{
- key: '1',
- firstName: 'John',
- lastName: 'Brown',
- age: 32,
- address: 'New York No. 1 Lake Park',
- addres:'31232',
- addre:'31231',
- addr:'231321',
- }, {
- key: '2',
- firstName: 'Jim',
- lastName: 'Green',
- age: 42,
- address: 'London No. 1 Lake Park',
- addres:'31232',
- addre:'31231',
- addr:'231321',
- }, {
- key: '3',
- firstName: 'Joe',
- lastName: 'Black',
- age: 32,
- address: 'Sidney No. 1 Lake Park',
- addres:'31232',
- addre:'31231',
- addr:'231321',
- }, {
- key: '4',
- firstName: 'Jim',
- lastName: 'Green',
- age: 42,
- address: 'London No. 1 Lake Park',
- addres:'31232',
- addre:'31231',
- addr:'231321',
- },
- ];
-
- //图片组件
- 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 className="clearfix">
- <Upload
- action={globalConfig.context + "/api/admin/achievement/uploadPicture"}
- data={{ 'sign': this.props.pictureSign }}
- listType="picture-card"
- fileList={fileList}
- onPreview={this.handlePreview}
- onChange={this.handleChange} >
- {fileList.length >= 5 ? null : uploadButton}
- </Upload>
- <Modal maskClosable={false} visible={previewVisible} footer={null} onCancel={this.handleCancel}>
- <img alt="example" style={{ width: '100%' }} src={previewImage} />
- </Modal>
- </div>
- );
- }
- });
- const contactsOptionWoman=[];
- const datat = [{
- key: 1,
- name: 'John Brown sr.',
- },
- {
- key: 12,
- name: 'John Brown jr.',
- }, {
- key: 13,
- name: 'Jim Green sr.',
- }];
- const AchievementList = Form.create()(React.createClass({
-
- loadData(pageNumber, apiUrl) {
- this.state.data = [];
- this.setState({
- loading: true
- });
- $.ajax({
- method: "post",
- dataType: "json",
- crossDomain: false,
- url:globalConfig.context + '/api/admin/customer/listPrivateCustomer',
- data: {
- pageNumber: pageNumber || 1,
- pageSize: this.state.pagination.pageSize,
- customerName: this.state.customerName, //名称1
- shareTyp: this.state.shareTyp, //客户类型1
- province:this.state.province,//地区
- customerStatus:this.state.customerStatus,//客户状态1
- contactName:this.state.contactName,//联系人姓名1
- adminName:this.state.adminName,//跟单人1
- companyIntention:this.state.companyIntention,//意向服务
- followSituation:this.state.followSituation,//最新跟进
- //releaseDateStartDate: this.state.releaseDate[0],
- //releaseDateEndDate: this.state.releaseDate[1],
- },
- success: function (data) {
- let theArr = [];
- if (!data.data || !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,
- companyName:thisdata.companyName,//公司名称
- _shareType:thisdata._shareType,//客户类型
- locationProvince:thisdata.locationProvince,//地区
- contactName:thisdata.contactName, //联系人姓名
- telNum:thisdata.telNum,//手机号
- _customerStatus:thisdata._customerStatus,//客户状态
- _companyIntention:thisdata._companyIntention,//意向服务
- _followSituation:thisdata._followSituation,//最新跟进
- customerStatus:thisdata.customerStatus,//客户状态
- companyIntention:thisdata.companyIntention,//意向服务
- followSituation:thisdata.followSituation,//最新跟进
- adminName:thisdata.adminName, //跟进人
- followDate:thisdata.followDate,
- customerStatus:thisdata.customerStatus,//客户状态
- companyIntention:thisdata.companyIntention,//意向服务
-
- });
- };
- this.state.pagination.current = data.data.pageNumber;
- 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));
- },
- //通过ID查询这个个公司的跟进记录
- getNewWoman(theUid) {
- const contactsOptionWoman=[]
- $.ajax({
- method: "post",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + "/api/admin/customer/findCustomerUserNameList",
- data: {
- cid: theUid
- },
- success: function (data) {
- let theOption = [];
- if (!data.data) {
- if (data.error && data.error.length) {
- message.warning(data.error[0].message);
- return;
- };
- };
- for (let item in data.data) {
- let theDataName = data.data[item].name;
- let theDataId = data.data[item].id;
- contactsOptionWoman.push("{value:"+theDataName+",key:"+theDataId+"}");
- };
- console.log(contactsOptionWoman);
- this.setState({
- contactsOption: contactsOptionWoman
- });
- }.bind(this),
- });
-
- },
- getNewWoman: function (e) {
- if (e) {
- let theType = '';
- contactsOptionWoman.map(function (item) {
- if (item.value == e) {
- theType = item.key;
- };
- });
- return theType;
- }
- },
- //通过ID查询这一条的信息
- Detailload(deletedIds){
- $.ajax({
- method: "post",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + '/api/admin/customer/findCustomerUserDetails',
- data: {
- id: deletedIds
- },
- success: function (data) {
- let thisData = data.data;
- if (!thisData) {
- if (data.error && data.error.length) {
- message.warning(data.error[0].message);
- };
- thisData = {};
- };
- this.setState({
- data: thisData,
- orgDisplay: thisData.ownerType,
- switchValue: Boolean(!thisData.ownerId),
- radios:thisData.hot==='1'?true:false,
- tags: thisData.keyword ? (thisData.keyword.replace(/(,|、)/g, ",")).split(',') : [],
- technicalPictureUrl: thisData.technicalPictureUrl ? splitUrl(thisData.technicalPictureUrl, ',', globalConfig.avatarHost + '/upload') : [],
- coverImg: thisData.coverImg ? splitUrl(thisData.coverImg, ',', globalConfig.avatarHost + '/upload') : [],
- maturityPictureUrl: thisData.maturityPictureUrl ? splitUrl(thisData.maturityPictureUrl, ',', globalConfig.avatarHost + '/upload') : [],
- });
- if (thisData.ownerId) {
- this.getContactsList(thisData.ownerId);
- };
- }.bind(this),
- }).always(function () {
- this.setState({
- loading: false
- });
- }.bind(this));
- },
- //点击便捷记录
- setModal1Visible(modal1Visible) {
- this.setState({ modal1Visible });
- let deletedIds;
- let adminName;
- let customerStatus;
- let companyIntention;
- let followSituation;
-
- for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
- let rowItem = this.state.selectedRows[idx];
- if (rowItem.id) {
- deletedIds=rowItem.id;
- adminName=rowItem.adminName;
- companyIntention=rowItem.companyIntention;
- followSituation=rowItem.followSituation;
- };
- };
- this.Detailload(deletedIds);
- this.getNewWoman(deletedIds);
- },
- setModal2Visible(modal2Visible) {
- this.setState({ modal2Visible });
-
- },
- //历史记录中点击跟进人模板出现
- setModal3Visible(modal3Visible) {
- this.setState({ modal3Visible });
- this.state.data = [];
- this.setState({
- loading: true
- });
- $.ajax({
- method: "post",
- dataType: "json",
- crossDomain: false,
- url:globalConfig.context + '/api/admin/customer/listPrivateCustomer',
- data: {
-
- },
- success: function (data) {
- let theArr = [];
- if (!data.data || !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,
- companyName:thisdata.companyName,//公司名称
- _shareType:thisdata._shareType,//客户类型
- locationProvince:thisdata.locationProvince,//地区
- contactName:thisdata.contactName, //联系人姓名
- telNum:thisdata.telNum,//手机号
- _customerStatus:thisdata._customerStatus,//客户状态
- _companyIntention:thisdata._companyIntention,//意向服务
- _followSituation:thisdata._followSituation,//最新跟进
- adminName:thisdata.adminName, //跟进人
- followDate:thisdata.followDate
- });
- };
- };
- this.setState({
- datahistory: theArr,
- });
- }.bind(this),
- }).always(function () {
- this.setState({
- loading: false
- });
- }.bind(this));
-
- },
- //删除历史记录
- onDelete(){
-
- },
-
- setModal4Visible(modal4Visible) {
- this.setState({ modal4Visible }); //需要一个请求数据
- },
- //点击名称时获取列表
- setModal5Visible(modal5Visible) {
- this.setState({ modal5Visible });
- let deletedIds;
- let adminName;
- let customerStatus;
- let companyIntention;
- let followSituation;
- for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
- let rowItem = this.state.selectedRows[idx];
- if (rowItem.id) {
- deletedIds=rowItem.id;
- adminName=rowItem.adminName;
- companyIntention=rowItem.companyIntention;
- followSituation=rowItem.followSituation;
- };
- };
- this.setState({ modal5Visible }); //需要一个请求数据
- this.Detailload(deletedIds);
- },
- //历史记录查看更多,还是历史记录接口
- setModal6Visible(modal6Visible) {
- this.setState({ modal6Visible }); //需要一个请求数据
- },
- getPictureUrl(e) {
- this.setState({pictureUrl: e });
- },
- componentWillReceiveProps(nextProps) {
- if (!this.props.visible && nextProps.visible) {
- if (nextProps.data && nextProps.data.id) {
- this.loadData(nextProps.data.id, nextProps.detailApiUrl);
- };
- this.state.technicalPictureUrl = [];
- };
- },
- //快捷设置保存提交
- handleSubmit(e) {
- e.preventDefault();
- let adminName;
- let customerStatus;
- let companyIntention;
- let followSituation;
-
- for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
- let rowItem = this.state.selectedRows[idx];
- if (rowItem.id) {
- deletedIds=rowItem.id;
- adminName=rowItem.adminName;
- customerStatus=rowItem.customerStatus;
- companyIntention=rowItem.companyIntention;
- followSituation=rowItem.followSituation;
-
- };
- };
- this.state.data = []
- this.setState({
- selectedRowKeys: [],
- loading: deletedIds.length > 0
- });
- let deletedIds;
- this.state.data = [];
- 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: [],
-
- });
- this.props.form.validateFields((err, values) => {
- if (!err) {
- this.setState({
- loading: true
- });
- let custype=values._shareType;
- let customerTypechange="";
- switch(custype){
- case "个人客户":customerTypechange=0;break;
- case "公司客户":customerTypechange=1;break;
- }
- let companyIntentions= getCompanyIntentionOn(values.companyIntention);
- let followSituations= getfllowSituationOn(values.followSituation);
- console.log(values.followSituation)
- $.ajax({
- method: "POST",
- dataType: "json",
- crossDomain: false,
- url:globalConfig.context + '/api/admin/customer/updCustomer',
- data: {
- id: deletedIds,//编号id
- customerTyp :customerTypechange,//客户信息 1
- createTime: values.createTime ? values.createTime.format('YYYY-MM-DD') : undefined,//时间 1\
- companyIntention: companyIntentions,
- companyName: values.companyName,//公司名称 1
- companyIndustry: values.companyIndustry,//公司行业
- tag: values.tag,
- locationProvince: values.locationProvince,//省份1
- adress: values.adress,//详细地址1
- remarks: values.remarks,//备注1
- followSituation:this.state.followSituation?this.state.followSituation:followSituations,//最新跟进1
- customerStatus: values.customerStatus,//客户状态1
- name: values.name,//客户姓名1
- mobile: values.mobile,//座机1
- telNum: values.telNum,//手机号码1
- sex: values.sex,//性别1
- customerPosition: values.customerPosition,//职位1
- wechat: values.wechat,//微信号1
- qq: values.qq,//qq 1
- depatrment: values.depatrment,//部门 1
- email: values.email,//邮箱 1
- shareTyp:0,
- customerStatus:customerStatus,
- beforeCustomerStatus:customerStatus,
- beforeCompanyIntention:companyIntention,
- beforeFollowSituation:followSituation,
- beforeAdminName:adminName,
- }
- }).done(function (data) {
- this.setState({
- loading: false
- });
- if (!data.error.length) {
- message.success('保存成功!');
- this.setModal1Visible(false)
- } else {
- message.warning(data.error[0].message);
- }
- this.loadData();
- }.bind(this));
- }
- })
- this.setModal5Visible(false);
- },
- submitcontact(e){
- 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: [],
-
- });
- e.preventDefault();
- 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/addCustomer',
- data: {
- id: deletedIds,//编号id
- // serialNumber: values.serialNumber,//联系方式
- // serialNumber: values.serialNumber,//更新的客户状态
- // serialNumber: values.serialNumber,//最新跟进状态
- // serialNumber: values.serialNumber,//跟进结果
- // ownerEmail: this.state.switchValue ? values.ownerEmail : undefined,//开关控制下详细资料
- }
- }).done(function (data) {
- this.setState({
- loading: false
- });
- if (!data.error.length) {
- message.success('保存成功!');
- this.setModal2Visible(false)
- } else {
- message.warning(data.error[0].message);
- }
- this.loadData();
- }.bind(this));
- }
- });
- },
- getTechnicalPictureUrl(e) {
- this.setState({ technicalPictureUrl: e });
- },
-
- //新建联系人modal框显示
- showModal(){
- this.setState({
- visible: true,
- });
- },
-
- //指定转交人的点击函数
- showModa(){
- alert("147");
- this.setState({
- visible: true,
- });
- let changeIds;
- let adminName;
- let customerStatus;
- let companyIntention;
- let followSituation;
- for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
- let rowItem = this.state.selectedRows[idx];
- if (rowItem.id) {
- changeIds=rowItem.id;
- adminName=rowItem.adminName;
- customerStatus=rowItem.customerStatus;
- companyIntention=rowItem.companyIntention;
- followSituation=rowItem.followSituation;
-
- };
- };
- $.ajax({
- method: "post",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + "/api/admin/customer/findAdmin",
- data: {
- id: changeIds,//这一行数据的ID
- BeforeCompanyIntention:companyIntention,//意向服务
- getBeforeCustomerStatus:customerStatus,//客户状态
- BeforeFollowSituation:followSituation,//最新跟进状态
- BeforeAdminName:adminName,//跟进人
- }
- }).done(function (data) {
-
- if (data.error && data.error.length) {
- message.warning(data.error[0].message);
- } else {
- let theAssigne = [];
- if (!data.data) {
- if (data.error && data.error.length) {
- message.warning(data.error[0].message);
- };
- alert(111);
- } else {
- for (let i = 0; i < data.data.length; i++) {
-
- let thisdata = data.data[i];
- //处理数据 进行循环
- theAssigne.push({
- key: thisdata.name,
- ids: thisdata.id,
- mobile:thisdata.mobile,
- adminName: thisdata.adminName,
- customerStatus: thisdata.customerStatus,
- companyIntention: thisdata.companyIntention,
- followSituation: thisdata.followSituation,
-
- });
- };
- console.log(theAssigne);
- };
- this.setState({
- dataman: theAssigne,
- });
- }
- }.bind(this));
- },
- //选择了指定人之后的保存点击函数,需要修改函数
- changeAssigner() {
- alert("选好了开始转交");
- this.setState({
- visible: false,
- });
- let changeIds;
- let adminName;
- let customerStatus;
- let companyIntention;
- let followSituation;
- for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
- let rowItem = this.state.selectedRows[idx];
- if (rowItem.id) {
- changeId=rowItem.id;
- adminName=rowItem.adminName;
- customerStatus=rowItem.customerStatus;
- companyIntention=rowItem.companyIntention;
- followSituation=rowItem.followSituation;
- changeIds=rowItem.ids;
-
- };
- };
- $.ajax({
- method: "GET",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + "/api/admin/customer/deleteCustomer",
- data: {
- id: changeId,//这一行数据的ID
- followId:changeIds,//指定转交人的ID
- BeforeCompanyIntention:companyIntention,//意向服务
- getBeforeCustomerStatus:customerStatus,//客户状态
- BeforeFollowSituation:followSituation,//最新跟进状态
- BeforeAdminName:adminName,//跟进人
- }
- }).done(function (data) {
- if (!data.data.error.length) {
- message.success('转交成功!');
- this.setState({
- loading: false,
- });
- } else {
- message.warning(data.error[0].message);
- };
- this.loadData();
- }.bind(this));
- },
- handleOk(e){
- this.setState({
- visible: false,
- });
- },
- handleCancel(e){
- this.setState({
- visible: false,
- });
- },
-
- getInitialState() {
- return {
- technicalPictureUrl: [],
- modal1Visible: false,
- modal2Visible: false,
- visible: false ,
- searchMore: true,
- searchType: 0,
- validityPeriodDate: [],
- releaseDate: [],
- selectedRowKeys: [],
- 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 + '条数据';
- }
- },
- columnsman:[{
- title: '姓名',
- dataIndex: 'key',
- key: 'key'
- },{
- title: '手机号码',
- dataIndex: 'mobile',
- key: 'mobile'
- }
- ],
- columns: [
- {
- title: '公司名称',
- dataIndex: 'companyName',
- key: 'companyName',
- render: text => {
- const theData = this.state.data || {};
- const contactsOption="";
- const { getFieldDecorator } = this.props.form;
- const FormItem = Form.Item
- const formItemLayout = {
- labelCol: { span: 8 },
- wrapperCol: { span: 14 },
- };
- return (
- <div>
- <Button onClick={() => this.setModal5Visible(true)}>{text}</Button>
- <Modal
- footer=''
- title="客户详情"
- width='1000px'
- visible={this.state.modal5Visible}
- onOk={() => this.setModal5Visible(false)}
- onCancel={() => this.setModal5Visible(false)}
- >
- <Form horizontal onSubmit={this.handleSubmit} id="demand-form">
- <Spin spinning={this.state.loading}>
- <div className="clearfix">
- <FormItem className="half-item"
- {...formItemLayout}
- label="客户类型1223" >
- {getFieldDecorator('_shareType', {
- rules: [{ required: true, message: '此项为必填项!' }],
- initialValue: theData._shareType
- })(
- <Select placeholder="选择客户类型" style={{ width: 160 }} >
- <Select.Option value="0" >个人客户</Select.Option>
- <Select.Option value="1" >公司客户</Select.Option>
- </Select>
- )}
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="" >
- <span>{theData.id}</span>
- </FormItem>
- <div className="clearfix" style={{marginLeft:'40px',marginBottom:'20px',color:'#000000'}}>基本资料:</div>
- <div>
- <FormItem className="half-item"
- {...formItemLayout}
- label="跟单人" >
- {getFieldDecorator('adminName', {
- initialValue: theData.adminName
- })(
- <Input />
- )}
- </FormItem>
- </div>
- <div className="clearfix" style={{marginLeft:'40px',marginBottom:'20px',color:'#000000'}}>公司资料:</div>
- <div>
- <FormItem className="half-item"
- {...formItemLayout}
- label="公司名称" >
- {getFieldDecorator('companyName', {
- rules: [{ required: true, message: '此项为必填项!' }],
- initialValue: theData.companyName
- })(
- <Input />
- )}
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="公司行业" >
- {getFieldDecorator('companyIndustry', {
- initialValue: theData.companyIndustry
- })(
- <Input />
- )}
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="意向服务" >
- {getFieldDecorator('companyIntention', {
- rules: [{ required: true, message: '此项为必填项!' }],
- initialValue: getCompanyIntention(theData.companyIntention)
- })(
- <Select placeholder="选择服务类型" >
- {
- intentionalService.map(function (item) {
- return <Select.Option key={item.value} >{item.key}</Select.Option>
- })
- }
- </Select>
- )}
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="地区" >
- {getFieldDecorator('locationProvince', {
- initialValue: getcityArr(theData.locationProvince)
- })(
- <Select placeholder="选择地区" style={{ width: 160 }} >
- {
- cityArr.map(function (item) {
- return <Select.Option key={item.value} >{item.key}</Select.Option>
- })
- }
- </Select>
- )}
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="最新跟进" >
- {getFieldDecorator('followSituation', {
- rules: [{ required: true, message: '此项为必填项!' }],
- initialValue: getfllowSituation(theData.followSituation)
- })(
- <Select placeholder="选择跟进进度" style={{ width: 160 }} >
- {
- newFollow.map(function (item) {
- return <Select.Option key={item.value} >{item.key}</Select.Option>
- })
- }
- </Select>
- )}
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="客户状态" >
- {getFieldDecorator('customerStatus', {
- rules: [{ required: true, message: '此项为必填项!' }],
- initialValue: getcustomerStatue(theData.customerStatus)
- })(
- <Select placeholder="选择客户状态" style={{ width: 160 }} >
- {
- customerStatus.map(function (item) {
- return <Select.Option key={item.value} >{item.key}</Select.Option>
- })
- }
- </Select>
- )}
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="详细地址" >
- {getFieldDecorator('adress', {
- initialValue: theData.adress
- })(
- <Input />
- )}
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="标签" >
- {getFieldDecorator('tag', {
- initialValue: theData.tag
- })(
- <Select placeholder="选择客户标签" >
- {
- tag.map(function (item) {
- return <Select.Option key={item.key} >{item.key}</Select.Option>
- })
- }
- </Select>
- )}
- </FormItem>
- <div className="clearfix">
- <FormItem
- labelCol={{ span: 4 }}
- wrapperCol={{ span: 18 }}
- label="备注" >
- {getFieldDecorator('remarks', {
- initialValue: theData.remarks
- })(
- <Input type="textarea" rows={4} />
- )}
- </FormItem>
- </div>
- </div>
- <div className="clearfix" style={{marginLeft:'40px',marginBottom:'20px',color:'#000000'}}>联系资料:</div>
- <div>
- <FormItem className="half-item"
- {...formItemLayout}
- label="姓名" >
- {getFieldDecorator('contactName', {
- rules: [{ required: true, message: '此项为必填项!' }],
- initialValue: theData.contactName
- })(
- <Input />
- )}
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="性别" >
- {getFieldDecorator('sex', {
- rules: [{ required: true, message: '此项为必填项!' }],
- initialValue: theData.sex
- })(
- <Radio.Group onChange={(e) => { this.setState({ sex: e.target.value }); }}>
- <Radio value="0">男</Radio>
- <Radio value="1">女</Radio>
- </Radio.Group>
- )}
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="手机号码" >
- {getFieldDecorator('telNum', {
-
- initialValue: theData.telNum
- })(
- <Input />
- )}
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="座机号" >
- {getFieldDecorator('mobile', {
- initialValue: theData.mobile
- })(
- <Input />
- )}
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="QQ号码" >
- {getFieldDecorator('qq', {
- initialValue: theData.qq
- })(
- <Input />
- )}
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="邮箱号" >
- {getFieldDecorator('email', {
- initialValue: theData.email
- })(
- <Input />
- )}
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="微信" >
- {getFieldDecorator('wechat', {
- initialValue: theData.wechat
- })(
- <Input />
- )}
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="部门" >
- {getFieldDecorator('depatrment', {
- initialValue: theData.depatrment
- })(
- <Input />
- )}
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="职位" >
- {getFieldDecorator('customerPosition', {
- initialValue: theData.customerPosition
- })(
- <Input />
- )}
- </FormItem>
- </div>
- </div>
- <FormItem wrapperCol={{ span: 12, offset: 4 }}>
- <Button className="set-submit" type="primary" htmlType="submit">保存</Button>
- <Button className="set-submit" type="ghost" onClick={() => this.setModal5Visible(false)}>取消</Button>
- </FormItem>
- </Spin>
- </Form >
- </Modal>
- </div>
-
- )
- }
- }, {
- title: '客户类型',
- dataIndex: '_shareType',
- key: '_shareType'
- // render: text => { return getcustomerTyp(text); }
- }, {
- title: '地区',
- dataIndex: 'locationProvince',
- key: 'locationProvince',
- render: text => { return getcityArr(text); }
- }, {
- title: '联系人姓名',
- dataIndex: 'contactName',
- key: 'contactName',
- },
- {
- title: '手机号',
- dataIndex: 'telNum',
- key:'telNum',
- },
- {
- title: '客户状态',
- dataIndex: '_customerStatus',
- key: '_customerStatus'
- //render: text => { return getcustomerStatue(text) }
- },
- {
- title: '意向服务',
- dataIndex: 'companyIntention',
- key: 'companyIntention',
- render: text => { return getCompanyIntention(text) }
- },
- {
- title: '最新跟进',
- dataIndex: '_followSituation',
- key: '_followSituation',
- render:text => {
- const theData = this.state.data || {};
- const theDate = this.state.date || {};
- const contactsOption="";
- const rowSelection = {
- selectedRowKeys: this.state.selectedRowKeys,
- onChange: (selectedRowKeys, selectedRows) => {
- this.setState({
- selectedRows: selectedRows.slice(-1),
- selectedRowKeys: selectedRowKeys.slice(-1)
- });
- }
- };
- const FormItem = Form.Item;
- const { getFieldDecorator } = this.props.form;
- const formItemLayout = {
- labelCol: { span: 8 },
- wrapperCol: { span: 14 },
- };
- const formItemLayput = {
- labelCol: { span: 10 },
- wrapperCol: { span: 14 },
- };
- return (
- <div>
- <Button onClick={() => this.setModal3Visible(true)} style={{marginRight:'10px'}}>{text}</Button>
- <Button type="primary" onClick={() => this.setModal1Visible(true)} ><Icon type="plus" /></Button>
- <Modal
- style={{left:'500px'}}
- footer=''
- title="跟进人详细信息"
- width='400px'
- visible={this.state.modal4Visible}
- onOk={() => this.setModal4Visible(false)}
- onCancel={() => this.setModal4Visible(false)}
- >
- <Form horizontal onSubmit={this.submitcontact} id="demand-form">
- <Spin spinning={this.state.loading}>
- <div className='clearfix'>
- <FormItem className="half-item"
- {...formItemLayput}
- label="所属公司" >
- <span>{theData.id}</span>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayput}
- label="主要联系人" >
- <span>{theData.id}</span>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayput}
- label="性别" >
- <span>{theData.id}</span>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayput}
- label="姓名" >
- <span>{theData.id}</span>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayput}
- label="QQ号" >
- <span>{theData.id}</span>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayput}
- label="手机号" >
- <span>{theData.id}</span>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayput}
- label="部门" >
- <span>{theData.id}</span>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayput}
- label="职位" >
- <span>{theData.id}</span>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayput}
- label="微信号" >
- <span>{theData.id}</span>
- </FormItem>
- </div>
- </Spin>
- </Form>
- </Modal>
- <Modal
- footer=''
- title="历史记录列表"
- width='600px'
- visible={this.state.modal3Visible}
- onOk={() => this.setModal3Visible(false)}
- onCancel={() => this.setModal3Visible(false)}
- >
- <Spin spinning={this.state.loading}>
- <Table dataSource={datas}>
- <Column
- title="时间"
- dataIndex="firstName"
- key="firstName"
- />
- <Column
- title="跟进人"
- dataIndex="lastName"
- key="lastName"
- render={(text, record) => (
- <span style={{color:'#f00'}} onClick={() => this.setModal4Visible(true)}>{text}</span>
- )}
- />
- <Column
- title="客户"
- dataIndex="age"
- key="age"
- />
- <Column
- title="联系方式"
- dataIndex="address"
- key="address"
- />
- <Column
- title="最新跟进状态"
- dataIndex="addres"
- key="addres"
- />
- <Column
- title="跟进结果"
- dataIndex="查看更多"
- key="查看更多"
- render={(text, record) => (
- <div>
- <span onClick={() => this.setModal6Visible(true)}>查看更多</span>
- <Modal
- footer=''
- title="更多详情"
- visible={this.state.modal6Visible}
- onOk={() => this.setModal6Visible(false)}
- onCancel={() => this.setModal6Visible(false)}>
- <Spin spinning={this.state.loading}>
- <div className="clearfix">
- <FormItem
- labelCol={{ span: 5 }}
- wrapperCol={{ span: 18 }}
- label="跟进结果" >
- <span>{this.state.cagory}</span>
- </FormItem>
- </div>
- <FormItem
- labelCol={{ span: 5 }}
- wrapperCol={{ span: 18 }}
- label="附件" >
- <div className="clearfix">
- <Upload className="demandDetailShow-upload"
- listType="picture-card"
- fileList={this.state.technicalPictureUrl}
- onPreview={(file) => {
- this.setState({
- previewImage: file.url || file.thumbUrl,
- previewVisible: true,
- });
- }} >
- </Upload>
- <Modal maskClosable={false} footer={null}
- visible={this.state.previewVisible}
- onCancel={() => { this.setState({ previewVisible: false }) }}>
- <img alt="" style={{ width: '100%' }} src={this.state.previewImage || ''} />
- </Modal>
- </div>
- </FormItem>
- </Spin>
- </Modal>
- </div>
- )}
- />
- <Column
- title="删除记录"
- key="del"
- render={(text, record, index) => (
- <Popconfirm title="是否删除?" onConfirm={() => this.onDelete(index)}>
- <a href="#">Delete</a>
- </Popconfirm>
- )}
- />
- </Table>
- </Spin>
- </Modal>
- <Modal
- footer=''
- title="便捷修改"
- width='1000px'
- visible={this.state.modal1Visible}
- onOk={() => this.setModal1Visible(false)}
- onCancel={() => this.setModal1Visible(false)}
- >
- <Form horizontal onSubmit={this.handleSubmit} id="demand-form">
- <Spin spinning={this.state.loading}>
- <div className="user-search">
- <Row>
- <FormItem className="half-item"
- {...formItemLayout}
- label="客户公司名称:" >
- <span>{theData.companyName}</span>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="最新联系人:" >
- {getFieldDecorator('contactsOptionWoman', {
- initialValue:contactsOptionWoman
- })(
- <Select placeholder="" style={{width:'140px'}} id={"newselect"}>
- {
- contactsOptionWoman.map(function (item) {
- return <Select.Option key={item.value} style={{width:'140px'}}>{item.key}</Select.Option>
- })
- }
- </Select>
- )}
- <span style={{width:'120px',display:'inline-block',marginLeft:'20px'}}>{getcustomerTyp(theData.customerTyp)}
- <Button type="primary" onClick={() => this.setModal2Visible(true)}>添加</Button>
- </span>
- <Modal
- footer=''
- width='800px'
- title="添加详情"
- visible={this.state.modal2Visible}
- onOk={() => this.setModal2Visible(false)}
- onCancel={() => this.setModal2Visible(false)}
- >
- <Form horizontal onSubmit={this.submitcontact} id="demand-form">
- <Spin spinning={this.state.loading}>
- <Row>
- <FormItem className="half-item"
- {...formItemLayout}
- label="所属公司" >
- <span>{theData.id}</span>
- </FormItem>
- </Row>
- <Row>
- <FormItem
- labelCol={{ span: 4 }}
- wrapperCol={{ span: 14 }}
- label="是否是主要联系人:" style={{marginRight:'10px'}}>
- <Radio.Group value={this.state.hots} onChange={(e) => {
- this.setState({ hots: 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.hot} onChange={(e) => {
- this.setState({ hot: 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.paymentId} required
- onChange={(e) => { this.setState({ paymentId: e.target.value }) }} />
- </Col>
- <Col span={2} style={{ marginLeft: '50px' }}>QQ号:</Col>
- <Col span={8}>
- <Input value={this.state.entId}
- onChange={(e) => { this.setState({ entId: e.target.value }) }} />
- </Col>
- </Row>
- <Row style={{ marginTop: '20px',paddingLeft:'50px' }}>
- <Col span={2}>*手机号:</Col>
- <Col span={8}>
- <Input value={this.state.pay} required
- onChange={(e) => { this.setState({ pay: e.target.value }) }} />
- </Col>
- <Col span={2} style={{ marginLeft: '50px' }}>座机号:</Col>
- <Col span={8}>
- <Input value={this.state.paym}
- onChange={(e) => { this.setState({ paym: e.target.value }) }} />
- </Col>
- </Row>
-
- <Row style={{ marginTop: '20px' ,paddingLeft:'50px'}}>
- <Col span={2}>部门:</Col>
- <Col span={8}>
- <Input value={this.state.paytId}
- onChange={(e) => { this.setState({ paytId: e.target.value }) }} />
- </Col>
- <Col span={2} style={{ marginLeft: '50px' }}>职位:</Col>
- <Col span={8}>
- <Input value={this.state.paentId}
- onChange={(e) => { this.setState({ paentId: e.target.value }) }} />
- </Col>
- </Row>
- <Row style={{ marginTop: '20px',paddingLeft:'50px' }}>
- <Col span={2}>微信号:</Col>
- <Col span={8}>
- <Input value={this.state.payId}
- onChange={(e) => { this.setState({ payId: 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.setModal2Visible(false)} id='change_rem'>取消</Button>
- </Row>
- </Spin>
- </Form>
- </Modal>
- </FormItem>
- </Row>
- <FormItem className="half-item"
- {...formItemLayout}
- label="最新跟进时间:" >
- <span>{theData.createTime}</span>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="联系方式" >
- {getFieldDecorator('contact', {
- initialValue: getcontact(theData.contact)
- })(
- <Select placeholder="选择方式" style={{width:'100px'}} >
- <Select.Option value="电话">电话</Select.Option>
- <Select.Option value="邮件">邮件</Select.Option>
- <Select.Option value="面谈">面谈</Select.Option>
- <Select.Option value="短信">短信</Select.Option>
- </Select>
- )}
- {getFieldDecorator('contacts', {
- initialValue: getcontact(theData.mobile)
- })(
- <Input style={{width:'180px'}}/>
- )}
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="客户状态:" >
- <span>{getcustomerStatue(theData.customerStatus)}</span>
- </FormItem>
- <div className="clearfix">
- <FormItem className="half-item"
- {...formItemLayout}
- label="更新当前客户状态" >
- {getFieldDecorator('customerStatue', {
- initialValue: getcustomerStatue(theData.customerStatus)
- })(
- <Select placeholder="选择客户状态" style={{width:'200px'}}>
- {
- customerStatus.map(function (item) {
- return <Select.Option key={item.value} style={{width:'200px'}}>{item.key}</Select.Option>
- })
- }
- </Select>
- )}
- </FormItem>
- </div>
- <FormItem className="half-item"
- {...formItemLayout}
- label="最新跟进状态" >
- {getFieldDecorator('fllowSituation', {
- initialValue: getfllowSituation(theData.followSituation)
- })(
- <Select placeholder="选择跟进状态" style={{width:'200px'}}>
- {
- newFollow.map(function (item) {
- return <Select.Option key={item.value} style={{width:'200px'}}>{item.key}</Select.Option>
- })
- }
- </Select>
- )}
- </FormItem>
- <div className="clearfix">
- <FormItem
- labelCol={{ span: 4 }}
- wrapperCol={{ span: 18 }}
- label="跟进结果" >
- {getFieldDecorator('remarks', {
- initialValue: ""
- })(
- <Input type="textarea" rows={4} />
- )}
- </FormItem>
- </div>
- <div className="clearfix">
- <FormItem
- labelCol={{ span: 4 }}
- wrapperCol={{ span: 18 }}
- label="技术图片" >
- <PicturesWall
- pictureSign="achievement_technical_picture"
- fileList={this.getTechnicalPictureUrl}
- pictureUrl={this.state.technicalPictureUrl} />
- <p>图片建议:图片要清晰。</p>
- </FormItem>
- </div>
- <Button style={{ marginRight: '20px' ,marginLeft:'160px',marginBottom:'50px'}} type="primary" onClick={this.handleSubmit}>保存</Button>
- <Button className="set-submit" type="ghost" onClick={() => this.setModal1Visible(false)} id='change_rem'>取消</Button>
- </div>
- </Spin>
- </Form >
- </Modal>
- </div>
- )
- }
- },
- {
- title: '跟单人',
- dataIndex: 'adminName',
- key: 'adminName',
- },
- {
- title: '时间',
- dataIndex: 'followDate',
- key: 'followDate',
- }
- ],
- dataSource: [],
- searchTime: [,]
- };
- },
-
-
- componentWillMount() {
- let theArr = [];
- customerStatus.map(function (item) {
- theArr.push(
- <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
- )
- });
- let auditArr = [];
- cityArr.map(function (item) {
- auditArr.push(
- <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
- )
- });
- let intentionalArr = [];
- intentionalService.map(function (item) {
- intentionalArr.push(
- <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
- )
- });
- let newArr = [];
- newFollow.map(function (item) {
- newArr.push(
- <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
- )
- });
- this.state.customerStatuarr = theArr;
- this.state.auditStatusOption = auditArr;
- this.state.intentionalOption = intentionalArr;
- this.state.newOption = newArr;
- if (window.location.search) {
- let theObj = getSearchUrl(window.location.search);
- if (theObj.rid) {
- theObj.id = theObj.rid;
- if (theObj.rid != 'null') {
- this.tableRowClick(theObj);
- };
- };
- };
- this.loadData();
- },
- tableRowClick(record, index) {
- this.state.RowData = record;
- this.setState({
- showDesc: true
- });
- },
-
- //删除功能
- delectRow() {
- let deletedIds;
- let adminName;
- let customerStatus;
- let companyIntention;
- let followSituation;
-
- for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
- let rowItem = this.state.selectedRows[idx];
- if (rowItem.id) {
- deletedIds=rowItem.id;
- adminName=rowItem.adminName;
- customerStatus=rowItem.customerStatus;
- companyIntention=rowItem.companyIntention;
- followSituation=rowItem.followSituation;
- };
- };
- this.state.data = []
- this.setState({
- selectedRowKeys: [],
- loading: deletedIds.length > 0
- });
- $.ajax({
- method: "post",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + "/api/admin/customer/deleteCustomer",
- data: {
- id: deletedIds,//删除的ID
- beforeCustomerStatus:customerStatus,
- beforeCompanyIntention:companyIntention,
- beforeFollowSituation:followSituation,
- adminName:adminName
- }
- }).done(function (data) {
- if (!data.error.length) {
- message.success('删除成功!');
- this.setState({
- loading: false,
- });
- } else {
- message.warning(data.error[0].message);
- };
- this.loadData();
- }.bind(this));
- },
- //转为公共客户功能
- changeRow() {
- 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: [],
- loading: deletedIds.length > 0
- });
- $.ajax({
- method: "GET",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + "/api/admin/customer/deleteCustomer", //等待接口
- data: {
- id: deletedIds
- }
- }).done(function (data) {
- if (!data.data.error.length) {
- message.success('已转为公共客户!');
- this.setState({
- loading: false,
- });
- } else {
- message.warning(data.error[0].message);
- };
- this.loadData();
- }.bind(this));
- },
- addClick() {
- this.state.RowData = {};
- this.setState({
- showDesc: true
- });
- },
-
- closeDesc(e, s) {
- this.state.showDesc = e;
- if (s) {
- this.loadData();
- };
- },
- search() {
- this.loadData();
- },
- reset() {
- this.state.id = undefined;
- this.state.customerName = undefined;
- this.state.shareTyp = undefined;
- this.state.province = undefined;
- this.state.ownerType = undefined;
- this.state.customerStatus = undefined;
- this.state.auditStatus = undefined;
- this.state.adminName = undefined;
- this.state.contactName = undefined;
- this.state.releaseDate = [];
- this.loadData();
- },
- searchSwitch() {
- this.setState({
- searchMore: !this.state.searchMore
- });
- },
- render() {
- const FormItem = Form.Item
- const rowSelection = {
- selectedRowKeys: this.state.selectedRowKeys,
- onChange: (selectedRowKeys, selectedRows) => {
- this.setState({
- selectedRows: selectedRows.slice(-1),
- selectedRowKeys: selectedRowKeys.slice(-1)
- });
- }
- };
- const hasSelected = this.state.selectedRowKeys.length > 0;
- const { RangePicker } = DatePicker;
- const theData = this.props.data || {};
- const { getFieldDecorator } = this.props.form;
- const formItemLayout = {
- labelCol: { span: 8 },
- wrapperCol: { span: 14 },
- };
- return (
- <div className="user-content" >
- <div className="content-title">
- <span>客户管理</span>
- <div className="patent-addNew clearfix">
- <Upload
- action={globalConfig.context + "/api/admin/achievement/uploadTemplate"}
- data={{ 'sign': 'achievement_template' }}
- beforeUpload={beforeUploadFile}
- showUploadList={false}
- onChange={(info) => {
- if (info.file.status !== 'uploading') {
- console.log(info.file, info.fileList);
- }
- if (info.file.status === 'done') {
- if (!info.file.response.error.length) {
- message.success(`${info.file.name} 文件上传成功!`);
- } else {
- message.warning(info.file.response.error[0].message);
- return;
- };
- } else if (info.file.status === 'error') {
- message.error(`${info.file.name} 文件上传失败。`);
- };
- }} >
- <Button>上传批量导入模板</Button>
- </Upload>
- <Button onClick={() => { window.open(globalConfig.context + '/api/admin/achievement/downloadTemplate?sign=achievement_template') }}>下载批量导入模板</Button>
- <Button type="primary" className="addButton" onClick={this.addClick}>新建客户<Icon type="plus" /></Button>
- <BatchImport closeDesc={this.closeDesc} />
- </div>
- </div>
- <div className="user-search">
- <Input placeholder="公司名称"
- value={this.state.customerName}
- onChange={(e) => { this.setState({ customerName: e.target.value }); }} />
- <Select placeholder="客户类型" style={{ width: 120 }}
- value={this.state.shareTyp }
- onChange={(e) => { this.setState({ shareTyp : e }) }}>
- <Select.Option value="0" >个人客户</Select.Option>
- <Select.Option value="1" >公司客户</Select.Option>
- </Select>
- <Select placeholder="意向服务"
- style={{ width: 160 }}
- value={this.state.companyIntention}
- onChange={(e) => { this.setState({ companyIntention: e }) }}>
- {this.state.intentionalOption}
- </Select>
- <Select placeholder="跟进进度"
- style={{ width: 160 }}
- value={this.state.followSituation}
- onChange={(e) => { this.setState({ followSituation: e }) }}>
- {this.state.newOption}
- </Select>
- <Select placeholder="地区"
- style={{ width: 160 }}
- value={this.state.province}
- onChange={(e) => { this.setState({ province: e }) }}>
- {this.state.auditStatusOption}
- </Select>
- <Select placeholder="客户状态" style={{ width: 120 }}
- value={this.state.customerStatus}
- onChange={(e) => { this.setState({ customerStatus: e }) }}>
- {this.state.customerStatuarr}
- </Select>
- <Button type="primary" onClick={this.search}>搜索</Button>
- <Button onClick={this.reset}>重置</Button>
- <Button style={{ background: "#ea0862", border: "none", color: "#fff" }}
- disabled={!hasSelected}
- onClick={this.delectRow}>删除<Icon type="minus" /></Button>
- <Button type="primary" onClick={this.showModa} disabled={!hasSelected}>指定转交人<Icon type="plus" /></Button>
- <Modal
- footer=''
- title="选择指定人"
- visible={this.state.visible}
- onOk={this.handleOk}
- onCancel={this.handleCancel}
-
- >
- <Spin spinning={this.state.loading}>
- <Table
- columns={this.state.columnsman}
- rowSelection={rowSelection}
- dataSource={this.state.dataman}
- pagination={this.state.pagination} />
-
- <FormItem wrapperCol={{ span: 12, offset: 12 }}>
- <Button className="set-submit" type="primary" htmlType="submit" id="change_keep" style={{marginLeft:"50px"}} onClick={this.changeAssigner }>保存</Button>
- <Button className="set-submit" type="ghost" onClick={this.handleCancel } style={{marginLeft:"30px"}} id='change_rem'>取消</Button>
- </FormItem>
- </Spin>
- </Modal>
- <Button style={{ background: "#3fcf9e", border: "none", color: "#fff" }}
- disabled={!hasSelected}
- onClick={this.changeRow}>转为公共客户<Icon /></Button>
- <span>更多搜索<Switch defaultChecked={false} onChange={this.searchSwitch} /></span>
- <div className="search-more" style={this.state.searchMore ? { display: 'none' } : {}}>
- <Input placeholder="跟单人" style={{width:'140px',marginRight:'10px'}}
- value={this.state.adminName}
- onChange={(e) => { this.setState({ adminName: e.target.value }); }} />
- <Input placeholder="联系人姓名" style={{width:'140px',marginRight:'10px'}}
- value={this.state.contactName}
- onChange={(e) => { this.setState({ contactName: e.target.value }); }} />
- <span>发布时间 :</span>
- <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 }); }} />
-
- </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}
- />
- </Spin>
- </div>
- <TechAchievementDesc
- data={this.state.RowData}
- detailApiUrl={this.props['data-detailApiUrl']}
- achievementCategoryOption={this.state.achievementCategoryOption}
- showDesc={this.state.showDesc}
- closeDesc={this.closeDesc} />
-
- </div >
- );
- }
- }));
- export default AchievementList;
|