signCustomer.jsx 31 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046
  1. import React from 'react';
  2. import {
  3. Checkbox,
  4. Button,
  5. AutoComplete,
  6. Cascader,
  7. Input,
  8. Select,
  9. Tabs,
  10. Spin,
  11. Table,
  12. message,
  13. DatePicker,
  14. Form,
  15. Modal,
  16. Tooltip
  17. } from 'antd';
  18. import ajax from 'jquery/src/ajax/xhr.js';
  19. import $ from 'jquery/src/ajax';
  20. import moment from 'moment';
  21. import { citySelect, provinceList } from '@/NewDicProvinceList';
  22. import { socialAttribute, industry, auditStatusL, lvl, currentMember } from '@/dataDic.js';
  23. import { getSocialAttribute, beforeUploadFile, ShowModal } from "@/tools.js";
  24. import FollowDetail from './followDetail.jsx'
  25. import ShowModalDiv from "@/showModal.jsx";
  26. import ZhuanjiaoDetail from "@/zhuanjiaoDetail.jsx";
  27. import IntentionDetail from './intentionDetail/intentionDetail'
  28. import './customer.less';
  29. import { ChooseList } from "../../../order/orderNew/chooseList";
  30. import EnterpriseNameChange from "../../../../common/enterpriseNameChange";
  31. import Detaile from "../query/detail";
  32. const { TabPane } = Tabs
  33. const confirm = Modal.confirm;
  34. const IntentionCustomer = Form.create()(React.createClass({
  35. loadData(pageNo, apiUrl) {
  36. this.setState({
  37. visitModul: false,
  38. loading: true,
  39. ispage: pageNo,
  40. modalVisible: false
  41. });
  42. let api = apiUrl ? apiUrl : this.props.ApiUrl;
  43. let enterpriseNature = undefined; // 企业性质 0=其他,1=国企,2=央企,3=私企,4=合资企业(含港澳台),5=外资控股
  44. let listedNature = undefined; // 上市 0=否,1=是
  45. if (this.state.nature && this.state.nature.length >= 2) {
  46. enterpriseNature = this.state.nature[1];
  47. }
  48. if (this.state.nature && this.state.nature.length >= 3) {
  49. listedNature = this.state.nature[2];
  50. }
  51. $.ajax({
  52. method: "post",
  53. dataType: "json",
  54. crossDomain: false,
  55. url: globalConfig.context + api,
  56. data: {
  57. pageNo: pageNo || 1,
  58. pageSize: this.state.pagination.pageSize,
  59. name: this.state.nameSearch,
  60. channel: this.state.channelSearch,
  61. province: !(this.state.addressSearch).length ? this.state.provinceSearch : this.state.addressSearch[0],
  62. city: !(this.state.addressSearch).length ? '' : this.state.addressSearch[1],
  63. startDate: this.state.releaseDate[0],
  64. endDate: this.state.releaseDate[1],
  65. nature: this.state.nature ? this.state.nature[0] : undefined,
  66. enterpriseNature,
  67. listedNature,
  68. },
  69. success: function (data) {
  70. ShowModal(this);
  71. let theArr = [];
  72. if (data.error.length || data.data.list == "") {
  73. if (data.error && data.error.length) {
  74. message.warning(data.error[0].message);
  75. };
  76. } else {
  77. for (let i = 0; i < data.data.list.length; i++) {
  78. let thisdata = data.data.list[i];
  79. let diqu = (thisdata.province == null ? "" : thisdata.province) + (thisdata.city == null ? "" : "-" + thisdata.city) + (thisdata.area == null ? "" : "-" + thisdata.area);
  80. thisdata.key = i;
  81. thisdata.id = thisdata.uid;
  82. thisdata.transferTime = thisdata.transferTime && thisdata.transferTime.split(" ")[0];
  83. thisdata.lastSignTime = thisdata.lastSignTime && thisdata.lastSignTime.split(" ")[0];
  84. thisdata.lastFollowTime = thisdata.lastFollowTime && thisdata.lastFollowTime.split(" ")[0];
  85. thisdata.locationProvince = diqu;
  86. theArr.push(thisdata);
  87. };
  88. this.state.pagination.current = data.data.pageNo;
  89. this.state.pagination.total = data.data.totalCount;
  90. };
  91. if (data.data && data.data.list && !data.data.list.length) {
  92. this.state.pagination.current = 0
  93. this.state.pagination.total = 0
  94. };
  95. this.setState({
  96. dataSource: theArr,
  97. pagination: this.state.pagination,
  98. selectedRowKeys: []
  99. });
  100. }.bind(this),
  101. }).always(function () {
  102. this.setState({
  103. loading: false
  104. });
  105. }.bind(this));
  106. },
  107. //品类数据获取
  108. category() {
  109. $.ajax({
  110. method: "get",
  111. dataType: "json",
  112. crossDomain: false,
  113. url: globalConfig.context + "/api/admin/Varieties/getSuperList",
  114. data: {},
  115. success: function (data) {
  116. let thedata = data.data;
  117. let theArr = [];
  118. if (!thedata) {
  119. if (data.error && data.error.length) {
  120. message.warning(data.error[0].message);
  121. }
  122. thedata = {};
  123. } else {
  124. thedata.map(function (item, index) {
  125. theArr.push({
  126. value: item.id,
  127. key: item.cname,
  128. });
  129. });
  130. }
  131. this.setState({
  132. categoryArr: theArr,
  133. });
  134. }.bind(this),
  135. });
  136. },
  137. getInitialState() {
  138. return {
  139. categoryArr: [],
  140. addressSearch: [],
  141. orgCodeUrl: [],
  142. companyLogoUrl: [],
  143. visible: false,
  144. searchMore: true,
  145. releaseDate: [],
  146. visitModul: false,
  147. keys: false,
  148. detailApi: "",
  149. followData: {},
  150. selectedRowKeys: [],
  151. selectedRowKey: [],
  152. selectedRows: [],
  153. loading: false,
  154. defaultActiveKey: '',
  155. modalVisible: false,
  156. pagination: {
  157. defaultCurrent: 1,
  158. defaultPageSize: 10,
  159. showQuickJumper: true,
  160. pageSize: 10,
  161. onChange: function (page) {
  162. this.loadData(page);
  163. }.bind(this),
  164. showTotal: function (total) {
  165. return "共" + total + "条数据";
  166. },
  167. },
  168. columns: [
  169. {
  170. title: "客户名称",
  171. dataIndex: "name",
  172. key: "name",
  173. width: 200,
  174. render: (text, record) => {
  175. return (
  176. <span>
  177. {record.channel === 1 ? <div style={{
  178. background: '#ef7207',
  179. color: '#FFF',
  180. padding: '1px 7px',
  181. borderRadius: '5px',
  182. fontSize: '12px',
  183. display: 'inline-block',
  184. marginRight: '10px'
  185. }}>
  186. 外联
  187. </div> : null}
  188. <Tooltip title={text}>
  189. <div
  190. // style={{
  191. // maxWidth: '120px',
  192. // overflow: 'hidden',
  193. // textOverflow: "ellipsis",
  194. // whiteSpace: 'nowrap',
  195. // }}
  196. >{text}</div>
  197. </Tooltip>
  198. </span>
  199. )
  200. },
  201. },
  202. {
  203. title: "统一社会信用代码",
  204. dataIndex: "orgCode",
  205. key: "orgCode",
  206. render: (text) => {
  207. return <div style={{ color: !text ? "red" : "#000000A6" }}>
  208. {!text ? "待补充" : text}
  209. </div>;
  210. },
  211. },
  212. {
  213. title: "客户性质",
  214. dataIndex: "nature",
  215. key: "nature",
  216. render: (text, record) => {
  217. let natureArr = [];
  218. if (record.nature !== undefined || record.nature !== null) {
  219. natureArr.push(record.nature);
  220. }
  221. if (record.enterpriseNature !== undefined || record.enterpriseNature !== null) {
  222. natureArr.push(record.enterpriseNature);
  223. }
  224. if (record.listedNature !== undefined || record.listedNature !== null) {
  225. natureArr.push(record.listedNature);
  226. }
  227. return this.getNatureText(natureArr, record.natureOther);
  228. },
  229. },
  230. {
  231. title: "地区",
  232. dataIndex: "locationProvince",
  233. key: "locationProvince",
  234. },
  235. {
  236. title: "初始时间",
  237. dataIndex: "transferTime",
  238. key: "transferTime",
  239. },
  240. {
  241. title: "最新跟进日期",
  242. dataIndex: "lastFollowTime",
  243. key: "lastFollowTime",
  244. },
  245. {
  246. title: "剩余私有天数",
  247. dataIndex: "surplusFollowTime",
  248. key: "surplusFollowTime",
  249. },
  250. // {
  251. // title: "剩余签单天数",
  252. // dataIndex: "surplusSignTime",
  253. // key: "surplusSignTime",
  254. // },
  255. // {
  256. // title: "联系人",
  257. // dataIndex: "contacts",
  258. // key: "contacts",
  259. // },
  260. // {
  261. // title: "联系电话",
  262. // dataIndex: "contactMobile",
  263. // key: "contactMobile",
  264. // },
  265. {
  266. title: "社会属性",
  267. dataIndex: "societyTag",
  268. key: "societyTag",
  269. render: (text) => {
  270. return getSocialAttribute(text);
  271. },
  272. },
  273. {
  274. title: "操作",
  275. dataIndex: "abc",
  276. key: "abc",
  277. width: 420,
  278. render: (text, record, index) => {
  279. return (
  280. <div>
  281. <Button
  282. onClick={(e) => {
  283. const _this = this
  284. e.stopPropagation()
  285. if (!record.orgCode) {
  286. confirm({
  287. title: '您暂时不可以跟进客户',
  288. content: `请先完善"企业统一社会信用代码"`,
  289. cancelText: '取消',
  290. okText: '去完善',
  291. onOk() {
  292. _this.tableRowClick(record)
  293. },
  294. onCancel() { },
  295. });
  296. } else {
  297. this.visit(record);
  298. }
  299. }}
  300. type="primary"
  301. >
  302. 客户跟进
  303. </Button>
  304. <Button
  305. style={{ marginLeft: 10 }}
  306. onClick={(e) => {
  307. e.stopPropagation(), this.zhuanjiaoDetail(record);
  308. }}
  309. type="primary"
  310. >
  311. 记录
  312. </Button>
  313. <Button
  314. style={{ marginLeft: 10 }}
  315. type="primary"
  316. onClick={(e) => {
  317. e.stopPropagation();
  318. this.setState({
  319. defaultActiveKey: '6'
  320. }, () => {
  321. this.tableRowClick(record);
  322. })
  323. }}
  324. >
  325. 转交项目
  326. </Button>
  327. <Button
  328. style={{ marginLeft: 10 }}
  329. type="primary"
  330. onClick={(e) => {
  331. e.stopPropagation();
  332. this.setState({
  333. visitD: true,
  334. RowData: record,
  335. })
  336. }}
  337. >
  338. 新增限定项目
  339. </Button>
  340. </div>
  341. );
  342. },
  343. },
  344. ],
  345. data: [],
  346. dataSource: [],
  347. selList: [],
  348. natureOptions: [{
  349. value: 1,
  350. label: "政府机构"
  351. }, {
  352. value: 2,
  353. label: "科研院所"
  354. }, {
  355. value: 3,
  356. label: "高等院校"
  357. }, {
  358. value: 4,
  359. label: "社会团体"
  360. }, {
  361. value: 5,
  362. label: "企业",
  363. children: [{
  364. value: 1,
  365. label: "国企",
  366. children: [{
  367. value: 1,
  368. label: "上市公司",
  369. }, {
  370. value: 0,
  371. label: "非上市公司",
  372. }]
  373. }, {
  374. value: 2,
  375. label: "央企",
  376. children: [{
  377. value: 1,
  378. label: "上市公司",
  379. }, {
  380. value: 0,
  381. label: "非上市公司",
  382. }]
  383. }, {
  384. value: 3,
  385. label: "私企",
  386. children: [{
  387. value: 1,
  388. label: "上市公司",
  389. }, {
  390. value: 0,
  391. label: "非上市公司",
  392. }]
  393. }, {
  394. value: 4,
  395. label: "合资企业(含港澳台)",
  396. children: [{
  397. value: 1,
  398. label: "上市公司",
  399. }, {
  400. value: 0,
  401. label: "非上市公司",
  402. }]
  403. }, {
  404. value: 5,
  405. label: "外资控股",
  406. children: [{
  407. value: 1,
  408. label: "上市公司",
  409. }, {
  410. value: 0,
  411. label: "非上市公司",
  412. }]
  413. }]
  414. }, {
  415. value: 0,
  416. label: "其他组织"
  417. }]
  418. };
  419. },
  420. /**
  421. * 转译客户性质
  422. * @param {*} value
  423. * @returns
  424. */
  425. getNatureText(value, otherText) {
  426. if (value.length && value[0] === 0) {
  427. // 其他
  428. return `其他组织(${otherText})`;
  429. } else {
  430. let text = [];
  431. let level = 0;
  432. const loopData = (data) => {
  433. for (let i=0; i<data.length; i++) {
  434. let item = data[i];
  435. if (item.value === value[level]) {
  436. text.push(item.label);
  437. if (item.children) {
  438. level += 1;
  439. loopData(item.children)
  440. }
  441. break;
  442. }
  443. }
  444. }
  445. loopData(this.state.natureOptions);
  446. return text.join("/");
  447. }
  448. },
  449. zhuanjiaoDetail(record) {
  450. this.setState({
  451. zhuanjiaoVisible: true,
  452. zhuanjiaoId: record.id
  453. })
  454. },
  455. zhuanjiaoDetailCancel() {
  456. this.setState({
  457. zhuanjiaoVisible: false
  458. })
  459. },
  460. //进入新增拜访记录
  461. visit(e) {
  462. this.setState({
  463. followData: e,
  464. visitModul: true,
  465. modalVisible: false
  466. })
  467. },
  468. //列表删除功能
  469. delectRow() {
  470. let deletedIds;
  471. for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
  472. let rowItem = this.state.selectedRows[idx];
  473. if (rowItem.id) {
  474. deletedIds = rowItem.id;
  475. };
  476. };
  477. this.setState({
  478. loading: true,
  479. selectedRowKeys: [],
  480. });
  481. $.ajax({
  482. method: "get",
  483. dataType: "json",
  484. crossDomain: false,
  485. url: globalConfig.context + "/api/admin/customer/deleteCustomer",
  486. data: {
  487. uid: deletedIds, //删除的ID
  488. }
  489. }).done(function (data) {
  490. if (!data.error.length) {
  491. message.success('删除成功!');
  492. this.setState({
  493. loading: false,
  494. });
  495. } else {
  496. message.warning(data.error[0].message);
  497. };
  498. this.loadData(this.state.ispage);
  499. }.bind(this));
  500. },
  501. componentWillMount() {
  502. //城市
  503. let Province = [];
  504. provinceList.map(function (item) {
  505. var id = String(item.id)
  506. Province.push(
  507. <Select.Option value={id} key={item.name}>{item.name}</Select.Option>
  508. )
  509. });
  510. //行业
  511. let intentionalArr = [];
  512. industry.map(function (item) {
  513. intentionalArr.push(
  514. <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
  515. )
  516. });
  517. this.state.Provinces = Province;
  518. this.state.intentionalOption = intentionalArr;
  519. this.loadData();
  520. this.category();
  521. },
  522. closeDesc(e, s) {
  523. this.state.visitD = e
  524. this.state.basicState = e
  525. this.state.visitModul = e;
  526. this.state.modalVisible = e;
  527. this.state.showDesc = e;
  528. this.setState({
  529. defaultActiveKey: ''
  530. })
  531. if (s) {
  532. this.loadData(this.state.ispage);
  533. };
  534. },
  535. search() {
  536. this.loadData();
  537. },
  538. reset() {
  539. this.state.nameSearch = '';
  540. this.state.addressSearch = [];
  541. this.state.provinceSearch = undefined;
  542. this.state.channelSearch = undefined;
  543. this.state.citySearch = undefined;
  544. this.state.releaseDate[0] = undefined;
  545. this.state.releaseDate[1] = undefined;
  546. this.state.nature = undefined;
  547. this.setState({ nature: []}, () => {
  548. this.loadData();
  549. });
  550. },
  551. searchSwitch() {
  552. this.setState({
  553. visitModul: false,
  554. searchMore: !this.state.searchMore
  555. });
  556. },
  557. //整行点击
  558. tableRowClick(record) {
  559. this.state.visitModul = false;
  560. this.state.RowData = record;
  561. this.setState({
  562. // selectedRowKeys: [],
  563. modalVisible: true,
  564. basicState: true,
  565. contactState: true,
  566. modalName: record.name
  567. })
  568. },
  569. //指定转交人自动补全
  570. supervisor(e) {
  571. $.ajax({
  572. method: "get",
  573. dataType: "json",
  574. crossDomain: false,
  575. url: globalConfig.context + "/api/admin/customer/listAdminByName",
  576. data: {
  577. adminName: e
  578. },
  579. success: function (data) {
  580. let thedata = data.data;
  581. if (!thedata) {
  582. if (data.error && data.error.length) {
  583. message.warning(data.error[0].message);
  584. };
  585. thedata = {};
  586. };
  587. this.setState({
  588. customerArr: thedata,
  589. });
  590. }.bind(this),
  591. }).always(function () {
  592. this.setState({
  593. loading: false
  594. });
  595. }.bind(this));
  596. },
  597. componentWillReceiveProps(nextProps) {
  598. if (nextProps.ApiUrl != this.props.ApiUrl) {
  599. if (!this.state.searchMore) {
  600. this.state.searchMore = true
  601. }
  602. this.state.nameSearch = '';
  603. this.state.addressSearch = [];
  604. this.state.provinceSearch = undefined;
  605. this.state.channelSearch = undefined
  606. this.state.citySearch = undefined;
  607. this.state.releaseDate[0] = undefined;
  608. this.state.releaseDate[1] = undefined;
  609. this.loadData(null, nextProps.ApiUrl);
  610. };
  611. },
  612. changeList(arr) {
  613. const newArr = [];
  614. this.state.columns.forEach(item => {
  615. arr.forEach(val => {
  616. if (val === item.title) {
  617. newArr.push(item);
  618. }
  619. });
  620. });
  621. this.setState({
  622. changeList: newArr
  623. });
  624. },
  625. //上级主管输入框失去焦点是判断客户是否存在
  626. selectAuto(value, options) {
  627. this.setState({
  628. auto: value,
  629. });
  630. },
  631. //值改变时请求客户名称
  632. httpChange(e) {
  633. if (e.length >= 1) {
  634. this.supervisor(e);
  635. }
  636. this.setState({
  637. auto: e,
  638. });
  639. },
  640. showConfirm() {
  641. if (this.state.confirmLoading) {
  642. return false;
  643. }
  644. let _this = this;
  645. Modal.confirm({
  646. title: "提示",
  647. content: (
  648. <span style={{ color: "red" }}>
  649. 确定要转交以下客户吗?
  650. {
  651. this.state.selectedRows.map((value, index) => (
  652. <div key={index} style={{ marginTop: '5px', color: "#000" }}>
  653. {value.name}
  654. </div>
  655. ))
  656. }
  657. </span>
  658. ),
  659. onOk() {
  660. _this.setState({
  661. informationTransferVisible: true
  662. })
  663. },
  664. onCancel() { },
  665. });
  666. },
  667. //转交
  668. changeAssigner(infor) {
  669. let type = infor
  670. if (infor == 1) {
  671. if (this.state.selList.length == 0) {
  672. message.warn("请勾选您需要转交的信息!")
  673. return
  674. } else if (this.state.selList.length == 2) {
  675. type = 3
  676. } else {
  677. type = this.state.selList[0]
  678. }
  679. }
  680. if (this.state.theTypes) {
  681. this.setState({
  682. confirmLoading: true,
  683. informationTransferVisible: false
  684. })
  685. const hide = message.loading('转交中...', 0);
  686. let changeIds = '';
  687. let oldAid = '';
  688. for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
  689. let rowItem = this.state.selectedRows[idx];
  690. if (rowItem.id) {
  691. oldAid = rowItem.aid;
  692. changeIds = this.state.selectedRows.length - 1 === idx ? changeIds + rowItem.id : changeIds + rowItem.id + ',';
  693. }
  694. }
  695. $.ajax({
  696. method: "get",
  697. dataType: "json",
  698. crossDomain: false,
  699. url: globalConfig.context + "/api/admin/customer/transferToOther",
  700. data: {
  701. uid: changeIds, //这一行数据的ID
  702. aid: this.state.theTypes, //指定转交人的ID
  703. oldAid: window.adminData.uid,
  704. operatorType: 4,
  705. data: type,
  706. },
  707. }).done(
  708. function (data) {
  709. hide();
  710. this.setState({
  711. selList: [],
  712. })
  713. if (!data.error.length) {
  714. this.setState({
  715. auto: "",
  716. loading: false,
  717. selectedRowKeys: [],
  718. });
  719. if (data.data.length == 0) {
  720. message.success("转交成功!");
  721. } else {
  722. data.data.forEach(function (e) { message.warning(e) })
  723. }
  724. } else {
  725. message.warning(data.error[0].message);
  726. }
  727. this.loadData(
  728. Math.min(
  729. this.state.ispage == undefined ? 1 : this.state.ispage,
  730. Math.ceil((this.state.pagination.total - 1) / 10)
  731. )
  732. );
  733. this.setState({
  734. confirmLoading: false
  735. })
  736. }.bind(this)
  737. );
  738. } else {
  739. message.warning("请输入转交人姓名");
  740. }
  741. },
  742. blurChange(e) {
  743. let theType = "";
  744. let contactLists = this.state.customerArr || [];
  745. if (e) {
  746. contactLists.map(function (item) {
  747. if (item.name == e.toString()) {
  748. theType = item.id;
  749. }
  750. });
  751. }
  752. this.setState({
  753. theTypes: theType,
  754. });
  755. },
  756. render() {
  757. const rowSelection = {
  758. selectedRowKeys: this.state.selectedRowKeys,
  759. onChange: (selectedRowKeys, selectedRows) => {
  760. this.setState({
  761. modalVisible: false,
  762. selectedRows: selectedRows,
  763. selectedRowKeys: selectedRowKeys
  764. });
  765. },
  766. onSelect: (recordt, selected, selectedRows) => {
  767. this.setState({
  768. modalVisible: false,
  769. recordt: recordt.id
  770. })
  771. },
  772. };
  773. const hasSelected = this.state.selectedRowKeys.length > 0;
  774. const { RangePicker } = DatePicker;
  775. const dataSources = this.state.customerArr || [];
  776. const options = dataSources.map((group) =>
  777. <Select.Option key={group.id} value={group.name}>{group.name}</Select.Option>
  778. )
  779. const intentionState = this.props.intentionState || '';
  780. return (
  781. <div className="user-content">
  782. <ShowModalDiv ShowModal={this.state.showModal} onClose={() => { this.setState({ showModal: false }) }} />
  783. {this.state.zhuanjiaoVisible ? (
  784. <ZhuanjiaoDetail
  785. cancel={this.zhuanjiaoDetailCancel}
  786. visible={this.state.zhuanjiaoVisible}
  787. type={1}
  788. id={this.state.zhuanjiaoId}
  789. />
  790. ) : (
  791. ""
  792. )}
  793. <div className="content-title" style={{ marginBottom: 10 }}>
  794. <span style={{ fontWeight: 900, fontSize: 16 }}>{!intentionState ? "签单客户" : "签单客户"}</span>
  795. <span style={{ color: "red", float: "right" }}>注:签单客户,30天未跟进,将自动释放至公共库!!!</span>
  796. </div>
  797. <Tabs defaultActiveKey="1" className="test">
  798. <TabPane tab="搜索" key="1">
  799. <div className="user-search">
  800. <Input
  801. placeholder="客户名称"
  802. value={this.state.nameSearch}
  803. onChange={(e) => {
  804. this.setState({ nameSearch: e.target.value });
  805. }}
  806. />
  807. <Select
  808. placeholder="是否为外联"
  809. style={{ width: 110 }}
  810. value={this.state.channelSearch}
  811. onChange={(e) => {
  812. this.setState({ channelSearch: e });
  813. }}
  814. >
  815. <Select.Option value={0}>
  816. 非外联
  817. </Select.Option>
  818. <Select.Option value={1}>
  819. 外联
  820. </Select.Option>
  821. </Select>
  822. <Select
  823. placeholder="省"
  824. style={{ width: 80 }}
  825. value={this.state.provinceSearch}
  826. onChange={(e) => {
  827. this.setState({ provinceSearch: e });
  828. }}
  829. >
  830. {this.state.Provinces}
  831. </Select>
  832. <span style={{ marginRight: "10px" }}>
  833. <Cascader
  834. options={citySelect()}
  835. value={this.state.addressSearch}
  836. placeholder="选择城市"
  837. onChange={(e, pre) => {
  838. this.setState({ addressSearch: e });
  839. }}
  840. />
  841. </span>
  842. {/* <div className="clearfix" style={{ marginTop: "5px" }}>
  843. <div
  844. className="search-more"
  845. style={this.state.searchMore ? { display: "none" } : {}}
  846. > */}
  847. <span>签单时间:</span>
  848. <RangePicker
  849. value={[
  850. this.state.releaseDate[0]
  851. ? moment(this.state.releaseDate[0])
  852. : null,
  853. this.state.releaseDate[1]
  854. ? moment(this.state.releaseDate[1])
  855. : null,
  856. ]}
  857. onChange={(data, dataString) => {
  858. this.setState({ releaseDate: dataString });
  859. }}
  860. />
  861. <span style={{ marginLeft: "10px" }}>
  862. {/* <Select
  863. placeholder="客户性质"
  864. style={{ width: 110 }}
  865. value={this.state.nature}
  866. onChange={(e) => {
  867. this.setState({ nature: e });
  868. }}
  869. >
  870. <Option value={1}>政府机构</Option>
  871. <Option value={2}>科研院所</Option>
  872. <Option value={3}>高等院校</Option>
  873. <Option value={4}>国有企业</Option>
  874. <Option value={5}>民营企业</Option>
  875. <Option value={6}>社会团体</Option>
  876. <Option value={0}>其他</Option>
  877. </Select> */}
  878. <Cascader
  879. options={this.state.natureOptions}
  880. placeholder="请选择客户性质"
  881. value={this.state.nature}
  882. onChange={e => { this.setState({ nature: e }) }}
  883. />
  884. </span>
  885. <Button
  886. type="primary"
  887. onClick={this.search}
  888. style={{ marginLeft: 10 }}
  889. >
  890. 搜索
  891. </Button>
  892. <Button onClick={this.reset}>重置</Button>
  893. {/* {adminData.isSuperAdmin?<Popconfirm title="是否删除?" onConfirm={this.delectRow} okText="是" cancelText="否">
  894. <Button type="danger" style={{marginLeft:'10px'}}
  895. disabled={!hasSelected}
  896. >删除<Icon type="minus" />
  897. </Button>
  898. </Popconfirm>:''
  899. }*/}
  900. {/* <span style={{ marginLeft: "10px", marginRight: "20px" }}>
  901. 更多搜索
  902. <Switch
  903. checked={!this.state.searchMore}
  904. onChange={this.searchSwitch}
  905. />
  906. </span> */}
  907. </div>
  908. </TabPane>
  909. <TabPane tab="操作" key="2">
  910. <div className="user-search">
  911. <AutoComplete
  912. className="certain-category-search"
  913. dropdownClassName="certain-category-search-dropdown"
  914. dropdownMatchSelectWidth={false}
  915. style={{ width: "120px" }}
  916. dataSource={options}
  917. placeholder="输入转交人姓名"
  918. value={this.state.auto}
  919. onChange={this.httpChange}
  920. filterOption={true}
  921. onBlur={this.blurChange}
  922. onSelect={this.selectAuto}
  923. disabled={!hasSelected}
  924. >
  925. <Input />
  926. </AutoComplete>
  927. <Button
  928. type="primary"
  929. onClick={(e) => {
  930. e.stopPropagation();
  931. this.showConfirm();
  932. }}
  933. disabled={!hasSelected}
  934. style={{ marginRight: 10 }}
  935. >
  936. 转交客户
  937. </Button>
  938. <EnterpriseNameChange
  939. type='journal'
  940. disabled={!(hasSelected && this.state.selectedRows.length === 1)}
  941. style={{ marginLeft: 10 }}
  942. enterpriseId={this.state.selectedRows[0] && this.state.selectedRows[0].id} />
  943. </div>
  944. </TabPane>
  945. <TabPane tab="更改表格显示数据" key="3">
  946. <div style={{ marginLeft: 10 }}>
  947. <ChooseList
  948. columns={this.state.columns}
  949. changeFn={this.changeList}
  950. changeList={this.state.changeList}
  951. top={55}
  952. margin={11}
  953. />
  954. </div>
  955. </TabPane>
  956. </Tabs>
  957. <div className="patent-table">
  958. <Spin spinning={this.state.loading}>
  959. <Table
  960. size="middle"
  961. columns={
  962. this.state.changeList
  963. ? this.state.changeList
  964. : this.state.columns
  965. }
  966. dataSource={this.state.dataSource}
  967. rowSelection={rowSelection}
  968. pagination={this.state.pagination}
  969. onRowClick={this.tableRowClick}
  970. />
  971. </Spin>
  972. </div>
  973. <FollowDetail
  974. categoryArr={this.state.categoryArr}
  975. followData={this.state.followData}
  976. visitModul={this.state.visitModul}
  977. closeDesc={this.closeDesc}
  978. loadData={this.loadData}
  979. />
  980. <IntentionDetail
  981. categoryArr={this.state.categoryArr}
  982. detailApi={this.props.detailApi}
  983. IntentionData={this.state.RowData}
  984. loadData={() => { this.loadData(this.state.pagination.current) }}
  985. modalVisible={this.state.modalVisible}
  986. defaultActiveKey={this.state.defaultActiveKey}
  987. name={this.state.modalName}
  988. closeDesc={this.closeDesc}
  989. basicState={this.state.basicState}
  990. contactState={this.state.contactState}
  991. />
  992. {this.state.informationTransferVisible && <Modal
  993. visible={this.state.informationTransferVisible}
  994. width="420px"
  995. title="提醒"
  996. onCancel={() => {
  997. this.setState({
  998. informationTransferVisible: false,
  999. selList: [],
  1000. })
  1001. }}
  1002. footer={[
  1003. <Button key="1" size="large" type={"primary"} onClick={() => {
  1004. this.changeAssigner(1);
  1005. }}>需要</Button>,
  1006. <Button key="2" size="large" type={"danger"} onClick={() => {
  1007. this.changeAssigner(0);
  1008. }}>不需要</Button>,
  1009. ]}
  1010. >
  1011. <div style={{ padding: "0px 40px 20px" }}>
  1012. 请确定,是否一并转交以下信息,如单个资料无法转交成功,则去掉对应“勾选”项,转交单一信息!
  1013. </div>
  1014. <div style={{ width: "50%", margin: "0 auto" }}>
  1015. <Checkbox.Group onChange={e => { this.setState({ selList: e }); }}>
  1016. <Checkbox value={1}>1.需要转交该客户资料</Checkbox>
  1017. <br />
  1018. <Checkbox value={2}>2.需要转交该客户名下的订单</Checkbox>
  1019. </Checkbox.Group>
  1020. </div>
  1021. </Modal>}
  1022. <Detaile
  1023. visitModul={this.state.visitD}
  1024. data={this.state.RowData}
  1025. detailApi='/api/admin/customer/getLockedProject'
  1026. closeDesc={this.closeDesc}
  1027. />
  1028. </div>
  1029. );
  1030. }
  1031. }));
  1032. export default IntentionCustomer;