import React from 'react'; import { Tag, Tooltip, Radio, Icon, Button, AutoComplete, Cascader, Input, Select, Spin, Popconfirm, Table, Switch, message, Calendar, DatePicker, Upload, Form, Modal, Tabs, Card } from 'antd'; import ajax from 'jquery/src/ajax/xhr.js'; import $ from 'jquery/src/ajax'; import Jquery from 'jquery/dist/jquery.js'; import moment from 'moment'; import MainBusinessLog from './mainBusinessLog'; import ChangeMainProducts from './ChangeMainProducts'; import PDF from 'react-pdf'; import 'viewer/dist/crocodoc.viewer.css'; import TechAchievementDesc from '@/manageCenter/achievement/crmAchievement.jsx'; import { citySelect, provinceList, areaSelect } from '@/NewDicProvinceList'; import { socialAttribute, industry, auditStatusL, lvl, currentMember, slcRedit, dataGrade, year, xiangmoState } from '@/dataDic.js'; import { getSocialAttribute, beforeUploadFile, splitUrl, getSlcRedit, getDataGrade, getAchievementCategory, getTechAuditStatus, getboutique, getPreviews, getPreview, getXiangmoState, ShowModal, onReplace, } from "@/tools.js"; import './customer.less'; const TabPane = Tabs.TabPane; import ShowModalDiv from "@/showModal.jsx"; import ImgList from "../../../../common/imgList"; import { ChooseList } from "../../../order/orderNew/chooseList"; import EnterpriseNameChange from "../../../../common/enterpriseNameChange"; import TextArea from "antd/es/input/TextArea"; const Dragger = Upload.Dragger; //图片组件 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; this.state.pojectApplicationUrl = undefined; }, render() { const { previewVisible, previewImage, fileList } = this.state; const uploadButton = (
点击上传
); return (
{ this.handleChange(infor) }} fileList={fileList} />
); } }); const IntentionCustomer = Form.create()(React.createClass({ loadData(pageNo, apiUrl) { this.setState({ visitModul: false, loading: true, ispage: pageNo, modalVisible: false }); let url = this.props.isMaintain ? '/api/admin/customer/mainProductsList' : "/api/admin/customer/listCustomerInformation"; let data = { pageNo: pageNo || 1, pageSize: this.state.pagination.pageSize, businessScope: this.state.businessScope, dataGrade: this.state.dataGrade, follow: this.state.follow, province: !(this.state.addressSearch).length ? this.state.provinceSearch : this.state.addressSearch[0], city: !(this.state.addressSearch).length ? undefined : this.state.addressSearch[1], } if (this.props.isMaintain) { data.shiroType = this.props.shiroType; data.userName = this.state.nameSearch || undefined; data.adminName = this.state.adminName || undefined; data.key = this.state.productKeyword || undefined; data.startTime = this.state.releaseDate[0] || undefined; data.endTime = this.state.releaseDate[1] || undefined; data.depId = this.state.depId || undefined; data.shareType = isNaN(parseInt(this.state.shareType)) ? undefined : this.state.shareType } else { data.name = this.state.nameSearch; data.startDate = this.state.releaseDate[0]; data.endDate = this.state.releaseDate[1]; } $.ajax({ method: this.props.isMaintain ? 'get' : "post", dataType: "json", crossDomain: false, url: globalConfig.context + url, data, success: function (data) { ShowModal(this); if (data.error.length === 0) { let theArr = []; for (let i = 0; i < data.data.list.length; i++) { let thisdata = data.data.list[i]; let diqu = (thisdata.province == null ? "" : thisdata.province) + (thisdata.city == null ? "" : "-" + thisdata.city) + (thisdata.area == null ? "" : "-" + thisdata.area); thisdata.key = i; thisdata.diqu = diqu; thisdata.dataGrade = thisdata.dataGrade ? (thisdata.dataGrade * 100).toFixed(2) + "%" : ""; theArr.push(thisdata); }; this.state.pagination.current = data.data.pageNo; this.state.pagination.total = data.data.totalCount; if (data.data && data.data.list && !data.data.list.length) { this.state.pagination.current = 0 this.state.pagination.total = 0 } this.setState({ dataSource: theArr, pageNo: data.data.pageNo, pagination: this.state.pagination, selectedRowKeys: [] }); } else { message.warning(data.error[0].message); } }.bind(this), }).always(function () { this.setState({ loading: false }); }.bind(this)); }, loadDatas(pageNos) { this.setState({ loading: true, }); $.ajax({ method: "get", dataType: "json", crossDomain: false, url: globalConfig.context + "/api/admin/achievement/listUserAchievement", data: { pageNo: pageNos || 1, pageSize: this.state.paginationDate.pageSize, uid: this.state.uid, }, 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, serialNumber: thisdata.serialNumber, dataCategory: thisdata.dataCategory, name: thisdata.name, keyword: thisdata.keyword, theName: thisdata.username || thisdata.ownerName, category: thisdata.category, ownerName: thisdata.username ? thisdata.username : thisdata.ownerName, ownerType: thisdata.ownerType, ownerMobile: thisdata.ownerMobile, status: thisdata.status, releaseDate: thisdata.releaseDate, releaseDateFormattedDate: thisdata.releaseDateFormattedDate, auditStatus: thisdata.auditStatus, boutique: thisdata.boutique, hot: thisdata.hot, techBrokerId: thisdata.techBrokerId, createTimeFormattedDate: thisdata.createTimeFormattedDate, remark: thisdata.remark }); }; this.state.paginationDate.current = data.data.pageNo; this.state.paginationDate.total = data.data.totalCount; }; this.setState({ dataSourceDate: theArr, pageNos: pageNos, paginationDate: this.state.paginationDate }); }.bind(this), }).always(function () { this.setState({ loading: false }); }.bind(this)); }, loadDatac(pageNo, apiUrl) { this.setState({ loading: true, }); $.ajax({ method: "get", dataType: "json", crossDomain: false, url: globalConfig.context + "/api/admin/customers/selectListOrgAnnual", data: { // pageNo: pageNo || 1, // pageSize: this.state.pagination.pageSize, uid: this.state.uid, }, 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]; let diqu = (thisdata.province == null ? "" : thisdata.province) + (thisdata.city == null ? "" : "-" + thisdata.city) + (thisdata.area == null ? "" : "-" + thisdata.area); theArr.push({ key: i, id: thisdata.id,//年报ID uid: thisdata.uid,//客户ID year: thisdata.year,//年份 salesAmount: thisdata.salesAmount,//营销额 researchAmount: thisdata.researchAmount,//研发费用 assets: thisdata.assets,//总资产 fixedAssets: thisdata.fixedAssets,//固定资产 aid: thisdata.aid,//录入人 }); }; // this.state.pagination.current = data.data.pageNo; // this.state.pagination.total = data.data.totalCount; }; if (data.data && data.data.list && !data.data.list.length) { this.state.pagination.current = 0 this.state.pagination.total = 0 } this.setState({ dataSourcec: theArr, // pageNo: pageNo, // pagination: this.state.pagination, // selectedRowKeys:[] }); }.bind(this), }).always(function () { this.setState({ loading: false }); }.bind(this)); }, loadDatax(pageNo, apiUrl) { this.setState({ loading: true, }); $.ajax({ method: "get", dataType: "json", crossDomain: false, url: globalConfig.context + "/api/admin/customers/selectListOrgYearProject", data: { uid: this.state.uid, }, 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]; let diqu = (thisdata.province == null ? "" : thisdata.province) + (thisdata.city == null ? "" : "-" + thisdata.city) + (thisdata.area == null ? "" : "-" + thisdata.area); theArr.push({ key: i, id: thisdata.id,//用户ID uid: thisdata.uid,//客户ID projectName: thisdata.projectName,//项目名称 year: thisdata.year,//年份 status: thisdata.status ? thisdata.status.toString() : "",//项目状态 remark: thisdata.remark,//备注 aid: thisdata.aid,//录入人 }); }; // this.state.pagination.current = data.data.pageNo; // this.state.pagination.total = data.data.totalCount; }; if (data.data && data.data.list && !data.data.list.length) { this.state.pagination.current = 0 this.state.pagination.total = 0 } this.setState({ dataSourcex: theArr, }); }.bind(this), }).always(function () { this.setState({ loading: false }); }.bind(this)); }, getInitialState() { return { businessScope: [], departmentArr: [], inputVisible: false, inputValue: '', salesTarget: [], inputVisible1: false, inputValue1: '', pdfUrl: '', addressSearch: [], orgCodeUrl: [], companyLogoUrl: [], visible: false, releaseDate: [], visitModul: false, detailApi: '', followData: {}, selectedRowKeys: [], selectedRows: [], loading: false, callnub: "0", pojectApplicationUrl: "", isXian: 0, modalVisible: false, numPages: null, pageNumber: 1, pagec: 0, pages: 18, mainProductsArr: '', isXin: 1, pagination: { defaultCurrent: 1, defaultPageSize: 10, showQuickJumper: true, pageSize: 10, onChange: function (page) { this.loadData(page); }.bind(this), showTotal: function (total) { return '共' + total + '条数据'; } }, paginationDate: { defaultCurrent: 1, defaultPageSize: 10, showQuickJumper: true, pageSize: 10, onChange: function (page) { this.loadDatas(page); }.bind(this), showTotal: function (total) { return '共' + total + '条数据'; } }, changeMainProductsArr: [], adminMaintainColumns: [ { title: '客户名称', dataIndex: 'userName', key: 'userName', width: 200, render: text => { return (
{onReplace(text)}
) } }, { title: '地区', dataIndex: 'province', key: 'province', }, { title: '客户类型', dataIndex: 'shareType', key: 'shareType', width: 80, render: (text) => { return ( text === 0 ? '私有客户' : text === 1 ? '公共客户' : text === 2 ? '签单客户' : text === 3 ? '外联客户' : '' ) } }, { title: '主营产品', dataIndex: 'businessScope', key: 'businessScope', width: 250, render: (text) => { return (
{text}
) } }, { title: '所属人', dataIndex: 'adminName', key: 'adminName', }, { title: '所属部门', dataIndex: 'depName', key: 'depName', }, { title: '更新人', dataIndex: 'updateName', key: 'updateName', }, { title: '更新时间', dataIndex: 'dateUpdateTimes', key: 'dateUpdateTimes', width: 130, }, { title: '操作', dataIndex: 'uid', key: 'uid', render: text => { return (
{this.props.shiroType !== 2 && }
) } } ], maintainColumns: [ { title: '客户名称', dataIndex: 'userName', key: 'userName', width: 200, render: text => { return (
{text}
) } }, { title: '主营产品', dataIndex: 'businessScope', key: 'businessScope', width: 250, className: 'crmBusinessScope', render: (text, record) => { return (
主营产品 (请以"/"分割)