huiKuan.jsx 37 KB

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