huiKuan.jsx 34 KB

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