inforChange.jsx 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811
  1. import React, { Component } from "react";
  2. import {
  3. AutoComplete,
  4. Button,
  5. Cascader,
  6. Input,
  7. message,
  8. Modal,
  9. Popconfirm,
  10. Select,
  11. Spin,
  12. Table,
  13. Tag,
  14. Tooltip
  15. } from "antd";
  16. import { areaSelect, getProvince } from '@/NewDicProvinceList';
  17. import { industry, natureList } from '@/dataDic.js'
  18. import { getIndustry, getNatureType } from '@/tools.js'
  19. import $ from "jquery/src/ajax";
  20. import TextArea from "antd/es/input/TextArea";
  21. const Option = Select.Option;
  22. class InforChange extends Component {
  23. constructor(props) {
  24. super(props);
  25. let nature = [];
  26. if (props.data.nature !== undefined || props.data.nature !== null) {
  27. nature.push(props.data.nature);
  28. }
  29. if (props.data.enterpriseNature !== undefined || props.data.enterpriseNature !== null) {
  30. nature.push(props.data.enterpriseNature);
  31. }
  32. if (props.data.listedNature !== undefined || props.data.listedNature !== null) {
  33. nature.push(props.data.listedNature);
  34. }
  35. this.state = {
  36. visible: false,
  37. changeType: 0,
  38. colunmn: [
  39. {
  40. title: "操作人名称",
  41. dataIndex: "adminName",
  42. key: "adminName",
  43. },
  44. {
  45. title: "客户名称",
  46. dataIndex: "name",
  47. key: "name",
  48. render: (text) => {
  49. return (
  50. <Tooltip title={text}>
  51. <div
  52. // style={{
  53. // maxWidth: '150px',
  54. // overflow: 'hidden',
  55. // textOverflow: "ellipsis",
  56. // whiteSpace: 'nowrap',
  57. // }}
  58. >{text}</div>
  59. </Tooltip>
  60. )
  61. }
  62. },
  63. {
  64. title: "操作时间",
  65. dataIndex: "createTimes",
  66. key: "createTimes",
  67. },
  68. ],
  69. dataSource: [],
  70. inputVisible: false,
  71. inputValue: '',
  72. dataArrar: [],
  73. cooperationProjects: [],
  74. orgCode: props.data.orgCode,
  75. locationProvince: props.data.locationProvince,
  76. businessScope: props.data.businessScope,
  77. intendedProject: props.data.intendedProject,
  78. industryName: props.data.industryName,
  79. nature: nature,
  80. natureText: "",
  81. natureOther: props.data.natureOther,
  82. natureOptions: [{
  83. value: 1,
  84. label: "政府机构"
  85. }, {
  86. value: 2,
  87. label: "科研院所"
  88. }, {
  89. value: 3,
  90. label: "高等院校"
  91. }, {
  92. value: 4,
  93. label: "社会团体"
  94. }, {
  95. value: 5,
  96. label: "企业",
  97. children: [{
  98. value: 1,
  99. label: "国企",
  100. children: [{
  101. value: 1,
  102. label: "上市公司",
  103. }, {
  104. value: 0,
  105. label: "非上市公司",
  106. }]
  107. }, {
  108. value: 2,
  109. label: "央企",
  110. children: [{
  111. value: 1,
  112. label: "上市公司",
  113. }, {
  114. value: 0,
  115. label: "非上市公司",
  116. }]
  117. }, {
  118. value: 3,
  119. label: "私企",
  120. children: [{
  121. value: 1,
  122. label: "上市公司",
  123. }, {
  124. value: 0,
  125. label: "非上市公司",
  126. }]
  127. }, {
  128. value: 4,
  129. label: "合资企业(含港澳台)",
  130. children: [{
  131. value: 1,
  132. label: "上市公司",
  133. }, {
  134. value: 0,
  135. label: "非上市公司",
  136. }]
  137. }, {
  138. value: 5,
  139. label: "外资控股",
  140. children: [{
  141. value: 1,
  142. label: "上市公司",
  143. }, {
  144. value: 0,
  145. label: "非上市公司",
  146. }]
  147. }]
  148. }, {
  149. value: 0,
  150. label: "其他组织"
  151. }]
  152. }
  153. this.onChange = this.onChange.bind(this);
  154. this.onCancel = this.onCancel.bind(this);
  155. this.loadData = this.loadData.bind(this);
  156. this.onOk = this.onOk.bind(this);
  157. this.showInput = this.showInput.bind(this);
  158. this.handleInputConfirm = this.handleInputConfirm.bind(this);
  159. this.handleClose = this.handleClose.bind(this);
  160. this.handleCloseCooperation = this.handleCloseCooperation.bind(this);
  161. this.supervisor = this.supervisor.bind(this);
  162. this.onSelect = this.onSelect.bind(this);
  163. }
  164. componentDidMount() {
  165. let natureText = this.getNatureText(this.state.nature);
  166. this.setState({ natureText });
  167. }
  168. onChange(type) {
  169. if (!this.props.data.level && this.props.data.level != 0) {
  170. Modal.warning({
  171. title: '系统提示',
  172. content: (
  173. <div>
  174. <p>请先设置客户类型。操作位置:</p>
  175. <p>1.勾选客户名称</p>
  176. <p>2.点击切换至“操作”项</p>
  177. <p>3.选择相应的客户类型即可。</p>
  178. </div>
  179. ),
  180. });
  181. return
  182. }
  183. this.setState({
  184. visible: true,
  185. changeType: type,
  186. })
  187. }
  188. onCancel() {
  189. this.setState({
  190. visible: false,
  191. loading: false,
  192. changeType: 0,
  193. dataArrar: []
  194. })
  195. }
  196. loadData() {
  197. this.setState({
  198. loading: true
  199. });
  200. $.ajax({
  201. method: "get",
  202. dataType: "json",
  203. crossDomain: false,
  204. url: globalConfig.context + "/api/admin/customer/listUserName",
  205. data: {
  206. uid: this.props.enterpriseId,
  207. },
  208. success: function (data) {
  209. if (data.error.length || data.data.list == "") {
  210. if (data.error && data.error.length) {
  211. message.warning(data.error[0].message);
  212. }
  213. } else {
  214. this.setState({
  215. initialName: data.data[0] ? data.data[0].name : ''
  216. })
  217. data.data.splice(0, 1);
  218. this.setState({
  219. dataSource: data.data,
  220. });
  221. }
  222. }.bind(this),
  223. }).always(
  224. function () {
  225. this.setState({
  226. loading: false,
  227. });
  228. }.bind(this)
  229. );
  230. }
  231. onOk() {
  232. const { dataArrar } = this.state;
  233. if (this.state.changeType === 3 && !/^[A-Z0-9]{15}$|^[A-Z0-9]{17}$|^[A-Z0-9]{18}$|^[A-Z0-9]{20}$/.test(dataArrar)) {
  234. message.warning('请输入正确的统一社会信用代码')
  235. return
  236. }
  237. if (this.state.changeType === 0 && dataArrar.length === 0) {
  238. message.warning('请输入省-市-区');
  239. return;
  240. }
  241. if (this.state.changeType === 1 && dataArrar.length === 0) {
  242. message.warning('请输入企业主管产品/服务');
  243. return;
  244. }
  245. if (this.state.changeType === 2 && dataArrar.length === 0) {
  246. message.warning('请输入意向合作项目');
  247. return;
  248. }
  249. if (this.state.changeType === 4 && dataArrar.length === 0) {
  250. message.warning('请选择企业行业');
  251. return
  252. }
  253. if (this.state.changeType === 5 && dataArrar.length === 0) {
  254. message.warning('请选择客户性质');
  255. return
  256. }
  257. this.setState({
  258. loading: true
  259. });
  260. let data = {
  261. uid: this.props.enterpriseId,
  262. }
  263. if (this.state.changeType === 0) {
  264. data.province = dataArrar[0] || undefined;
  265. data.city = dataArrar[1] || undefined;
  266. data.area = dataArrar[2] || undefined;
  267. }
  268. if (this.state.changeType === 1) {
  269. data.businessScope = dataArrar.join(',')
  270. }
  271. if (this.state.changeType === 2) {
  272. let arr = [];
  273. for (let i of dataArrar) {
  274. arr.push(i.label)
  275. }
  276. data.intendedProject = arr.join(',')
  277. }
  278. if (this.state.changeType === 3) {
  279. data.orgCode = dataArrar
  280. // this.props.onCancel();
  281. }
  282. if (this.state.changeType === 4) {
  283. data.industry = dataArrar.join(',')
  284. data.industryName = getIndustry(dataArrar)
  285. }
  286. if (this.state.changeType === 5) {
  287. let enterpriseNature = undefined; // 企业性质 0=其他,1=国企,2=央企,3=私企,4=合资企业(含港澳台),5=外资控股
  288. let listedNature = undefined; // 上市 0=否,1=是
  289. if (dataArrar.length >= 2) {
  290. enterpriseNature = dataArrar[1];
  291. }
  292. if (dataArrar.length >= 3) {
  293. listedNature = dataArrar[2];
  294. }
  295. data.nature = dataArrar[0];
  296. data.enterpriseNature = enterpriseNature;
  297. data.listedNature = listedNature;
  298. data.natureOther = this.state.natureOther;
  299. }
  300. console.log(data)
  301. $.ajax({
  302. url: globalConfig.context + "/api/admin/customer/updateUserDate",
  303. method: "post",
  304. data: data
  305. }).done(
  306. function (data) {
  307. this.setState({
  308. loading: false
  309. });
  310. if (data.error.length === 0) {
  311. message.success("恭喜您,更改成功!");
  312. if (this.state.changeType === 0) {
  313. this.setState({
  314. locationProvince: getProvince(dataArrar[0], dataArrar[1], dataArrar[2])
  315. })
  316. }
  317. if (this.state.changeType === 1) {
  318. this.setState({
  319. businessScope: dataArrar.join(',')
  320. })
  321. }
  322. if (this.state.changeType === 2) {
  323. let arr = [];
  324. for (let i of dataArrar) {
  325. arr.push(i.label)
  326. }
  327. this.setState({
  328. intendedProject: arr.join(',')
  329. })
  330. }
  331. if (this.state.changeType === 3) {
  332. this.setState({
  333. orgCode: dataArrar
  334. })
  335. this.props.onCancel();
  336. }
  337. if (this.state.changeType === 4) {
  338. this.setState({
  339. industryName: getIndustry(dataArrar)
  340. })
  341. }
  342. if (this.state.changeType === 5) {
  343. this.setState({
  344. natureText: this.getNatureText(dataArrar)
  345. })
  346. }
  347. this.onCancel();
  348. } else {
  349. message.warning(data.error[0].message);
  350. }
  351. }.bind(this)
  352. )
  353. }
  354. /**
  355. * 转译客户性质
  356. * @param {*} value
  357. * @returns
  358. */
  359. getNatureText(value) {
  360. if (value.length === 1 && value[0] === 0) {
  361. // 其他
  362. return `其他(${this.state.natureOther})`;
  363. } else {
  364. let text = [];
  365. let level = 0;
  366. const loopData = (data) => {
  367. for (let i=0; i<data.length; i++) {
  368. let item = data[i];
  369. if (item.value === value[level]) {
  370. text.push(item.label);
  371. if (item.children) {
  372. level += 1;
  373. loopData(item.children)
  374. }
  375. break;
  376. }
  377. }
  378. }
  379. loopData(this.state.natureOptions);
  380. return text.join("/");
  381. }
  382. }
  383. showInput() {
  384. let str = this.state.dataArrar.join('/')
  385. this.setState({
  386. inputVisible: true,
  387. inputValue: str
  388. });
  389. }
  390. handleInputConfirm() {
  391. let inputValue = this.state.inputValue;
  392. let arr = inputValue.split('/');
  393. let lv = true;
  394. for (let i of arr) {
  395. if (i.length > 16) {
  396. message.warning('单个标签字数不能超过16个字符')
  397. lv = false;
  398. return;
  399. }
  400. }
  401. if (lv) {
  402. arr = Array.from(new Set(arr));
  403. arr = arr.filter(v => v);
  404. this.setState({
  405. dataArrar: arr,
  406. inputVisible: false,
  407. inputValue: '',
  408. });
  409. }
  410. }
  411. handleClose(removedTag) {
  412. let dataArrar = this.state.dataArrar.filter(tag => { return tag !== removedTag });
  413. this.setState({ dataArrar });
  414. }
  415. handleCloseCooperation(removedTag) {
  416. let dataArrar = this.state.dataArrar.filter(tag => { return tag.value !== removedTag.value });
  417. this.setState({ dataArrar });
  418. }
  419. supervisor(value) {
  420. $.ajax({
  421. method: "get",
  422. dataType: "json",
  423. crossDomain: false,
  424. url: globalConfig.context + '/api/admin/order/getBusinessProjectByName',
  425. data: {
  426. businessName: value
  427. },
  428. success: function (data) {
  429. let thedata = data.data;
  430. if (data.error.length === 0) {
  431. this.setState({
  432. cooperationProjects: thedata,
  433. });
  434. } else {
  435. message.warning(data.error[0].message);
  436. }
  437. }.bind(this),
  438. }).always(
  439. function () {
  440. }.bind(this)
  441. );
  442. }
  443. onSelect(value) {
  444. let arr = this.state.cooperationProjects.filter(v => v.id === value);
  445. let arr1 = this.state.dataArrar.filter(v => v.value === value);
  446. if (arr.length > 0) {
  447. if (arr1.length > 0) {
  448. message.warning('选项已存在');
  449. } else {
  450. this.state.dataArrar.push({
  451. label: arr[0].bname,
  452. value: arr[0].id,
  453. })
  454. this.setState({
  455. dataArrar: this.state.dataArrar
  456. })
  457. }
  458. }
  459. }
  460. render() {
  461. return (
  462. <div style={{
  463. fontSize: 14,
  464. fontWeight: "bold",
  465. marginTop: 20,
  466. }}>
  467. <div style={{
  468. display: 'flex',
  469. alignItems: 'center',
  470. paddingBottom: '5px'
  471. }}>
  472. <div style={{ width: '123px', color: "#58A3FF" }}>统一社会信用代码:</div>
  473. <div style={{ color: "#58A3FF" }}>
  474. {
  475. !this.state.orgCode ? "待补充" : this.state.orgCode
  476. }
  477. </div>
  478. {this.props.type === 'modify' && <Button style={{ marginLeft: '5px' }} type="primary" onClick={(e) => { e.stopPropagation(); this.onChange(3) }}>修改</Button>}
  479. {this.props.type === 'modify' && <span style={{ color: "red", marginLeft: 20 }}>如,科德集团则填写91430105670766451M</span>}
  480. </div>
  481. <div style={{
  482. display: 'flex',
  483. alignItems: 'center',
  484. paddingBottom: '5px'
  485. }}>
  486. <div style={{ width: '123px' }}>省-市-区:</div>
  487. <div>
  488. {
  489. this.state.locationProvince
  490. }
  491. </div>
  492. {this.props.type === 'modify' && <Button style={{ marginLeft: '5px' }} type="primary" onClick={(e) => { e.stopPropagation(); this.onChange(0) }}>修改</Button>}
  493. </div>
  494. <div style={{
  495. display: 'flex',
  496. alignItems: 'center',
  497. paddingBottom: '5px'
  498. }}>
  499. <div style={{ width: '123px' }}>企业主营产品/服务:</div>
  500. <div>
  501. {
  502. this.state.businessScope
  503. }
  504. </div>
  505. {this.props.type === 'modify' && <Button style={{ marginLeft: '5px' }} type="primary" onClick={(e) => { e.stopPropagation(); this.onChange(1) }}>修改</Button>}
  506. </div>
  507. <div style={{
  508. display: 'flex',
  509. alignItems: 'center',
  510. paddingBottom: '5px'
  511. }}>
  512. <div style={{ width: '123px' }}>意向合作项目:</div>
  513. <div>
  514. {
  515. this.state.intendedProject
  516. }
  517. </div>
  518. {this.props.type === 'modify' && <Button style={{ marginLeft: '5px' }} type="primary" onClick={(e) => { e.stopPropagation(); this.onChange(2) }}>修改</Button>}
  519. </div>
  520. <div style={{
  521. display: 'flex',
  522. alignItems: 'center',
  523. paddingBottom: '5px'
  524. }}>
  525. <div style={{ width: '123px' }}>企业行业:</div>
  526. <div>
  527. {
  528. this.state.industryName
  529. }
  530. </div>
  531. {this.props.type === 'modify' && <Button style={{ marginLeft: '5px' }} type="primary" onClick={(e) => { e.stopPropagation(); this.onChange(4) }}>修改</Button>}
  532. </div>
  533. <div style={{
  534. display: 'flex',
  535. alignItems: 'center',
  536. paddingBottom: '5px'
  537. }}>
  538. <div style={{ width: '123px' }}>客户性质:</div>
  539. <div>
  540. {
  541. this.state.natureText
  542. }
  543. </div>
  544. {this.props.type === 'modify' && <Button style={{ marginLeft: '5px' }} type="primary" onClick={(e) => { e.stopPropagation(); this.onChange(5) }}>修改</Button>}
  545. </div>
  546. <Modal
  547. footer={null}
  548. maskClosable={false}
  549. width={this.props.type === 'journal' ? '1200px' : this.props.type === 'modify' ? '400px' : '800px'}
  550. title={this.props.type === 'journal' ? '操作日志' : this.props.type === 'modify' ? '信息修改' : ''}
  551. visible={this.state.visible}
  552. onCancel={this.onCancel}>
  553. <div>
  554. {this.props.type === 'modify' ?
  555. <div className='enterpriseNameContent'>
  556. <div className='enterpriseNameItem'>
  557. <div className='enterpriseNameTitle'>
  558. {
  559. this.state.changeType === 0 ? '省-市-区' :
  560. this.state.changeType === 1 ? '企业主管产品/服务' :
  561. this.state.changeType === 2 ? '意向合作项目' :
  562. this.state.changeType === 3 ? '统一社会信用代码' :
  563. this.state.changeType === 4 ? '企业行业' :
  564. this.state.changeType === 5 ? '客户性质' : ''
  565. }
  566. :
  567. </div>
  568. <div className='enterpriseNameValue'>
  569. {
  570. this.state.changeType === 0 ? this.state.locationProvince :
  571. this.state.changeType === 1 ? this.state.businessScope :
  572. this.state.changeType === 2 ? this.state.intendedProject :
  573. this.state.changeType === 3 ? this.state.orgCode :
  574. this.state.changeType === 4 ? this.state.industryName :
  575. this.state.changeType === 5 ? this.state.natureText : ''
  576. }
  577. </div>
  578. </div>
  579. <div className='enterpriseNameItem'>
  580. <div className='enterpriseNameTitle'>更改:</div>
  581. <div className='enterpriseNameValue'>
  582. {
  583. this.state.changeType === 0 ? <Cascader
  584. options={areaSelect()}
  585. placeholder="选择城市"
  586. onChange={(e, pre) => {
  587. this.setState({
  588. dataArrar: e
  589. })
  590. }}
  591. /> :
  592. this.state.changeType === 1 ?
  593. <div>
  594. <div>
  595. {this.state.dataArrar.map((tag) => {
  596. const isLongTag = tag.length > 20;
  597. const tagElem = (
  598. <Tag closable key={tag} afterClose={() => this.handleClose(tag)}>
  599. {isLongTag ? `${tag.slice(0, 20)}...` : tag}
  600. </Tag>
  601. );
  602. return isLongTag ? <Tooltip title={tag} key={tag}>{tagElem}</Tooltip> : tagElem;
  603. })}
  604. {
  605. !this.state.inputVisible &&
  606. <Button
  607. size="small"
  608. type="primary"
  609. onClick={this.showInput}>
  610. + 新增主营产品
  611. </Button>
  612. }
  613. </div>
  614. {this.state.inputVisible && (<div>
  615. <TextArea
  616. style={{ width: '300px', height: '100px' }}
  617. value={this.state.inputValue}
  618. onChange={(e) => {
  619. this.setState({
  620. inputValue: e.target.value
  621. })
  622. }} />
  623. <div style={{ color: '#f00' }}>提示:请用 / 符号隔开关键字</div>
  624. <div>
  625. <Button
  626. size="small"
  627. type="primary"
  628. onClick={this.handleInputConfirm}>
  629. 确定
  630. </Button>
  631. <Button
  632. size="small"
  633. style={{ marginLeft: '5px' }}
  634. onClick={() => {
  635. this.setState({
  636. inputVisible: false,
  637. inputValue: ''
  638. })
  639. }}>
  640. 取消
  641. </Button>
  642. </div>
  643. </div>)}
  644. </div>
  645. :
  646. this.state.changeType === 2 ?
  647. <div>
  648. <div style={{ paddingBottom: this.state.dataArrar.length === 0 ? 0 : '10px' }}>
  649. {this.state.dataArrar.map((tag, index) => {
  650. const isLongTag = tag.label.length > 20;
  651. const tagElem = (
  652. <Tag closable key={tag.label} afterClose={() => this.handleCloseCooperation(tag)}>
  653. {isLongTag ? `${tag.label.slice(0, 20)}...` : tag.label}
  654. </Tag>
  655. );
  656. return isLongTag ? <Tooltip title={tag.label} key={tag.label}>{tagElem}</Tooltip> : tagElem;
  657. })}
  658. </div>
  659. <div>
  660. <AutoComplete
  661. style={{ width: 200 }}
  662. onSearch={this.supervisor}
  663. onSelect={this.onSelect}
  664. placeholder="请输入关键字"
  665. >
  666. {
  667. this.state.cooperationProjects.map(function (item) {
  668. return <Select.Option key={item.id} value={item.id}>{item.bname}</Select.Option>
  669. })
  670. }
  671. </AutoComplete>
  672. </div>
  673. </div>
  674. :
  675. this.state.changeType === 3 ?
  676. <div>
  677. <div>
  678. <Input
  679. style={{ width: 200 }}
  680. placeholder="请输入统一社会信用代码"
  681. onChange={(e) => {
  682. this.setState({
  683. dataArrar: e.target.value
  684. })
  685. }}
  686. />
  687. </div>
  688. <div style={{ color: "red", position: "absolute" }}>如,科德集团则填写91430105670766451M</div>
  689. </div>
  690. : this.state.changeType === 4 ?
  691. <div>
  692. <Select
  693. style={{ width: 200 }}
  694. placeholder="请选择行业"
  695. onChange={e => {
  696. this.setState({
  697. dataArrar: e
  698. })
  699. }}
  700. multiple
  701. >
  702. {
  703. industry.map(function (item) {
  704. return <Option key={item.value} value={item.value}>{item.key}</Option>
  705. })
  706. }
  707. </Select>
  708. </div>
  709. : this.state.changeType === 5 ?
  710. <div>
  711. <div>
  712. {/* <Select
  713. style={{ width: 200 }}
  714. placeholder="请选择客户性质"
  715. onChange={e => {
  716. this.setState({
  717. dataArrar: e
  718. })
  719. }}
  720. >
  721. {
  722. natureList.map(function (item) {
  723. return <Option key={item.value} value={item.value}>{item.key}</Option>
  724. })
  725. }
  726. </Select> */}
  727. <Cascader
  728. options={this.state.natureOptions}
  729. placeholder="请选择客户性质"
  730. onChange={e => { this.setState({ dataArrar: e }) }}
  731. />
  732. </div>
  733. {
  734. !!this.state.dataArrar && this.state.dataArrar[0] == 0 &&
  735. <div>
  736. <TextArea
  737. style={{ width: '300px', height: '100px' }}
  738. placeholder='其他说明'
  739. value={this.state.natureOther}
  740. onChange={(e) => {
  741. this.setState({
  742. natureOther: e.target.value
  743. })
  744. }} />
  745. </div>
  746. }
  747. </div>
  748. : ''
  749. }
  750. </div>
  751. </div>
  752. </div> : this.props.type === 'journal' ?
  753. <div>
  754. <Spin spinning={this.state.loading} >
  755. <Table
  756. columns={this.state.colunmn}
  757. dataSource={this.state.dataSource}
  758. pagination={false}
  759. scroll={{ x: "max-content", y: 0 }}
  760. bordered
  761. size="small"
  762. />
  763. </Spin>
  764. </div> : null
  765. }
  766. {
  767. this.props.type === 'modify' ?
  768. <Popconfirm placement="top" title="确定要修改吗?" onConfirm={(e) => {
  769. e.stopPropagation();
  770. this.onOk();
  771. }} okText="确定" cancelText="取消">
  772. <Button type='primary'>
  773. 确定修改
  774. </Button>
  775. </Popconfirm> : null
  776. }
  777. </div>
  778. </Modal >
  779. </div >
  780. )
  781. }
  782. }
  783. export default InforChange;