huiKuan.jsx 34 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177
  1. import React from "react";
  2. import $ from "jquery/src/ajax";
  3. import moment from "moment";
  4. import "./public.less";
  5. import {
  6. Form,
  7. Button,
  8. Input,
  9. Select,
  10. Spin,
  11. Table,
  12. message,
  13. Modal,
  14. Upload,
  15. DatePicker,
  16. Icon,
  17. Tabs,
  18. Popconfirm,
  19. Tag
  20. } from "antd";
  21. import {
  22. getProjectStatus,
  23. getProvinceA,
  24. getInvoiceStatus,
  25. getprovince,
  26. getStatus,
  27. getPeople,
  28. splitUrl,
  29. moneyVerify
  30. } from "@/tools";
  31. import { ChooseList } from "../../../../component/manageCenter/order/orderNew/chooseList";
  32. import "./huiKuan.less"
  33. const { RangePicker } = DatePicker;
  34. const FormItem = Form.Item;
  35. const { TextArea } = Input;
  36. const { TabPane } = Tabs;
  37. const HuiKuan = React.createClass({
  38. loadData(pageNo,pageSize) {
  39. this.state.data = [];
  40. this.setState({
  41. loading: true
  42. });
  43. $.ajax({
  44. method: "get",
  45. dataType: "json",
  46. crossDomain: false,
  47. url: globalConfig.context + "/api/admin/receivables/listReceivables",
  48. data: {
  49. pageNo: pageNo || 1,
  50. pageSize: pageSize || this.state.pagination.pageSize,
  51. // 订单状态 判断是否重复
  52. status: this.state.statusSearch,
  53. // 订单编号
  54. orderNo: this.state.orderNoSearch,
  55. // 合同编号
  56. contractNo: this.state.nameSearch,
  57. // 付款方
  58. corporateName: this.state.payFrom,
  59. // 营销员名字
  60. adminName: this.state.adminName,
  61. // 客户名称
  62. nickname: this.state.nickname,
  63. // 订单所属部门id
  64. orderDepId: this.state.orderBranch,
  65. // 管理员部门id
  66. adminDepId: this.state.principalList
  67. },
  68. success: function(data) {
  69. let theArr = [];
  70. if (!data.data || !data.data.pagination.list) {
  71. if (data.error && data.error.length) {
  72. message.warning(data.error[0].message);
  73. }
  74. } else {
  75. for (let i = 0; i < data.data.pagination.list.length; i++) {
  76. let thisdata = data.data.pagination.list[i];
  77. theArr.push({
  78. key: thisdata.id,
  79. status: {
  80. first: thisdata.status,
  81. second: thisdata.inptStatus
  82. },
  83. orderNo: thisdata.orderNo,
  84. contractNo: thisdata.contractNo,
  85. corporateName: thisdata.corporateName,
  86. nickname: thisdata.nickname,
  87. totalAmount: thisdata.totalAmount,
  88. depName: thisdata.depName,
  89. amount: thisdata.amount,
  90. receivablesTimes: thisdata.receivablesTimes,
  91. createTimes: thisdata.createTimes,
  92. remarks: thisdata.remarks,
  93. financialPayNo: thisdata.financialPayNo,
  94. settlementAmount: thisdata.settlementAmount
  95. });
  96. }
  97. }
  98. this.state.pagination.current = data.data.pagination.pageNo;
  99. this.state.pagination.total = data.data.pagination.totalCount;
  100. if (
  101. data.data &&
  102. data.data.pagination.list &&
  103. !data.data.pagination.list.length
  104. ) {
  105. this.state.pagination.current = 0;
  106. this.state.pagination.total = 0;
  107. }
  108. this.setState({
  109. totalPage: data.data.pagination.totalPage,
  110. dataSource: theArr,
  111. pagination: this.state.pagination,
  112. totalHui: data.data.count ? data.data.count.totalAmount : 0,
  113. hui: data.data.count ? data.data.count.amount : 0
  114. });
  115. // console.log(this.state.dataSource);
  116. }.bind(this)
  117. }).always(
  118. function() {
  119. this.setState({
  120. loading: false
  121. });
  122. }.bind(this)
  123. );
  124. },
  125. departmentList() {
  126. this.setState({
  127. loading: true
  128. });
  129. $.ajax({
  130. method: "get",
  131. dataType: "json",
  132. crossDomain: false,
  133. url: globalConfig.context + "/api/admin/organization/selectSuperId",
  134. data: {},
  135. success: function(data) {
  136. let thedata = data.data;
  137. let theArr = [];
  138. if (!thedata) {
  139. if (data.error && data.error.length) {
  140. message.warning(data.error[0].message);
  141. }
  142. } else {
  143. thedata.map(function(item, index) {
  144. theArr.push({
  145. key: index,
  146. name: item.name,
  147. id: item.id
  148. });
  149. });
  150. }
  151. this.setState({
  152. departmentArr: theArr
  153. });
  154. }.bind(this)
  155. }).always(
  156. function() {
  157. this.setState({
  158. loading: false
  159. });
  160. }.bind(this)
  161. );
  162. },
  163. getInitialState() {
  164. return {
  165. mergeModal: false,
  166. visible: false,
  167. selectedRowKeys: [], // Check here to configure the default column
  168. loading: false,
  169. searchMore: true,
  170. assignVisible: false,
  171. releaseDate: [],
  172. totalPage: 0,
  173. boHuivisible: false,
  174. selectedRowKeys: [],
  175. selectedRows: [],
  176. // 弹出层数据
  177. modalData: {},
  178. // userName: "",
  179. contractNo: "",
  180. loading: false,
  181. reason: "",
  182. foo: 0,
  183. // 子组件改变的表格title数组
  184. changeList: undefined,
  185. pagination: {
  186. defaultCurrent: 1,
  187. defaultPageSize: 10,
  188. showQuickJumper: true,
  189. pageSize: 10,
  190. onChange: function(page) {
  191. this.loadData(page);
  192. }.bind(this),
  193. showTotal: function(total) {
  194. return "共" + total + "条数据";
  195. }
  196. },
  197. paginationModal: {
  198. pageSize: 100,
  199. showTotal: function(total) {
  200. return "共" + total + "条数据";
  201. }
  202. },
  203. columns: [
  204. {
  205. title: "合同编号",
  206. dataIndex: "contractNo",
  207. key: "contractNo",
  208. // fixed: "left"
  209. className: "title-table"
  210. },
  211. {
  212. title: "订单编号",
  213. dataIndex: "orderNo",
  214. key: "orderNo",
  215. className: "title-table"
  216. },
  217. {
  218. title: "流水编号",
  219. dataIndex: "financialPayNo",
  220. key: "financialPayNo",
  221. className: "title-table"
  222. },
  223. {
  224. title: "客户名称",
  225. dataIndex: "nickname",
  226. key: "nickname",
  227. className: "title-table"
  228. },
  229. {
  230. title: "付款方",
  231. dataIndex: "corporateName",
  232. key: "corporateName",
  233. className: "title-table"
  234. },
  235. {
  236. title: "合同额(万元)",
  237. dataIndex: "totalAmount",
  238. key: "totalAmount",
  239. className: "title-table"
  240. },
  241. {
  242. title: "已收款(万元)",
  243. dataIndex: "settlementAmount",
  244. key: "settlementAmount",
  245. className: "title-table"
  246. },
  247. {
  248. title: "本次回款(万元)",
  249. dataIndex: "amount",
  250. key: "amount",
  251. className: "title-table"
  252. },
  253. {
  254. title: "回款时间",
  255. dataIndex: "receivablesTimes",
  256. key: "receivablesTimes",
  257. className: "title-table"
  258. },
  259. {
  260. title: "状态",
  261. dataIndex: "status",
  262. key: "status",
  263. className: "title-table",
  264. render: status => {
  265. let str = "";
  266. let color = "";
  267. let str2 = "";
  268. let color2 = "";
  269. if (status.first == 0) {
  270. color = "#87d068";
  271. str = "正常"
  272. if(status.second == 1) {
  273. str = "内容缺失"
  274. color = "#000";
  275. }else if(status.second == 2) {
  276. str = "订单异常"
  277. color = "#000";
  278. }else if(status.second == 3) {
  279. str = "名称不一致"
  280. color = "#000";
  281. }
  282. } else if (status.first == 1) {
  283. str = "重复";
  284. color = "#f50";
  285. if (status.second == 1) {
  286. str2 = "内容缺失";
  287. color2 = "#000";
  288. } else if (status.second == 2) {
  289. str2 = "订单异常";
  290. color2 = "#000";
  291. } else if (status.second == 3) {
  292. str2 = "名称不一致";
  293. color2 = "#000";
  294. }
  295. } else {
  296. color = "#000";
  297. if (status.first == 2) {
  298. str = "订单异常";
  299. } else if (status.first == 3) {
  300. str = "金额异常";
  301. } else if (status.first == 4) {
  302. str = "名称异常";
  303. } else if (status.first == 5) {
  304. str = "已收款";
  305. }
  306. }
  307. return (
  308. <div>
  309. <Tag color={color}>{str}</Tag>
  310. <Tag color={color2} style={{ display: status.first == 1 && status.second != 0 ? "inline-blcok" : "none" }}>{str2}</Tag>
  311. </div>
  312. );
  313. }
  314. },
  315. {
  316. title: "批量导入时间",
  317. dataIndex: "createTimes",
  318. key: "createTimes",
  319. className: "title-table"
  320. },
  321. {
  322. title: "备注",
  323. dataIndex: "remarks",
  324. key: "remarks",
  325. className: "title-table"
  326. }
  327. ],
  328. columnsDate: [
  329. {
  330. title: "编号",
  331. dataIndex: "id",
  332. key: "id"
  333. },
  334. {
  335. title: "订单编号",
  336. dataIndex: "orderno",
  337. key: "orderno"
  338. },
  339. {
  340. title: "开票金额(万元)",
  341. dataIndex: "amount",
  342. key: "amount"
  343. },
  344. {
  345. title: "申请时间",
  346. dataIndex: "createTime",
  347. key: "createTime"
  348. },
  349. {
  350. title: "开票状态",
  351. dataIndex: "status",
  352. key: "status",
  353. render: text => {
  354. return getInvoiceStatus(text);
  355. }
  356. }
  357. ],
  358. dataSource: [],
  359. upLoadFlag: false,
  360. upLoad: {
  361. name: "file",
  362. action: globalConfig.context + "/api/admin/receivables/import",
  363. headers: {
  364. authorization: "authorization-text"
  365. },
  366. onChange: info => {
  367. if (info.file.status == "done") {
  368. if (info.file.response.data == 1) {
  369. message.success("导入成功!");
  370. this.loadData();
  371. } else {
  372. message.warning(info.file.response.error[0].message);
  373. }
  374. }
  375. }
  376. }
  377. };
  378. },
  379. search() {
  380. this.loadData();
  381. },
  382. componentWillMount() {
  383. this.loadData();
  384. this.departmentList();
  385. // $("#rcDialogTitle0").on("click", function() {
  386. // alert(123);
  387. // console.log(123);
  388. // });
  389. },
  390. reset() {
  391. this.state.nameSearch = "";
  392. this.state.releaseDate = [];
  393. this.state.orderNoSearch = "";
  394. this.state.adminName = "";
  395. this.state.departmenttList = [];
  396. this.state.nickname = "";
  397. this.state.principalList = [];
  398. this.state.payFrom = "";
  399. this.state.statusSearch = [];
  400. this.state.orderBranch = [];
  401. this.state.statusSearch = [];
  402. this.loadData();
  403. },
  404. changeList(arr) {
  405. const newArr = [];
  406. this.state.columns.forEach(item => {
  407. arr.forEach(val => {
  408. if (val === item.title) {
  409. newArr.push(item);
  410. }
  411. });
  412. });
  413. this.setState({
  414. changeList: newArr
  415. });
  416. },
  417. onSelectChange(selectedRowKeys) {
  418. // console.log("selectedRowKeys changed: ", selectedRowKeys);
  419. this.setState({ selectedRowKeys });
  420. },
  421. showModal() {
  422. this.setState({
  423. visible: true,
  424. choose: true
  425. });
  426. this.state.dataSource.forEach((item) => {
  427. if(item.key == this.state.selectedRowKeys[0]) {
  428. this.setState({
  429. modalData: JSON.parse(JSON.stringify(item))
  430. })
  431. // console.log(this.state.modalData);
  432. }
  433. })
  434. },
  435. tableRowClick(record) {
  436. this.setState({
  437. visible: true,
  438. choose: true
  439. });
  440. this.setState({
  441. modalData: JSON.parse(JSON.stringify(record))
  442. });
  443. },
  444. handleOk() {
  445. if(moneyVerify(this.state.modalData.amount)) return
  446. this.setState({ loading: true });
  447. if(!this.state.choose) {
  448. $.ajax({
  449. method: "POST",
  450. dataType: "json",
  451. crossDomain: false,
  452. url: globalConfig.context + "/api/admin/receivables/addReceivables",
  453. data: {
  454. orderNo: this.state.modalData.orderNo,
  455. amount: this.state.modalData.amount,
  456. receivablesTimes: this.state.modalData.receivablesTimes,
  457. // totalAmount: this.state.modalData.totalAmount,
  458. // contractNo: this.state.modalData.contractNo,
  459. // nickname: this.state.modalData.nickname,
  460. remarks: this.state.modalData.remarks,
  461. corporateName: this.state.modalData.corporateName,
  462. financialPayNo: this.state.modalData.financialPayNo
  463. },
  464. success: function(data) {
  465. if (data.error && data.error.length) {
  466. message.warning(data.error[0].message);
  467. } else {
  468. // console.log("成功", data);
  469. message.success("添加成功!")
  470. this.loadData();
  471. this.state.selectedRowKeys = [];
  472. this.setState({
  473. selectedRowKeys: this.state.selectedRowKeys
  474. });
  475. this.setState({ loading: false, visible: false });
  476. }
  477. }.bind(this)
  478. }).always(
  479. function() {
  480. this.setState({
  481. loading: false
  482. });
  483. }.bind(this)
  484. );
  485. }else{
  486. $.ajax({
  487. method: "POST",
  488. dataType: "json",
  489. crossDomain: false,
  490. url: globalConfig.context + "/api/admin/receivables/updateReceivables",
  491. data: {
  492. orderNo: this.state.modalData.orderNo,
  493. amount: this.state.modalData.amount,
  494. receivablesTimes: this.state.modalData.receivablesTimes,
  495. // totalAmount: this.state.modalData.totalAmount,
  496. // contractNo: this.state.modalData.contractNo,
  497. // nickname: this.state.modalData.nickname,
  498. corporateName: this.state.modalData.corporateName,
  499. financialPayNo: this.state.modalData.financialPayNo,
  500. remarks: this.state.modalData.remarks,
  501. id: this.state.modalData.key
  502. },
  503. success: function(data) {
  504. if (data.error && data.error.length) {
  505. message.warning(data.error[0].message);
  506. }else {
  507. // console.log("成功",data);
  508. message.success("修改成功!")
  509. this.loadData()
  510. this.state.selectedRowKeys = [];
  511. this.setState({
  512. selectedRowKeys: this.state.selectedRowKeys
  513. });
  514. this.setState({ loading: false, visible: false });
  515. }
  516. }.bind(this)
  517. }).always(
  518. function() {
  519. this.setState({
  520. loading: false
  521. });
  522. }.bind(this)
  523. );}
  524. // this.setState({ loading: false, visible: false });
  525. },
  526. handleCancel() {
  527. // this.loadData()
  528. this.setState({ visible: false });
  529. },
  530. callback(key) {
  531. // console.log(key);
  532. },
  533. delChecked() {
  534. // console.log("被删除列表",this.state.selectedRowKeys);
  535. let ids = this.state.selectedRowKeys.join(",")
  536. $.ajax({
  537. method: "POST",
  538. dataType: "json",
  539. crossDomain: false,
  540. url: globalConfig.context + "/api/admin/receivables/deleteReceivables",
  541. data: {
  542. ids,
  543. type: 0
  544. },
  545. success: function(data) {
  546. if (data.error && data.error.length) {
  547. message.warning(data.error[0].message);
  548. }
  549. message.success("删除成功!")
  550. }.bind(this)
  551. }).always(
  552. function() {
  553. this.loadData()
  554. this.state.selectedRowKeys = [];
  555. this.setState({
  556. selectedRowKeys: this.state.selectedRowKeys
  557. });
  558. }.bind(this)
  559. );
  560. // this.loadData()
  561. },
  562. delAllChecked() {
  563. // console.log("删除全部");
  564. $.ajax({
  565. method: "POST",
  566. dataType: "json",
  567. crossDomain: false,
  568. url: globalConfig.context + "/api/admin/receivables/deleteReceivables",
  569. data: {
  570. type: 1
  571. },
  572. success: function(data) {
  573. if (data.error && data.error.length) {
  574. message.warning(data.error[0].message);
  575. }
  576. message.success("删除全部成功!")
  577. }.bind(this)
  578. }).always(
  579. function() {
  580. this.loadData();
  581. this.state.selectedRowKeys = [];
  582. this.setState({
  583. selectedRowKeys: this.state.selectedRowKeys
  584. });
  585. }.bind(this)
  586. );
  587. // this.loadData()
  588. // console.log("aaa", $(".ant-modal-content"));
  589. },
  590. mergeAll() {
  591. // console.log("合并全部");
  592. $.ajax({
  593. method: "POST",
  594. dataType: "json",
  595. crossDomain: false,
  596. url: globalConfig.context + "/api/admin/receivables/batchImport",
  597. data: {},
  598. success: function(data) {
  599. if (data.error && data.error.length) {
  600. message.warning(data.error[0].message);
  601. }else {
  602. message.success("合并成功!请在收款列表中,查看已收款情况。");
  603. this.setState({
  604. mergeModal: false
  605. });
  606. }
  607. }.bind(this)
  608. }).always(
  609. function() {
  610. this.loadData();
  611. this.state.pagination.pageSize = 10
  612. this.state.selectedRowKeys = []
  613. this.setState({
  614. selectedRowKeys: this.state.selectedRowKeys,
  615. pagination: this.state.pagination,
  616. mergeModal: false
  617. })
  618. // window.location.reload();
  619. }.bind(this)
  620. );
  621. // message.success("合并成功!请在收款列表中,查看已收款情况。");
  622. },
  623. addModal() {
  624. this.state.modalData = {}
  625. this.setState({
  626. modalData: this.state.modalData,
  627. visible: true,
  628. choose: false
  629. })
  630. },
  631. download() {
  632. window.location.href =
  633. globalConfig.context +
  634. "/api/admin/receivables/downloadTemplate?" +
  635. "sign=receivbles_template";
  636. },
  637. // daoHui() {
  638. // window.location.href =
  639. // globalConfig.context +
  640. // "/api/admin/receivables/exportReceivables"
  641. // },
  642. render() {
  643. const formItemLayout = {
  644. labelCol: { span: 8 },
  645. wrapperCol: { span: 14 }
  646. };
  647. var departmentArr = this.state.departmentArr || [];
  648. const { loading, selectedRowKeys, visible } = this.state;
  649. const rowSelection = {
  650. selectedRowKeys,
  651. onChange: this.onSelectChange,
  652. hideDefaultSelections: true
  653. };
  654. var departmentArr = this.state.departmentArr || [];
  655. return (
  656. <div className="user-content" style={{ position: "relative" }}>
  657. <div className="content-title" style={{ marginBottom: 10 }}>
  658. <span style={{ fontWeight: 900, fontSize: 16 }}>批量回款</span>
  659. </div>
  660. <Tabs defaultActiveKey="1" onChange={this.callback} className="test">
  661. <TabPane tab="搜索" key="1">
  662. <div className="user-search" style={{ marginLeft: 10 }}>
  663. <Input
  664. placeholder="合同编号"
  665. value={this.state.nameSearch}
  666. onChange={e => {
  667. this.setState({ nameSearch: e.target.value });
  668. }}
  669. />
  670. <Input
  671. placeholder="订单编号"
  672. value={this.state.orderNoSearch}
  673. onChange={e => {
  674. this.setState({ orderNoSearch: e.target.value });
  675. }}
  676. />
  677. <Input
  678. placeholder="客户名称"
  679. value={this.state.nickname}
  680. onChange={e => {
  681. this.setState({ nickname: e.target.value });
  682. }}
  683. />
  684. <Select
  685. placeholder="状态"
  686. style={{ width: 150, marginRight: 10 }}
  687. value={this.state.statusSearch}
  688. onChange={e => {
  689. this.setState({ statusSearch: e });
  690. // console.log("状态", e);
  691. }}
  692. >
  693. <Select.Option key={0}>正常</Select.Option>
  694. <Select.Option key={1}>重复</Select.Option>
  695. <Select.Option key={2}>异常</Select.Option>
  696. </Select>
  697. <Input
  698. placeholder="订单负责人"
  699. value={this.state.adminName}
  700. onChange={e => {
  701. this.setState({ adminName: e.target.value });
  702. }}
  703. />
  704. <Select
  705. placeholder="订单所属部门"
  706. style={{ width: 150, marginRight: 10 }}
  707. value={this.state.orderBranch}
  708. onChange={e => {
  709. this.setState({ orderBranch: e });
  710. }}
  711. >
  712. {departmentArr.map(function(item) {
  713. return (
  714. <Select.Option key={item.id}>{item.name}</Select.Option>
  715. );
  716. })}
  717. </Select>
  718. <Select
  719. placeholder="负责人所属部门"
  720. style={{ width: 150, marginRight: 10 }}
  721. value={this.state.principalList}
  722. onChange={e => {
  723. this.setState({ principalList: e });
  724. }}
  725. >
  726. {departmentArr.map(function(item) {
  727. return (
  728. <Select.Option key={item.id}>{item.name}</Select.Option>
  729. );
  730. })}
  731. </Select>
  732. <Input
  733. placeholder="付款方"
  734. value={this.state.payFrom}
  735. onChange={e => {
  736. this.setState({ payFrom: e.target.value });
  737. }}
  738. />
  739. <Button
  740. type="primary"
  741. onClick={this.search}
  742. style={{ marginLeft: 10 }}
  743. >
  744. 搜索
  745. </Button>
  746. <Button onClick={this.reset}>重置</Button>
  747. </div>
  748. </TabPane>
  749. <TabPane tab="更改表格显示数据" key="2">
  750. <div style={{ marginLeft: 10 }}>
  751. <ChooseList
  752. columns={this.state.columns}
  753. changeFn={this.changeList}
  754. changeList={this.state.changeList}
  755. top={55}
  756. margin={11}
  757. display={"inline-block"}
  758. style={{ marginBottom: 17 }}
  759. />
  760. </div>
  761. </TabPane>
  762. <TabPane tab="操作" key="3">
  763. <div
  764. class={123}
  765. style={{
  766. position: "relative",
  767. top: 10,
  768. left: 10,
  769. // zIndex: 99,
  770. // left: 400,
  771. // transform: "translateX(-50%)",
  772. display: "inline-block",
  773. width: 122,
  774. height: 28,
  775. overflow: "hidden"
  776. }}
  777. >
  778. <Upload {...this.state.upLoad}>
  779. <Button
  780. type="primary"
  781. disabled={this.state.dataSource.length != 0}
  782. >
  783. <Icon type="upload" />
  784. 导入回款列表
  785. </Button>
  786. </Upload>
  787. </div>
  788. <Button
  789. type="primary"
  790. style={{ marginBottom: 11, marginLeft: 25 }}
  791. onClick={this.download}
  792. >
  793. 下载回款列表模板
  794. </Button>
  795. {/* <Button
  796. type="primary"
  797. style={{ marginBottom: 20, marginLeft: 15 }}
  798. onClick={this.daoHui}
  799. >
  800. 导出回款列表
  801. </Button> */}
  802. <Button
  803. type="primary"
  804. style={{ marginBottom: 11, marginLeft: 15 }}
  805. disabled={this.state.selectedRowKeys.length == 1 ? false : true}
  806. onClick={this.showModal}
  807. >
  808. 修改单条数据
  809. </Button>
  810. <Button
  811. type="primary"
  812. style={{ marginBottom: 11, marginLeft: 15 }}
  813. onClick={this.addModal}
  814. >
  815. 添加单条数据
  816. </Button>
  817. <Popconfirm
  818. placement="top"
  819. title={"您确定要删除选中项的回款信息吗?删除后,不可以恢复!"}
  820. onConfirm={this.delChecked}
  821. okText="确定"
  822. cancelText="取消"
  823. >
  824. <Button
  825. primary
  826. type="danger"
  827. style={{ marginBottom: 11, marginLeft: 15 }}
  828. disabled={this.state.selectedRowKeys.length > 0 ? false : true}
  829. >
  830. 删除选中项
  831. </Button>
  832. </Popconfirm>
  833. <Popconfirm
  834. placement="top"
  835. title={"您确定要删除全部的回款信息吗?删除后,不可以恢复!"}
  836. onConfirm={this.delAllChecked}
  837. okText="确定"
  838. cancelText="取消"
  839. >
  840. <Button
  841. type="danger"
  842. style={{ marginBottom: 11, marginLeft: 15 }}
  843. disabled={this.state.dataSource.length == 0}
  844. >
  845. 删除全部
  846. </Button>
  847. </Popconfirm>
  848. <Button
  849. type="danger"
  850. style={{ marginBottom: 11, marginLeft: 15 }}
  851. disabled={this.state.dataSource.length == 0}
  852. onClick={e => {
  853. this.loadData(1, 100);
  854. this.setState({
  855. mergeModal: true
  856. });
  857. }}
  858. >
  859. 确认合并回款
  860. </Button>
  861. <Button
  862. type="danger"
  863. style={{ marginBottom: 11, marginLeft: 15 }}
  864. disabled={this.state.dataSource.length == 0}
  865. onClick={e => {
  866. this.setState({
  867. selectedRowKeys: []
  868. });
  869. }}
  870. >
  871. 重置选项
  872. </Button>
  873. </TabPane>
  874. </Tabs>
  875. <div className="patent-table" style={{ position: "relative" }}>
  876. <Spin spinning={this.state.loading}>
  877. <Table
  878. columns={
  879. this.state.changeList == undefined
  880. ? this.state.columns
  881. : this.state.changeList
  882. }
  883. scroll={{ x: "max-content" }}
  884. dataSource={this.state.dataSource}
  885. pagination={this.state.pagination}
  886. rowSelection={rowSelection}
  887. onRowDoubleClick={this.tableRowClick.bind(this)}
  888. bordered
  889. size="small"
  890. />
  891. </Spin>
  892. <p
  893. style={{ display: "inline-block", fontSize: "14px", color: "red" }}
  894. >
  895. {
  896. <span style={{ marginRight: 10 }}>
  897. {`回款金额总计(万元):${this.state.hui ? this.state.hui : "0"}`}
  898. </span>
  899. }
  900. {
  901. <span>
  902. {`合同额总计(万元):${
  903. this.state.totalHui ? this.state.totalHui : "0"
  904. }`}
  905. </span>
  906. }
  907. </p>
  908. </div>
  909. <Modal
  910. width={500}
  911. visible={visible}
  912. title="收款记录"
  913. onOk={this.handleOk}
  914. onCancel={this.handleCancel}
  915. footer={[
  916. <Button key="back" onClick={this.handleCancel}>
  917. 取消
  918. </Button>,
  919. <Button
  920. key="submit"
  921. type="primary"
  922. loading={loading}
  923. onClick={this.handleOk}
  924. >
  925. 保存
  926. </Button>
  927. ]}
  928. >
  929. <p
  930. style={{
  931. marginBottom: 10,
  932. display: this.state.choose ? "block" : "none"
  933. }}
  934. >
  935. 合同编号:
  936. <Input
  937. style={{
  938. width: "auto"
  939. }}
  940. disabled={this.state.choose}
  941. value={this.state.modalData.contractNo}
  942. onChange={e => {
  943. let val = e.target.value;
  944. this.state.modalData.contractNo = val;
  945. this.setState({ modalData: this.state.modalData });
  946. }}
  947. />
  948. </p>
  949. <p style={{ marginBottom: 10 }}>
  950. 订单编号:
  951. <Input
  952. style={{ width: "auto" }}
  953. value={this.state.modalData.orderNo}
  954. onChange={e => {
  955. let val = e.target.value;
  956. this.state.modalData.orderNo = val;
  957. this.setState({ modalData: this.state.modalData });
  958. }}
  959. />
  960. </p>
  961. <p style={{ marginBottom: 10 }}>
  962. 流水编号:
  963. <Input
  964. style={{ width: "auto" }}
  965. value={this.state.modalData.financialPayNo}
  966. onChange={e => {
  967. let val = e.target.value;
  968. this.state.modalData.financialPayNo = val;
  969. this.setState({ modalData: this.state.modalData });
  970. }}
  971. />
  972. </p>
  973. <p style={{ marginBottom: 10 }}>
  974. 付款方:
  975. <Input
  976. style={{ width: "auto" }}
  977. value={this.state.modalData.corporateName}
  978. onChange={e => {
  979. let val = e.target.value;
  980. this.state.modalData.corporateName = val;
  981. this.setState({ modalData: this.state.modalData });
  982. }}
  983. />
  984. </p>
  985. <p
  986. style={{
  987. marginBottom: 10,
  988. display: this.state.choose ? "block" : "none"
  989. }}
  990. >
  991. 客户名称:
  992. <Input
  993. style={{
  994. width: "auto"
  995. }}
  996. disabled={this.state.choose}
  997. value={this.state.modalData.nickname}
  998. onChange={e => {
  999. let val = e.target.value;
  1000. this.state.modalData.nickname = val;
  1001. this.setState({ modalData: this.state.modalData });
  1002. }}
  1003. />
  1004. </p>
  1005. <p
  1006. style={{
  1007. marginBottom: 10,
  1008. display: this.state.choose ? "block" : "none"
  1009. }}
  1010. >
  1011. 合同额(万元):
  1012. <Input
  1013. style={{
  1014. width: "auto",
  1015. display: this.state.choose ? "inline-block" : "none"
  1016. }}
  1017. disabled={this.state.choose}
  1018. value={this.state.modalData.totalAmount}
  1019. onChange={e => {
  1020. let val = e.target.value;
  1021. this.state.modalData.totalAmount = val;
  1022. this.setState({ modalData: this.state.modalData });
  1023. }}
  1024. />
  1025. </p>
  1026. <p style={{ marginBottom: 10 }}>
  1027. 本次回款(万元):
  1028. <Input
  1029. style={{ width: "auto" }}
  1030. value={this.state.modalData.amount}
  1031. onChange={e => {
  1032. let val = e.target.value;
  1033. this.state.modalData.amount = val;
  1034. this.setState({ modalData: this.state.modalData });
  1035. }}
  1036. />
  1037. </p>
  1038. <p style={{ marginBottom: 10 }}>
  1039. 回款时间:
  1040. <DatePicker
  1041. showTime
  1042. placeholder="选择回款时间"
  1043. value={
  1044. this.state.modalData.receivablesTimes
  1045. ? moment(this.state.modalData.receivablesTimes, "YYYY-MM-DD")
  1046. : ""
  1047. }
  1048. onChange={(v, e) => {
  1049. this.state.modalData.receivablesTimes = e;
  1050. console.log(e);
  1051. this.setState({ modalData: this.state.modalData });
  1052. }}
  1053. onOk={() => {}}
  1054. />
  1055. </p>
  1056. <p
  1057. style={{
  1058. marginBottom: 10,
  1059. display: this.state.choose ? "block" : "none"
  1060. }}
  1061. >
  1062. 批量导入时间:
  1063. <Input
  1064. style={{ width: "auto" }}
  1065. value={this.state.modalData.createTimes}
  1066. disabled
  1067. onChange={e => {
  1068. let val = e.target.value;
  1069. this.state.modalData.createTimes = val;
  1070. this.setState({ modalData: this.state.modalData });
  1071. }}
  1072. />
  1073. </p>
  1074. <p style={{ marginBottom: 10 }}>
  1075. <span style={{ display: "inline-block", marginBottom: 20 }}>
  1076. 备注:
  1077. </span>
  1078. <TextArea
  1079. style={{ width: "70%" }}
  1080. value={this.state.modalData.remarks}
  1081. onChange={e => {
  1082. this.state.modalData.remarks = e.target.value;
  1083. // console.log(e);
  1084. this.setState({ modalData: this.state.modalData });
  1085. }}
  1086. placeholder="请输入备注信息"
  1087. autosize={{ minRows: 3, maxRows: 5 }}
  1088. />
  1089. </p>
  1090. </Modal>
  1091. <Modal
  1092. title="确认合并列表"
  1093. visible={this.state.mergeModal}
  1094. width={1300}
  1095. onOk={this.mergeAll}
  1096. onCancel={() => {
  1097. this.setState({
  1098. mergeModal: false
  1099. });
  1100. }}
  1101. >
  1102. <div className="patent-table" style={{ position: "relative" }}>
  1103. <Spin spinning={this.state.loading}>
  1104. <Table
  1105. columns={this.state.columns}
  1106. scroll={{ x: "max-content" }}
  1107. dataSource={this.state.dataSource}
  1108. bordered
  1109. size="small"
  1110. pagination={this.state.paginationModal}
  1111. />
  1112. </Spin>
  1113. <p
  1114. style={{
  1115. display: "inline-block",
  1116. fontSize: "14px",
  1117. color: "red"
  1118. }}
  1119. >
  1120. {
  1121. <span style={{ marginRight: 10 }}>
  1122. {`回款金额总计(万元):${
  1123. this.state.hui ? this.state.hui : "0"
  1124. }`}
  1125. </span>
  1126. }
  1127. {
  1128. <span>
  1129. {`合同额总计(万元):${
  1130. this.state.totalHui ? this.state.totalHui : "0"
  1131. }`}
  1132. </span>
  1133. }
  1134. </p>
  1135. </div>
  1136. </Modal>
  1137. </div>
  1138. );
  1139. }
  1140. });
  1141. export default HuiKuan;