index.jsx 75 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930
  1. import React, { Component } from "react";
  2. import { View, Input, Button, Text, Picker, RadioGroup, Label, Radio } from "@tarojs/components";
  3. import Taro, { getCurrentInstance } from "@tarojs/taro";
  4. import { getProvince } from '../../utils/tools/index'
  5. import {
  6. AtSearchBar,
  7. AtCheckbox,
  8. AtTextarea,
  9. AtModal,
  10. AtModalHeader,
  11. AtModalContent,
  12. AtModalAction,
  13. AtInput,
  14. AtIcon,
  15. AtButton,
  16. AtTag,
  17. AtRadio,
  18. AtInputNumber
  19. } from "taro-ui";
  20. import Skeleton from "taro-skeleton";
  21. import {
  22. queryByUidAll,
  23. updateUserDate,
  24. updateUser,
  25. addOneContact,
  26. findCustomerContacts,
  27. updateMainContact,
  28. limitUser,
  29. getBusinessProjectByName,
  30. } from "../../utils/servers/servers";
  31. import "./index.less";
  32. import "taro-ui/dist/style/components/icon.scss";
  33. import "taro-ui/dist/style/components/textarea.scss";
  34. import "taro-ui/dist/style/components/modal.scss";
  35. import "taro-ui/dist/style/components/timeline.scss";
  36. import "taro-ui/dist/style/components/calendar.scss";
  37. import "taro-ui/dist/style/components/input.scss";
  38. import "taro-ui/dist/style/components/checkbox.scss";
  39. import "taro-ui/dist/style/components/search-bar.scss";
  40. import "taro-ui/dist/style/components/tag.scss";
  41. import MessageNoticebar from "../../components/common/messageNoticebar";
  42. import { industry, channelTypeList } from '../../utils/tools/config';
  43. import { getChannel } from "../../utils/tools";
  44. import Superior from "../../components/common/superior";
  45. import CheckboxPicker from "../../components/common/CheckboxPicker";
  46. import AddressPicker from "../../components/common/addressPicker"
  47. import InteractList from "./components/InteractList";
  48. class CustomerProfile extends Component {
  49. $instance = getCurrentInstance();
  50. constructor(props) {
  51. super(props);
  52. this.state = {
  53. upType: -1,
  54. isOpened: false,
  55. dtails: {},
  56. info: {},
  57. sector: {},
  58. isAdd: false,
  59. obj: {},
  60. userList: [],
  61. options: [],
  62. checkOptions: [],
  63. isSuperior: false,
  64. channe: {},
  65. isMask: false,
  66. addressPickerShow: false,
  67. region: [],
  68. customItem: [],
  69. multiplePickerShow: false,
  70. multiplePickerTitle: '',
  71. multiplePickerType: '',
  72. multiplePickerOptions: [],
  73. multiplePickerCheckedList: [],
  74. addItemShow: false,
  75. addItemType: '',
  76. addItemTitle: '',
  77. addItemInputVal: '',
  78. interactShow: false,
  79. interactShowType: '',
  80. interactTitle: '',
  81. interactList: []
  82. };
  83. this.queryByUidAll = this.queryByUidAll.bind(this);
  84. this.update = this.update.bind(this);
  85. this.add = this.add.bind(this);
  86. this.getUserList = this.getUserList.bind(this);
  87. this.getBusinessProjectByName = this.getBusinessProjectByName.bind(this);
  88. this.onSearchChange = this.onSearchChange.bind(this);
  89. this.handleOpenMultiplePicker = this.handleOpenMultiplePicker.bind(this);
  90. this.handleMultipleConfirm = this.handleMultipleConfirm.bind(this);
  91. this.handleAddItemSave = this.handleAddItemSave.bind(this);
  92. this.handleCloseAddItemDialog = this.handleCloseAddItemDialog.bind(this);
  93. }
  94. componentDidMount() {
  95. this.setState({
  96. isMask: false
  97. })
  98. this.queryByUidAll();
  99. if (!this.isLogin()) {
  100. Taro.setStorageSync('currentPage', `/pages/customerProfile/index?id=${this.$instance.router.params.id}`)
  101. }
  102. }
  103. toggleAddressPicker(e) {
  104. const addressIds = getProvince(e.province, e.city, e.area);
  105. const { dtails } = this.state;
  106. dtails.locationProvince = addressIds[0];
  107. dtails.locationProvinceName = e.province;
  108. dtails.locationCity = addressIds[1];
  109. dtails.locationCityName = e.city;
  110. dtails.locationArea = addressIds[2];
  111. dtails.locationAreaName = e.area;
  112. this.setState({ dtails, addressPickerShow: false });
  113. }
  114. handleOpenMultiplePicker(type) {
  115. let multiplePickerOptions = [];
  116. let multiplePickerTitle = '';
  117. let multiplePickerCheckedList = [];
  118. const { dtails } = this.state;
  119. switch (type) {
  120. case 'industry':
  121. // 企业所属行业
  122. multiplePickerOptions = industry;
  123. multiplePickerCheckedList = !!dtails.industry ? dtails.industry.toString().split(',') : [];
  124. multiplePickerTitle = '请选择企业所属行业';
  125. break;
  126. case 'externalInvestIndustry':
  127. // 对外投资控股的行业
  128. multiplePickerOptions = industry;
  129. multiplePickerCheckedList = !!dtails.externalInvestIndustry ? dtails.externalInvestIndustry.toString().split(',') : [];
  130. multiplePickerTitle = '请选择对外投资控股的行业';
  131. break;
  132. default:
  133. break;
  134. }
  135. this.setState({
  136. multiplePickerShow: true,
  137. multiplePickerType: type,
  138. multiplePickerTitle,
  139. multiplePickerOptions,
  140. multiplePickerCheckedList: multiplePickerCheckedList.map(item => Number(item))
  141. })
  142. }
  143. handleMultipleConfirm(selectedIds, selectedLabels) {
  144. const { multiplePickerType, dtails } = this.state;
  145. switch (multiplePickerType) {
  146. case "industry":
  147. // 企业所属行业
  148. dtails.industry = selectedIds.join(',');
  149. dtails.industryName = selectedLabels.join('、');
  150. break;
  151. case "externalInvestIndustry":
  152. // 对外投资控股的行业
  153. dtails.externalInvestIndustry = selectedIds.join(',');
  154. dtails.externalInvestIndustryName = selectedLabels.join('、');
  155. break;
  156. default:
  157. break;
  158. }
  159. this.setState({ dtails })
  160. }
  161. bindRegionChange (e) {
  162. console.log('picker发送选择改变,携带值为', e.detail.value)
  163. this.setState({
  164. region: e.detail.value
  165. })
  166. }
  167. isLogin() {
  168. return !!Taro.getStorageSync('userInfor');
  169. }
  170. onShareAppMessage() {
  171. this.limitUser();
  172. return {
  173. title: "客户档案",
  174. path: "/pages/customerProfile/index?id=" + this.$instance.router.params.id,
  175. };
  176. }
  177. // 客户档案详情
  178. queryByUidAll() {
  179. queryByUidAll(
  180. this.$instance.router.params.notRequired,
  181. { id: this.$instance.router.params.id, }
  182. )
  183. .then((v) => {
  184. if (v.error.length === 0) {
  185. this.setState({
  186. dtails: {
  187. ...v.data,
  188. companyCount: v.data.companyCount || 0,
  189. socialSecurityCount: v.data.socialSecurityCount || 0,
  190. externalInvestCount: v.data.externalInvestCount || 0,
  191. financialRevenue: v.data.financialRevenue || 0,
  192. financialTax: v.data.financialTax || 0,
  193. financialProperty: v.data.financialProperty || 0,
  194. financialRd: v.data.financialRd || 0,
  195. earlyCommunication: '',
  196. customerDemand: '',
  197. interviewIdeas: '',
  198. interviewPurpose: '',
  199. interviewRecommend: '',
  200. interviewFeedback: '',
  201. followUpPlan: ''
  202. }
  203. })
  204. } else {
  205. setTimeout(() => {
  206. Taro.navigateBack({
  207. delta: 1
  208. })
  209. }, 1800);
  210. Taro.showToast({
  211. title: v.error[0].message,
  212. icon: "none",
  213. duration: 1800,
  214. });
  215. }
  216. })
  217. .catch((err) => {
  218. Taro.showToast({ title: "系统错误,请稍后再试", icon: "none" });
  219. });
  220. }
  221. validParams(params) {
  222. let flag = true;
  223. let message = '';
  224. if (!params.locationProvince) {
  225. message = '请选择企业所在地省市区';
  226. flag = false;
  227. } else if (!params.industry) {
  228. message = '请选择企业所属行业';
  229. flag = false;
  230. } else if (!params.businessScope) {
  231. message = '主营产品不能为空';
  232. flag = false;
  233. } else if (params.companyCount === '' || params.companyCount === undefined || params.companyCount === null) {
  234. message = '请输入母/子公司数';
  235. flag = false;
  236. } else if (params.socialSecurityCount === '' || params.socialSecurityCount === undefined || params.socialSecurityCount === null) {
  237. message = '请输入社保人数';
  238. flag = false;
  239. } else if (params.externalInvestCount === '' || params.externalInvestCount === undefined || params.externalInvestCount === null) {
  240. message = '请输入对外投资控股的企业数';
  241. flag = false;
  242. } else if (params.financialRevenue === '' || params.financialRevenue === undefined || params.financialRevenue === null) {
  243. message = '请输入营收数据';
  244. flag = false;
  245. } else if (params.financialTax === '' || params.financialTax === undefined || params.financialTax === null) {
  246. message = '请输入税收数据';
  247. flag = false;
  248. } else if (params.financialProperty === '' || params.financialProperty === undefined || params.financialProperty === null) {
  249. message = '请输入资产数据';
  250. flag = false;
  251. } else if (params.financialRd === '' || params.financialRd === undefined || params.financialRd === null) {
  252. message = '请输入研发费用';
  253. flag = false;
  254. } else if (!params.externalInvestIndustry) {
  255. message = '请选择对外投资控股的行业';
  256. flag = false;
  257. } else if (!params.externalInvestName) {
  258. message = '请选择对外投资控股的企业';
  259. flag = false;
  260. } else if (!params.earlyCommunication || (params.earlyCommunication && params.earlyCommunication.length < 20)) {
  261. message = '请输入客户的难处,并且在20字以上';
  262. flag = false;
  263. } else if (!params.customerDemand || (params.customerDemand && params.customerDemand.length < 20)) {
  264. message = '请输入客户的需求,并且在20字以上';
  265. flag = false;
  266. } else if (!params.interviewIdeas || (params.interviewIdeas && params.interviewIdeas.length < 20)) {
  267. message = '请输入面谈思路,并且在20字以上';
  268. flag = false;
  269. } else if (!params.interviewPurpose || (params.interviewPurpose && params.interviewPurpose.length < 20)) {
  270. message = '请输入面谈达成的目的,并且在20字以上';
  271. flag = false;
  272. } else if (!params.interviewRecommend || (params.interviewRecommend && params.interviewRecommend.length < 20)) {
  273. message = '请输入经理/上级面谈建议,并且在20字以上';
  274. flag = false;
  275. } else {
  276. if (this.state.dtails.interviewList.length) {
  277. if (!params.interviewFeedback || (params.interviewFeedback && params.interviewFeedback.length < 20)) {
  278. message = '请输入面谈后的反馈,并且在20字以上';
  279. flag = false;
  280. } else if (!params.followUpPlan || (params.followUpPlan && params.followUpPlan.length < 20)) {
  281. message = '请输入后续跟进计划,并且在20字以上';
  282. flag = false;
  283. }
  284. }
  285. }
  286. return { flag, message };
  287. }
  288. onSaveAllData() {
  289. const { dtails } = this.state;
  290. const params = {
  291. id: dtails.id,
  292. uid: dtails.uid,
  293. industry: dtails.industry,
  294. industryName: dtails.industryName,
  295. earlyCommunication: dtails.earlyCommunication,
  296.     customerDemand: dtails.customerDemand,
  297.     interviewIdeas: dtails.interviewIdeas,
  298.     interviewPurpose: dtails.interviewPurpose,
  299.     interviewRecommend: dtails.interviewRecommend,
  300.     interviewFeedback: dtails.interviewFeedback,
  301.     followUpPlan: dtails.followUpPlan,
  302.     patentCount: dtails.patentCount,
  303.     inventionPatentCount: dtails.inventionPatentCount,
  304.     utilityModelCount: dtails.utilityModelCount,
  305.     appearancePatentCount: dtails.appearancePatentCount,
  306.     softwareWorksCount: dtails.softwareWorksCount,
  307.     otherCount: dtails.otherCount,
  308.     financialData: dtails.financialData,
  309.     companyCount: dtails.companyCount,
  310.     socialSecurityCount: dtails.socialSecurityCount,
  311.     externalInvestCount: dtails.externalInvestCount,
  312.     externalInvestIndustry: dtails.externalInvestIndustry,
  313. externalInvestIndustryName: dtails.externalInvestIndustryName,
  314. externalInvestId: '0,0',
  315.     externalInvestName: dtails.externalInvestName,
  316.     financialRevenue: dtails.financialRevenue,
  317.     financialTax: dtails.financialTax,
  318.     financialProperty: dtails.financialProperty,
  319.     financialRd: dtails.financialRd,
  320. locationProvince: dtails.locationProvince,
  321. locationProvinceName: dtails.locationProvinceName,
  322. locationCity: dtails.locationCity,
  323. locationCityName: dtails.locationCityName,
  324. locationArea: dtails.locationArea,
  325. locationAreaName: dtails.locationAreaName,
  326. standard: dtails.standard,
  327. businessScope: dtails.businessScope
  328. };
  329. for (let key in params) {
  330. if (params[key] === undefined || params[key] === 'undefined' || params[key] === null || params[key] === 'null') {
  331. delete params[key];
  332. }
  333. }
  334. const { flag, message } = this.validParams(params);
  335. if (!flag) {
  336. Taro.showToast({
  337. title: message,
  338. icon: "none",
  339. });
  340. return;
  341. }
  342. updateUser(params).then((v) => {
  343. if (v.error.length === 0) {
  344. Taro.showToast({
  345. title: "修改成功",
  346. });
  347. setTimeout(() => {
  348. //表示回到上一页面
  349. Taro.navigateBack({
  350. delta: 1
  351. });
  352. }, 1000)
  353. } else {
  354. Taro.showToast({
  355. title: v.error[0].message,
  356. icon: "none",
  357. });
  358. }
  359. })
  360. }
  361. // 修改客户档案
  362. update() {
  363. // const { upType, info } = this.state
  364. // console.log(info)
  365. // let tipList = [
  366. // { key: "inventionPatentCount", value: "请填写发明专利数" },
  367. // { key: "utilityModelCount", value: "请填写实用新型数" },
  368. // { key: "appearancePatentCount", value: "请填写外观专利数" },
  369. // { key: "softwareWorksCount", value: "请填写软著数" },
  370. // { key: "otherCount", value: "请填写其他数量" },
  371. // { key: "financialData", value: "请填写财务数据" },
  372. // { key: "earlyCommunication", value: "请填写前期沟通" },
  373. // { key: "interviewIdeas", value: "请填写面谈思路及目的" },
  374. // { key: "interviewDistribution", value: "请填写主要面谈人及分工" },
  375. // { key: "enterpriseCount", value: "请填写覆盖企业数" },
  376. // { key: "channelIndicators", value: "请填写渠道考核指标" },
  377. // ]
  378. // if (!info.id) {
  379. // delete info.id
  380. // }
  381. // for (let i in info) {
  382. // if (!info[i] && info[i] !== 0) {
  383. // for (var j = 0; j < tipList.length; j++) {
  384. // if (tipList[j].key == i) {
  385. // Taro.showToast({
  386. // title: tipList[j].value,
  387. // icon: "none",
  388. // });
  389. // }
  390. // }
  391. // return
  392. // } else if (info[i] == 0) {
  393. // if (i == "channelType") {
  394. // Taro.showToast({
  395. // title: "请选择渠道类型",
  396. // icon: "none",
  397. // });
  398. // return
  399. // }
  400. // }
  401. // if ((i == "financialData" || i == "earlyCommunication" || i == "interviewIdeas" || i == "interviewDistribution")
  402. // && info[i].length < 20) {
  403. // Taro.showToast({
  404. // title: "至少20字以上",
  405. // icon: "none",
  406. // });
  407. // return
  408. // }
  409. // }
  410. // updateUserDate(upType, info).then((v) => {
  411. // if (v.error.length === 0) {
  412. // Taro.showToast({
  413. // title: "修改成功",
  414. // });
  415. // this.setState({
  416. // isOpened: false
  417. // })
  418. // this.queryByUidAll()
  419. // } else {
  420. // Taro.showToast({
  421. // title: v.error[0].message,
  422. // icon: "none",
  423. // });
  424. // }
  425. // }).catch(() => {
  426. // })
  427. this.setState({ isOpened: false, dtails: { ...this.state.dtails, ...this.state.info } })
  428. }
  429. // 新建联系人
  430. add() {
  431. let data = this.state.obj
  432. for (let i in data) {
  433. if (!data[i] && data[i] !== 0) {
  434. Taro.showToast({
  435. title: "请完善信息",
  436. icon: "none",
  437. });
  438. return
  439. } else if (i == "mobile") {
  440. if (!(/^1[3-9]\d{9}$/.test(data[i]))) {
  441. Taro.showToast({
  442. title: "请输入正确地手机号",
  443. icon: "none",
  444. });
  445. return
  446. }
  447. }
  448. }
  449. data.major = 1
  450. addOneContact(data).then((v) => {
  451. if (v.error.length === 0) {
  452. Taro.showToast({
  453. title: "添加成功",
  454. });
  455. this.setState({
  456. isAdd: false
  457. })
  458. this.queryByUidAll()
  459. } else {
  460. Taro.showToast({
  461. title: v.error[0].message,
  462. icon: "none",
  463. });
  464. }
  465. }).catch(() => {
  466. })
  467. }
  468. // 项目列表
  469. getBusinessProjectByName(val) {
  470. getBusinessProjectByName({
  471. businessName: val || "",
  472. })
  473. .then((v) => {
  474. if (v.error.length === 0) {
  475. let theArr = [];
  476. if (v.data.length > 0) {
  477. for (let i = 0; i < v.data.length; i++) {
  478. let thisdata = v.data[i];
  479. theArr.push({
  480. value: thisdata.bname,
  481. label: thisdata.bname,
  482. });
  483. };
  484. }
  485. this.setState({
  486. options: theArr
  487. })
  488. } else {
  489. Taro.showToast({ title: v.error[0].message, icon: "none" });
  490. }
  491. })
  492. .catch((err) => {
  493. Taro.showToast({ title: "系统错误,请稍后再试", icon: "none" });
  494. });
  495. }
  496. onSearchChange(value) {
  497. this.setState({
  498. value,
  499. });
  500. }
  501. getUserList() {
  502. findCustomerContacts({
  503. uid: this.$instance.router.params.id,
  504. })
  505. .then((v) => {
  506. if (v.error.length === 0) {
  507. this.setState({
  508. userList: v.data || []
  509. })
  510. } else {
  511. Taro.showToast({ title: v.error[0].message, icon: "none" });
  512. }
  513. })
  514. .catch((err) => {
  515. Taro.showToast({ title: "系统错误,请稍后再试", icon: "none" });
  516. });
  517. }
  518. updateMainContact(id) {
  519. updateMainContact({
  520. uid: this.$instance.router.params.id,
  521. ocbId: id,
  522. }).then((v) => {
  523. if (v.error.length === 0) {
  524. Taro.showToast({
  525. title: "设置成功",
  526. });
  527. this.getUserList()
  528. } else {
  529. Taro.showToast({
  530. title: v.error[0].message,
  531. icon: "none",
  532. });
  533. }
  534. }).catch(() => {
  535. })
  536. }
  537. limitUser() {
  538. limitUser({
  539. uid: this.$instance.router.params.id,
  540. // hours: 1,
  541. }).then((v) => {
  542. if (v.error.length === 0) {
  543. } else {
  544. Taro.showToast({
  545. title: v.error[0].message,
  546. icon: "none",
  547. });
  548. }
  549. }).catch(() => {
  550. })
  551. }
  552. addItemDialog(type) {
  553. let title;
  554. switch (type) {
  555. case 'externalInvestName':
  556. // 对外投资控股的企业名称
  557. title = '添加对外投资控股的企业名称';
  558. break;
  559. default:
  560. break;
  561. }
  562. this.setState({ addItemShow: true, addItemType: type, addItemTitle: title });
  563. }
  564. handleCloseAddItemDialog() {
  565. this.setState({ addItemShow: false, addItemType: '', addItemInputVal: '' });
  566. }
  567. handleAddItemSave() {
  568. switch (this.state.addItemType) {
  569. case 'externalInvestName':
  570. const { dtails } = this.state;
  571. let externalInvestName = this.state.dtails.externalInvestName || '';
  572. let externalInvestNameArr = externalInvestName.split('、').filter(item => !!item);
  573. externalInvestNameArr.push(this.state.addItemInputVal);
  574. dtails.externalInvestName = externalInvestNameArr.join('、');
  575. this.setState({ dtails }, () => {
  576. this.handleCloseAddItemDialog();
  577. });
  578. break;
  579. default:
  580. break;
  581. }
  582. }
  583. openInteractHis(type) {
  584. console.log(this.state.dtails)
  585. let interactTitle;
  586. let interactList = this.state.dtails.interviewList;
  587. switch (type) {
  588. case 'earlyCommunication':
  589. interactTitle = '客户的难处历史记录';
  590. break;
  591. case 'customerDemand':
  592. interactTitle = '客户的需求历史记录';
  593. break;
  594. case 'interviewIdeas':
  595. interactTitle = '面谈思路历史记录';
  596. break;
  597. case 'interviewPurpose':
  598. interactTitle = '面谈达成的目的历史记录';
  599. break;
  600. case 'interviewRecommend':
  601. interactTitle = '经理/上级面谈建议历史记录';
  602. break;
  603. case 'interviewFeedback':
  604. interactTitle = '面谈后反馈历史记录';
  605. interactList = interactList.slice(1, interactList.length);
  606. break;
  607. case 'followUpPlan':
  608. interactTitle = '后续跟进计划历史记录';
  609. interactList = interactList.slice(1, interactList.length);
  610. break;
  611. default:
  612. break;
  613. }
  614. this.setState({
  615. interactShow: true,
  616. interactShowType: type,
  617. interactTitle,
  618. interactList
  619. });
  620. }
  621. render() {
  622. const { dtails, upType, info, obj, userList } = this.state;
  623. return (
  624. <View className="customerProfile">
  625. <MessageNoticebar />
  626. <View
  627. className="titleContent"
  628. >
  629. {Object.keys(dtails).length === 0 ? (
  630. <Skeleton
  631. title
  632. row={3}
  633. animateName="elastic"
  634. avatarShape="square"
  635. loading
  636. />
  637. ) : (
  638. <View className="content">
  639. <View className="name">
  640. <Text style={{ width: "80%" }}>
  641. <Text className="bod">{dtails.nickname}&nbsp;&nbsp;</Text>
  642. <Text style={{ fontSize: "12px", color: ["red", "green"][dtails.signBills] }}>{["未签单", "已签单"][dtails.signBills]}</Text>
  643. </Text>
  644. {dtails.myUser == 1 && <Button className="share" plain type='primary' open-type="share">分享</Button>}
  645. {/* <View className="share">分享</View> */}
  646. </View>
  647. <View className="button">
  648. <View className="but"
  649. onClick={e => {
  650. e.stopPropagation()
  651. this.setState({
  652. isSuperior: true
  653. })
  654. }}
  655. >上级指导</View>
  656. {
  657. this.state.isSuperior &&
  658. <Superior
  659. id={dtails.uid}
  660. userNames={dtails.nickname}
  661. isOpinion={this.state.isSuperior}
  662. isFill={dtails.myUser == 0}
  663. onClose={() => {
  664. this.setState({
  665. isSuperior: false
  666. })
  667. }}
  668. />
  669. }
  670. <View className="but"
  671. onClick={e => {
  672. e.stopPropagation()
  673. Taro.navigateTo({
  674. url: "/pages/situation/index?id=" + this.$instance.router.params.id + "&notRequired=" + this.$instance.router.params.notRequired,
  675. });
  676. }}
  677. >公出记录</View>
  678. </View>
  679. <View className="row">
  680. <View className="code">{dtails.orgCode}</View>
  681. <View className="time">{dtails.createTime}</View>
  682. </View>
  683. {
  684. dtails.newChannel == 1
  685. ?
  686. <View className="first">
  687. <View className="tit">
  688. 已知渠道情况
  689. {
  690. dtails.myUser == 1 &&
  691. <View className="up"
  692. onClick={e => {
  693. e.stopPropagation()
  694. this.setState({
  695. upType: 7,
  696. isOpened: true,
  697. info: {
  698. uid: this.$instance.router.params.id,
  699. channelType: dtails.channelType,
  700. enterpriseCount: dtails.enterpriseCount,
  701. channelIndicators: dtails.channelIndicators,
  702. },
  703. channe: {
  704. id: dtails.channelType,
  705. title: getChannel(dtails.channelType)
  706. }
  707. })
  708. }}
  709. >修改</View>
  710. }
  711. </View>
  712. <View className="val">渠道类别:{getChannel(dtails.channelType)}</View>
  713. <View className="val">渠道企业数:{dtails.enterpriseCount}</View>
  714. <View className="val">渠道考核指标:{dtails.channelIndicators}</View>
  715. <View className="tit">
  716. <Text>
  717. 联系人
  718. <Text className="txt">(面谈人)</Text>
  719. </Text>
  720. {
  721. dtails.myUser == 1 &&
  722. <View className="up"
  723. onClick={e => {
  724. e.stopPropagation()
  725. this.getUserList();
  726. this.setState({
  727. isAdd: true,
  728. obj: {
  729. uid: this.$instance.router.params.id,
  730. name: "",
  731. position: "",
  732. department: "",
  733. mobile: "",
  734. }
  735. })
  736. }}
  737. >新增</View>
  738. }
  739. </View>
  740. {
  741. !!dtails.contactList && dtails.contactList.map((v, k) =>
  742. <View className="val" key={k}>{v.name}&nbsp;&nbsp;{v.position}&nbsp;&nbsp;{v.department}&nbsp;&nbsp;{v.mobile}</View>
  743. )
  744. }
  745. </View>
  746. :
  747. <View className="first">
  748. <View className="title">企业面谈思路表</View>
  749. <View className="val" style={{ display: 'flex' }}>
  750. 企业所在地省市区:
  751. {/* <Picker
  752. mode='region'
  753. value={this.state.region}
  754. customItem={this.state.customItem}
  755. onChange={this.bindRegionChange.bind(this)}
  756. >
  757. <View className='picker'>
  758. { this.state.region.length ? this.state.region.join('-') : '请选择' }
  759. </View>
  760. </Picker> */}
  761. <View onClick={() => {this.setState({ addressPickerShow: true })}}>
  762. { dtails.locationProvince ? `${dtails.locationProvinceName}-${dtails.locationCityName}-${dtails.locationAreaName}` : '请选择' }
  763. </View>
  764. <AddressPicker
  765. pickerShow={this.state.addressPickerShow}
  766. onHandleToggleShow={this.toggleAddressPicker.bind(this)}
  767. />
  768. </View>
  769. {/* <View className="tit">
  770. 企业面谈思路表
  771. {
  772. dtails.myUser == 1 &&
  773. <View className="up"
  774. onClick={e => {
  775. e.stopPropagation()
  776. this.setState({
  777. upType: 0,
  778. isOpened: true,
  779. info: {
  780. uid: this.$instance.router.params.id,
  781. industry: dtails.industry,
  782. businessScope: dtails.businessScope,
  783. },
  784. sector: {
  785. id: dtails.industry,
  786. title: dtails.industryName
  787. }
  788. })
  789. }}
  790. >修改</View>
  791. }
  792. </View> */}
  793. <View className="val" style={{display: 'flex'}}>
  794. 企业所属行业:
  795. <View onClick={() => this.handleOpenMultiplePicker('industry')}>
  796. { this.state.dtails.industryName || '请选择' }
  797. </View>
  798. </View>
  799. <View className="val" style={{display: 'flex', alignItems: 'center'}}>
  800. 主营产品:
  801. <View style={{flex: 1}}>
  802. <AtInput
  803. value={dtails.businessScope}
  804. name='businessScope'
  805. placeholder='可填写多个,用“、”隔开'
  806. size='mini'
  807. onChange={value => {
  808. dtails.businessScope = value;
  809. this.setState({ dtails })
  810. }}
  811. />
  812. </View>
  813. </View>
  814. <View className="val" style={{ display: 'flex', alignItems: 'center' }}>
  815. 母/子公司数:
  816. <View style={{width: '120rpx'}}>
  817. <AtInputNumber
  818. min={0}
  819. max={99999}
  820. value={dtails.companyCount}
  821. name='companyCount'
  822. type='number'
  823. placeholder='请输入数量'
  824. size='mini'
  825. onChange={value => {
  826. dtails.companyCount = value;
  827. this.setState({ dtails })
  828. }}
  829. />
  830. </View>
  831. </View>
  832. <View className="val" style={{ display: 'flex', alignItems: 'center' }}>
  833. 社保人数:
  834. <View style={{width: '120rpx'}}>
  835. <AtInputNumber
  836. min={0}
  837. max={99999}
  838. value={dtails.socialSecurityCount}
  839. name='socialSecurityCount'
  840. type='number'
  841. placeholder='请输入数量'
  842. size='mini'
  843. onChange={value => {
  844. dtails.socialSecurityCount = value;
  845. this.setState({ dtails })
  846. }}
  847. />
  848. </View>
  849. </View>
  850. <View className="val" style={{ display: 'flex', alignItems: 'center' }}>
  851. 对外投资控股的企业数:
  852. <View style={{width: '120rpx'}}>
  853. <AtInputNumber
  854. min={0}
  855. max={99999}
  856. value={dtails.externalInvestCount}
  857. name='externalInvestCount'
  858. type='number'
  859. placeholder='请输入数量'
  860. size='mini'
  861. onChange={value => {
  862. dtails.externalInvestCount = value;
  863. this.setState({ dtails })
  864. }}
  865. />
  866. </View>
  867. </View>
  868. <View className="val" style={{display: 'flex'}}>
  869. 对外投资控股的行业:
  870. <View onClick={() => this.handleOpenMultiplePicker('externalInvestIndustry')}>
  871. { this.state.dtails.externalInvestIndustryName || '请选择' }
  872. </View>
  873. </View>
  874. <View className="val" style={{display: 'flex'}}>
  875. 对外投资控股的企业名称:
  876. <View onClick={() => this.addItemDialog('externalInvestName')}>
  877. { this.state.dtails.externalInvestName || '点击新增' }
  878. </View>
  879. </View>
  880. <View className="tit">
  881. <Text>
  882. 主要面谈联系信息
  883. {/* <Text className="txt">(面谈人)</Text> */}
  884. </Text>
  885. {
  886. dtails.myUser == 1 &&
  887. <View className="up"
  888. onClick={e => {
  889. e.stopPropagation()
  890. this.getUserList();
  891. this.setState({
  892. isAdd: true,
  893. obj: {
  894. uid: this.$instance.router.params.id,
  895. name: "",
  896. position: "",
  897. department: "",
  898. mobile: "",
  899. }
  900. })
  901. }}
  902. >新增</View>
  903. }
  904. </View>
  905. {
  906. !!dtails.contactList && dtails.contactList.map((v, k) =>
  907. <View className="val" key={k}>
  908. {v.name}&nbsp;&nbsp;{v.position}&nbsp;&nbsp;{v.department}&nbsp;&nbsp;{v.mobile}
  909. {this.state.isMask && <View className="mask"></View>}
  910. </View>
  911. )
  912. }
  913. <View className="tit">
  914. 本次面谈项目
  915. {
  916. dtails.myUser == 1 &&
  917. <View className="up"
  918. onClick={e => {
  919. e.stopPropagation()
  920. this.getBusinessProjectByName("")
  921. this.setState({
  922. upType: 5,
  923. isOpened: true,
  924. info: {
  925. uid: this.$instance.router.params.id,
  926. intendedProject: dtails.intendedProject,
  927. },
  928. checkOptions: !!dtails.intendedProject ? dtails.intendedProject.split(",") : []
  929. })
  930. }}
  931. >新增</View>
  932. }
  933. </View>
  934. <View className="val">{dtails.intendedProject || "无"}</View>
  935. <View style={{marginTop: '60rpx'}}>
  936. <View className="title">面谈已知企业情况</View>
  937. <View className="tit">
  938. <Text>
  939. 1.知识产权情况
  940. <Text className="txt">(专利信息、标准、专利、软著)</Text>
  941. </Text>
  942. {
  943. dtails.myUser == 1 &&
  944. <View className="up"
  945. onClick={e => {
  946. e.stopPropagation()
  947. this.setState({
  948. upType: 1,
  949. isOpened: true,
  950. info: {
  951. uid: this.$instance.router.params.id,
  952. id: dtails.id,
  953. inventionPatentCount: dtails.inventionPatentCount || 0,
  954. utilityModelCount: dtails.utilityModelCount || 0,
  955. appearancePatentCount: dtails.appearancePatentCount || 0,
  956. softwareWorksCount: dtails.softwareWorksCount || 0,
  957. otherCount: dtails.otherCount || 0,
  958. }
  959. })
  960. }}
  961. >修改</View>
  962. }
  963. </View>
  964. <View className="val">
  965. 专利&nbsp;<Text className="num">{dtails.patentCount || 0}</Text>&nbsp;&nbsp;&nbsp;
  966. 其中发明专利&nbsp;<Text className="num">{dtails.inventionPatentCount || 0}</Text>&nbsp;&nbsp;&nbsp;
  967. 实用新型&nbsp;<Text className="num">{dtails.utilityModelCount || 0}</Text>&nbsp;&nbsp;&nbsp;
  968. 外观设计&nbsp;<Text className="num">{dtails.appearancePatentCount || 0}</Text>&nbsp;&nbsp;&nbsp;
  969. 软著&nbsp;<Text className="num">{dtails.softwareWorksCount || 0}</Text>&nbsp;&nbsp;&nbsp;
  970. 标准&nbsp;<Text className="num">{dtails.standard == 1 ? '有' : '无'}</Text>&nbsp;&nbsp;&nbsp;
  971. 其他类型&nbsp;<Text className="num">{dtails.otherCount || 0}</Text>&nbsp;&nbsp;&nbsp;
  972. </View>
  973. <View className="tit">2.财务数据</View>
  974. <View className="val" style={{display: 'flex', alignItems: 'center'}}>
  975. 营收(万元):
  976. <View style={{width: '120rpx'}}>
  977. <AtInputNumber
  978. min={0}
  979. max={99999}
  980. value={dtails.financialRevenue}
  981. name='financialRevenue'
  982. type='number'
  983. placeholder='请输入数量'
  984. size='mini'
  985. onChange={value => {
  986. dtails.financialRevenue = value;
  987. this.setState({ dtails })
  988. }}
  989. />
  990. </View>
  991. </View>
  992. <View className="val" style={{display: 'flex', alignItems: 'center'}}>
  993. 税收(万元):
  994. <View style={{width: '120rpx'}}>
  995. <AtInputNumber
  996. min={0}
  997. max={99999}
  998. value={dtails.financialTax}
  999. name='financialTax'
  1000. type='number'
  1001. placeholder='请输入数量'
  1002. size='mini'
  1003. onChange={value => {
  1004. dtails.financialTax = value;
  1005. this.setState({ dtails })
  1006. }}
  1007. />
  1008. </View>
  1009. </View>
  1010. <View className="val" style={{display: 'flex', alignItems: 'center'}}>
  1011. 资产(万元):
  1012. <View style={{width: '120rpx'}}>
  1013. <AtInputNumber
  1014. min={0}
  1015. max={99999}
  1016. value={dtails.financialProperty}
  1017. name='financialProperty'
  1018. type='number'
  1019. placeholder='请输入数量'
  1020. size='mini'
  1021. onChange={value => {
  1022. dtails.financialProperty = value;
  1023. this.setState({ dtails })
  1024. }}
  1025. />
  1026. </View>
  1027. </View>
  1028. <View className="val" style={{display: 'flex', alignItems: 'center'}}>
  1029. 研发费用(万元):
  1030. <View style={{width: '120rpx'}}>
  1031. <AtInputNumber
  1032. min={0}
  1033. max={99999}
  1034. value={dtails.financialRd}
  1035. name='financialRd'
  1036. type='number'
  1037. placeholder='请输入数量'
  1038. size='mini'
  1039. onChange={value => {
  1040. dtails.financialRd = value;
  1041. this.setState({ dtails })
  1042. }}
  1043. />
  1044. </View>
  1045. </View>
  1046. <View className="tit">3.前期沟通情况</View>
  1047. <View className="tit">
  1048. <Text>
  1049. 客户的难处
  1050. <Text className="txt">(20字以上)</Text>
  1051. </Text>
  1052. { dtails.interviewList.length ? (
  1053. <AtIcon value='clock' size='20' color='#1E90FF' onClick={() => this.openInteractHis('earlyCommunication')}></AtIcon>
  1054. ) : null }
  1055. </View>
  1056. <View className="val">
  1057. <AtTextarea
  1058. value={dtails.earlyCommunication}
  1059. maxLength={200}
  1060. placeholder='请编写本次面谈客户难处~'
  1061. height={70}
  1062. onChange={value => {
  1063. dtails.earlyCommunication = value;
  1064. this.setState({ dtails });
  1065. }}
  1066. />
  1067. </View>
  1068. <View className="tit">
  1069. <Text>
  1070. 客户的需求
  1071. <Text className="txt">(20字以上)</Text>
  1072. </Text>
  1073. { dtails.interviewList.length ? (
  1074. <AtIcon value='clock' size='20' color='#1E90FF' onClick={() => this.openInteractHis('customerDemand')}></AtIcon>
  1075. ) : null }
  1076. </View>
  1077. <View className="val">
  1078. <AtTextarea
  1079. value={dtails.customerDemand}
  1080. maxLength={200}
  1081. placeholder='请编写本次面谈客户需求~'
  1082. height={70}
  1083. onChange={value => {
  1084. dtails.customerDemand = value;
  1085. this.setState({ dtails });
  1086. }}
  1087. />
  1088. </View>
  1089. <View className="tit">
  1090. <Text>
  1091. 面谈思路
  1092. <Text className="txt">(20字以上)</Text>
  1093. </Text>
  1094. { dtails.interviewList.length ? (
  1095. <AtIcon value='clock' size='20' color='#1E90FF' onClick={() => this.openInteractHis('interviewIdeas')}></AtIcon>
  1096. ) : null }
  1097. </View>
  1098. <View className="val">
  1099. <AtTextarea
  1100. value={dtails.interviewIdeas}
  1101. maxLength={200}
  1102. placeholder='请编写本次面谈客户思路~'
  1103. height={70}
  1104. onChange={value => {
  1105. dtails.interviewIdeas = value;
  1106. this.setState({ dtails });
  1107. }}
  1108. />
  1109. </View>
  1110. <View className="tit">
  1111. <Text>
  1112. 面谈达成的目的
  1113. <Text className="txt">(20字以上)</Text>
  1114. </Text>
  1115. { dtails.interviewList.length ? (
  1116. <AtIcon value='clock' size='20' color='#1E90FF' onClick={() => this.openInteractHis('interviewPurpose')}></AtIcon>
  1117. ) : null }
  1118. </View>
  1119. <View className="val">
  1120. <AtTextarea
  1121. value={dtails.interviewPurpose}
  1122. maxLength={200}
  1123. placeholder='请编写本次面谈达成的目的~'
  1124. height={70}
  1125. onChange={value => {
  1126. dtails.interviewPurpose = value;
  1127. this.setState({ dtails });
  1128. }}
  1129. />
  1130. </View>
  1131. <View className="tit">
  1132. <Text>
  1133. 经理/上级面谈建议
  1134. <Text className="txt">(由经理/上级口述,本人整理,20字以上)</Text>
  1135. </Text>
  1136. { dtails.interviewList.length ? (
  1137. <AtIcon value='clock' size='20' color='#1E90FF' onClick={() => this.openInteractHis('interviewRecommend')}></AtIcon>
  1138. ) : null }
  1139. </View>
  1140. <View className="val">
  1141. <AtTextarea
  1142. value={dtails.interviewRecommend}
  1143. maxLength={200}
  1144. placeholder='请编写本次面谈建议~'
  1145. height={70}
  1146. onChange={value => {
  1147. dtails.interviewRecommend = value;
  1148. this.setState({ dtails });
  1149. }}
  1150. />
  1151. </View>
  1152. { dtails.interviewList && dtails.interviewList.length ? (
  1153. <>
  1154. <View className="tit">
  1155. <Text>
  1156. 面谈后的反馈
  1157. <Text className="txt">(20字以上)</Text>
  1158. </Text>
  1159. <AtIcon value='clock' size='20' color='#1E90FF' onClick={() => this.openInteractHis('interviewFeedback')}></AtIcon>
  1160. </View>
  1161. <View className="val">
  1162. <AtTextarea
  1163. value={dtails.interviewFeedback}
  1164. maxLength={200}
  1165. placeholder='请编写本次面谈后的反馈~'
  1166. height={70}
  1167. onChange={value => {
  1168. dtails.interviewFeedback = value;
  1169. this.setState({ dtails });
  1170. }}
  1171. />
  1172. </View>
  1173. <View className="tit">
  1174. <Text>
  1175. 后续跟进计划
  1176. <Text className="txt">(20字以上)</Text>
  1177. </Text>
  1178. <AtIcon value='clock' size='20' color='#1E90FF' onClick={() => this.openInteractHis('followUpPlan')}></AtIcon>
  1179. </View>
  1180. <View className="val">
  1181. <AtTextarea
  1182. value={dtails.followUpPlan}
  1183. maxLength={200}
  1184. placeholder='请编写后续跟进计划~'
  1185. height={70}
  1186. onChange={value => {
  1187. dtails.followUpPlan = value;
  1188. this.setState({ dtails });
  1189. }}
  1190. />
  1191. </View>
  1192. </>
  1193. ) : null }
  1194. <AtButton type="primary" onClick={this.onSaveAllData.bind(this)}>保存</AtButton>
  1195. </View>
  1196. </View>
  1197. }
  1198. {/* {
  1199. dtails.newChannel == 1
  1200. ?
  1201. <View className="two">
  1202. <View className="title">面谈前渠道情况</View>
  1203. <View className="tit">
  1204. <Text>
  1205. 面谈项目
  1206. </Text>
  1207. {
  1208. dtails.myUser == 1 &&
  1209. <View className="up"
  1210. onClick={e => {
  1211. e.stopPropagation()
  1212. this.getBusinessProjectByName("")
  1213. this.setState({
  1214. upType: 5,
  1215. isOpened: true,
  1216. info: {
  1217. uid: this.$instance.router.params.id,
  1218. intendedProject: dtails.intendedProject,
  1219. },
  1220. checkOptions: !!dtails.intendedProject ? dtails.intendedProject.split(",") : []
  1221. })
  1222. }}
  1223. >修改</View>
  1224. }
  1225. </View>
  1226. <View className="val">{dtails.intendedProject || "无"}</View>
  1227. <View className="tit">
  1228. <Text>
  1229. 面谈思路及目的
  1230. </Text>
  1231. {
  1232. dtails.myUser == 1 &&
  1233. <View className="up"
  1234. onClick={e => {
  1235. e.stopPropagation()
  1236. this.setState({
  1237. upType: 4,
  1238. isOpened: true,
  1239. info: {
  1240. uid: this.$instance.router.params.id,
  1241. id: dtails.id,
  1242. interviewIdeas: dtails.interviewIdeas,
  1243. }
  1244. })
  1245. }}
  1246. >修改</View>
  1247. }
  1248. </View>
  1249. <View className="val">{dtails.interviewIdeas || "无"}</View>
  1250. <View className="tit">
  1251. <Text>
  1252. 我方主要面谈人及分工
  1253. </Text>
  1254. {
  1255. dtails.myUser == 1 &&
  1256. <View className="up"
  1257. onClick={e => {
  1258. e.stopPropagation()
  1259. this.setState({
  1260. upType: 6,
  1261. isOpened: true,
  1262. info: {
  1263. uid: this.$instance.router.params.id,
  1264. id: dtails.id,
  1265. interviewDistribution: dtails.interviewDistribution,
  1266. }
  1267. })
  1268. }}
  1269. >修改</View>
  1270. }
  1271. </View>
  1272. <View className="val">{dtails.interviewDistribution || "无"}</View>
  1273. </View>
  1274. :
  1275. <View className="two">
  1276. <View className="title">面谈企业情况</View>
  1277. <AtInput
  1278. name='mzgssl'
  1279. title='母/子公司数'
  1280. type='number'
  1281. placeholder='请输入数量'
  1282. />
  1283. <AtInput
  1284. name='sbrs'
  1285. title=''
  1286. type='number'
  1287. placeholder='请输入数量'
  1288. size='mini'
  1289. />
  1290. <AtInput
  1291. name='qyes'
  1292. title='对外投资控股的企业数'
  1293. type='number'
  1294. placeholder='请输入数量'
  1295. />
  1296. <View className="tit">
  1297. <Text>
  1298. 知识产权情况
  1299. <Text className="txt">(专利信息、标准、专利、软著)</Text>
  1300. </Text>
  1301. {
  1302. dtails.myUser == 1 &&
  1303. <View className="up"
  1304. onClick={e => {
  1305. e.stopPropagation()
  1306. this.setState({
  1307. upType: 1,
  1308. isOpened: true,
  1309. info: {
  1310. uid: this.$instance.router.params.id,
  1311. id: dtails.id,
  1312. inventionPatentCount: dtails.inventionPatentCount || 0,
  1313. utilityModelCount: dtails.utilityModelCount || 0,
  1314. appearancePatentCount: dtails.appearancePatentCount || 0,
  1315. softwareWorksCount: dtails.softwareWorksCount || 0,
  1316. otherCount: dtails.otherCount || 0,
  1317. }
  1318. })
  1319. }}
  1320. >修改</View>
  1321. }
  1322. </View>
  1323. <View className="val">
  1324. 专利&nbsp;<Text className="num">{dtails.patentCount || 0}</Text>&nbsp;&nbsp;&nbsp;
  1325. 其中发明专利&nbsp;<Text className="num">{dtails.inventionPatentCount || 0}</Text>&nbsp;&nbsp;&nbsp;
  1326. 实用新型&nbsp;<Text className="num">{dtails.utilityModelCount || 0}</Text>&nbsp;&nbsp;&nbsp;
  1327. 外观设计&nbsp;<Text className="num">{dtails.appearancePatentCount || 0}</Text>&nbsp;&nbsp;&nbsp;
  1328. 软著&nbsp;<Text className="num">{dtails.softwareWorksCount || 0}</Text>&nbsp;&nbsp;&nbsp;
  1329. 标准&nbsp;<Text className="num">{'有'}</Text>&nbsp;&nbsp;&nbsp;
  1330. 其他类型&nbsp;<Text className="num">{dtails.otherCount || 0}</Text>&nbsp;&nbsp;&nbsp;
  1331. </View>
  1332. <View className="tit">
  1333. <Text>
  1334. 财务数据
  1335. <Text className="txt">(包括营收、税收、资产、研发费用等)</Text>
  1336. </Text>
  1337. {
  1338. dtails.myUser == 1 &&
  1339. <View className="up"
  1340. onClick={e => {
  1341. e.stopPropagation()
  1342. this.setState({
  1343. upType: 2,
  1344. isOpened: true,
  1345. info: {
  1346. uid: this.$instance.router.params.id,
  1347. id: dtails.id,
  1348. financialData: dtails.financialData,
  1349. }
  1350. })
  1351. }}
  1352. >修改</View>
  1353. }
  1354. </View>
  1355. <View className="val">{dtails.financialData || "无"}</View>
  1356. <View className="tit">
  1357. <Text>
  1358. 前期沟通
  1359. <Text className="txt">(客户的难处、需求)</Text>
  1360. </Text>
  1361. {
  1362. dtails.myUser == 1 &&
  1363. <View className="up"
  1364. onClick={e => {
  1365. e.stopPropagation()
  1366. this.setState({
  1367. upType: 3,
  1368. isOpened: true,
  1369. info: {
  1370. uid: this.$instance.router.params.id,
  1371. id: dtails.id,
  1372. earlyCommunication: dtails.earlyCommunication,
  1373. }
  1374. })
  1375. }}
  1376. >修改</View>
  1377. }
  1378. </View>
  1379. <View className="val">{dtails.earlyCommunication || "无"}</View>
  1380. <View className="tit">
  1381. <Text>
  1382. 面谈思路及目的
  1383. </Text>
  1384. {
  1385. dtails.myUser == 1 &&
  1386. <View className="up"
  1387. onClick={e => {
  1388. e.stopPropagation()
  1389. this.setState({
  1390. upType: 4,
  1391. isOpened: true,
  1392. info: {
  1393. uid: this.$instance.router.params.id,
  1394. id: dtails.id,
  1395. interviewIdeas: dtails.interviewIdeas,
  1396. }
  1397. })
  1398. }}
  1399. >修改</View>
  1400. }
  1401. </View>
  1402. <View className="val">{dtails.interviewIdeas || "无"}</View>
  1403. </View>
  1404. } */}
  1405. </View>
  1406. )}
  1407. </View>
  1408. <AtModal
  1409. isOpened={this.state.isOpened}
  1410. onClose={() => {
  1411. this.setState({
  1412. isOpened: false
  1413. })
  1414. }}
  1415. >
  1416. <AtModalHeader>信息修改</AtModalHeader>
  1417. <AtModalContent>
  1418. {
  1419. upType == 0 &&
  1420. <View>
  1421. <View className='selectTitle'>企业行业</View>
  1422. <Picker
  1423. value={this.state.sector.id}
  1424. range={industry} rangeKey='title' mode='selector'
  1425. onChange={(e) => {
  1426. this.setState({
  1427. sector: industry[e.detail.value],
  1428. info: Object.assign(info, {
  1429. industry: industry[e.detail.value].id,
  1430. })
  1431. })
  1432. }}>
  1433. <View style={{ marginBottom: "10px", color: !this.state.sector.title && "#CCCCCC" }}>
  1434. {!this.state.sector.title ? "请选择" : this.state.sector.title}
  1435. </View>
  1436. </Picker>
  1437. <View className='selectTitle'>企业主营产品/服务</View>
  1438. <Input
  1439. // name='value'
  1440. // title='企业主营产品/服务'
  1441. type='text'
  1442. placeholder='请用,符号隔开关键字'
  1443. value={info.businessScope}
  1444. onInput={e => {
  1445. this.setState({
  1446. info: Object.assign(info, {
  1447. businessScope: e.detail.value,
  1448. })
  1449. })
  1450. }}
  1451. />
  1452. </View>
  1453. }
  1454. {
  1455. upType == 1 &&
  1456. <View>
  1457. <AtInput
  1458. name='inventionPatentCount'
  1459. title='发明专利'
  1460. type='number'
  1461. value={info.inventionPatentCount}
  1462. onChange={e => {
  1463. this.setState({
  1464. info: Object.assign(info, {
  1465. inventionPatentCount: e,
  1466. })
  1467. })
  1468. }}
  1469. />
  1470. <AtInput
  1471. name='utilityModelCount'
  1472. title='实用新型'
  1473. type='number'
  1474. value={info.utilityModelCount}
  1475. onChange={e => {
  1476. this.setState({
  1477. info: Object.assign(info, {
  1478. utilityModelCount: e,
  1479. })
  1480. })
  1481. }}
  1482. />
  1483. <AtInput
  1484. name='appearancePatentCount'
  1485. title='外观专利'
  1486. type='number'
  1487. value={info.appearancePatentCount}
  1488. onChange={e => {
  1489. this.setState({
  1490. info: Object.assign(info, {
  1491. appearancePatentCount: e,
  1492. })
  1493. })
  1494. }}
  1495. />
  1496. <AtInput
  1497. name='softwareWorksCount'
  1498. title='软著'
  1499. type='number'
  1500. value={info.softwareWorksCount}
  1501. onChange={e => {
  1502. this.setState({
  1503. info: Object.assign(info, {
  1504. softwareWorksCount: e,
  1505. })
  1506. })
  1507. }}
  1508. />
  1509. <View style={{display: 'flex', margin: '12rpx 0'}}>
  1510. <Text style={{ fontSize: '32rpx', marginRight: '16rpx', width: '172rpx' }}>标准</Text>
  1511. <RadioGroup title="标准" onChange={e => {
  1512. dtails.standard = Number(e.target.value);
  1513. this.setState({ dtails });
  1514. }}>
  1515. <Label className='radio-list__label'>
  1516. <Radio className='radio-list__radio' value={1} checked={dtails.standard == 1}>有</Radio>
  1517. </Label>
  1518. <Label className='radio-list__label'>
  1519. <Radio className='radio-list__radio' value={0} checked={!dtails.standard}>无</Radio>
  1520. </Label>
  1521. </RadioGroup>
  1522. </View>
  1523. <AtInput
  1524. name='otherCount'
  1525. title='其他'
  1526. type='number'
  1527. value={dtails.otherCount}
  1528. onChange={e => {
  1529. this.setState({
  1530. info: Object.assign(dtails, {
  1531. otherCount: e,
  1532. })
  1533. })
  1534. }}
  1535. />
  1536. </View>
  1537. }
  1538. {
  1539. upType == 2 &&
  1540. <View>
  1541. <View className='selectTitle'>财务数据</View>
  1542. <AtTextarea
  1543. value={info.financialData || ""}
  1544. onChange={e => {
  1545. this.setState({
  1546. info: Object.assign(info, {
  1547. financialData: e,
  1548. }),
  1549. })
  1550. }}
  1551. maxLength={200}
  1552. placeholder='请填写财务数据~'
  1553. />
  1554. </View>
  1555. }
  1556. {
  1557. upType == 3 &&
  1558. <View>
  1559. <View className='selectTitle'>前期沟通</View>
  1560. <AtTextarea
  1561. value={info.earlyCommunication || ""}
  1562. onChange={e => {
  1563. this.setState({
  1564. info: Object.assign(info, {
  1565. earlyCommunication: e,
  1566. }),
  1567. })
  1568. }}
  1569. maxLength={200}
  1570. placeholder='请填写前期沟通~'
  1571. />
  1572. </View>
  1573. }
  1574. {
  1575. upType == 4 &&
  1576. <View>
  1577. <View className='selectTitle'>面谈思路及目的</View>
  1578. <AtTextarea
  1579. value={info.interviewIdeas || ""}
  1580. onChange={e => {
  1581. this.setState({
  1582. info: Object.assign(info, {
  1583. interviewIdeas: e,
  1584. }),
  1585. })
  1586. }}
  1587. maxLength={200}
  1588. placeholder='请填写面谈思路及目的~'
  1589. />
  1590. </View>
  1591. }
  1592. {
  1593. upType == 5 &&
  1594. <View>
  1595. <AtSearchBar
  1596. placeholder="请输入项目名称"
  1597. showActionButton
  1598. value={this.state.value}
  1599. onChange={this.onSearchChange}
  1600. onActionClick={() => {
  1601. this.getBusinessProjectByName(this.state.value);
  1602. }}
  1603. onClear={() => {
  1604. this.setState({
  1605. value: "",
  1606. }, () => { this.getBusinessProjectByName(this.state.value) });
  1607. }}
  1608. />
  1609. {
  1610. this.state.checkOptions.length > 0 &&
  1611. <View className="selproject">
  1612. 已选择:
  1613. {
  1614. this.state.checkOptions.map((v, i) =>
  1615. <View className="selptxt" key={i}
  1616. onClick={() => {
  1617. let list = this.state.checkOptions
  1618. for (var j = 0; j < list.length; j++) {
  1619. if (list[j] == v) {
  1620. list.splice(j, 1)
  1621. this.setState({
  1622. checkOptions: list,
  1623. info: Object.assign(info, {
  1624. intendedProject: list.toString(),
  1625. }),
  1626. })
  1627. }
  1628. }
  1629. }}
  1630. >{v}&nbsp;<AtIcon className='atIcon' value='close-circle' size='12' color='#fff' /></View>
  1631. )
  1632. }
  1633. </View>
  1634. }
  1635. <AtCheckbox
  1636. options={this.state.options}
  1637. selectedList={this.state.checkOptions}
  1638. onChange={e => {
  1639. this.setState({
  1640. checkOptions: e,
  1641. info: Object.assign(info, {
  1642. intendedProject: e.toString(),
  1643. }),
  1644. })
  1645. }}
  1646. />
  1647. </View>
  1648. }
  1649. {
  1650. upType == 6 &&
  1651. <View>
  1652. <View className='selectTitle'>我方主要面谈人及分工</View>
  1653. <AtTextarea
  1654. value={info.interviewDistribution || ""}
  1655. onChange={e => {
  1656. this.setState({
  1657. info: Object.assign(info, {
  1658. interviewDistribution: e,
  1659. }),
  1660. })
  1661. }}
  1662. maxLength={200}
  1663. placeholder='请填写我方主要面谈人及分工~'
  1664. />
  1665. </View>
  1666. }
  1667. {
  1668. upType == 7 &&
  1669. <View>
  1670. <View className='selectTitle' style={{ height: "30px" }}>
  1671. 渠道类别:
  1672. <Picker
  1673. value={this.state.channe.id}
  1674. range={channelTypeList} rangeKey='title' mode='selector'
  1675. onChange={(e) => {
  1676. this.setState({
  1677. channe: channelTypeList[e.detail.value],
  1678. info: Object.assign(info, {
  1679. channelType: channelTypeList[e.detail.value].id,
  1680. })
  1681. })
  1682. }}>
  1683. <View style={{ marginBottom: "10px", width: "160px", color: !this.state.channe.title && "#CCCCCC" }}>
  1684. {!this.state.channe.title ? "请选择" : this.state.channe.title}
  1685. </View>
  1686. </Picker>
  1687. </View>
  1688. <View className='selectTitle' style={{ height: "30px" }}>
  1689. 覆盖企业数:
  1690. <Input
  1691. style={{ width: "50%" }}
  1692. type='number'
  1693. placeholder='请填写个数'
  1694. value={info.enterpriseCount}
  1695. onInput={e => {
  1696. this.setState({
  1697. info: Object.assign(info, {
  1698. enterpriseCount: e.detail.value,
  1699. })
  1700. })
  1701. }}
  1702. />
  1703. </View>
  1704. <View className='selectTitle' >渠道考核指标</View>
  1705. <AtTextarea
  1706. value={info.channelIndicators || ""}
  1707. onChange={e => {
  1708. this.setState({
  1709. info: Object.assign(info, {
  1710. channelIndicators: e,
  1711. }),
  1712. })
  1713. }}
  1714. maxLength={200}
  1715. placeholder='请填写渠道考核指标~'
  1716. />
  1717. </View>
  1718. }
  1719. </AtModalContent>
  1720. <AtModalAction>
  1721. <Button type='secondary' onClick={() => { this.setState({ isOpened: false }) }}>取消</Button>
  1722. <Button type='primary' onClick={this.update}>确定修改</Button>
  1723. </AtModalAction>
  1724. </AtModal>
  1725. <AtModal
  1726. isOpened={this.state.isAdd}
  1727. onClose={() => {
  1728. this.setState({
  1729. isAdd: false
  1730. })
  1731. }}
  1732. >
  1733. <AtModalHeader>联系人</AtModalHeader>
  1734. <AtModalContent>
  1735. {
  1736. userList.map((item) =>
  1737. <View key={item.id} className="additem">
  1738. <Text className="txt">{item.name || " "}</Text>
  1739. <Text className="txt">{item.position || " "}</Text>
  1740. <Text className="txt">{item.department || " "}</Text>
  1741. <Text className="mobile">{item.mobile || " "}</Text>
  1742. <View
  1743. className={item.major == 1 ? "bts" : "bt"}
  1744. onClick={() => {
  1745. item.major != 1 && this.updateMainContact(item.id)
  1746. }}
  1747. >
  1748. {item.major == 1 ? "已选" : "选择"}
  1749. </View>
  1750. </View>
  1751. )
  1752. }
  1753. <AtInput
  1754. required
  1755. name='name'
  1756. title='姓名'
  1757. type='text'
  1758. placeholder='请填写姓名'
  1759. value={obj.name}
  1760. onChange={e => {
  1761. this.setState({
  1762. obj: Object.assign(obj, {
  1763. name: e,
  1764. })
  1765. })
  1766. }}
  1767. />
  1768. <AtInput
  1769. required
  1770. name='position'
  1771. title='职位'
  1772. type='text'
  1773. placeholder='请填写职位'
  1774. value={obj.position}
  1775. onChange={e => {
  1776. this.setState({
  1777. obj: Object.assign(obj, {
  1778. position: e,
  1779. })
  1780. })
  1781. }}
  1782. />
  1783. <AtInput
  1784. required
  1785. name='department'
  1786. title='部门'
  1787. type='text'
  1788. placeholder='请填写部门'
  1789. value={obj.department}
  1790. onChange={e => {
  1791. this.setState({
  1792. obj: Object.assign(obj, {
  1793. department: e,
  1794. })
  1795. })
  1796. }}
  1797. />
  1798. <AtInput
  1799. required
  1800. name='mobile'
  1801. title='手机'
  1802. type='phone'
  1803. placeholder='请填写手机号'
  1804. value={obj.mobile}
  1805. onChange={e => {
  1806. this.setState({
  1807. obj: Object.assign(obj, {
  1808. mobile: e,
  1809. })
  1810. })
  1811. }}
  1812. />
  1813. </AtModalContent>
  1814. <AtModalAction>
  1815. <Button type='secondary'
  1816. onClick={() => {
  1817. this.setState({
  1818. isAdd: false
  1819. }, () => {
  1820. this.queryByUidAll()
  1821. })
  1822. }}>取消</Button>
  1823. <Button type='primary' onClick={this.add}>保存</Button>
  1824. </AtModalAction>
  1825. </AtModal>
  1826. <AtModal
  1827. isOpened={this.state.addItemShow}
  1828. onClose={this.handleCloseAddItemDialog}
  1829. >
  1830. <AtModalHeader>新增对外投资控股的企业</AtModalHeader>
  1831. <AtModalContent>
  1832. <AtInput
  1833. required
  1834. name='mobile'
  1835. title='企业名称'
  1836. placeholder='请输入企业名称'
  1837. value={this.state.addItemInputVal}
  1838. onChange={value => this.setState({ addItemInputVal: value })}
  1839. />
  1840. </AtModalContent>
  1841. <AtModalAction>
  1842. <Button type='secondary' onClick={this.handleCloseAddItemDialog}>取消</Button>
  1843. <Button type='primary' onClick={this.handleAddItemSave}>保存</Button>
  1844. </AtModalAction>
  1845. </AtModal>
  1846. {/* 多选框 */}
  1847. <CheckboxPicker
  1848. isOpened={this.state.multiplePickerShow}
  1849. title={this.state.multiplePickerTitle}
  1850. options={this.state.multiplePickerOptions}
  1851. checkedList={this.state.multiplePickerCheckedList}
  1852. onClose={() => {this.setState({multiplePickerShow: false})}}
  1853. onConfirm={this.handleMultipleConfirm}
  1854. ></CheckboxPicker>
  1855. {/* 沟通情况历史记录 */}
  1856. <InteractList
  1857. isOpened={this.state.interactShow}
  1858. list={this.state.interactList}
  1859. type={this.state.interactShowType}
  1860. title={this.state.interactTitle}
  1861. onClose={() => {
  1862. this.setState({ interactShow: false })
  1863. }}
  1864. />
  1865. </View>
  1866. );
  1867. }
  1868. }
  1869. export default CustomerProfile;