inforChange.jsx 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806
  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.industry,
  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
  284. }
  285. if (this.state.changeType === 5) {
  286. let enterpriseNature = undefined; // 企业性质 0=其他,1=国企,2=央企,3=私企,4=合资企业(含港澳台),5=外资控股
  287. let listedNature = undefined; // 上市 0=否,1=是
  288. if (dataArrar.length >= 2) {
  289. enterpriseNature = dataArrar[1];
  290. }
  291. if (dataArrar.length >= 3) {
  292. listedNature = dataArrar[2];
  293. }
  294. data.nature = dataArrar[0];
  295. data.enterpriseNature = enterpriseNature;
  296. data.listedNature = listedNature;
  297. data.natureOther = this.state.natureOther;
  298. }
  299. $.ajax({
  300. url: globalConfig.context + "/api/admin/customer/updateUserDate",
  301. method: "post",
  302. data: data
  303. }).done(
  304. function (data) {
  305. this.setState({
  306. loading: false
  307. });
  308. if (data.error.length === 0) {
  309. message.success("恭喜您,更改成功!");
  310. if (this.state.changeType === 0) {
  311. this.setState({
  312. locationProvince: getProvince(dataArrar[0], dataArrar[1], dataArrar[2])
  313. })
  314. }
  315. if (this.state.changeType === 1) {
  316. this.setState({
  317. businessScope: dataArrar.join(',')
  318. })
  319. }
  320. if (this.state.changeType === 2) {
  321. let arr = [];
  322. for (let i of dataArrar) {
  323. arr.push(i.label)
  324. }
  325. this.setState({
  326. intendedProject: arr.join(',')
  327. })
  328. }
  329. if (this.state.changeType === 3) {
  330. this.setState({
  331. orgCode: dataArrar
  332. })
  333. this.props.onCancel();
  334. }
  335. if (this.state.changeType === 4) {
  336. this.setState({
  337. industryName: getIndustry(dataArrar)
  338. })
  339. }
  340. if (this.state.changeType === 5) {
  341. this.setState({
  342. natureText: this.getNatureText(dataArrar)
  343. })
  344. }
  345. this.onCancel();
  346. } else {
  347. message.warning(data.error[0].message);
  348. }
  349. }.bind(this)
  350. )
  351. }
  352. /**
  353. * 转译客户性质
  354. * @param {*} value
  355. * @returns
  356. */
  357. getNatureText(value) {
  358. if (value.length === 1 && value[0] === 0) {
  359. // 其他
  360. return `其他(${this.state.natureOther})`;
  361. } else {
  362. let text = [];
  363. let level = 0;
  364. const loopData = (data) => {
  365. for (let i=0; i<data.length; i++) {
  366. let item = data[i];
  367. if (item.value === value[level]) {
  368. text.push(item.label);
  369. if (item.children) {
  370. level += 1;
  371. loopData(item.children)
  372. }
  373. break;
  374. }
  375. }
  376. }
  377. loopData(this.state.natureOptions);
  378. return text.join("/");
  379. }
  380. }
  381. showInput() {
  382. let str = this.state.dataArrar.join('/')
  383. this.setState({
  384. inputVisible: true,
  385. inputValue: str
  386. });
  387. }
  388. handleInputConfirm() {
  389. let inputValue = this.state.inputValue;
  390. let arr = inputValue.split('/');
  391. let lv = true;
  392. for (let i of arr) {
  393. if (i.length > 16) {
  394. message.warning('单个标签字数不能超过16个字符')
  395. lv = false;
  396. return;
  397. }
  398. }
  399. if (lv) {
  400. arr = Array.from(new Set(arr));
  401. arr = arr.filter(v => v);
  402. this.setState({
  403. dataArrar: arr,
  404. inputVisible: false,
  405. inputValue: '',
  406. });
  407. }
  408. }
  409. handleClose(removedTag) {
  410. let dataArrar = this.state.dataArrar.filter(tag => { return tag !== removedTag });
  411. this.setState({ dataArrar });
  412. }
  413. handleCloseCooperation(removedTag) {
  414. let dataArrar = this.state.dataArrar.filter(tag => { return tag.value !== removedTag.value });
  415. this.setState({ dataArrar });
  416. }
  417. supervisor(value) {
  418. $.ajax({
  419. method: "get",
  420. dataType: "json",
  421. crossDomain: false,
  422. url: globalConfig.context + '/api/admin/order/getBusinessProjectByName',
  423. data: {
  424. businessName: value
  425. },
  426. success: function (data) {
  427. let thedata = data.data;
  428. if (data.error.length === 0) {
  429. this.setState({
  430. cooperationProjects: thedata,
  431. });
  432. } else {
  433. message.warning(data.error[0].message);
  434. }
  435. }.bind(this),
  436. }).always(
  437. function () {
  438. }.bind(this)
  439. );
  440. }
  441. onSelect(value) {
  442. let arr = this.state.cooperationProjects.filter(v => v.id === value);
  443. let arr1 = this.state.dataArrar.filter(v => v.value === value);
  444. if (arr.length > 0) {
  445. if (arr1.length > 0) {
  446. message.warning('选项已存在');
  447. } else {
  448. this.state.dataArrar.push({
  449. label: arr[0].bname,
  450. value: arr[0].id,
  451. })
  452. this.setState({
  453. dataArrar: this.state.dataArrar
  454. })
  455. }
  456. }
  457. }
  458. render() {
  459. return (
  460. <div style={{
  461. fontSize: 14,
  462. fontWeight: "bold",
  463. marginTop: 20,
  464. }}>
  465. <div style={{
  466. display: 'flex',
  467. alignItems: 'center',
  468. paddingBottom: '5px'
  469. }}>
  470. <div style={{ width: '123px', color: "#58A3FF" }}>统一社会信用代码:</div>
  471. <div style={{ color: "#58A3FF" }}>
  472. {
  473. !this.state.orgCode ? "待补充" : this.state.orgCode
  474. }
  475. </div>
  476. {this.props.type === 'modify' && <Button style={{ marginLeft: '5px' }} type="primary" onClick={(e) => { e.stopPropagation(); this.onChange(3) }}>修改</Button>}
  477. {this.props.type === 'modify' && <span style={{ color: "red", marginLeft: 20 }}>如,科德集团则填写91430105670766451M</span>}
  478. </div>
  479. <div style={{
  480. display: 'flex',
  481. alignItems: 'center',
  482. paddingBottom: '5px'
  483. }}>
  484. <div style={{ width: '123px' }}>省-市-区:</div>
  485. <div>
  486. {
  487. this.state.locationProvince
  488. }
  489. </div>
  490. {this.props.type === 'modify' && <Button style={{ marginLeft: '5px' }} type="primary" onClick={(e) => { e.stopPropagation(); this.onChange(0) }}>修改</Button>}
  491. </div>
  492. <div style={{
  493. display: 'flex',
  494. alignItems: 'center',
  495. paddingBottom: '5px'
  496. }}>
  497. <div style={{ width: '123px' }}>企业主营产品/服务:</div>
  498. <div>
  499. {
  500. this.state.businessScope
  501. }
  502. </div>
  503. {this.props.type === 'modify' && <Button style={{ marginLeft: '5px' }} type="primary" onClick={(e) => { e.stopPropagation(); this.onChange(1) }}>修改</Button>}
  504. </div>
  505. <div style={{
  506. display: 'flex',
  507. alignItems: 'center',
  508. paddingBottom: '5px'
  509. }}>
  510. <div style={{ width: '123px' }}>意向合作项目:</div>
  511. <div>
  512. {
  513. this.state.intendedProject
  514. }
  515. </div>
  516. {this.props.type === 'modify' && <Button style={{ marginLeft: '5px' }} type="primary" onClick={(e) => { e.stopPropagation(); this.onChange(2) }}>修改</Button>}
  517. </div>
  518. <div style={{
  519. display: 'flex',
  520. alignItems: 'center',
  521. paddingBottom: '5px'
  522. }}>
  523. <div style={{ width: '123px' }}>企业行业:</div>
  524. <div>
  525. {
  526. this.state.industryName
  527. }
  528. </div>
  529. {this.props.type === 'modify' && <Button style={{ marginLeft: '5px' }} type="primary" onClick={(e) => { e.stopPropagation(); this.onChange(4) }}>修改</Button>}
  530. </div>
  531. <div style={{
  532. display: 'flex',
  533. alignItems: 'center',
  534. paddingBottom: '5px'
  535. }}>
  536. <div style={{ width: '123px' }}>客户性质:</div>
  537. <div>
  538. {
  539. this.state.natureText
  540. }
  541. </div>
  542. {this.props.type === 'modify' && <Button style={{ marginLeft: '5px' }} type="primary" onClick={(e) => { e.stopPropagation(); this.onChange(5) }}>修改</Button>}
  543. </div>
  544. <Modal
  545. footer={null}
  546. maskClosable={false}
  547. width={this.props.type === 'journal' ? '1200px' : this.props.type === 'modify' ? '400px' : '800px'}
  548. title={this.props.type === 'journal' ? '操作日志' : this.props.type === 'modify' ? '信息修改' : ''}
  549. visible={this.state.visible}
  550. onCancel={this.onCancel}>
  551. <div>
  552. {this.props.type === 'modify' ?
  553. <div className='enterpriseNameContent'>
  554. <div className='enterpriseNameItem'>
  555. <div className='enterpriseNameTitle'>
  556. {
  557. this.state.changeType === 0 ? '省-市-区' :
  558. this.state.changeType === 1 ? '企业主管产品/服务' :
  559. this.state.changeType === 2 ? '意向合作项目' :
  560. this.state.changeType === 3 ? '统一社会信用代码' :
  561. this.state.changeType === 4 ? '企业行业' :
  562. this.state.changeType === 5 ? '客户性质' : ''
  563. }
  564. :
  565. </div>
  566. <div className='enterpriseNameValue'>
  567. {
  568. this.state.changeType === 0 ? this.state.locationProvince :
  569. this.state.changeType === 1 ? this.state.businessScope :
  570. this.state.changeType === 2 ? this.state.intendedProject :
  571. this.state.changeType === 3 ? this.state.orgCode :
  572. this.state.changeType === 4 ? this.state.industryName :
  573. this.state.changeType === 5 ? this.state.natureText : ''
  574. }
  575. </div>
  576. </div>
  577. <div className='enterpriseNameItem'>
  578. <div className='enterpriseNameTitle'>更改:</div>
  579. <div className='enterpriseNameValue'>
  580. {
  581. this.state.changeType === 0 ? <Cascader
  582. options={areaSelect()}
  583. placeholder="选择城市"
  584. onChange={(e, pre) => {
  585. this.setState({
  586. dataArrar: e
  587. })
  588. }}
  589. /> :
  590. this.state.changeType === 1 ?
  591. <div>
  592. <div>
  593. {this.state.dataArrar.map((tag) => {
  594. const isLongTag = tag.length > 20;
  595. const tagElem = (
  596. <Tag closable key={tag} afterClose={() => this.handleClose(tag)}>
  597. {isLongTag ? `${tag.slice(0, 20)}...` : tag}
  598. </Tag>
  599. );
  600. return isLongTag ? <Tooltip title={tag} key={tag}>{tagElem}</Tooltip> : tagElem;
  601. })}
  602. {
  603. !this.state.inputVisible &&
  604. <Button
  605. size="small"
  606. type="primary"
  607. onClick={this.showInput}>
  608. + 新增主营产品
  609. </Button>
  610. }
  611. </div>
  612. {this.state.inputVisible && (<div>
  613. <TextArea
  614. style={{ width: '300px', height: '100px' }}
  615. value={this.state.inputValue}
  616. onChange={(e) => {
  617. this.setState({
  618. inputValue: e.target.value
  619. })
  620. }} />
  621. <div style={{ color: '#f00' }}>提示:请用 / 符号隔开关键字</div>
  622. <div>
  623. <Button
  624. size="small"
  625. type="primary"
  626. onClick={this.handleInputConfirm}>
  627. 确定
  628. </Button>
  629. <Button
  630. size="small"
  631. style={{ marginLeft: '5px' }}
  632. onClick={() => {
  633. this.setState({
  634. inputVisible: false,
  635. inputValue: ''
  636. })
  637. }}>
  638. 取消
  639. </Button>
  640. </div>
  641. </div>)}
  642. </div>
  643. :
  644. this.state.changeType === 2 ?
  645. <div>
  646. <div style={{ paddingBottom: this.state.dataArrar.length === 0 ? 0 : '10px' }}>
  647. {this.state.dataArrar.map((tag, index) => {
  648. const isLongTag = tag.label.length > 20;
  649. const tagElem = (
  650. <Tag closable key={tag.label} afterClose={() => this.handleCloseCooperation(tag)}>
  651. {isLongTag ? `${tag.label.slice(0, 20)}...` : tag.label}
  652. </Tag>
  653. );
  654. return isLongTag ? <Tooltip title={tag.label} key={tag.label}>{tagElem}</Tooltip> : tagElem;
  655. })}
  656. </div>
  657. <div>
  658. <AutoComplete
  659. style={{ width: 200 }}
  660. onSearch={this.supervisor}
  661. onSelect={this.onSelect}
  662. placeholder="请输入关键字"
  663. >
  664. {
  665. this.state.cooperationProjects.map(function (item) {
  666. return <Select.Option key={item.id} value={item.id}>{item.bname}</Select.Option>
  667. })
  668. }
  669. </AutoComplete>
  670. </div>
  671. </div>
  672. :
  673. this.state.changeType === 3 ?
  674. <div>
  675. <div>
  676. <Input
  677. style={{ width: 200 }}
  678. placeholder="请输入统一社会信用代码"
  679. onChange={(e) => {
  680. this.setState({
  681. dataArrar: e.target.value
  682. })
  683. }}
  684. />
  685. </div>
  686. <div style={{ color: "red", position: "absolute" }}>如,科德集团则填写91430105670766451M</div>
  687. </div>
  688. : this.state.changeType === 4 ?
  689. <div>
  690. <Select
  691. style={{ width: 200 }}
  692. placeholder="请选择行业"
  693. onChange={e => {
  694. this.setState({
  695. dataArrar: e
  696. })
  697. }}
  698. >
  699. {
  700. industry.map(function (item) {
  701. return <Option key={item.value} value={item.value}>{item.key}</Option>
  702. })
  703. }
  704. </Select>
  705. </div>
  706. : this.state.changeType === 5 ?
  707. <div>
  708. <div>
  709. {/* <Select
  710. style={{ width: 200 }}
  711. placeholder="请选择客户性质"
  712. onChange={e => {
  713. this.setState({
  714. dataArrar: e
  715. })
  716. }}
  717. >
  718. {
  719. natureList.map(function (item) {
  720. return <Option key={item.value} value={item.value}>{item.key}</Option>
  721. })
  722. }
  723. </Select> */}
  724. <Cascader
  725. options={this.state.natureOptions}
  726. placeholder="请选择客户性质"
  727. onChange={e => { this.setState({ dataArrar: e }) }}
  728. />
  729. </div>
  730. {
  731. !!this.state.dataArrar && this.state.dataArrar[0] == 0 &&
  732. <div>
  733. <TextArea
  734. style={{ width: '300px', height: '100px' }}
  735. placeholder='其他说明'
  736. value={this.state.natureOther}
  737. onChange={(e) => {
  738. this.setState({
  739. natureOther: e.target.value
  740. })
  741. }} />
  742. </div>
  743. }
  744. </div>
  745. : ''
  746. }
  747. </div>
  748. </div>
  749. </div> : this.props.type === 'journal' ?
  750. <div>
  751. <Spin spinning={this.state.loading} >
  752. <Table
  753. columns={this.state.colunmn}
  754. dataSource={this.state.dataSource}
  755. pagination={false}
  756. scroll={{ x: "max-content", y: 0 }}
  757. bordered
  758. size="small"
  759. />
  760. </Spin>
  761. </div> : null
  762. }
  763. {
  764. this.props.type === 'modify' ?
  765. <Popconfirm placement="top" title="确定要修改吗?" onConfirm={(e) => {
  766. e.stopPropagation();
  767. this.onOk();
  768. }} okText="确定" cancelText="取消">
  769. <Button type='primary'>
  770. 确定修改
  771. </Button>
  772. </Popconfirm> : null
  773. }
  774. </div>
  775. </Modal >
  776. </div >
  777. )
  778. }
  779. }
  780. export default InforChange;