contactPerson.jsx 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107
  1. import React from "react";
  2. import {
  3. Table,
  4. Button,
  5. Spin,
  6. message,
  7. Popconfirm,
  8. Alert,
  9. Modal,
  10. Input,
  11. Cascader,
  12. Select,
  13. InputNumber,
  14. AutoComplete,
  15. Tag
  16. } from "antd";
  17. import $ from "jquery/src/ajax";
  18. import AddContact from "../../../customer/NEW/signCustomer/followDetail/addContact";
  19. import "./index.less";
  20. import { areaSelect, getProvince } from "@/NewDicProvinceList";
  21. const TextArea = Input.TextArea;
  22. const Option = Select.Option;
  23. const ContactPerson = React.createClass({
  24. getInitialState() {
  25. return {
  26. major: 0,
  27. loading: false,
  28. addcontactModul: false,
  29. enterpriseName: "",
  30. ContactsLists: [
  31. {
  32. title: "姓名",
  33. dataIndex: "name",
  34. key: "name",
  35. render: (text, record, index) => {
  36. if (record.id) return <div>{text}</div>;
  37. },
  38. },
  39. {
  40. title: "联系人部门",
  41. dataIndex: "department",
  42. key: "department",
  43. render: (text, record, index) => {
  44. if (record.id) return <div>{text}</div>;
  45. },
  46. },
  47. {
  48. title: "联系人职务",
  49. dataIndex: "position",
  50. key: "position",
  51. render: (text, record, index) => {
  52. if (record.id) return <div>{text}</div>;
  53. },
  54. },
  55. {
  56. title: "主要联系人",
  57. dataIndex: "major",
  58. width: 100,
  59. key: "major",
  60. render: (text) => {
  61. return text == 1 ? "是" : "否";
  62. },
  63. },
  64. {
  65. title: "地区",
  66. dataIndex: "cityName",
  67. key: "cityName",
  68. render: (text, record, index) => {
  69. if (record.id) return <div>{text}</div>;
  70. },
  71. },
  72. {
  73. title: "手机号码",
  74. dataIndex: "mobile",
  75. key: "mobile",
  76. render: (text, record, index) => {
  77. if (record.id) return <div>{text}</div>;
  78. },
  79. },
  80. {
  81. title: "座机",
  82. dataIndex: "fixedTel",
  83. key: "fixedTel",
  84. render: (text, record, index) => {
  85. if (record.id) return <div>{text}</div>;
  86. },
  87. },
  88. {
  89. title: "微信",
  90. dataIndex: "wechat",
  91. key: "wechat",
  92. render: (text, record, index) => {
  93. if (record.id) return <div>{text}</div>;
  94. },
  95. },
  96. {
  97. title: "联系人QQ",
  98. dataIndex: "qq",
  99. key: "qq",
  100. render: (text, record, index) => {
  101. if (record.id) return <div>{text}</div>;
  102. },
  103. },
  104. {
  105. title: "电子邮箱",
  106. dataIndex: "email",
  107. key: "email",
  108. render: (text, record, index) => {
  109. if (record.id) return <div>{text}</div>;
  110. },
  111. },
  112. {
  113. title: "更新时间",
  114. dataIndex: "createTimes",
  115. key: "createTimes",
  116. render: (text, record, index) => {
  117. if (record.id) return <div>{text}</div>;
  118. },
  119. },
  120. {
  121. title: "跟进人",
  122. dataIndex: "aname",
  123. key: "aname",
  124. render: (text, record, index) => {
  125. if (record.id) return <div>{text}</div>;
  126. },
  127. },
  128. {
  129. title: "操作",
  130. dataIndex: "dels",
  131. key: "dels",
  132. render: (text, record, index) => {
  133. return (
  134. !this.props.isCustomerAdmin && (
  135. <div>
  136. {/* 禁止管理员删除联系人 */}
  137. {/* {adminData.isSuperAdmin || !record.id ? (
  138. <Popconfirm
  139. title="是否删除?"
  140. onConfirm={(e) => {
  141. this.confirmDelet(record);
  142. }}
  143. okText="删除"
  144. cancelText="不删除"
  145. >
  146. <Button
  147. style={{
  148. marginRight: "10px",
  149. color: "#ffffff",
  150. background: "#f00",
  151. border: "none",
  152. }}
  153. >
  154. 删除
  155. </Button>
  156. </Popconfirm>
  157. ) : (
  158. ""
  159. )} */}
  160. {record.major != 1 ? (
  161. <Button
  162. style={{
  163. marginRight: "10px",
  164. color: "#ffffff",
  165. background: "green",
  166. border: "none",
  167. }}
  168. onClick={(e) => {
  169. e.stopPropagation(), this.mainContact(record);
  170. }}
  171. >
  172. 设为主要联系人
  173. </Button>
  174. ) : (
  175. ""
  176. )}
  177. </div>
  178. )
  179. );
  180. },
  181. },
  182. ],
  183. channeOb: [
  184. { name: "民主党派", val: 2 },
  185. { name: "园区", val: 3 },
  186. { name: "民间组织", val: 4 },
  187. { name: "战略合作单位", val: 5 },
  188. { name: "其他", val: 1 },
  189. ],
  190. visible: "", //修改弹窗状态
  191. name: "",
  192. locationProvince: "",
  193. introduction: "",
  194. newname: "",
  195. dataArrar: [],
  196. newintroduction: "",
  197. newtype: 0,
  198. enterpriseCount: 0,
  199. channelIndicators: "",
  200. cooperationProjects: [],
  201. };
  202. },
  203. //tab2删除
  204. confirmDelet(e) {
  205. this.setState({
  206. loading: true,
  207. });
  208. if (e.id) {
  209. $.ajax({
  210. method: "get",
  211. dataType: "json",
  212. crossDomain: false,
  213. url: globalConfig.context + "/api/admin/customer/deleteOneContact",
  214. data: {
  215. ocbId: e.id, //删除的ID
  216. },
  217. }).done(
  218. function (data) {
  219. if (!data.error.length) {
  220. message.success("删除成功!");
  221. this.setState({
  222. loading: false,
  223. });
  224. } else {
  225. message.warning(data.error[0].message);
  226. }
  227. this.contactLists();
  228. }.bind(this)
  229. );
  230. } else {
  231. this.contactLists();
  232. }
  233. },
  234. //选择主要联系人
  235. mainContact(record) {
  236. this.setState({
  237. loading: true,
  238. });
  239. $.ajax({
  240. method: "get",
  241. dataType: "json",
  242. crossDomain: false,
  243. url: globalConfig.context + "/api/admin/customer/updateMainContact",
  244. data: {
  245. uid: this.props.data.id,
  246. ocbId: record.id,
  247. },
  248. }).done(
  249. function (data) {
  250. if (!data.error.length) {
  251. message.success("设为主要联系人成功!");
  252. this.setState({
  253. loading: false,
  254. });
  255. } else {
  256. message.warning(data.error[0].message);
  257. }
  258. this.contactLists();
  259. }.bind(this)
  260. );
  261. this.state.contactList.forEach((item) => {
  262. item.major = 0;
  263. });
  264. record.major = 1;
  265. // console.log(record);
  266. this.setState({
  267. contactList: this.state.contactList,
  268. });
  269. },
  270. //tab2获取联系人详情
  271. contactLists(ids) {
  272. this.setState({
  273. loading: true,
  274. });
  275. $.ajax({
  276. method: "get",
  277. dataType: "json",
  278. crossDomain: false,
  279. url: globalConfig.context + "/api/admin/customer/findCustomerContacts",
  280. data: {
  281. uid: ids || this.props.data.id, //名称1
  282. },
  283. success: function (data) {
  284. let theArr = [];
  285. if (data.error.length || data.data.list == "") {
  286. if (data.error && data.error.length) {
  287. message.warning(data.error[0].message);
  288. }
  289. } else {
  290. for (let i = 0; i < data.data.length; i++) {
  291. let thisdata = data.data[i];
  292. theArr.push({
  293. key: i,
  294. id: thisdata.id,
  295. name: thisdata.name,
  296. mobile: thisdata.mobile,
  297. email: thisdata.email,
  298. qq: thisdata.qq,
  299. wechat: thisdata.wechat,
  300. department: thisdata.department,
  301. position: thisdata.position,
  302. major: thisdata.major,
  303. createTimes: thisdata.createTimes,
  304. fixedTel: thisdata.fixedTel,
  305. aname: thisdata.aname,
  306. cityName:
  307. (thisdata.provinceName || "") +
  308. (thisdata.cityName || "") +
  309. (thisdata.areaName || ""),
  310. });
  311. }
  312. }
  313. this.setState({
  314. contactList: theArr,
  315. });
  316. }.bind(this),
  317. }).always(
  318. function () {
  319. this.setState({
  320. loading: false,
  321. });
  322. }.bind(this)
  323. );
  324. },
  325. //新增
  326. //tab2新增联系人
  327. addcontact() {
  328. this.setState({
  329. addcontactModul: true,
  330. });
  331. },
  332. //
  333. componentWillMount() {
  334. const { data } = this.props
  335. this.contactLists(this.props.data.id);
  336. this.setState({
  337. name: this.props.name,
  338. locationProvince: (data.province || "") + (!data.city ? "" : "-") + (data.city || "") + (!data.area ? "" : "-") + (data.area || ""),
  339. introduction: this.props.data.introduction,
  340. type: this.props.data.type,
  341. enterpriseCount: this.props.data.enterpriseCount,
  342. channelIndicators: this.props.data.channelIndicators,
  343. intendedProject: this.props.data.intendedProject,
  344. });
  345. this.queryByUid(this.props.data.id)
  346. },
  347. componentWillReceiveProps(nextProps) {
  348. // if (nextProps.data.id && nextProps.contactState) {
  349. if (nextProps.data.id) {
  350. this.contactLists(nextProps.data.id);
  351. }
  352. },
  353. // 查询企业信息
  354. queryByUid() {
  355. this.setState({
  356. loading: true
  357. });
  358. $.ajax({
  359. method: "get",
  360. dataType: "json",
  361. crossDomain: false,
  362. url: globalConfig.context + "/api/admin/userArchives/queryByUid",
  363. data: {
  364. id: this.props.data.id,
  365. },
  366. success: function (data) {
  367. if (data.error.length || data.data.list == "") {
  368. if (data.error && data.error.length) {
  369. message.warning(data.error[0].message);
  370. }
  371. } else {
  372. this.setState({
  373. interviewDistribution: data.data.interviewDistribution,
  374. interviewIdeas: data.data.interviewIdeas,
  375. // detail: data.data
  376. })
  377. }
  378. }.bind(this)
  379. }).always(
  380. function () {
  381. this.setState({
  382. loading: false
  383. });
  384. }.bind(this)
  385. );
  386. },
  387. supervisor(value) {
  388. $.ajax({
  389. method: "get",
  390. dataType: "json",
  391. crossDomain: false,
  392. url: globalConfig.context + '/api/admin/order/getBusinessProjectByName',
  393. data: {
  394. businessName: value
  395. },
  396. success: function (data) {
  397. let thedata = data.data;
  398. if (data.error.length === 0) {
  399. this.setState({
  400. cooperationProjects: thedata,
  401. });
  402. } else {
  403. message.warning(data.error[0].message);
  404. }
  405. }.bind(this),
  406. }).always(
  407. function () {
  408. }.bind(this)
  409. );
  410. },
  411. onSelect(value) {
  412. let arr = this.state.cooperationProjects.filter(v => v.id === value);
  413. let arr1 = this.state.dataArrar.filter(v => v.value === value);
  414. if (arr.length > 0) {
  415. if (arr1.length > 0) {
  416. message.warning('选项已存在');
  417. } else {
  418. this.state.dataArrar.push({
  419. label: arr[0].bname,
  420. value: arr[0].id,
  421. })
  422. this.setState({
  423. dataArrar: this.state.dataArrar
  424. })
  425. }
  426. }
  427. },
  428. // 修改渠道名称
  429. onOk() {
  430. if (!this.state.newname) {
  431. message.warning("请输入渠道名称");
  432. return;
  433. }
  434. this.setState({
  435. loading: true,
  436. });
  437. $.ajax({
  438. url: globalConfig.context + "/api/admin/customer/updateUserName",
  439. method: "post",
  440. data: {
  441. uid: this.props.data.id,
  442. userName: this.state.newname,
  443. },
  444. }).done(
  445. function (data) {
  446. this.setState({
  447. loading: false,
  448. });
  449. if (data.error.length === 0) {
  450. message.success("恭喜您,更名成功!");
  451. this.setState({
  452. visible: "",
  453. name: this.state.newname,
  454. });
  455. } else {
  456. message.warning(data.error[0].message);
  457. }
  458. }.bind(this)
  459. );
  460. },
  461. // 修改信息
  462. updateDate() {
  463. const { dataArrar, visible, newintroduction, newtype, newenterpriseCount, newchannelIndicators, newinterviewIdeas, newinterviewDistribution } = this.state;
  464. if (dataArrar.length === 0 && visible == "city") {
  465. message.warning("请选择省-市-区");
  466. return;
  467. }
  468. if (!newintroduction && visible == "introduction") {
  469. message.warning("请输入简介");
  470. return;
  471. }
  472. if (newtype == 0 && visible == "type") {
  473. message.warning("请选择渠道类别");
  474. return;
  475. }
  476. if (!newenterpriseCount && newenterpriseCount != 0 && visible == "enterpriseCount") {
  477. message.warning("请输入渠道覆盖企业数");
  478. return;
  479. }
  480. if (!newchannelIndicators && visible == "channelIndicators") {
  481. message.warning("请输入渠道考核标准");
  482. return;
  483. }
  484. if (dataArrar.length == 0 && visible == "intendedProject") {
  485. message.warning("请输入面谈项目");
  486. return;
  487. }
  488. if (!newinterviewIdeas && visible == "interviewIdeas") {
  489. message.warning("请输入面谈思路及目的");
  490. return;
  491. }
  492. if (!newinterviewDistribution && visible == "interviewDistribution") {
  493. message.warning("请输入我方主要面谈及分工");
  494. return;
  495. }
  496. this.setState({
  497. loading: true,
  498. });
  499. let data = {
  500. uid: this.props.data.id,
  501. };
  502. if (visible == "city") {
  503. data.province = dataArrar[0] || undefined;
  504. data.city = dataArrar[1] || undefined;
  505. data.area = dataArrar[2] || undefined;
  506. }
  507. if (visible == "introduction") {
  508. data.introduction = newintroduction;
  509. }
  510. if (visible == "type") {
  511. data.channelType = newtype;
  512. }
  513. if (visible == "enterpriseCount") {
  514. data.enterpriseCount = newenterpriseCount;
  515. }
  516. if (visible == "channelIndicators") {
  517. data.channelIndicators = newchannelIndicators
  518. }
  519. if (visible == "intendedProject") {
  520. let arr = [];
  521. for (let i of dataArrar) {
  522. arr.push(i.label)
  523. }
  524. data.intendedProject = arr.join(',')
  525. }
  526. if (visible == "interviewIdeas") {
  527. data.interviewIdeas = newinterviewIdeas
  528. }
  529. if (visible == "interviewDistribution") {
  530. data.interviewDistribution = newinterviewDistribution
  531. }
  532. $.ajax({
  533. url: globalConfig.context +
  534. visible == "channelIndicators"
  535. ? "/api/admin/userArchives/update" : visible == "enterpriseCount"
  536. ? "/api/admin/userArchives/update" : visible == "interviewIdeas"
  537. ? "/api/admin/userArchives/update" : visible == "interviewDistribution"
  538. ? "/api/admin/userArchives/update" : "/api/admin/customer/updateUserDate",
  539. method: "post",
  540. data: data,
  541. }).done(
  542. function (data) {
  543. this.setState({
  544. loading: false,
  545. });
  546. if (data.error.length === 0) {
  547. message.success("恭喜您,更改成功!");
  548. this.setState({
  549. visible: "",
  550. });
  551. if (visible == "city") {
  552. this.setState({
  553. locationProvince: getProvince(
  554. dataArrar[0],
  555. dataArrar[1],
  556. dataArrar[2]
  557. ),
  558. });
  559. }
  560. if (visible == "introduction") {
  561. this.setState({
  562. introduction: newintroduction,
  563. });
  564. }
  565. if (visible == "type") {
  566. this.setState({
  567. type: newtype,
  568. });
  569. }
  570. if (visible == "enterpriseCount") {
  571. this.setState({
  572. enterpriseCount: newenterpriseCount,
  573. });
  574. }
  575. if (visible == "channelIndicators") {
  576. this.setState({
  577. channelIndicators: newchannelIndicators,
  578. });
  579. }
  580. if (visible == "intendedProject") {
  581. let arr = [];
  582. for (let i of dataArrar) {
  583. arr.push(i.label)
  584. }
  585. this.setState({
  586. intendedProject: arr.join(',')
  587. })
  588. }
  589. if (visible == "interviewIdeas") {
  590. this.setState({
  591. interviewIdeas: newinterviewIdeas,
  592. });
  593. }
  594. if (visible == "interviewDistribution") {
  595. this.setState({
  596. interviewDistribution: newinterviewDistribution,
  597. });
  598. }
  599. } else {
  600. message.warning(data.error[0].message);
  601. }
  602. }.bind(this)
  603. );
  604. },
  605. handleCloseCooperation(removedTag) {
  606. let dataArrar = this.state.dataArrar.filter(tag => { return tag.value !== removedTag.value });
  607. this.setState({ dataArrar });
  608. },
  609. render() {
  610. const { visible } = this.state;
  611. return (
  612. <div>
  613. <div className="clearfix">
  614. <Alert
  615. message="注:已保存信息不可修改,可新增正确的信息并设置为主要联系人"
  616. banner
  617. />
  618. <div
  619. style={{
  620. display: "flex",
  621. flexDirection: "row",
  622. justifyContent: "space-between",
  623. margin: "30px 60px 30px 0px",
  624. }}
  625. >
  626. <div
  627. style={{
  628. fontSize: 14,
  629. fontWeight: "bold",
  630. }}
  631. >
  632. <div style={{ padding: "5px 0" }}>
  633. <span>渠道名称:{this.state.name}</span>
  634. <Button
  635. type="primary"
  636. style={{ marginLeft: "20px" }}
  637. onClick={() => {
  638. this.setState({
  639. visible: "name",
  640. newname: "",
  641. });
  642. }}
  643. >
  644. 渠道更名
  645. </Button>
  646. </div>
  647. <div style={{ padding: "5px 0" }}>
  648. <span>
  649. 渠道类别:{[
  650. "",
  651. "其他",
  652. "民主党派",
  653. "园区",
  654. "民间组织",
  655. "战略合作单位",
  656. ][this.state.type]}
  657. </span>
  658. <Button
  659. type="primary"
  660. style={{ marginLeft: "20px" }}
  661. onClick={() => {
  662. this.setState({
  663. visible: "type",
  664. newtype: "",
  665. });
  666. }}
  667. >
  668. 修改
  669. </Button>
  670. </div>
  671. <div style={{ padding: "5px 0" }}>
  672. <span>
  673. 省-市-区:
  674. {this.state.locationProvince}
  675. </span>
  676. <Button
  677. type="primary"
  678. style={{ marginLeft: "20px" }}
  679. onClick={() => {
  680. this.setState({
  681. visible: "city",
  682. dataArrar: [],
  683. });
  684. }}
  685. >
  686. 修改
  687. </Button>
  688. </div>
  689. <div style={{ padding: "5px 0" }}>
  690. <span>渠道简介:{this.state.introduction}</span>
  691. <Button
  692. type="primary"
  693. style={{ marginLeft: "20px" }}
  694. onClick={() => {
  695. this.setState({
  696. visible: "introduction",
  697. newintroduction: "",
  698. });
  699. }}
  700. >
  701. 修改
  702. </Button>
  703. </div>
  704. <div style={{ padding: "5px 0" }}>
  705. <span>渠道覆盖企业数:{this.state.enterpriseCount}</span>
  706. <Button
  707. type="primary"
  708. style={{ marginLeft: "20px" }}
  709. onClick={() => {
  710. this.setState({
  711. visible: "enterpriseCount",
  712. newenterpriseCount: "",
  713. });
  714. }}
  715. >
  716. 修改
  717. </Button>
  718. </div>
  719. <div style={{ padding: "5px 0" }}>
  720. <span>渠道考核指标:{this.state.channelIndicators}</span>
  721. <Button
  722. type="primary"
  723. style={{ marginLeft: "20px" }}
  724. onClick={() => {
  725. this.setState({
  726. visible: "channelIndicators",
  727. newchannelIndicators: "",
  728. });
  729. }}
  730. >
  731. 修改
  732. </Button>
  733. </div>
  734. </div>
  735. <Button
  736. className="ContactsList"
  737. type="primary"
  738. onClick={this.addcontact}
  739. >
  740. 新增联系人
  741. </Button>
  742. </div>
  743. </div>
  744. <div className="clearfix">
  745. <Spin spinning={this.state.loading}>
  746. <Table
  747. pagination={false}
  748. columns={this.state.ContactsLists}
  749. dataSource={this.state.contactList}
  750. />
  751. </Spin>
  752. </div>
  753. <div style={{
  754. fontSize: 14,
  755. marginTop: 20,
  756. }}>
  757. <div style={{ fontWeight: "bold", marginBottom: 5, color: "#58A3FF" }}>面谈的渠道情况</div>
  758. <div style={{ fontWeight: "bold", marginTop: 10 }}>
  759. 面谈项目&nbsp;&nbsp;&nbsp;&nbsp;
  760. {
  761. !this.props.isCustomerAdmin &&
  762. <Button
  763. type="primary"
  764. onClick={() => {
  765. this.setState({
  766. visible: "intendedProject",
  767. dataArrar: [],
  768. })
  769. }}
  770. >
  771. 修改
  772. </Button>
  773. }
  774. </div>
  775. <div style={{ fontSize: 12, }}>{this.state.intendedProject || "无"}</div>
  776. <div style={{ fontWeight: "bold", marginTop: 10 }}>
  777. 面谈思路及目的&nbsp;&nbsp;&nbsp;&nbsp;
  778. {
  779. !this.props.isCustomerAdmin &&
  780. <Button
  781. type="primary"
  782. onClick={() => {
  783. this.setState({
  784. visible: "interviewIdeas",
  785. newinterviewIdeas: "",
  786. })
  787. }}
  788. >
  789. 修改
  790. </Button>
  791. }
  792. </div>
  793. <div style={{ fontSize: 12, }}>{this.state.interviewIdeas || "无"}</div>
  794. <div style={{ fontWeight: "bold", marginTop: 10 }}>
  795. 我方主要面谈人及分工&nbsp;&nbsp;&nbsp;&nbsp;
  796. {
  797. !this.props.isCustomerAdmin &&
  798. <Button
  799. type="primary"
  800. onClick={() => {
  801. this.setState({
  802. visible: "interviewDistribution",
  803. newinterviewDistribution: "",
  804. })
  805. }}
  806. >
  807. 修改
  808. </Button>
  809. }
  810. </div>
  811. <div style={{ fontSize: 12, }}>{this.state.interviewDistribution || "无"}</div>
  812. </div>
  813. {/* 新增联系人 */}
  814. <AddContact
  815. addcontactModul={this.state.addcontactModul}
  816. uids={this.props.data.id}
  817. closeFollow={() => {
  818. this.setState(
  819. {
  820. addcontactModul: false,
  821. },
  822. () => {
  823. this.contactLists();
  824. }
  825. );
  826. }}
  827. />
  828. {/* 信息修改 */}
  829. <Modal
  830. footer={null}
  831. maskClosable={false}
  832. width={300}
  833. title={"信息修改"}
  834. visible={visible != ""}
  835. onCancel={() => {
  836. this.setState({
  837. visible: "",
  838. });
  839. }}
  840. >
  841. <div>
  842. {visible == "name" && (
  843. <div className="enterpriseNameContent">
  844. <div className="enterpriseNameItem">
  845. <div className="enterpriseNameTitle">更改前:</div>
  846. <div className="enterpriseNameValue">{this.state.name}</div>
  847. </div>
  848. <div className="enterpriseNameItem">
  849. <div className="enterpriseNameTitle">更改后:</div>
  850. <div className="enterpriseNameValue">
  851. <Input
  852. value={this.state.newname}
  853. onChange={(e) => {
  854. this.setState({
  855. newname: e.target.value,
  856. });
  857. }}
  858. />
  859. </div>
  860. </div>
  861. </div>
  862. )}
  863. {visible == "city" && (
  864. <div className="enterpriseNameContent">
  865. <div className="enterpriseNameItem">
  866. <div className="enterpriseNameTitle">更改前:</div>
  867. <div className="enterpriseNameValue">
  868. {this.state.locationProvince}
  869. </div>
  870. </div>
  871. <div className="enterpriseNameItem">
  872. <div className="enterpriseNameTitle">更改后:</div>
  873. <div className="enterpriseNameValue">
  874. <Cascader
  875. options={areaSelect()}
  876. placeholder="选择城市"
  877. onChange={(e, pre) => {
  878. this.setState({
  879. dataArrar: e,
  880. });
  881. }}
  882. />
  883. </div>
  884. </div>
  885. </div>
  886. )}
  887. {visible == "introduction" && (
  888. <div className="enterpriseNameContent">
  889. <div className="enterpriseNameItem">
  890. <div className="enterpriseNameTitle">更改前:</div>
  891. <div className="enterpriseNameValue">
  892. {this.state.introduction}
  893. </div>
  894. </div>
  895. <div className="enterpriseNameItem">
  896. <div className="enterpriseNameTitle">更改后:</div>
  897. <div className="enterpriseNameValue">
  898. <TextArea
  899. style={{ width: "200px" }}
  900. value={this.state.newintroduction}
  901. onChange={(e) => {
  902. this.setState({
  903. newintroduction: e.target.value,
  904. });
  905. }}
  906. />
  907. </div>
  908. </div>
  909. </div>
  910. )}
  911. {visible == "type" && (
  912. <div className="enterpriseNameContent">
  913. <div className="enterpriseNameItem">
  914. <div className="enterpriseNameTitle">更改前:</div>
  915. <div className="enterpriseNameValue">
  916. {[
  917. "",
  918. "其他",
  919. "民主党派",
  920. "园区",
  921. "民间组织",
  922. "战略合作单位",
  923. ][this.state.type]}</div>
  924. </div>
  925. <div className="enterpriseNameItem">
  926. <div className="enterpriseNameTitle">更改后:</div>
  927. <div className="enterpriseNameValue">
  928. <Select
  929. style={{ width: 165 }}
  930. placeholder="请选择"
  931. value={this.state.newtype == 0 ? undefined : this.state.newtype}
  932. onChange={(e) => {
  933. this.setState({
  934. newtype: e,
  935. });
  936. }}
  937. >
  938. {this.state.channeOb.map(it => (
  939. <Option key={it.val}>{it.name}</Option>
  940. ))}
  941. </Select>
  942. </div>
  943. </div>
  944. </div>
  945. )}
  946. {visible == "enterpriseCount" && (
  947. <div className="enterpriseNameContent">
  948. <div className="enterpriseNameItem">
  949. <div className="enterpriseNameTitle">更改前:</div>
  950. <div className="enterpriseNameValue">{this.state.enterpriseCount}</div>
  951. </div>
  952. <div className="enterpriseNameItem">
  953. <div className="enterpriseNameTitle">更改后:</div>
  954. <div className="enterpriseNameValue">
  955. <InputNumber
  956. value={this.state.newenterpriseCount}
  957. onChange={(e) => {
  958. this.setState({
  959. newenterpriseCount: e,
  960. });
  961. }}
  962. />
  963. </div>
  964. </div>
  965. </div>
  966. )}
  967. {visible == "channelIndicators" && (
  968. <div className="enterpriseNameContent">
  969. <div className="enterpriseNameItem">
  970. <div className="enterpriseNameTitle">更改前:</div>
  971. <div className="enterpriseNameValue">
  972. {this.state.channelIndicators}
  973. </div>
  974. </div>
  975. <div className="enterpriseNameItem">
  976. <div className="enterpriseNameTitle">更改后:</div>
  977. <div className="enterpriseNameValue">
  978. <TextArea
  979. style={{ width: "200px" }}
  980. value={this.state.newchannelIndicators}
  981. onChange={(e) => {
  982. this.setState({
  983. newchannelIndicators: e.target.value,
  984. });
  985. }}
  986. />
  987. </div>
  988. </div>
  989. </div>
  990. )}
  991. {visible == "intendedProject" && (
  992. <div className="enterpriseNameContent">
  993. <div className="enterpriseNameItem">
  994. <div className="enterpriseNameTitle">意向合作项目:</div>
  995. <div className="enterpriseNameValue">
  996. {this.state.intendedProject}
  997. </div>
  998. </div>
  999. <div className="enterpriseNameItem">
  1000. <div className="enterpriseNameTitle">更改后:</div>
  1001. <div className="enterpriseNameValue">
  1002. <div style={{ paddingBottom: this.state.dataArrar.length === 0 ? 0 : '10px' }}>
  1003. {this.state.dataArrar.map((tag, index) => {
  1004. const isLongTag = tag.label.length > 20;
  1005. const tagElem = (
  1006. <Tag closable key={tag.label} afterClose={() => this.handleCloseCooperation(tag)}>
  1007. {isLongTag ? `${tag.label.slice(0, 20)}...` : tag.label}
  1008. </Tag>
  1009. );
  1010. return isLongTag ? <Tooltip title={tag.label} key={tag.label}>{tagElem}</Tooltip> : tagElem;
  1011. })}
  1012. </div>
  1013. <div>
  1014. <AutoComplete
  1015. style={{ width: 200 }}
  1016. onSearch={this.supervisor}
  1017. onSelect={this.onSelect}
  1018. placeholder="请输入关键字"
  1019. >
  1020. {
  1021. this.state.cooperationProjects.map(function (item) {
  1022. return <Select.Option key={item.id} value={item.id}>{item.bname}</Select.Option>
  1023. })
  1024. }
  1025. </AutoComplete>
  1026. </div>
  1027. </div>
  1028. </div>
  1029. </div>
  1030. )}
  1031. {visible == "interviewIdeas" && (
  1032. <div className="enterpriseNameContent">
  1033. <div className="enterpriseNameItem">
  1034. <div className="enterpriseNameTitle">更改前:</div>
  1035. <div className="enterpriseNameValue">
  1036. {this.state.interviewIdeas}
  1037. </div>
  1038. </div>
  1039. <div className="enterpriseNameItem">
  1040. <div className="enterpriseNameTitle">更改后:</div>
  1041. <div className="enterpriseNameValue">
  1042. <TextArea
  1043. style={{ width: "200px" }}
  1044. value={this.state.newinterviewIdeas}
  1045. onChange={(e) => {
  1046. this.setState({
  1047. newinterviewIdeas: e.target.value,
  1048. });
  1049. }}
  1050. />
  1051. </div>
  1052. </div>
  1053. </div>
  1054. )}
  1055. {visible == "interviewDistribution" && (
  1056. <div className="enterpriseNameContent">
  1057. <div className="enterpriseNameItem">
  1058. <div className="enterpriseNameTitle">更改前:</div>
  1059. <div className="enterpriseNameValue">
  1060. {this.state.interviewDistribution}
  1061. </div>
  1062. </div>
  1063. <div className="enterpriseNameItem">
  1064. <div className="enterpriseNameTitle">更改后:</div>
  1065. <div className="enterpriseNameValue">
  1066. <TextArea
  1067. style={{ width: "200px" }}
  1068. value={this.state.newinterviewDistribution}
  1069. onChange={(e) => {
  1070. this.setState({
  1071. newinterviewDistribution: e.target.value,
  1072. });
  1073. }}
  1074. />
  1075. </div>
  1076. </div>
  1077. </div>
  1078. )}
  1079. <Popconfirm
  1080. placement="top"
  1081. title="确定要修改吗?"
  1082. onConfirm={(e) => {
  1083. e.stopPropagation();
  1084. visible == "name" ? this.onOk() : this.updateDate();
  1085. }}
  1086. okText="确定"
  1087. cancelText="取消"
  1088. >
  1089. <Button type="primary">确定修改</Button>
  1090. </Popconfirm>
  1091. </div>
  1092. </Modal>
  1093. </div>
  1094. );
  1095. },
  1096. });
  1097. export default ContactPerson;