addIntention.jsx 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741
  1. import React from 'react';
  2. import { Modal, message, Spin, Input, Select, Button, Form, Col, Cascader, Tag, Tooltip, AutoComplete, Icon } from 'antd';
  3. import $ from 'jquery/src/ajax';
  4. import { areaSelect } from '@/NewDicProvinceList';
  5. import { socialAttribute, customerSource } from '@/dataDic.js';
  6. import TextArea from "antd/es/input/TextArea";
  7. const confirm = Modal.confirm;
  8. const AchievementDetailForm = Form.create()(React.createClass({
  9. getInitialState() {
  10. return {
  11. loading: false,
  12. data: {},
  13. detailApi: '',
  14. businessScope: [],
  15. inputVisible: false,
  16. cooperationProjects: [],
  17. selectCooperationProjects: []
  18. };
  19. },
  20. handleSubmit(e) {
  21. // if (/.*[\u4e00-\u9fa5]+.*$/.test(this.state.content)) {
  22. // } else {
  23. // message.error("请填写正确的姓名,且至少包含一个汉字");
  24. // return;
  25. // }
  26. e.preventDefault();
  27. this.props.form.validateFields((err, values) => {
  28. let re = new RegExp("^[\u4e00-\u9fa5]");
  29. if (!re.test(values.name)) {
  30. message.warning('公司名称必须以汉字开头!')
  31. return
  32. }
  33. if (!re.test(values.name.charAt(values.name.length - 1))) {
  34. message.warning('公司名称必须以汉字结尾!')
  35. return
  36. }
  37. if (values.name.length > 64) {
  38. message.warning('公司名称字数不超过64个!')
  39. return false;
  40. };
  41. let regu = /[`~!#$%^&*'_[\]+=<>?:"{}|~!#¥%……&*=-@-!{}|/《》?:“”【】、;;‘’,,.。、\s+]/g;
  42. if (regu.test(values.name)) {
  43. message.warning('公司名称不能存在特殊符号或空格!')
  44. return false;
  45. }
  46. if (/.*[\u4e00-\u9fa5]+.*$/.test(values.content)) {
  47. } else {
  48. message.error("请填写正确的联系人,且至少包含一个汉字");
  49. return false;
  50. };
  51. if (/.*[\u4e00-\u9fa5]+.*$/.test(values.position)) {
  52. } else {
  53. message.error("请填写正确的职位,且至少包含一个汉字");
  54. return false;
  55. };
  56. if (!values.ProvinceCity[1]) {
  57. message.warning('请选择地区');
  58. return false;
  59. };
  60. if (values.content.length > 32) {
  61. message.warning('联系人字数不超过32个')
  62. return false;
  63. };
  64. if (values.length > 13) {
  65. message.warning('电话号码字数不超过13个')
  66. return false;
  67. };
  68. if (this.state.businessScope.length === 0) {
  69. message.warning('请选择主营产品')
  70. return false;
  71. }
  72. if (this.state.selectCooperationProjects.length === 0) {
  73. message.warning('请选择意向合作项目')
  74. return false;
  75. }
  76. let arr = [];
  77. for (let i of this.state.selectCooperationProjects) {
  78. arr.push(i.label)
  79. }
  80. if (!err) {
  81. this.setState({
  82. loading: true
  83. });
  84. $.ajax({
  85. method: "POST",
  86. dataType: "json",
  87. crossDomain: false,
  88. url: globalConfig.context + '/api/admin/customer/addCustomer',
  89. data: {
  90. name: values.name,
  91. contacts: values.content,
  92. contactMobile: values.telnum,
  93. societyTag: '0', //社会属性默认为 社会企业
  94. //source:values.customerSource,
  95. province: (values.ProvinceCity)[0],//省
  96. city: (values.ProvinceCity)[1],//市
  97. area: (values.ProvinceCity)[2],//区
  98. type: '1',
  99. intendedProject: arr.join(','),
  100. businessScope: this.state.businessScope.join(','),
  101. position: values.position,
  102. }
  103. }).done(function (data) {
  104. this.setState({
  105. loading: false
  106. });
  107. if (!data.error.length) {
  108. message.success('保存成功!');
  109. this.setState({
  110. verification: false
  111. })
  112. this.props.handleOk();
  113. } else {
  114. message.warning(data.error[0].message);
  115. }
  116. }.bind(this));
  117. }
  118. });
  119. },
  120. componentWillMount() {
  121. this.state.name = '';
  122. this.state.content = '';
  123. this.state.position = '';
  124. this.state.telnum = '';
  125. // this.state.societyTagt='0';
  126. this.state.customerSource = '0';
  127. this.state.inputValue = '';
  128. this.state.businessScope = [];
  129. this.state.inputVisible = false;
  130. this.state.cooperationProjects = [];
  131. this.state.selectCooperationProjects = [];
  132. },
  133. componentWillReceiveProps(nextProps) {
  134. if (!this.props.visible && nextProps.visible) {
  135. this.state.name = '';
  136. this.state.content = '';
  137. this.state.position = '';
  138. this.state.telnum = '';
  139. this.state.inputValue = '';
  140. this.state.businessScope = [];
  141. this.state.inputVisible = false;
  142. this.state.cooperationProjects = [];
  143. this.state.selectCooperationProjects = [];
  144. // this.state.societyTagt='0';
  145. this.props.form.resetFields();
  146. };
  147. },
  148. handleClose(removedTag) {
  149. let businessScope = this.state.businessScope.filter(tag => { return tag !== removedTag });
  150. this.setState({ businessScope });
  151. },
  152. handleCloseCooperation(removedTag) {
  153. let selectCooperationProjects = this.state.selectCooperationProjects.filter(tag => { return tag.value !== removedTag.value });
  154. this.setState({ selectCooperationProjects });
  155. },
  156. showInput() {
  157. let str = this.state.businessScope.join('/')
  158. this.setState({
  159. inputVisible: true,
  160. inputValue: str
  161. });
  162. },
  163. handleInputConfirm() {
  164. let inputValue = this.state.inputValue;
  165. let arr = inputValue.split('/');
  166. let lv = true;
  167. for (let i of arr) {
  168. if (i.length > 16) {
  169. message.warning('单个标签字数不能超过16个字符')
  170. lv = false;
  171. return;
  172. }
  173. }
  174. if (lv) {
  175. arr = Array.from(new Set(arr));
  176. arr = arr.filter(v => v);
  177. this.setState({
  178. businessScope: arr,
  179. inputVisible: false,
  180. inputValue: '',
  181. });
  182. }
  183. },
  184. //加载(自动补全)
  185. supervisor(value) {
  186. $.ajax({
  187. method: "get",
  188. dataType: "json",
  189. crossDomain: false,
  190. url: globalConfig.context + '/api/admin/order/getBusinessProjectByName',
  191. data: {
  192. businessName: value
  193. },
  194. success: function (data) {
  195. let thedata = data.data;
  196. if (data.error.length === 0) {
  197. this.setState({
  198. cooperationProjects: thedata,
  199. });
  200. } else {
  201. message.warning(data.error[0].message);
  202. }
  203. }.bind(this),
  204. }).always(
  205. function () {
  206. }.bind(this)
  207. );
  208. },
  209. onSelect(value) {
  210. let arr = this.state.cooperationProjects.filter(v => v.id === value);
  211. let arr1 = this.state.selectCooperationProjects.filter(v => v.value === value);
  212. if (arr.length > 0) {
  213. if (arr1.length > 0) {
  214. message.warning('选项已存在');
  215. } else {
  216. this.state.selectCooperationProjects.push({
  217. label: arr[0].bname,
  218. value: arr[0].id,
  219. })
  220. this.setState({
  221. selectCooperationProjects: this.state.selectCooperationProjects
  222. })
  223. }
  224. }
  225. },
  226. checkUserName() {
  227. this.setState({
  228. verification: false
  229. })
  230. let yzName = this.props.form.getFieldValue('name')
  231. if (!yzName) {
  232. message.warning('请输入公司名称');
  233. return;
  234. }
  235. let re = new RegExp("^[\u4e00-\u9fa5]");
  236. if (!re.test(yzName)) {
  237. message.warning('公司名称必须以汉字开头!')
  238. return
  239. }
  240. if (!re.test(yzName.charAt(yzName.length - 1))) {
  241. message.warning('公司名称必须以汉字结尾!')
  242. return
  243. }
  244. if (yzName.length > 64) {
  245. message.warning('公司名称字数不超过64个!')
  246. return;
  247. };
  248. let regu = /[`~!#$%^&*'_[\]+=<>?:"{}|~!#¥%……&*=-@-!{}|/《》?:“”【】、;;‘’,,.。、\s+]/g;
  249. if (regu.test(yzName)) {
  250. message.warning('公司名称不能存在特殊符号或空格!')
  251. return false;
  252. }
  253. $.ajax({
  254. method: "get",
  255. dataType: "json",
  256. crossDomain: false,
  257. url: globalConfig.context + '/api/admin/customer/checkUserName',
  258. data: {
  259. userName: this.props.form.getFieldValue('name')
  260. },
  261. success: function (data) {
  262. if (data.error.length === 0) {
  263. if (!data.data) {
  264. this.setState({
  265. verification: true
  266. })
  267. } else {
  268. Modal.info({
  269. title: '提醒',
  270. content: (
  271. <div>
  272. <p>企业客户已存在!请在“客户管理-企业客户-企业客户查询”输入企业全称查询所属人信息</p>
  273. </div>
  274. ),
  275. });
  276. this.setState({
  277. verification: false
  278. })
  279. }
  280. } else {
  281. message.warning(data.error[0].message);
  282. }
  283. }.bind(this),
  284. }).always(
  285. function () {
  286. }.bind(this)
  287. );
  288. },
  289. render() {
  290. const theData = this.state.data || {};
  291. const { getFieldDecorator } = this.props.form;
  292. const FormItem = Form.Item
  293. const formItemLayout = {
  294. labelCol: { span: 6 },
  295. wrapperCol: { span: 14 },
  296. };
  297. return (
  298. <div>
  299. <Form layout="horizontal" onSubmit={this.handleSubmit} id="demand-form">
  300. <Spin spinning={this.state.loading}>
  301. <div>
  302. <Col style={{ color: 'red', marginBottom: '10px' }} span={12} offset={6}>注意:请录入真实有效的客户信息</Col>
  303. <div className="clearfix">
  304. <FormItem className="mid-item"
  305. {...formItemLayout}
  306. label="公司名称" >
  307. {getFieldDecorator('name', {
  308. rules: [{ required: true, message: '此项为必填项!' }],
  309. initialValue: this.state.name
  310. })(
  311. <span style={{ display: 'flex', alignItems: 'center', position: 'relative' }}>
  312. <Input placeholder="公司名称" />
  313. {this.state.verification && <Icon type="check-circle" style={{
  314. fontSize: 16,
  315. color: '#30e031',
  316. position: 'absolute',
  317. right: '80px',
  318. }} />}
  319. <Button onClick={this.checkUserName} type="primary" style={{ marginLeft: '10px' }}>验证</Button>
  320. </span>
  321. )}
  322. </FormItem>
  323. </div>
  324. <div className="clearfix">
  325. <FormItem
  326. {...formItemLayout}
  327. label="省-市-区"
  328. >
  329. {getFieldDecorator('ProvinceCity', {
  330. rules: [{ required: true, message: '此项为必填项!' }],
  331. initialValue: this.state.ProvinceCity
  332. })(
  333. <Cascader options={areaSelect()} placeholder="选择城市" />
  334. )}
  335. </FormItem>
  336. </div>
  337. <div className="clearfix">
  338. <FormItem className="mid-item"
  339. {...formItemLayout}
  340. label="联系人" >
  341. {getFieldDecorator('content', {
  342. rules: [{ required: true, message: '此项为必填项!' }],
  343. initialValue: this.state.content
  344. })(
  345. <Input placeholder="联系人姓名" />
  346. )}
  347. </FormItem>
  348. </div>
  349. <div className="clearfix">
  350. <FormItem className="mid-item"
  351. {...formItemLayout}
  352. label="职位" >
  353. {getFieldDecorator('position', {
  354. rules: [{ required: true, message: '此项为必填项!' }],
  355. initialValue: this.state.position
  356. })(
  357. <Input placeholder="联系人职位" />
  358. )}
  359. </FormItem>
  360. </div>
  361. <div className="clearfix">
  362. <FormItem className="mid-item"
  363. {...formItemLayout}
  364. label="联系电话" >
  365. {getFieldDecorator('telnum', {
  366. rules: [{ required: true, message: '此项为必填项!' }],
  367. initialValue: this.state.telnum
  368. })(
  369. <Input placeholder="请填写手机号,仅填座机号时,请后续补充手机号" />
  370. )}
  371. </FormItem>
  372. </div>
  373. <div className="clearfix">
  374. <FormItem className="mid-item"
  375. {...formItemLayout}
  376. required
  377. label="主营产品" >
  378. <div>
  379. {this.state.businessScope.map((tag, index) => {
  380. const isLongTag = tag.length > 20;
  381. const tagElem = (
  382. <Tag closable key={tag} afterClose={() => this.handleClose(tag)}>
  383. {isLongTag ? `${tag.slice(0, 20)}...` : tag}
  384. </Tag>
  385. );
  386. return isLongTag ? <Tooltip title={tag} key={tag}>{tagElem}</Tooltip> : tagElem;
  387. })}
  388. {
  389. !this.state.inputVisible &&
  390. <Button
  391. size="small"
  392. type="primary"
  393. onClick={this.showInput}>
  394. + 新增主营产品
  395. </Button>
  396. }
  397. </div>
  398. {this.state.inputVisible && (<div>
  399. <TextArea
  400. style={{ width: '300px', height: '100px' }}
  401. value={this.state.inputValue}
  402. onChange={(e) => {
  403. this.setState({
  404. inputValue: e.target.value
  405. })
  406. }} />
  407. <div style={{ color: '#f00' }}>提示:请用 / 符号隔开关键字</div>
  408. <div>
  409. <Button
  410. size="small"
  411. type="primary"
  412. onClick={this.handleInputConfirm}>
  413. 确定
  414. </Button>
  415. <Button
  416. size="small"
  417. style={{ marginLeft: '5px' }}
  418. onClick={() => {
  419. this.setState({
  420. inputVisible: false,
  421. inputValue: ''
  422. })
  423. }}>
  424. 取消
  425. </Button>
  426. </div>
  427. </div>)}
  428. </FormItem>
  429. </div>
  430. <div className="clearfix">
  431. <FormItem
  432. className="mid-item"
  433. {...formItemLayout}
  434. required
  435. label="意向合作项目" >
  436. <div>
  437. <div style={{ paddingBottom: this.state.selectCooperationProjects.length === 0 ? 0 : '10px' }}>
  438. {this.state.selectCooperationProjects.map((tag, index) => {
  439. const isLongTag = tag.label.length > 20;
  440. const tagElem = (
  441. <Tag closable key={tag.label} afterClose={() => this.handleCloseCooperation(tag)}>
  442. {isLongTag ? `${tag.label.slice(0, 20)}...` : tag.label}
  443. </Tag>
  444. );
  445. return isLongTag ? <Tooltip title={tag.label} key={tag.label}>{tagElem}</Tooltip> : tagElem;
  446. })}
  447. </div>
  448. <div>
  449. <AutoComplete
  450. style={{ width: 200 }}
  451. onSearch={this.supervisor}
  452. onSelect={this.onSelect}
  453. placeholder="请输入关键字"
  454. >
  455. {
  456. this.state.cooperationProjects.map(function (item) {
  457. return <Select.Option key={item.id} value={item.id}>{item.bname}</Select.Option>
  458. })
  459. }
  460. </AutoComplete>
  461. </div>
  462. </div>
  463. </FormItem>
  464. </div>
  465. {/*<div className="clearfix">*/}
  466. {/* <FormItem className="mid-item"*/}
  467. {/* {...formItemLayout}*/}
  468. {/* label="社会属性"*/}
  469. {/* >*/}
  470. {/* {getFieldDecorator('societyTagt', {*/}
  471. {/* rules: [{ required: true, message: '此项为必填项!' }],*/}
  472. {/* initialValue: this.state.societyTagt*/}
  473. {/* })(*/}
  474. {/* <Select placeholder="客户社会属性">*/}
  475. {/* {*/}
  476. {/* socialAttribute.map(function (item) {*/}
  477. {/* return <Select.Option key={item.value} >{item.key}</Select.Option>*/}
  478. {/* })*/}
  479. {/* }*/}
  480. {/* </Select>*/}
  481. {/* )}*/}
  482. {/* </FormItem>*/}
  483. {/*</div>*/}
  484. </div>
  485. <FormItem wrapperCol={{ span: 12, offset: 6 }}>
  486. <Button type="primary" htmlType="submit" style={{ marginRight: '50px' }}>保存</Button>
  487. <Button type="ghost" onClick={this.props.closeDesc}>取消</Button>
  488. </FormItem>
  489. </Spin>
  490. </Form >
  491. </div>
  492. )
  493. }
  494. }));
  495. const AddPerson = Form.create()(React.createClass({
  496. getInitialState() {
  497. return {
  498. loading: false,
  499. data: {},
  500. detailApi: ''
  501. };
  502. },
  503. handleSubmit(e) {
  504. e.preventDefault();
  505. this.props.form.validateFields((err, values) => {
  506. if (values.companyNamet.length > 64) {
  507. message.warning('联系人字数不超过64个')
  508. return false;
  509. };
  510. if (!values.ProvinceCity[1]) {
  511. message.warning('请选择地区');
  512. return false;
  513. };
  514. if (values.telnums.length > 13) {
  515. message.warning('电话号码字数不超过13个')
  516. return false;
  517. };
  518. if (!err) {
  519. this.setState({
  520. loading: true
  521. });
  522. $.ajax({
  523. method: "POST",
  524. dataType: "json",
  525. crossDomain: false,
  526. url: globalConfig.context + '/api/admin/customer/addCustomer',
  527. data: {
  528. contacts: values.companyNamet,
  529. societyTag: values.societyTagt,
  530. name: values.companyNamet,
  531. contactMobile: values.telnums,
  532. source: values.customerSource,
  533. province: (values.ProvinceCity)[0],//省
  534. city: (values.ProvinceCity)[1],//市
  535. area: (values.ProvinceCity)[2],//区
  536. type: '0'
  537. }
  538. }).done(function (data) {
  539. this.setState({
  540. loading: false
  541. });
  542. if (!data.error.length) {
  543. message.success('保存成功!');
  544. this.props.handleOk();
  545. } else {
  546. message.warning(data.error[0].message);
  547. }
  548. }.bind(this));
  549. }
  550. });
  551. },
  552. componentWillMount() {
  553. this.state.companyNamet = '';
  554. this.state.telnum = '';
  555. this.state.societyTagt = '0';
  556. this.state.customerSource = '0';
  557. },
  558. componentWillReceiveProps(nextProps) {
  559. if (!this.props.visible && nextProps.visible) {
  560. this.state.companyNamet = '';
  561. this.state.telnum = '';
  562. this.state.societyTagt = '0';
  563. this.state.customerSource = '0';
  564. this.props.form.resetFields();
  565. };
  566. },
  567. render() {
  568. const theData = this.state.data || {};
  569. const { getFieldDecorator } = this.props.form;
  570. const FormItem = Form.Item
  571. const formItemLayout = {
  572. labelCol: { span: 6 },
  573. wrapperCol: { span: 14 },
  574. };
  575. return (
  576. <div>
  577. <Form layout="horizontal" onSubmit={this.handleSubmit} id="demand-form">
  578. <Spin spinning={this.state.loading}>
  579. <Col style={{ color: 'red', marginBottom: '10px' }} span={12} offset={6}>注意:请录入真实有效的客户信息</Col>
  580. <div className="clearfix">
  581. <FormItem className="mid-item"
  582. {...formItemLayout}
  583. label="客户姓名" >
  584. {getFieldDecorator('companyNamet', {
  585. rules: [{ required: true, message: '此项为必填项!' }],
  586. initialValue: this.state.companyNamet
  587. })(
  588. <Input placeholder="客户姓名" />
  589. )}
  590. </FormItem>
  591. </div>
  592. <div className="clearfix">
  593. <FormItem
  594. {...formItemLayout}
  595. label="省-市-区"
  596. >
  597. {getFieldDecorator('ProvinceCity', {
  598. rules: [{ required: true, message: '此项为必填项!' }],
  599. initialValue: this.state.ProvinceCity
  600. })(
  601. <Cascader options={areaSelect()} placeholder="选择城市" />
  602. )}
  603. </FormItem>
  604. </div>
  605. <div className="clearfix">
  606. <FormItem className="mid-item"
  607. {...formItemLayout}
  608. label="联系电话" >
  609. {getFieldDecorator('telnums', {
  610. rules: [{ required: true, message: '此项为必填项!' }],
  611. initialValue: this.state.telnums
  612. })(
  613. <Input placeholder="联系电话" />
  614. )}
  615. </FormItem>
  616. </div>
  617. <div className="clearfix">
  618. <FormItem className="mid-item"
  619. {...formItemLayout}
  620. label="社会属性"
  621. >
  622. {getFieldDecorator('societyTagt', {
  623. rules: [{ required: true, message: '此项为必填项!' }],
  624. initialValue: this.state.societyTagt
  625. })(
  626. <Select placeholder="客户社会属性">
  627. {
  628. socialAttribute.map(function (item) {
  629. return <Select.Option key={item.value} >{item.key}</Select.Option>
  630. })
  631. }
  632. </Select>
  633. )}
  634. </FormItem>
  635. </div>
  636. <div className="clearfix">
  637. <FormItem className="mid-item"
  638. {...formItemLayout}
  639. label="客户来源"
  640. >
  641. {getFieldDecorator('customerSource', {
  642. rules: [{ required: true, message: '此项为必填项!' }],
  643. initialValue: this.state.customerSource
  644. })(
  645. <Select placeholder="客户来源">
  646. {
  647. customerSource.map(function (item) {
  648. return <Select.Option key={item.value} >{item.key}</Select.Option>
  649. })
  650. }
  651. </Select>
  652. )}
  653. </FormItem>
  654. </div>
  655. <FormItem wrapperCol={{ span: 12, offset: 6 }}>
  656. <Button style={{ marginRight: '50px' }} type="primary" htmlType="submit">保存</Button>
  657. <Button type="ghost" onClick={this.props.closeDesc}>取消</Button>
  658. </FormItem>
  659. </Spin>
  660. </Form >
  661. </div>
  662. )
  663. }
  664. }));
  665. const AddIntention = React.createClass({
  666. getInitialState() {
  667. return {
  668. visible: false,
  669. tabsKey: 1,
  670. loading: false,
  671. dataSource: [],
  672. };
  673. },
  674. handleCancel(e) {
  675. this.setState({
  676. visible: false,
  677. });
  678. this.props.closeDesc(false);
  679. },
  680. handleOk(e) {
  681. this.setState({
  682. visible: false,
  683. });
  684. this.props.closeDesc(false, true);
  685. },
  686. componentWillReceiveProps(nextProps) {
  687. if (!this.state.visible && nextProps.showDesc) {
  688. this.state.tabsKey = "1";
  689. };
  690. this.state.visible = nextProps.showDesc;
  691. },
  692. render() {
  693. return (
  694. <div className="patent-desc">
  695. {
  696. this.state.visible &&
  697. <Modal maskClosable={false} visible={this.state.visible}
  698. onOk={this.checkPatentProcess} onCancel={this.handleCancel}
  699. width='600px'
  700. title='新建客户'
  701. footer=''
  702. className="admin-desc-content">
  703. <Spin spinning={this.state.loading}>
  704. {this.props.api.indexOf('Personal') < 0 ? <AchievementDetailForm
  705. data={this.props.data}
  706. newmodal={this.props.newmodal}
  707. closeDesc={this.handleCancel}
  708. visible={this.state.visible}
  709. handleOk={this.handleOk} /> : <AddPerson
  710. data={this.props.data}
  711. newmodal={this.props.newmodal}
  712. closeDesc={this.handleCancel}
  713. visible={this.state.visible}
  714. handleOk={this.handleOk}
  715. />}
  716. </Spin>
  717. </Modal>
  718. }
  719. </div>
  720. );
  721. },
  722. });
  723. export default Form.create({})(AddIntention);