123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178 |
- import React, { Component } from "react";
- import { View, Button, Text, Picker, RadioGroup, Label, Radio } from "@tarojs/components";
- import Taro, { getCurrentInstance } from "@tarojs/taro";
- import { getProvince } from '../../utils/tools/index'
- import {
- AtSearchBar,
- AtTextarea,
- AtModal,
- AtModalHeader,
- AtModalContent,
- AtModalAction,
- AtInput,
- AtIcon,
- AtButton,
- AtInputNumber
- } from "taro-ui";
- import Skeleton from "taro-skeleton";
- import {
- queryByUidAll,
- getInterviewByPrdid,
- updateUser,
- addOneContact,
- findCustomerContacts,
- updateMainContact,
- limitUser,
- getBusinessProjectByName,
- addProject,
- queryProjectList,
- delProject
- } from "../../utils/servers/servers";
- import "./index.less";
- import "taro-ui/dist/style/components/icon.scss";
- import "taro-ui/dist/style/components/textarea.scss";
- import "taro-ui/dist/style/components/modal.scss";
- import "taro-ui/dist/style/components/timeline.scss";
- import "taro-ui/dist/style/components/calendar.scss";
- import "taro-ui/dist/style/components/input.scss";
- import "taro-ui/dist/style/components/search-bar.scss";
- import MessageNoticebar from "../../components/common/messageNoticebar";
- import { industry, channelTypeList, yearList, addressList } from '../../utils/tools/config';
- import { getChannel } from "../../utils/tools";
- import Superior from "../../components/common/superior";
- import CheckboxPicker from "../../components/common/CheckboxPicker";
- import AddressPicker from "../../components/common/addressPicker"
- import CustomerProjectSelect from '../../components/common/CustomerProjectSelect';
- import InterviewHisList from "../../components/common/InterviewHisList";
- class CustomerProfile extends Component {
- $instance = getCurrentInstance();
- constructor(props) {
- super(props);
- this.state = {
- upType: -1,
- isOpened: false,
- dtails: {},
- projectingList: [],
- projectedList: [],
- projectList: [],
- info: {},
- sector: {},
- isAdd: false,
- obj: {},
- userList: [],
- allProjectList: [],
- options: [],
- checkProject: [],
- checkOptions: [],
- isSuperior: false,
- channe: {},
- isMask: false,
- addressPickerShow: false,
- region: [],
- customItem: [],
- multiplePickerShow: false,
- multiplePickerTitle: '',
- multiplePickerType: '',
- multiplePickerOptions: [],
- multiplePickerCheckedList: [],
- addItemShow: false,
- addItemType: '',
- addItemTitle: '',
- addItemInputVal: '',
- interactShow: false,
- interactShowType: '',
- interactTitle: '',
- interactList: [],
- checkCompShow: false,
- checkCompList: [],
- currAddress: [],
- };
- this.queryByUidAll = this.queryByUidAll.bind(this);
- this.update = this.update.bind(this);
- this.add = this.add.bind(this);
- this.getUserList = this.getUserList.bind(this);
- this.getBusinessProjectByName = this.getBusinessProjectByName.bind(this);
- this.onSearchChange = this.onSearchChange.bind(this);
- this.handleOpenMultiplePicker = this.handleOpenMultiplePicker.bind(this);
- this.handleMultipleConfirm = this.handleMultipleConfirm.bind(this);
- this.handleAddItemSave = this.handleAddItemSave.bind(this);
- this.handleCloseAddItemDialog = this.handleCloseAddItemDialog.bind(this);
- }
- componentDidMount() {
- this.setState({
- isMask: false
- })
- this.queryByUidAll();
- this.getProjectList();
- }
- componentDidUpdate(prevProps) {
- const { interviewIdx, customerList } = this.props;
- if (interviewIdx != prevProps.interviewIdx && interviewIdx >= 0 && interviewIdx < customerList.length) {
- this.queryByUidAll();
- this.getProjectList();
- }
- }
- addCommas(num) {
- let newNum = num.toString().replace(/,/g, '');
- if (num.toString().length > 1) {
- newNum = newNum.toString().replace(/^0+/, '');
- }
- return newNum.replace(/(\d)(?=(\d{3})+(?!\d))/g, '$1,');
- }
- openAddressPicker() {
- const { dtails } = this.state;
- let currAddress = [];
- if (dtails.locationProvince && dtails.locationCity && dtails.locationArea) {
- let provIdx = 0, cityIdx = 0, areaIdx = 0;
- addressList.map((provItem, idx1) => {
- if (provItem.id == dtails.locationProvince) {
- provIdx = idx1;
- provItem.cityList.map((cityItem, idx2) => {
- if (cityItem.id == dtails.locationCity) {
- cityIdx = idx2;
- cityItem.areaList.map((areaItem, idx3) => {
- if (areaItem.id == dtails.locationArea) {
- areaIdx = idx3;
- }
- })
- }
- })
- }
- })
- currAddress = [provIdx, cityIdx, areaIdx];
- }
- this.setState({ addressPickerShow: true, currAddress })
- }
- handlePrevClick() {
- this.props.onPrevClick();
- }
- handleNextClick() {
- this.onSaveAllData((resData) => {
- this.props.onNextClick(resData);
- })
- }
- toggleAddressPicker(e) {
- if (!e.province) {
- this.setState({ addressPickerShow: false });
- return;
- }
- const addressIds = getProvince(e.province, e.city, e.area);
- const { dtails } = this.state;
- dtails.locationProvince = addressIds[0];
- dtails.locationProvinceName = e.province;
- dtails.locationCity = addressIds[1];
- dtails.locationCityName = e.city;
- dtails.locationArea = addressIds[2];
- dtails.locationAreaName = e.area;
- this.setState({ dtails, addressPickerShow: false });
- }
- handleSelComp() {
- const { dtails } = this.state;
- let externalInvestList = [];
- if (dtails.externalInvestName) {
- let externalInvestNameList = dtails.externalInvestName ? dtails.externalInvestName.split(',') : [];
- let externalInvestIdList = dtails.externalInvestId ? dtails.externalInvestId.split(',') : [];
- externalInvestList = externalInvestNameList.map((name, idx) => {
- return { id: externalInvestIdList[idx] || 0, name }
- });
- }
- this.setState({ checkCompShow: true, checkCompList: externalInvestList });
- }
- handleCheckCompConfirm(data) {
- let externalInvestId = data.map(item => item.id).join(',');
- let externalInvestName = data.map(item => item.name).join(',');
- this.setState({ dtails: { ...this.state.dtails, externalInvestId, externalInvestName } });
- }
- handleOpenMultiplePicker(type) {
- let multiplePickerOptions = [];
- let multiplePickerTitle = '';
- let multiplePickerCheckedList = [];
- const { dtails, info } = this.state;
- switch (type) {
- case 'industry':
- // 企业所属行业
- multiplePickerOptions = industry;
- multiplePickerCheckedList = !!dtails.industry ? dtails.industry.toString().split(',') : [];
- multiplePickerTitle = '请选择企业所属行业';
- break;
- case 'externalInvestIndustry':
- // 对外投资控股的行业
- multiplePickerOptions = industry;
- multiplePickerCheckedList = !!dtails.externalInvestIndustry ? dtails.externalInvestIndustry.toString().split(',') : [];
- multiplePickerTitle = '请选择对外投资控股的行业';
- break;
- case 'examineStatusOther':
- // 复审年份
- multiplePickerOptions = yearList;
- multiplePickerCheckedList = info.examineStatusOther ? info.examineStatusOther.split(',') : [];
- multiplePickerTitle = '请选择年份';
- break;
- case 'buyStatusOther':
- // 复购/复审年份
- multiplePickerOptions = yearList;
- multiplePickerCheckedList = info.buyStatusOther ? info.buyStatusOther.split(',') : [];
- multiplePickerTitle = '请选择年份';
- break;
- default:
- break;
- }
- this.setState({
- multiplePickerShow: true,
- multiplePickerType: type,
- multiplePickerTitle,
- multiplePickerOptions,
- multiplePickerCheckedList: multiplePickerCheckedList.map(item => Number(item))
- })
- }
- handleMultipleConfirm(selectedIds, selectedLabels) {
- const { multiplePickerType, dtails, info } = this.state;
- switch (multiplePickerType) {
- case "industry":
- // 企业所属行业
- dtails.industry = selectedIds.join(',');
- dtails.industryName = selectedLabels.join(',');
- this.setState({ dtails })
- break;
- case "externalInvestIndustry":
- // 对外投资控股的行业
- dtails.externalInvestIndustry = selectedIds.join(',');
- dtails.externalInvestIndustryName = selectedLabels.join(',');
- this.setState({ dtails })
- break;
- case 'examineStatusOther':
- info.examineStatusOther = selectedIds.join(',');
- this.setState({ info });
- break;
- case 'buyStatusOther':
- info.buyStatusOther = selectedIds.join(',');
- this.setState({ info });
- break;
- default:
- break;
- }
- }
- bindRegionChange(e) {
- this.setState({
- region: e.detail.value
- })
- }
- isLogin() {
- return !!Taro.getStorageSync('userInfor');
- }
- onShareAppMessage() {
- this.limitUser();
- return {
- title: "客户档案",
- path: "/pages/customerProfile/index?id=" + this.$instance.router.params.id,
- };
- }
- getInterviewData() {
- getInterviewByPrdid({ prdid: this.$instance.router.params.prdid }).then(res => {
- if (res.error.length === 0) {
- let defaultDetailData = this.state.dtails || {};
- this.setState({
- dtails: {
- ...defaultDetailData,
- earlyCommunication: res.data.data.earlyCommunication,
- customerDemand: res.data.data.customerDemand,
- interviewIdeas: res.data.data.interviewIdeas,
- interviewPurpose: res.data.data.interviewPurpose,
- interviewRecommend: res.data.data.interviewRecommend,
- interviewFeedback: res.data.data.interviewFeedback,
- followUpPlan: res.data.data.followUpPlan,
- interviewList: res.data.list.filter(item => !!item.prdid),
- }
- });
- } else {
- Taro.showToast({ title: "沟通情况数据获取异常", icon: "none" });
- }
- })
- }
- // 客户档案详情
- queryByUidAll() {
- const id = this.$instance.router.params.id;
- queryByUidAll(
- true,
- { id }
- )
- .then((v) => {
- if (v.error.length === 0) {
- let dtailsData = {
- ...v.data,
- companyCount: this.addCommas(v.data.companyCount || 0),
- socialSecurityCount: this.addCommas(v.data.socialSecurityCount || 0),
- externalInvestCount: this.addCommas(v.data.externalInvestCount || 0),
- financialRevenue: this.addCommas(v.data.financialRevenue || 0),
- financialTax: this.addCommas(v.data.financialTax || 0),
- financialProperty: this.addCommas(v.data.financialProperty || 0),
- financialRd: this.addCommas(v.data.financialRd || 0),
- enterpriseCount: this.addCommas(v.data.enterpriseCount || 0),
- earlyCommunication: '',
- customerDemand: '',
- interviewIdeas: '',
- interviewPurpose: '',
- interviewRecommend: '',
- interviewFeedback: '',
- followUpPlan: '',
- interviewList: [],
- }
- let patentCount = this.countZlNum(dtailsData);
- this.setState({
- dtails: { ...dtailsData, patentCount }
- }, () => {
- this.getInterviewData();
- });
- } else {
- setTimeout(() => {
- Taro.navigateBack({
- delta: 1
- })
- }, 1800);
- Taro.showToast({
- title: v.error[0].message,
- icon: "none",
- duration: 1800,
- });
- }
- })
- .catch((err) => {
- Taro.showToast({ title: "系统错误,请稍后再试", icon: "none" });
- });
- }
- validParams(params) {
- const { dtails } = this.state;
- let flag = true;
- let message = '';
- if (dtails.newChannel == 1) {
- // 渠道客户
- if (!params.channelType) {
- flag = false;
- message = '请选择渠道性质';
- } else if (!params.enterpriseCount) {
- flag = false;
- message = '请输入渠道所覆盖企业数';
- } else if (!params.channelIndicators) {
- flag = false;
- message = '请输入渠道考核指标';
- } else if (!params.interviewIdeas || (params.interviewIdeas && params.interviewIdeas.length < 20)) {
- message = '请输入面谈思路,并且在20字以上';
- flag = false;
- } else if (!params.interviewPurpose || (params.interviewPurpose && params.interviewPurpose.length < 20)) {
- message = '请输入面谈达成的目的,并且在20字以上';
- flag = false;
- } else {
- if (this.state.dtails.interviewList.length) {
- if (!params.interviewFeedback || (params.interviewFeedback && params.interviewFeedback.length < 20)) {
- message = '请输入面谈后的反馈,并且在20字以上';
- flag = false;
- } else if (!params.followUpPlan || (params.followUpPlan && params.followUpPlan.length < 20)) {
- message = '请输入后续跟进计划,并且在20字以上';
- flag = false;
- }
- }
- }
- } else {
- if (!params.locationProvince) {
- message = '请选择企业所在地省市区';
- flag = false;
- } else if (!params.industry) {
- message = '请选择企业所属行业';
- flag = false;
- } else if (!params.businessScope) {
- message = '主营产品不能为空';
- flag = false;
- } else if (params.companyCount === '' || params.companyCount === undefined || params.companyCount === null) {
- message = '请输入母/子公司数';
- flag = false;
- } else if (params.socialSecurityCount === '' || params.socialSecurityCount === undefined || params.socialSecurityCount === null) {
- message = '请输入社保人数,并且不能为0';
- flag = false;
- } else if (!Number(params.financialRevenue)) {
- message = '请输入营收数据,并且不能为0';
- flag = false;
- } else if (!Number(params.financialTax)) {
- message = '请输入税收数据,并且不能为0';
- flag = false;
- } else if (!Number(params.financialProperty)) {
- message = '请输入资产数据,并且不能为0';
- flag = false;
- } else if (!Number(params.financialRd)) {
- message = '请输入研发费用,并且不能为0';
- flag = false;
- } else if (!params.earlyCommunication || (params.earlyCommunication && params.earlyCommunication.length < 20)) {
- message = '请输入客户的难处,并且在20字以上';
- flag = false;
- } else if (!params.customerDemand || (params.customerDemand && params.customerDemand.length < 20)) {
- message = '请输入客户的需求,并且在20字以上';
- flag = false;
- } else if (!params.interviewIdeas || (params.interviewIdeas && params.interviewIdeas.length < 20)) {
- message = '请输入面谈思路,并且在20字以上';
- flag = false;
- } else if (!params.interviewPurpose || (params.interviewPurpose && params.interviewPurpose.length < 20)) {
- message = '请输入面谈达成的目的,并且在20字以上';
- flag = false;
- } else if (!params.interviewRecommend || (params.interviewRecommend && params.interviewRecommend.length < 20)) {
- message = '请输入经理/上级面谈建议,并且在20字以上';
- flag = false;
- } else {
- if (this.state.dtails.interviewList.length) {
- if (!params.interviewFeedback || (params.interviewFeedback && params.interviewFeedback.length < 20)) {
- message = '请输入面谈后的反馈,并且在20字以上';
- flag = false;
- } else if (!params.followUpPlan || (params.followUpPlan && params.followUpPlan.length < 20)) {
- message = '请输入后续跟进计划,并且在20字以上';
- flag = false;
- }
- }
- }
- }
- return { flag, message };
- }
- onSaveAllData(callback) {
- const { dtails } = this.state;
- let params = {
- id: dtails.id,
- uid: dtails.uid,
- locationProvince: dtails.locationProvince,
- locationProvinceName: dtails.locationProvinceName,
- locationCity: dtails.locationCity,
- locationCityName: dtails.locationCityName,
- locationArea: dtails.locationArea,
- locationAreaName: dtails.locationAreaName,
- type: 1, // 1、更新档案和面谈,0、只更新档案
- };
- // 是否在面谈中,表示本次面谈未结束
- let curruaiIdList = this.props.uaiIdList.filter(item => item.uid == dtails.uid);
- if (curruaiIdList.length) {
- // 面谈编号
- params.uaiId = curruaiIdList[0].uaiId;
- }
- if (dtails.newChannel == 1) {
- // 渠道客户
- params = {
- ...params,
- channelType: dtails.channelType,
- enterpriseCount: dtails.enterpriseCount.replace(/,/g, ''),
- channelIndicators: dtails.channelIndicators,
- interviewIdeas: dtails.interviewIdeas,
- interviewPurpose: dtails.interviewPurpose,
- interviewFeedback: dtails.interviewFeedback,
- followUpPlan: dtails.followUpPlan,
- };
- } else {
- params = {
- ...params,
- industry: dtails.industry,
- industryName: dtails.industryName,
- earlyCommunication: dtails.earlyCommunication,
- customerDemand: dtails.customerDemand,
- interviewIdeas: dtails.interviewIdeas,
- interviewPurpose: dtails.interviewPurpose,
- interviewRecommend: dtails.interviewRecommend,
- interviewFeedback: dtails.interviewFeedback,
- followUpPlan: dtails.followUpPlan,
- patentCount: dtails.patentCount,
- inventionPatentCount: dtails.inventionPatentCount,
- utilityModelCount: dtails.utilityModelCount,
- appearancePatentCount: dtails.appearancePatentCount,
- softwareWorksCount: dtails.softwareWorksCount,
- otherCount: dtails.otherCount,
- financialData: dtails.financialData,
- companyCount: dtails.companyCount.replace(/,/g, ''),
- socialSecurityCount: dtails.socialSecurityCount.replace(/,/g, ''),
- externalInvestCount: dtails.externalInvestCount.replace(/,/g, ''),
- externalInvestIndustry: dtails.externalInvestIndustry,
- externalInvestIndustryName: dtails.externalInvestIndustryName,
- externalInvestId: dtails.externalInvestId,
- externalInvestName: dtails.externalInvestName,
- financialRevenue: dtails.financialRevenue.replace(/,/g, ''),
- financialTax: dtails.financialTax.replace(/,/g, ''),
- financialProperty: dtails.financialProperty.replace(/,/g, ''),
- financialRd: dtails.financialRd.replace(/,/g, ''),
- standard: dtails.standard,
- businessScope: dtails.businessScope,
- };
- }
- for (let key in params) {
- if (params[key] === undefined || params[key] === 'undefined' || params[key] === null || params[key] === 'null') {
- delete params[key];
- }
- }
- const { flag, message } = this.validParams(params);
- if (!flag) {
- Taro.showToast({
- title: message,
- icon: "none",
- });
- return;
- }
- updateUser(params).then((v) => {
- if (v.error.length === 0) {
- Taro.showToast({
- title: "修改成功",
- });
- callback && callback(v.data);
- } else {
- Taro.showToast({
- title: v.error[0].message,
- icon: "none",
- });
- }
- })
- }
- // 计算专利总数
- countZlNum({ inventionPatentCount, utilityModelCount, appearancePatentCount, softwareWorksCount, otherCount }) {
- let count = 0;
- if (inventionPatentCount && !isNaN(inventionPatentCount)) {
- count += Number(inventionPatentCount);
- }
- if (utilityModelCount && !isNaN(utilityModelCount)) {
- count += Number(utilityModelCount);
- }
- if (appearancePatentCount && !isNaN(appearancePatentCount)) {
- count += Number(appearancePatentCount);
- }
- if (softwareWorksCount && !isNaN(softwareWorksCount)) {
- count += Number(softwareWorksCount);
- }
- if (otherCount && !isNaN(otherCount)) {
- count += Number(otherCount);
- }
- return count;
- }
- // 修改客户档案
- update() {
- // const { upType, info } = this.state
- // console.log(info)
- // let tipList = [
- // { key: "inventionPatentCount", value: "请填写发明专利数" },
- // { key: "utilityModelCount", value: "请填写实用新型数" },
- // { key: "appearancePatentCount", value: "请填写外观专利数" },
- // { key: "softwareWorksCount", value: "请填写软著数" },
- // { key: "otherCount", value: "请填写其他数量" },
- // { key: "financialData", value: "请填写财务数据" },
- // { key: "earlyCommunication", value: "请填写前期沟通" },
- // { key: "interviewIdeas", value: "请填写面谈思路及目的" },
- // { key: "interviewDistribution", value: "请填写主要面谈人及分工" },
- // { key: "enterpriseCount", value: "请填写覆盖企业数" },
- // { key: "channelIndicators", value: "请填写渠道考核指标" },
- // ]
- // if (!info.id) {
- // delete info.id
- // }
- // for (let i in info) {
- // if (!info[i] && info[i] !== 0) {
- // for (var j = 0; j < tipList.length; j++) {
- // if (tipList[j].key == i) {
- // Taro.showToast({
- // title: tipList[j].value,
- // icon: "none",
- // });
- // }
- // }
- // return
- // } else if (info[i] == 0) {
- // if (i == "channelType") {
- // Taro.showToast({
- // title: "请选择渠道类型",
- // icon: "none",
- // });
- // return
- // }
- // }
- // if ((i == "financialData" || i == "earlyCommunication" || i == "interviewIdeas" || i == "interviewDistribution")
- // && info[i].length < 20) {
- // Taro.showToast({
- // title: "至少20字以上",
- // icon: "none",
- // });
- // return
- // }
- // }
- // updateUserDate(upType, info).then((v) => {
- // if (v.error.length === 0) {
- // Taro.showToast({
- // title: "修改成功",
- // });
- // this.setState({
- // isOpened: false
- // })
- // this.queryByUidAll()
- // } else {
- // Taro.showToast({
- // title: v.error[0].message,
- // icon: "none",
- // });
- // }
- // }).catch(() => {
- // })
- if (this.state.upType == 5) {
- this.postAddProject();
- } else {
- if (this.state.upType == 1) {
- // 计算专利
- let patentCount = this.countZlNum(this.state.info);
- this.setState({ isOpened: false, dtails: { ...this.state.dtails, ...this.state.info, patentCount } })
- } else {
- this.setState({ isOpened: false, dtails: { ...this.state.dtails, ...this.state.info } })
- }
- }
- }
- postAddProject() {
- const { checkProject, dtails, info, projectList } = this.state;
- const params = { uid: dtails.uid };
- if (!checkProject.length) {
- Taro.showToast({
- title: "请选择要添加的项目",
- icon: "none",
- });
- return;
- } else {
- let isAdded = projectList.some(item => item.pid == checkProject[0].id)
- if (isAdded) {
- Taro.showToast({
- title: checkProject[0].bname + '已存在,请勿重复添加!',
- icon: "none",
- });
- return false;
- }
- params.pid = checkProject[0].id;
- if (checkProject[0].cSort == 9) {
- if (!info.examineStatus) {
- Taro.showToast({
- title: "请选择审核状态",
- icon: "none",
- });
- return;
- } else if (info.examineStatus == 2 && !info.examineStatusOther) {
- Taro.showToast({
- title: "请选择复审年份",
- icon: "none",
- });
- return;
- } else if (info.examineStatus == 2 && info.examineStatusOther.split(',').length > 1) {
- Taro.showToast({
- title: "复审年份只能选择一个",
- icon: "none",
- });
- return;
- } else {
- params.examineStatus = info.examineStatus;
- params.examineStatusOther = info.examineStatus == 2 ? info.examineStatusOther : '';
- }
- } else if (checkProject[0].cSort == 6) {
- if (!info.buyStatus) {
- Taro.showToast({
- title: "请选择复购状态",
- icon: "none",
- });
- return;
- } else if (info.buyStatus == 2 && !info.buyStatusOther) {
- Taro.showToast({
- title: "请选择复购/复审年份",
- icon: "none",
- });
- return;
- } else {
- params.buyStatus = info.buyStatus;
- params.buyStatusOther = info.buyStatus == 2 ? info.buyStatusOther : '';
- }
- }
- }
- addProject(params).then(res => {
- if (res.error.length == 0) {
- Taro.showToast({
- title: "项目新增成功!",
- });
- this.setState({ isOpened: false, checkProject: [] })
- this.getProjectList();
- } else {
- Taro.showToast({
- title: res.error[0].message,
- icon: "none"
- });
- }
- })
- }
- /**
- * 获取项目列表
- */
- getProjectList() {
- let uid = this.$instance.router.params.id;
- const params = { uid, pageNo: 1, pageSize: 9999 }
- queryProjectList(params).then(res => {
- let urlPrdid = this.$instance.router.params.prdid;
- if (!res.error.length) {
- let projectList = res.data.list.filter(item => item.status === 0);
- this.setState({
- projectList,
- projectingList: projectList.filter(item => item.prdid == urlPrdid),
- projectedList: projectList.filter(item => item.prdid != urlPrdid)
- });
- }
- })
- }
- handleDelProject(data) {
- delProject(data.id, data).then(res => {
- if (!res.error.length) {
- Taro.showToast({
- title: "删除成功!",
- });
- this.getProjectList();
- } else {
- Taro.showToast({
- title: v.error[0].message,
- icon: "none"
- });
- }
- })
- }
- // 新建联系人
- add() {
- let data = this.state.obj
- for (let i in data) {
- if (!data[i] && data[i] !== 0) {
- Taro.showToast({
- title: "请完善信息",
- icon: "none",
- });
- return
- } else if ('name,position,department'.indexOf(i) > -1) {
- if (!data[i].match(/^[\D].*[\u4e00-\u9fff]+$/)) {
- let keyObjName = {
- name: "姓名",
- position: "职位",
- department: "部门"
- };
- Taro.showToast({
- title: `请输入正确的${keyObjName[i]},不能以数字开头,且至少包含一个汉字`,
- icon: "none",
- });
- return
- }
- } else if (i == "mobile") {
- if (!(/^1[3-9]\d{9}$/.test(data[i]))) {
- Taro.showToast({
- title: "请输入正确地手机号",
- icon: "none",
- });
- return
- }
- }
- }
- data.major = 1
- addOneContact(data).then((v) => {
- if (v.error.length === 0) {
- Taro.showToast({
- title: "添加成功",
- });
- this.setState({
- isAdd: false
- })
- this.queryByUidAll()
- } else {
- Taro.showToast({
- title: v.error[0].message,
- icon: "none",
- });
- }
- }).catch(() => {
- })
- }
- // 项目列表
- getBusinessProjectByName(val) {
- getBusinessProjectByName({
- businessName: val || "",
- })
- .then((v) => {
- if (v.error.length === 0) {
- let theArr = [];
- if (v.data.length > 0) {
- for (let i = 0; i < v.data.length; i++) {
- let thisdata = v.data[i];
- theArr.push({
- value: thisdata.id,
- label: thisdata.bname,
- });
- };
- }
- this.setState({
- allProjectList: v.data,
- options: theArr
- })
- } else {
- Taro.showToast({ title: v.error[0].message, icon: "none" });
- }
- })
- .catch((err) => {
- Taro.showToast({ title: "系统错误,请稍后再试", icon: "none" });
- });
- }
- onSearchChange(value) {
- this.setState({
- value,
- });
- }
- getUserList() {
- findCustomerContacts({
- uid: this.$instance.router.params.id,
- })
- .then((v) => {
- if (v.error.length === 0) {
- this.setState({
- userList: v.data || []
- })
- } else {
- Taro.showToast({ title: v.error[0].message, icon: "none" });
- }
- })
- .catch((err) => {
- Taro.showToast({ title: "系统错误,请稍后再试", icon: "none" });
- });
- }
- updateMainContact(id) {
- updateMainContact({
- uid: this.$instance.router.params.id,
- ocbId: id,
- }).then((v) => {
- if (v.error.length === 0) {
- Taro.showToast({
- title: "设置成功",
- });
- this.getUserList()
- } else {
- Taro.showToast({
- title: v.error[0].message,
- icon: "none",
- });
- }
- }).catch(() => {
- })
- }
- limitUser() {
- limitUser({
- uid: this.$instance.router.params.id,
- // hours: 1,
- }).then((v) => {
- if (v.error.length === 0) {
- } else {
- Taro.showToast({
- title: v.error[0].message,
- icon: "none",
- });
- }
- }).catch(() => {
- })
- }
- addItemDialog(type) {
- let title;
- switch (type) {
- case 'externalInvestName':
- // 对外投资控股的企业名称
- title = '添加对外投资控股的企业名称';
- break;
- default:
- break;
- }
- this.setState({ addItemShow: true, addItemType: type, addItemTitle: title });
- }
- handleCloseAddItemDialog() {
- this.setState({ addItemShow: false, addItemType: '', addItemInputVal: '' });
- }
- handleAddItemSave() {
- switch (this.state.addItemType) {
- case 'externalInvestName':
- const { dtails } = this.state;
- let externalInvestName = this.state.dtails.externalInvestName || '';
- let externalInvestNameArr = externalInvestName.split(',').filter(item => !!item);
- externalInvestNameArr.push(this.state.addItemInputVal);
- dtails.externalInvestName = externalInvestNameArr.join(',');
- this.setState({ dtails }, () => {
- this.handleCloseAddItemDialog();
- });
- break;
- default:
- break;
- }
- }
- openInteractHis(type) {
- let interactTitle;
- let interactList = this.state.dtails.interviewList;
- switch (type) {
- case 'earlyCommunication':
- interactTitle = '客户的难处历史记录';
- break;
- case 'customerDemand':
- interactTitle = '客户的需求历史记录';
- break;
- case 'interviewIdeas':
- interactTitle = '面谈思路历史记录';
- break;
- case 'interviewPurpose':
- interactTitle = '面谈达成的目的历史记录';
- break;
- case 'interviewRecommend':
- interactTitle = '经理/上级面谈建议历史记录';
- break;
- case 'interviewFeedback':
- interactTitle = '面谈后反馈历史记录';
- interactList = interactList.slice(1, interactList.length);
- break;
- case 'followUpPlan':
- interactTitle = '后续跟进计划历史记录';
- interactList = interactList.slice(1, interactList.length);
- break;
- default:
- break;
- }
- this.setState({
- interactShow: true,
- interactShowType: type,
- interactTitle,
- interactList
- });
- }
- renderProjectItemName(data) {
- let name = data.name;
- if (!!data.buyStatus) {
- // 会员项目
- if (data.buyStatus === 1) {
- name = name + `(新购)`;
- } else if (data.buyStatus === 2) {
- name = name + `(复购${data.buyStatusOther})`;
- }
- } else if (!!data.examineStatus) {
- // 高新项目
- if (data.examineStatus === 1) {
- name = name + `(初次审核)`;
- } else if (data.examineStatus === 2) {
- name = name + `(${data.examineStatusOther}年复审)`;
- }
- }
- return name;
- }
- render() {
- const { dtails, upType, info, obj, userList } = this.state;
- const publicType = this.$instance.router.params.publicType;
- return (
- <View className="customerProfile">
- <MessageNoticebar />
- <View
- className="titleContent"
- >
- {Object.keys(dtails).length === 0 ? (
- <Skeleton
- title
- row={3}
- animateName="elastic"
- avatarShape="square"
- loading
- />
- ) : (
- <View className="content">
- <View className="name">
- <Text style={{ width: "80%" }}>
- <Text className="bod">{dtails.nickname} </Text>
- <Text style={{ fontSize: "12px", color: ["red", "green"][dtails.signBills] }}>{["未签单", "已签单"][dtails.signBills]}</Text>
- </Text>
- {publicType === '0' && <Button className="share" plain type='primary' open-type="share">分享</Button>}
- {/* <View className="share">分享</View> */}
- </View>
- { publicType === '0' && (
- <>
- <View className="button">
- <View className="but"
- onClick={e => {
- e.stopPropagation()
- this.setState({
- isSuperior: true
- })
- }}
- >上级指导</View>
- {
- this.state.isSuperior &&
- <Superior
- id={dtails.uid}
- userNames={dtails.nickname}
- isOpinion={this.state.isSuperior}
- isFill={dtails.myUser == 0}
- onClose={() => {
- this.setState({
- isSuperior: false
- })
- }}
- />
- }
- <View className="but"
- onClick={e => {
- e.stopPropagation()
- Taro.navigateTo({
- url: "/pages/situation/index?id=" + this.$instance.router.params.id + "¬Required=" + this.$instance.router.params.notRequired,
- });
- }}
- >公出记录</View>
- </View>
- <View className="row">
- <View className="code">{dtails.orgCode}</View>
- <View className="time">{dtails.createTime}</View>
- </View>
- </>
- )}
- {
- dtails.newChannel == 1
- ?
- <View className="valueContent">
- <View className="title" style={{ margin: "14rpx 0 18rpx;" }}>渠道面谈思路表</View>
- {publicType === '0' && (
- <>
- <View className="item">
- <View className="item-title">企业所在地省市区:</View>
- <View className="item-value">
- <View>
- {dtails.locationProvince ? `${dtails.locationProvinceName}-${dtails.locationCityName}-${dtails.locationAreaName}` : ''}
- </View>
- </View>
- </View>
- <View className="item">
- <View className="item-title">渠道类别:</View>
- <View className="item-value">
- {!getChannel(dtails.channelType) ? "" : getChannel(dtails.channelType)}
- </View>
- </View>
- <View className="item">
- <View className="item-title">渠道企业数:</View>
- <View className="item-value">
- <AtInput
- min={0}
- value={dtails.enterpriseCount}
- name='companyCount'
- type='number'
- placeholder='请输入数量'
- size='mini'
- onChange={value => {
- dtails.enterpriseCount = this.addCommas(value);
- this.setState({ dtails })
- }}
- cursor={-1}
- disabled
- />
- </View>
- </View>
- <View className="item">
- <View className="item-title">渠道考核指标:</View>
- <View className="item-value">
- <AtTextarea
- value={dtails.channelIndicators || ''}
- onChange={e => {
- this.setState({
- dtails: Object.assign(dtails, {
- channelIndicators: e,
- }),
- })
- }}
- maxLength={200}
- placeholder='请填写渠道考核指标~'
- disabled
- />
- </View>
- </View>
- <View style={{ fontWeight: 600, color: "red" }}>
- <Text>首次面谈时间:</Text>
- <Text>{dtails.firstInterviewDate || '暂无面谈记录'}</Text>
- </View>
- <View className="item">
- <View className="item-title">
- 主要面谈联系信息:
- </View>
- <View className="item-value">
- {
- !!dtails.contactList && dtails.contactList.map((v, k) =>
- <View className="val" key={k}>{v.name} {v.position} {v.department} {v.mobile}</View>
- )
- }
- </View>
- </View>
- <View className="item">
- <View className="item-title">
- 本次面谈项目:
- </View>
- <View className="item-value">
- {
- this.state.projectingList.map((item) => {
- return <View>{this.renderProjectItemName(item)}</View>
- })
- }
- </View>
- </View>
- <View className="item">
- <View className="item-value">
- <View style={{ color: "red", marginTop: '24rpx', fontWeight: 600 }}>
- <Text>已面谈项目:</Text>
- {
- this.state.projectedList.map((item, idx) => {
- if (idx == this.state.projectedList.length - 1) {
- return <Text>{this.renderProjectItemName(item)}</Text>
- }
- return <Text>{this.renderProjectItemName(item)}、</Text>
- })
- }
- </View>
- </View>
- </View>
- </>
- )}
- <View className="item">
- <View className="item-title">
- <View>
- 面谈思路:
- <Text className="titleTips">(20字以上)</Text>
- </View>
- <View>
- {dtails.interviewList.length ? (
- <AtIcon value='clock' size='20' color='#1E90FF' onClick={() => this.openInteractHis('interviewIdeas')}></AtIcon>
- ) : null}
- </View>
- </View>
- <View className="item-value">
- <AtTextarea
- value={dtails.interviewIdeas || ''}
- maxLength={200}
- placeholder='~'
- height={70}
- onChange={value => {
- dtails.interviewIdeas = value;
- this.setState({ dtails });
- }}
- disabled
- />
- </View>
- </View>
- <View className="item">
- <View className="item-title">
- <View>
- 面谈达成的目的:
- <Text className="titleTips">(20字以上)</Text>
- </View>
- <View>
- {dtails.interviewList.length ? (
- <AtIcon value='clock' size='20' color='#1E90FF' onClick={() => this.openInteractHis('interviewPurpose')}></AtIcon>
- ) : null}
- </View>
- </View>
- <View className="item-value">
- <AtTextarea
- value={dtails.interviewPurpose || ''}
- maxLength={200}
- placeholder='~'
- height={70}
- onChange={value => {
- dtails.interviewPurpose = value;
- this.setState({ dtails });
- }}
- disabled
- />
- </View>
- </View>
- {dtails.interviewList && dtails.interviewList.length ? (
- <>
- <View className="item">
- <View className="item-title">
- <View>
- 面谈后的反馈:
- <Text className="titleTips">(20字以上)</Text>
- </View>
- <View>
- {dtails.interviewList.length ? (
- <AtIcon value='clock' size='20' color='#1E90FF' onClick={() => this.openInteractHis('interviewFeedback')}></AtIcon>
- ) : null}
- </View>
- </View>
- <View className="item-value">
- <AtTextarea
- value={dtails.interviewFeedback || ''}
- maxLength={200}
- placeholder='~'
- height={70}
- onChange={value => {
- dtails.interviewFeedback = value;
- this.setState({ dtails });
- }}
- disabled
- />
- </View>
- </View>
- <View className="item">
- <View className="item-title">
- <View>
- 后续跟进计划:
- <Text className="titleTips">(20字以上)</Text>
- </View>
- <View>
- {dtails.interviewList.length ? (
- <AtIcon value='clock' size='20' color='#1E90FF' onClick={() => this.openInteractHis('followUpPlan')}></AtIcon>
- ) : null}
- </View>
- </View>
- <View className="item-value">
- <AtTextarea
- value={dtails.followUpPlan || ''}
- maxLength={200}
- placeholder='~'
- height={70}
- onChange={value => {
- dtails.followUpPlan = value;
- this.setState({ dtails });
- }}
- disabled
- />
- </View>
- </View>
- </>
- ) : null}
- </View>
- :
- <View className="valueContent">
- <View className="title" style={{ margin: "14rpx 0 18rpx;" }}>企业面谈思路表</View>
- {publicType === '0' && (
- <>
- <View className="item">
- <view className="item-title">企业所在地省市区:</view>
- <view className="item-value">
- <View>
- {dtails.locationProvince ? `${dtails.locationProvinceName}-${dtails.locationCityName}-${dtails.locationAreaName}` : ''}
- </View>
- </view>
- </View>
- <View className="item">
- <view className="item-title">企业所属行业:</view>
- <view className="item-value">
- <View>
- {this.state.dtails.industryName || ''}
- </View>
- </view>
- </View>
- <View className="item">
- <view className="item-title">主营产品:</view>
- <view className="item-value">
- <AtInput
- value={dtails.businessScope}
- name='businessScope'
- placeholder='请用,符号隔开关键字'
- size='mini'
- onChange={value => {
- dtails.businessScope = value;
- this.setState({ dtails })
- }}
- cursor={-1}
- disabled
- />
- </view>
- </View>
- <View className="item flex">
- <view className="item-title">母/子公司数:</view>
- <view className="item-value">
- <View style={{ width: '260rpx' }}>
- <AtInput
- min={0}
- value={dtails.companyCount}
- name='companyCount'
- type='number'
- placeholder='请输入数量'
- size='mini'
- onChange={value => {
- dtails.companyCount = this.addCommas(value);
- this.setState({ dtails })
- }}
- cursor={-1}
- disabled
- />
- </View>
- </view>
- </View>
- <View className="item flex">
- <view className="item-title">社保人数:</view>
- <view className="item-value">
- <View style={{ width: '260rpx' }}>
- <AtInput
- min={0}
- value={dtails.socialSecurityCount}
- name='socialSecurityCount'
- type='number'
- placeholder='请输入数量'
- size='mini'
- onChange={value => {
- dtails.socialSecurityCount = this.addCommas(value);
- this.setState({ dtails })
- }}
- cursor={-1}
- disabled
- />
- </View>
- </view>
- </View>
- <View className="item flex">
- <view className="item-title">对外投资控股的企业数:</view>
- <view className="item-value">
- <View style={{ width: '260rpx' }}>
- <AtInput
- min={0}
- value={dtails.externalInvestCount}
- name='externalInvestCount'
- type='number'
- placeholder='请输入数量'
- size='mini'
- onChange={value => {
- dtails.externalInvestCount = this.addCommas(value);
- this.setState({ dtails })
- }}
- cursor={-1}
- disabled
- />
- </View>
- </view>
- </View>
- <View className="item">
- <view className="item-title">对外投资控股的行业:</view>
- <view className="item-value">
- <View>
- {dtails.externalInvestIndustryName || ''}
- </View>
- </view>
- </View>
- <View className="item">
- <view className="item-title">对外投资控股的企业名称:</view>
- <view className="item-value">
- <View>
- {dtails.externalInvestName || ''}
- </View>
- </view>
- </View>
- <View style={{ fontWeight: 600, color: "red" }}>
- <Text>首次面谈时间:</Text>
- <Text>{dtails.firstInterviewDate || '暂无面谈记录'}</Text>
- </View>
- <View className="item">
- <view className="item-title">
- 主要面谈联系信息:
- </view>
- <view className="item-value">
- {
- !!dtails.contactList && dtails.contactList.map((v, k) =>
- <View className="val" key={k}>
- {v.name} {v.position} {v.department} {v.mobile}
- {this.state.isMask && <View className="mask"></View>}
- </View>
- )
- }
- </view>
- </View>
- <View className="item">
- <View className="item-title">
- 本次面谈项目:
- </View>
- <View className="item-value">
- {
- this.state.projectingList.map((item) => {
- return <View>{this.renderProjectItemName(item)}</View>
- })
- }
- </View>
- </View>
- <View className="item">
- <View className="item-value">
- <View style={{ color: "red", marginTop: '24rpx', fontWeight: 600 }}>
- <Text>已面谈项目:</Text>
- {
- this.state.projectedList.map((item, idx) => {
- if (idx == this.state.projectedList.length - 1) {
- return <Text>{this.renderProjectItemName(item)}</Text>
- }
- return <Text>{this.renderProjectItemName(item)}、</Text>
- })
- }
- </View>
- </View>
- </View>
- </>
- )}
- <View style={{ marginTop: '60rpx' }}>
- {publicType === '0' && (
- <>
- <View className="title">面谈已知企业情况</View>
- <View className="tit" style={{ margin: '32rpx 0 20rpx;' }}>
- <Text>
- 1.知识产权情况
- <Text className="txt">(专利信息、标准、专利、软著)</Text>
- </Text>
- </View>
- <View className="val">
- 专利 <Text className="num">{dtails.patentCount || 0}</Text>
- 其中发明专利 <Text className="num">{dtails.inventionPatentCount}</Text>
- 实用新型 <Text className="num">{dtails.utilityModelCount}</Text>
- 外观设计 <Text className="num">{dtails.appearancePatentCount}</Text>
- 软著 <Text className="num">{dtails.softwareWorksCount}</Text>
- 标准 <Text className="num">{String(dtails.standard) === '1' ? '有' : String(dtails.standard) === '0' ? '无' : ''}</Text>
- 其他类型 <Text className="num">{dtails.otherCount}</Text>
- </View>
- <View className="tit" style={{ margin: '32rpx 0 20rpx;' }}>2.财务数据</View>
- <View className="item flex">
- <View className="item-title">营收(万元):</View>
- <View className="item-value">
- <View style={{ width: '260rpx' }}>
- <AtInput
- min={0}
- value={dtails.financialRevenue}
- name='financialRevenue'
- type='number'
- placeholder='请输入数量'
- size='mini'
- onChange={value => {
- dtails.financialRevenue = this.addCommas(value);
- this.setState({ dtails })
- }}
- cursor={-1}
- disabled
- />
- </View>
- </View>
- </View>
- <View className="item flex">
- <View className="item-title">税收(万元):</View>
- <View className="item-value">
- <View style={{ width: '260rpx' }}>
- <AtInput
- min={0}
- value={dtails.financialTax}
- name='financialTax'
- type='number'
- placeholder='请输入数量'
- size='mini'
- onChange={value => {
- dtails.financialTax = this.addCommas(value);
- this.setState({ dtails })
- }}
- cursor={-1}
- disabled
- />
- </View>
- </View>
- </View>
- <View className="item flex">
- <View className="item-title">资产(万元):</View>
- <View className="item-value">
- <View style={{ width: '260rpx' }}>
- <AtInput
- min={0}
- value={dtails.financialProperty}
- name='financialProperty'
- type='number'
- placeholder='请输入数量'
- size='mini'
- onChange={value => {
- dtails.financialProperty = this.addCommas(value);
- this.setState({ dtails })
- }}
- cursor={-1}
- disabled
- />
- </View>
- </View>
- </View>
- <View className="item flex">
- <View className="item-title">研发费用(万元):</View>
- <View className="item-value">
- <View style={{ width: '260rpx' }}>
- <AtInput
- min={0}
- value={dtails.financialRd}
- name='financialRd'
- type='number'
- placeholder='请输入数量'
- size='mini'
- onChange={value => {
- dtails.financialRd = this.addCommas(value);
- this.setState({ dtails })
- }}
- cursor={-1}
- disabled
- />
- </View>
- </View>
- </View>
- <View className="tit" style={{ margin: '32rpx 0 20rpx;' }}>3.前期沟通情况</View>
- </>
- )}
- <View className="item">
- <View className="item-title">
- <View>
- 客户的难处:
- <Text className="titleTips">(20字以上)</Text>
- </View>
- <View>
- {dtails.interviewList.length ? (
- <AtIcon value='clock' size='20' color='#1E90FF' onClick={() => this.openInteractHis('earlyCommunication')}></AtIcon>
- ) : null}
- </View>
- </View>
- <View className="item-value">
- <AtTextarea
- value={dtails.earlyCommunication || ''}
- maxLength={200}
- placeholder='~'
- height={70}
- onChange={value => {
- dtails.earlyCommunication = value;
- this.setState({ dtails });
- }}
- disabled
- />
- </View>
- </View>
- <View className="item">
- <View className="item-title">
- <View>
- 客户的需求:
- <Text className="titleTips">(20字以上)</Text>
- </View>
- <View>
- {dtails.interviewList.length ? (
- <AtIcon value='clock' size='20' color='#1E90FF' onClick={() => this.openInteractHis('customerDemand')}></AtIcon>
- ) : null}
- </View>
- </View>
- <View className="item-value">
- <AtTextarea
- value={dtails.customerDemand || ''}
- maxLength={200}
- placeholder='~'
- height={70}
- onChange={value => {
- dtails.customerDemand = value;
- this.setState({ dtails });
- }}
- disabled
- />
- </View>
- </View>
- <View className="item">
- <View className="item-title">
- <View>
- 面谈思路:
- <Text className="titleTips">(20字以上)</Text>
- </View>
- <View>
- {dtails.interviewList.length ? (
- <AtIcon value='clock' size='20' color='#1E90FF' onClick={() => this.openInteractHis('interviewIdeas')}></AtIcon>
- ) : null}
- </View>
- </View>
- <View className="item-value">
- <AtTextarea
- value={dtails.interviewIdeas || ''}
- maxLength={200}
- placeholder='~'
- height={70}
- onChange={value => {
- dtails.interviewIdeas = value;
- this.setState({ dtails });
- }}
- disabled
- />
- </View>
- </View>
- <View className="item">
- <View className="item-title">
- <View>
- 面谈达成的目的:
- <Text className="titleTips">(20字以上)</Text>
- </View>
- <View>
- {dtails.interviewList.length ? (
- <AtIcon value='clock' size='20' color='#1E90FF' onClick={() => this.openInteractHis('interviewPurpose')}></AtIcon>
- ) : null}
- </View>
- </View>
- <View className="item-value">
- <AtTextarea
- value={dtails.interviewPurpose || ''}
- maxLength={200}
- placeholder='~'
- height={70}
- onChange={value => {
- dtails.interviewPurpose = value;
- this.setState({ dtails });
- }}
- disabled
- />
- </View>
- </View>
- <View className="item">
- <View className="item-title">
- <View>
- 经理/上级面谈建议:
- <Text className="titleTips">(由经理/上级口述,本人整理,20字以上)</Text>
- </View>
- <View>
- {dtails.interviewList.length ? (
- <AtIcon value='clock' size='20' color='#1E90FF' onClick={() => this.openInteractHis('interviewRecommend')}></AtIcon>
- ) : null}
- </View>
- </View>
- <View className="item-value">
- <AtTextarea
- value={dtails.interviewRecommend || ''}
- maxLength={500}
- placeholder='~'
- height={70}
- onChange={value => {
- dtails.interviewRecommend = value;
- this.setState({ dtails });
- }}
- disabled
- />
- </View>
- </View>
- {dtails.interviewList && dtails.interviewList.length ? (
- <>
- <View className="item">
- <View className="item-title">
- <View>
- 面谈后的反馈:
- <Text className="titleTips">(20字以上)</Text>
- </View>
- <View>
- {dtails.interviewList.length ? (
- <AtIcon value='clock' size='20' color='#1E90FF' onClick={() => this.openInteractHis('interviewFeedback')}></AtIcon>
- ) : null}
- </View>
- </View>
- <View className="item-value">
- <AtTextarea
- value={dtails.interviewFeedback || ''}
- maxLength={200}
- placeholder='~'
- height={70}
- onChange={value => {
- dtails.interviewFeedback = value;
- this.setState({ dtails });
- }}
- disabled
- />
- </View>
- </View>
- <View className="item">
- <View className="item-title">
- <View>
- 后续跟进计划:
- <Text className="titleTips">(20字以上)</Text>
- </View>
- <View>
- {dtails.interviewList.length ? (
- <AtIcon value='clock' size='20' color='#1E90FF' onClick={() => this.openInteractHis('followUpPlan')}></AtIcon>
- ) : null}
- </View>
- </View>
- <View className="item-value">
- <AtTextarea
- value={dtails.followUpPlan || ''}
- maxLength={200}
- placeholder='~'
- height={70}
- onChange={value => {
- dtails.followUpPlan = value;
- this.setState({ dtails });
- }}
- disabled
- />
- </View>
- </View>
- </>
- ) : null}
- {/* <View style={{ display: 'flex', marginTop: '24rpx' }}>
- <AtButton type="secondary" circle onClick={this.handlePrevClick.bind(this)}>上一页</AtButton>
- <AtButton type="primary" circle onClick={this.handleNextClick.bind(this)}>下一页</AtButton>
- </View> */}
- </View>
- </View>
- }
- </View>
- )}
- </View>
- <AtModal
- isOpened={this.state.isOpened}
- onClose={() => {
- this.setState({
- isOpened: false,
- checkProject: [],
- checkOptions: []
- })
- }}
- >
- <AtModalHeader>信息修改</AtModalHeader>
- <AtModalContent>
- {
- upType == 1 &&
- <View>
- <AtInput
- name='inventionPatentCount'
- title='发明专利'
- type='number'
- value={info.inventionPatentCount}
- onChange={e => {
- this.setState({
- info: Object.assign(info, {
- inventionPatentCount: e,
- })
- })
- }}
- cursor={-1}
- />
- <AtInput
- name='utilityModelCount'
- title='实用新型'
- type='number'
- value={info.utilityModelCount}
- onChange={e => {
- this.setState({
- info: Object.assign(info, {
- utilityModelCount: e,
- })
- })
- }}
- cursor={-1}
- />
- <AtInput
- name='appearancePatentCount'
- title='外观专利'
- type='number'
- value={info.appearancePatentCount}
- onChange={e => {
- this.setState({
- info: Object.assign(info, {
- appearancePatentCount: e,
- })
- })
- }}
- cursor={-1}
- />
- <AtInput
- name='softwareWorksCount'
- title='软著'
- type='number'
- value={info.softwareWorksCount}
- onChange={e => {
- this.setState({
- info: Object.assign(info, {
- softwareWorksCount: e,
- })
- })
- }}
- cursor={-1}
- />
- <View style={{ display: 'flex', margin: '12rpx 0' }}>
- <Text style={{ fontSize: '32rpx', marginRight: '16rpx', width: '172rpx' }}>标准</Text>
- <RadioGroup title="标准" onChange={e => {
- info.standard = Number(e.target.value);
- this.setState({ info });
- }}>
- <Label className='radio-list__label'>
- <Radio className='radio-list__radio' value={1} checked={info.standard == 1}>有</Radio>
- </Label>
- <Label className='radio-list__label'>
- <Radio className='radio-list__radio' value={0} checked={!dtails.info}>无</Radio>
- </Label>
- </RadioGroup>
- </View>
- <AtInput
- name='otherCount'
- title='其他'
- type='number'
- value={info.otherCount}
- onChange={e => {
- this.setState({
- info: Object.assign(info, {
- otherCount: e,
- })
- })
- }}
- cursor={-1}
- />
- </View>
- }
- {
- upType == 5 &&
- <View>
- <AtSearchBar
- placeholder="请输入项目名称"
- showActionButton
- value={this.state.value}
- onChange={this.onSearchChange}
- onActionClick={() => {
- this.getBusinessProjectByName(this.state.value);
- }}
- onClear={() => {
- this.setState({
- value: "",
- }, () => { this.getBusinessProjectByName(this.state.value) });
- }}
- cursor={-1}
- />
- {/* 高新项目 */}
- {this.state.checkProject.length && this.state.checkProject[0].cSort == 9 ? <View style={{ backgroundColor: '#eee', padding: '20rpx 24rpx', margin: '24rpx' }}>
- <RadioGroup onChange={e => {
- const { info } = this.state;
- info.examineStatus = e.target.value;
- this.setState({ info });
- }}>
- <Label className='radio-list__label'>
- <Radio className='radio-list__radio' checked={info.examineStatus == 1} value={1}>初次审核</Radio>
- </Label>
- <Label className='radio-list__label'>
- <Radio className='radio-list__radio' checked={info.examineStatus == 2} value={2}>复审</Radio>
- </Label>
- </RadioGroup>
- {this.state.info.examineStatus == 2 && <View>
- <Text>复审年份:</Text>
- <Text style={{ textDecoration: 'underline' }} onClick={() => this.handleOpenMultiplePicker('examineStatusOther')}>{info.examineStatusOther || '请选择'}</Text>
- </View>}
- </View> : null}
- {/* 会员项目 */}
- {this.state.checkProject.length && this.state.checkProject[0].cSort == 6 ? <View style={{ backgroundColor: '#eee', padding: '20rpx 24rpx', margin: '24rpx' }}>
- <RadioGroup onChange={e => {
- const { info } = this.state;
- info.buyStatus = e.target.value;
- this.setState({ info });
- }}>
- <Label className='radio-list__label'>
- <Radio className='radio-list__radio' checked={info.buyStatus == 1} value={1}>新购</Radio>
- </Label>
- <Label className='radio-list__label'>
- <Radio className='radio-list__radio' checked={info.buyStatus == 2} value={2}>复购/复审</Radio>
- </Label>
- </RadioGroup>
- {this.state.info.buyStatus == 2 && <View>
- <Text>复购/复审年份:</Text>
- <Text style={{ textDecoration: 'underline' }} onClick={() => this.handleOpenMultiplePicker('buyStatusOther')}>{info.buyStatusOther || '请选择'}</Text>
- </View>}
- </View> : null}
- {this.state.isOpened && <View style={{ height: '550rpx', overflow: 'auto' }}>
- <RadioGroup onChange={e => {
- let currProject = this.state.allProjectList.find(item => item.id == e.target.value);
- this.setState({
- checkOptions: [e.target.value],
- checkProject: [currProject]
- });
- }}>
- {this.state.options.map((item, i) => {
- return (
- <View>
- <Label className='radio-list__label' for={i} key={i}>
- <Radio className='radio-list__radio' value={item.value} checked={this.state.checkOptions.indexOf(item.value) > -1}>{item.label}</Radio>
- </Label>
- </View>
- )
- })}
- </RadioGroup>
- </View>}
- </View>
- }
- </AtModalContent>
- <AtModalAction>
- <Button type='secondary' onClick={() => {
- this.setState({
- isOpened: false,
- checkOptions: [],
- checkProject: []
- })
- }}>取消</Button>
- <Button type='primary' onClick={this.update}>确定修改</Button>
- </AtModalAction>
- </AtModal>
- <AtModal
- isOpened={this.state.isAdd}
- onClose={() => {
- this.setState({
- isAdd: false
- })
- }}
- >
- <AtModalHeader>联系人</AtModalHeader>
- <AtModalContent>
- {
- userList.map((item) =>
- <View key={item.id} className="additem">
- <Text className="txt">{item.name || " "}</Text>
- <Text className="txt">{item.position || " "}</Text>
- <Text className="txt">{item.department || " "}</Text>
- <Text className="mobile">{item.mobile || " "}</Text>
- <View
- className={item.major == 1 ? "bts" : "bt"}
- onClick={() => {
- item.major != 1 && this.updateMainContact(item.id)
- }}
- >
- {item.major == 1 ? "已选" : "选择"}
- </View>
- </View>
- )
- }
- <AtInput
- required
- name='name'
- title='姓名'
- type='text'
- placeholder='请填写姓名'
- value={obj.name}
- onChange={e => {
- this.setState({
- obj: Object.assign(obj, {
- name: e,
- })
- })
- }}
- cursor={-1}
- />
- <AtInput
- required
- name='position'
- title='职位'
- type='text'
- placeholder='请填写职位'
- value={obj.position}
- onChange={e => {
- this.setState({
- obj: Object.assign(obj, {
- position: e,
- })
- })
- }}
- cursor={-1}
- />
- <AtInput
- required
- name='department'
- title='部门'
- type='text'
- placeholder='请填写部门'
- value={obj.department}
- onChange={e => {
- console.log(e)
- this.setState({
- obj: Object.assign(obj, {
- department: e,
- })
- })
- }}
- cursor={-1}
- />
- <AtInput
- required
- name='mobile'
- title='手机'
- type='phone'
- placeholder='请填写手机号'
- value={obj.mobile}
- onChange={e => {
- this.setState({
- obj: Object.assign(obj, {
- mobile: e,
- })
- })
- }}
- cursor={-1}
- />
- </AtModalContent>
- <AtModalAction>
- <Button type='secondary'
- onClick={() => {
- this.setState({
- isAdd: false,
- }, () => {
- this.queryByUidAll()
- })
- }}>取消</Button>
- <Button type='primary' onClick={this.add}>保存</Button>
- </AtModalAction>
- </AtModal>
- {/* 新增项目 */}
- <AtModal
- isOpened={this.state.addItemShow}
- onClose={this.handleCloseAddItemDialog}
- >
- <AtModalHeader>新增对外投资控股的企业</AtModalHeader>
- <AtModalContent>
- <AtInput
- required
- name='companyName'
- title='企业名称'
- placeholder='请输入企业名称'
- value={this.state.addItemInputVal}
- onChange={value => this.setState({ addItemInputVal: value })}
- cursor={-1}
- />
- </AtModalContent>
- <AtModalAction>
- <Button type='secondary' onClick={this.handleCloseAddItemDialog}>取消</Button>
- <Button type='primary' onClick={this.handleAddItemSave}>保存</Button>
- </AtModalAction>
- </AtModal>
- {/* 多选框 */}
- <CheckboxPicker
- isOpened={this.state.multiplePickerShow}
- title={this.state.multiplePickerTitle}
- options={this.state.multiplePickerOptions}
- checkedList={this.state.multiplePickerCheckedList}
- onClose={() => { this.setState({ multiplePickerShow: false, multiplePickerCheckedList: [] }) }}
- onConfirm={this.handleMultipleConfirm}
- ></CheckboxPicker>
- {/* 沟通情况历史记录 */}
- <InterviewHisList
- isOpened={this.state.interactShow}
- list={this.state.interactList}
- type={this.state.interactShowType}
- title={this.state.interactTitle}
- onClose={() => {
- this.setState({ interactShow: false })
- }}
- />
- {/* 省市区选择器 */}
- <AddressPicker
- value={this.state.currAddress}
- pickerShow={this.state.addressPickerShow}
- onHandleToggleShow={this.toggleAddressPicker.bind(this)}
- />
- <CustomerProjectSelect
- isOpened={this.state.checkCompShow}
- title="选择对外关联的控股企业"
- checkedList={this.state.checkCompList}
- onClose={() => { this.setState({ checkCompShow: false, checkCompList: [] }) }}
- onConfirm={this.handleCheckCompConfirm.bind(this)}
- />
- </View>
- );
- }
- }
- export default CustomerProfile;
|