shouKuanAll.jsx 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398
  1. import React from "react";
  2. import $ from "jquery/src/ajax";
  3. import moment from "moment";
  4. import "./public.less";
  5. import "./shouKuan.less";
  6. import {
  7. Button,
  8. Form,
  9. Input,
  10. Spin,
  11. Table,
  12. Select,
  13. message,
  14. DatePicker,
  15. Modal,
  16. Tabs,
  17. Col
  18. } from "antd";
  19. import OrderDesc from "../orderDetail/orderDesc";
  20. import Receivable from "./receivable";
  21. import Assign from "@/manageCenter/publicComponent/assign";
  22. import ReactToPrint from "react-to-print";
  23. import {
  24. getLiquidationStatus,
  25. getProcessStatus,
  26. getApproval,
  27. getInvoiceStatus,
  28. getTransactionProject
  29. } from "@/tools";
  30. import { ChooseList } from "../../order/orderNew/chooseList";
  31. const FormItem = Form.Item;
  32. const { TabPane } = Tabs;
  33. const ShouKuangAll = React.createClass({
  34. departmentList() {
  35. this.setState({
  36. loading: true
  37. });
  38. $.ajax({
  39. method: "get",
  40. dataType: "json",
  41. crossDomain: false,
  42. url: globalConfig.context + "/api/admin/organization/selectSuperId",
  43. data: {},
  44. success: function(data) {
  45. let thedata = data.data;
  46. let theArr = [];
  47. if (!thedata) {
  48. if (data.error && data.error.length) {
  49. message.warning(data.error[0].message);
  50. }
  51. } else {
  52. thedata.map(function(item, index) {
  53. theArr.push({
  54. key: index,
  55. name: item.name,
  56. id: item.id
  57. });
  58. });
  59. }
  60. this.setState({
  61. departmentArr: theArr
  62. });
  63. }.bind(this)
  64. }).always(
  65. function() {
  66. this.setState({
  67. loading: false
  68. });
  69. }.bind(this)
  70. );
  71. },
  72. loadData(pageNo, pageSize) {
  73. this.state.data = [];
  74. this.state.pagination.pageSize = 10;
  75. this.setState({
  76. selectedRowKeys: [],
  77. selectedRowKey: [],
  78. page: pageNo,
  79. loading: true,
  80. pagination: this.state.pagination
  81. });
  82. $.ajax({
  83. method: "get",
  84. dataType: "json",
  85. crossDomain: false,
  86. url: globalConfig.context + "/api/admin/financial/financeList",
  87. data: {
  88. pageNo: pageNo || 1,
  89. pageSize: pageSize || this.state.pagination.pageSize,
  90. buyerName: this.state.nameSearch, //客户名称
  91. orderNo: this.state.orderNoSearch,
  92. startTime: this.state.releaseDate[0],
  93. endTime: this.state.releaseDate[1],
  94. startFinalReceivablesTime: this.state.shouKuanDate[0],
  95. endFinalReceivablesTime: this.state.shouKuanDate[1],
  96. departmentId: this.state.departmenttList,
  97. processStatus: this.state.processStatusSearch,
  98. contractNo: this.state.contractNoSearch,
  99. liquidationStatus: this.state.liquidationStatus
  100. },
  101. success: function(data) {
  102. let theArr = [];
  103. if (!data.data || !data.data.pagination.list) {
  104. if (data.error && data.error.length) {
  105. message.warning(data.error[0].message);
  106. }
  107. } else {
  108. for (let i = 0; i < data.data.pagination.list.length; i++) {
  109. let thisdata = data.data.pagination.list[i];
  110. theArr.push({
  111. key: thisdata.orderNo,
  112. orderNo: thisdata.orderNo,
  113. orderType: thisdata.orderType,
  114. orderStatus: thisdata.orderStatus,
  115. sellerName: thisdata.sellerName,
  116. processStatus: thisdata.processStatus,
  117. liquidationStatus: thisdata.liquidationStatus,
  118. approval: thisdata.approval,
  119. buyerName: thisdata.buyerName,
  120. actuallyTotalAmount: thisdata.actuallyTotalAmount,
  121. signTime: thisdata.signTime,
  122. companyId: thisdata.companyId,
  123. companyName: thisdata.companyName,
  124. buyerId: thisdata.buyerId,
  125. buyerName: thisdata.buyerName,
  126. contractNo: thisdata.contractNo,
  127. createTime: thisdata.createTime,
  128. departmentName: thisdata.departmentName,
  129. invoiceAmount: thisdata.invoiceAmount,
  130. finalReceivables: thisdata.finalReceivables,
  131. finalReceivablesTime: thisdata.finalReceivablesTime,
  132. signTotalAmount: thisdata.signTotalAmount
  133. });
  134. }
  135. }
  136. this.state.pagination.current = data.data.pagination.pageNo;
  137. this.state.pagination.total = data.data.pagination.totalCount;
  138. if (
  139. data.data &&
  140. data.data.pagination.list &&
  141. !data.data.pagination.list.length
  142. ) {
  143. this.state.pagination.current = 0;
  144. this.state.pagination.total = 0;
  145. }
  146. this.setState({
  147. totalPage: data.data.pagination.totalPage,
  148. dataSource: theArr,
  149. pagination: this.state.pagination,
  150. totalHui: data.data.count ? data.data.count.signTotalAmount : 0,
  151. hui: data.data.count ? data.data.count.actuallyTotalAmount : 0
  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. searchMore: true,
  165. dvisible: false,
  166. assignVisibleX: false,
  167. assignVisibleY: false,
  168. releaseDate: [],
  169. shouKuanDate: [],
  170. assignDataX: [],
  171. assignDataY: [],
  172. totalPage: 0,
  173. // processStatusSearch: "3",
  174. boHuivisible: false,
  175. selectedRowKeys: [],
  176. selectedRows: [],
  177. loading: false,
  178. pagination: {
  179. defaultCurrent: 1,
  180. defaultPageSize: 10,
  181. showQuickJumper: true,
  182. pageSize: 10,
  183. onChange: function(page) {
  184. this.loadData(page);
  185. }.bind(this),
  186. showTotal: function(total) {
  187. return "共" + total + "条数据";
  188. }
  189. },
  190. // 子组件改变的表格title数组
  191. changeList: undefined,
  192. printColumns: [
  193. {
  194. title: "合同编号",
  195. dataIndex: "contractNo",
  196. key: "contractNo"
  197. },
  198. {
  199. title: "订单编号",
  200. dataIndex: "orderNo",
  201. key: "orderNo"
  202. // fixed: "left"
  203. },
  204. {
  205. title: "客户名称",
  206. dataIndex: "buyerName",
  207. key: "buyerName"
  208. },
  209. {
  210. title: "订单部门",
  211. dataIndex: "departmentName",
  212. key: "departmentName"
  213. },
  214. {
  215. title: "订单负责人",
  216. dataIndex: "sellerName",
  217. key: "sellerName"
  218. },
  219. {
  220. title: "签单日期",
  221. dataIndex: "signTime",
  222. key: "signTime"
  223. },
  224. {
  225. title: "下单日期",
  226. dataIndex: "createTime",
  227. key: "createTime"
  228. },
  229. {
  230. title: "签单金额(万元)",
  231. dataIndex: "signTotalAmount",
  232. key: "signTotalAmount"
  233. },
  234. {
  235. title: "开票金额(万元)",
  236. dataIndex: "invoiceAmount",
  237. key: "invoiceAmount"
  238. },
  239. {
  240. title: "已收款(万元)",
  241. dataIndex: "actuallyTotalAmount",
  242. key: "actuallyTotalAmount"
  243. },
  244. {
  245. title: "最近收款(万元)",
  246. dataIndex: "finalReceivables",
  247. key: "finalReceivables"
  248. },
  249. {
  250. title: "最近收款时间",
  251. dataIndex: "finalReceivablesTime",
  252. key: "finalReceivablesTime"
  253. },
  254. {
  255. title: "结算状态",
  256. dataIndex: "liquidationStatus",
  257. key: "liquidationStatus",
  258. render: text => {
  259. return getLiquidationStatus(text);
  260. }
  261. },
  262. {
  263. title: "流程状态",
  264. dataIndex: "processStatus",
  265. key: "processStatus",
  266. render: text => {
  267. return getProcessStatus(text);
  268. }
  269. },
  270. {
  271. title: "特批状态",
  272. dataIndex: "approval",
  273. key: "approval",
  274. render: text => {
  275. return getApproval(text);
  276. }
  277. }
  278. ],
  279. columns: [
  280. {
  281. title: "合同编号",
  282. dataIndex: "contractNo",
  283. key: "contractNo",
  284. className: "title-table"
  285. },
  286. {
  287. title: "订单编号",
  288. dataIndex: "orderNo",
  289. key: "orderNo",
  290. className: "title-table"
  291. // fixed: "left"
  292. },
  293. {
  294. title: "客户名称",
  295. dataIndex: "buyerName",
  296. key: "buyerName",
  297. className: "title-table"
  298. },
  299. {
  300. title: "订单部门",
  301. dataIndex: "departmentName",
  302. key: "departmentName",
  303. className: "title-table"
  304. },
  305. {
  306. title: "订单负责人",
  307. dataIndex: "sellerName",
  308. key: "sellerName",
  309. className: "title-table"
  310. },
  311. {
  312. title: "签单日期",
  313. dataIndex: "signTime",
  314. key: "signTime",
  315. className: "title-table"
  316. },
  317. {
  318. title: "下单日期",
  319. dataIndex: "createTime",
  320. key: "createTime",
  321. className: "title-table"
  322. },
  323. {
  324. title: "签单金额(万元)",
  325. dataIndex: "signTotalAmount",
  326. key: "signTotalAmount",
  327. className: "title-table"
  328. },
  329. {
  330. title: "开票金额(万元)",
  331. dataIndex: "invoiceAmount",
  332. key: "invoiceAmount",
  333. className: "title-table"
  334. },
  335. {
  336. title: "已收款(万元)",
  337. dataIndex: "actuallyTotalAmount",
  338. key: "actuallyTotalAmount",
  339. className: "title-table"
  340. },
  341. {
  342. title: "最近收款(万元)",
  343. dataIndex: "finalReceivables",
  344. key: "finalReceivables",
  345. className: "title-table"
  346. },
  347. {
  348. title: "最近收款时间",
  349. dataIndex: "finalReceivablesTime",
  350. key: "finalReceivablesTime",
  351. className: "title-table"
  352. },
  353. {
  354. title: "结算状态",
  355. dataIndex: "liquidationStatus",
  356. key: "liquidationStatus",
  357. className: "title-table",
  358. render: text => {
  359. return getLiquidationStatus(text);
  360. }
  361. },
  362. {
  363. title: "流程状态",
  364. dataIndex: "processStatus",
  365. key: "processStatus",
  366. className: "title-table",
  367. render: text => {
  368. return getProcessStatus(text);
  369. }
  370. },
  371. {
  372. title: "特批状态",
  373. dataIndex: "approval",
  374. key: "approval",
  375. className: "title-table",
  376. render: text => {
  377. return getApproval(text);
  378. }
  379. },
  380. // {
  381. // title: '订单状态',
  382. // dataIndex: 'orderStatus',
  383. // key: 'orderStatus',
  384. // render: text => { return getNewOrderStatus(text)}
  385. // },
  386. // {
  387. // title: "操作",
  388. // dataIndex: "caozuo",
  389. // key: "caouzo",
  390. // className: "title-table",
  391. // render: (text, recard) => {
  392. // return (
  393. // <div>
  394. // {recard.liquidationStatus < 2 &&
  395. // (recard.approval === 1 || recard.approval === 2) ? (
  396. // <Button
  397. // style={{ background: "rgb(192,192,192)" }}
  398. // onClick={e => {
  399. // e.stopPropagation(), this.evaluateX(recard);
  400. // }}
  401. // >
  402. // 收款
  403. // </Button>
  404. // ) : (
  405. // <Button
  406. // type="primary"
  407. // onClick={e => {
  408. // e.stopPropagation(), this.evaluateX(recard);
  409. // }}
  410. // >
  411. // 收款
  412. // </Button>
  413. // )}
  414. // {recard.processStatus < 4 ? (
  415. // <Button
  416. // type="primary"
  417. // onClick={e => {
  418. // e.stopPropagation(), this.evaluateZ(recard);
  419. // }}
  420. // style={{ marginLeft: "5px" }}
  421. // >
  422. // 通过
  423. // </Button>
  424. // ) : (
  425. // ""
  426. // )}
  427. // {!(
  428. // recard.actuallyTotalAmount &&
  429. // Number(recard.actuallyTotalAmount) > 0
  430. // ) && (
  431. // <Button
  432. // type="danger"
  433. // style={{ marginLeft: "5px" }}
  434. // onClick={e => {
  435. // e.stopPropagation(), this.reject(recard);
  436. // }}
  437. // >
  438. // 驳回
  439. // </Button>
  440. // )}
  441. // {
  442. // // <Button
  443. // // type="primary"
  444. // // style={{ marginLeft: "5px" }}
  445. // // onClick={e => {
  446. // // e.stopPropagation(), this.evaluateY(recard, "财务专员");
  447. // // console.log(recard);
  448. // // }}
  449. // // >
  450. // // 转交
  451. // // </Button>
  452. // }
  453. // </div>
  454. // );
  455. // }
  456. // }
  457. ],
  458. dataSource: [],
  459. searchTime: [],
  460. columnsDate: [
  461. {
  462. title: "编号",
  463. dataIndex: "id",
  464. key: "id"
  465. },
  466. {
  467. title: "订单编号",
  468. dataIndex: "orderno",
  469. key: "orderno"
  470. },
  471. {
  472. title: "开票金额(万元)",
  473. dataIndex: "amount",
  474. key: "amount"
  475. },
  476. {
  477. title: "申请时间",
  478. dataIndex: "createTime",
  479. key: "createTime"
  480. },
  481. {
  482. title: "开票状态",
  483. dataIndex: "status",
  484. key: "status",
  485. render: text => {
  486. return getInvoiceStatus(text);
  487. }
  488. }
  489. ],
  490. waterlistDate: [
  491. {
  492. title: "订单编号",
  493. dataIndex: "orderNo",
  494. key: "orderNo"
  495. },
  496. {
  497. title: "平台流水号",
  498. dataIndex: "billNo",
  499. key: "billNo"
  500. // fixed: "left"
  501. },
  502. {
  503. title: "收款金额(万元)",
  504. dataIndex: "transactionAmount",
  505. key: "transactionAmount"
  506. },
  507. {
  508. title: "收款方",
  509. dataIndex: "payeeName",
  510. key: "payeeName"
  511. },
  512. {
  513. title: "付款方",
  514. dataIndex: "payerName",
  515. key: "payerName"
  516. },
  517. {
  518. title: "流水科目",
  519. dataIndex: "transactionSubject",
  520. key: "transactionSubject",
  521. render: text => {
  522. return getTransactionProject(text);
  523. }
  524. },
  525. {
  526. title: "收款类型",
  527. dataIndex: "type",
  528. key: "type"
  529. },
  530. {
  531. title: "财务流水时间",
  532. dataIndex: "financialPayTimes",
  533. key: "financialPayTimes"
  534. },
  535. {
  536. title: "财务流水号",
  537. dataIndex: "financialPayNo",
  538. key: "financialPayNo"
  539. },
  540. {
  541. title: "订单负责人",
  542. dataIndex: "saleName",
  543. key: "saleName"
  544. },
  545. {
  546. title: "创建时间",
  547. dataIndex: "createTimes",
  548. key: "createTimes"
  549. }
  550. ],
  551. waterData: []
  552. };
  553. },
  554. // 特批通过
  555. evaluateZ(record) {
  556. $.ajax({
  557. method: "POST",
  558. dataType: "json",
  559. crossDomain: false,
  560. url: globalConfig.context + "/api/admin/financial/financeApproval",
  561. data: {
  562. orderNo: record.orderNo
  563. }
  564. }).done(
  565. function(data) {
  566. if (!data.error.length) {
  567. message.success("通过成功!");
  568. this.setState({
  569. loading: false
  570. });
  571. this.loadData();
  572. } else {
  573. message.warning(data.error[0].message);
  574. }
  575. }.bind(this)
  576. );
  577. },
  578. /* 收款 */
  579. evaluateX(recard) {
  580. this.state.assignDataX = recard;
  581. this.setState({
  582. assignVisibleX: true
  583. });
  584. },
  585. /* 转交 */
  586. evaluateY(recard, nub) {
  587. this.state.assignDataY = recard;
  588. this.setState({
  589. nub,
  590. assignVisibleY: true
  591. });
  592. },
  593. /* 驳回 */
  594. reject(recard) {
  595. this.setState({
  596. bohuiData: recard,
  597. boHuiVisible: true,
  598. content: ""
  599. });
  600. },
  601. boHuiOk() {
  602. this.setState({
  603. boHuiVisible: false
  604. });
  605. if (
  606. this.state.pagination.current == this.state.totalPage &&
  607. this.state.pagination.total % 10 == 1
  608. ) {
  609. this.loadData(this.state.page - 1);
  610. } else {
  611. this.loadData(this.state.page);
  612. }
  613. },
  614. boHuiCancel() {
  615. this.setState({
  616. boHuiVisible: false
  617. });
  618. },
  619. componentWillMount() {
  620. this.loadData();
  621. this.departmentList();
  622. },
  623. tableRowClick(record) {
  624. this.state.RowData = record;
  625. this.setState({
  626. showDesc: true
  627. });
  628. },
  629. closeDesc(e, s) {
  630. this.state.showDesc = e;
  631. if (s) {
  632. this.loadData(this.state.page);
  633. }
  634. },
  635. closeAssignX(e, s) {
  636. this.state.assignDataX = {};
  637. this.state.assignVisibleX = e;
  638. if (s) {
  639. this.loadData(this.state.page);
  640. }
  641. },
  642. closeAssignY(e, s) {
  643. this.state.assignDataY = {};
  644. this.state.assignVisibleY = e;
  645. if (s) {
  646. this.loadData(this.state.page);
  647. }
  648. },
  649. search() {
  650. this.loadData();
  651. },
  652. reset() {
  653. this.state.nameSearch = "";
  654. this.state.releaseDate = [];
  655. this.state.shouKuanDate = [];
  656. this.state.orderNoSearch = "";
  657. this.state.departmenttList = undefined;
  658. this.state.processStatus = [];
  659. this.state.contractNoSearch = "";
  660. this.loadData();
  661. },
  662. //驳回
  663. boHuiSubmit(e) {
  664. e.preventDefault();
  665. if (!this.state.content) {
  666. message.warning("请填写驳回原因");
  667. return false;
  668. }
  669. this.setState({
  670. loading: true
  671. });
  672. $.ajax({
  673. method: "POST",
  674. dataType: "json",
  675. crossDomain: false,
  676. url: globalConfig.context + "/api/admin/financial/reject",
  677. data: {
  678. orderNo: this.state.bohuiData.orderNo,
  679. reason: this.state.content
  680. }
  681. }).done(
  682. function(data) {
  683. if (!data.error.length) {
  684. message.success("驳回成功!");
  685. this.setState({
  686. loading: false
  687. });
  688. this.boHuiOk();
  689. } else {
  690. message.warning(data.error[0].message);
  691. }
  692. }.bind(this)
  693. );
  694. },
  695. searchSwitch() {
  696. this.setState({
  697. searchMore: !this.state.searchMore
  698. });
  699. },
  700. changeList(arr) {
  701. const newArr = [];
  702. this.state.columns.forEach(item => {
  703. arr.forEach(val => {
  704. if (val === item.title) {
  705. newArr.push(item);
  706. }
  707. });
  708. });
  709. this.setState({
  710. changeList: newArr
  711. });
  712. },
  713. callback(key) {
  714. console.log(key);
  715. },
  716. onSelectChange(selectedRowKeys) {
  717. // for(var i=0; i<selectedRowKeys.length; i++){
  718. // for(var j=i+1; j<selectedRowKeys.length; j++){
  719. // if(selectedRowKeys[i]==selectedRowKeys[j]){
  720. // selectedRowKeys.splice(j,1);
  721. // j--;
  722. // }
  723. // }
  724. // }
  725. this.setState({ selectedRowKeys });
  726. },
  727. inRecordCanl() {
  728. this.setState({
  729. bvisible: false
  730. });
  731. },
  732. inRecordData() {
  733. this.setState({
  734. loading: true
  735. });
  736. $.ajax({
  737. method: "get",
  738. dataType: "json",
  739. crossDomain: false,
  740. url:
  741. globalConfig.context +
  742. "/api/admin/orderInvoice/salesmanOrderInvoiceList",
  743. data: {
  744. orderNo: this.state.selectedRowKeys[0]
  745. },
  746. success: function(data) {
  747. let theArr = [];
  748. let sum = 0;
  749. if (!data.data) {
  750. if (data.error && data.error.length) {
  751. message.warning(data.error[0].message);
  752. }
  753. } else {
  754. for (let i = 0; i < data.data.list.length; i++) {
  755. let thisdata = data.data.list[i];
  756. sum += parseFloat(thisdata.amount);
  757. theArr.push({
  758. id: thisdata.id,
  759. orderno: thisdata.orderno, //订单编号
  760. amount: thisdata.amount, //签单金额
  761. createTime: thisdata.createTime, //流程状态
  762. status: thisdata.status, //结算状态
  763. rejectReason: thisdata.rejectReason
  764. });
  765. }
  766. }
  767. this.setState({
  768. recordData: theArr,
  769. sum: sum.toFixed(4)
  770. });
  771. }.bind(this)
  772. }).done(
  773. function() {
  774. this.setState({
  775. loading: false
  776. });
  777. }.bind(this)
  778. );
  779. },
  780. waterData() {
  781. this.state.data = [];
  782. this.setState({
  783. loading: true
  784. });
  785. $.ajax({
  786. method: "get",
  787. dataType: "json",
  788. crossDomain: false,
  789. url: globalConfig.context + "/api/admin/financial/myBillList",
  790. data: {
  791. orderNo: this.state.selectedRowKeys[0]
  792. },
  793. success: function(data) {
  794. let theArr = [];
  795. let waterSum = 0;
  796. if (!data.data || !data.data.list) {
  797. if (data.error && data.error.length) {
  798. message.warning(data.error[0].message);
  799. }
  800. } else {
  801. for (let i = 0; i < data.data.list.length; i++) {
  802. let thisdata = data.data.list[i];
  803. waterSum += parseFloat(thisdata.transactionAmount);
  804. theArr.push({
  805. key: i,
  806. orderNo: thisdata.orderNo,
  807. billNo: thisdata.billNo,
  808. transactionAmount: thisdata.transactionAmount,
  809. payeeName: thisdata.payeeName,
  810. payerName: thisdata.payerName,
  811. transactionSubject: thisdata.transactionSubject,
  812. transactionChannel: thisdata.transactionChannel,
  813. financialPayTimes: thisdata.financialPayTimes,
  814. financialPayNo: thisdata.financialPayNo,
  815. createrName: thisdata.createrName,
  816. saleName: thisdata.saleName,
  817. createTimes: thisdata.createTimes,
  818. type: thisdata.type == 0 ? "手工" : "批量"
  819. });
  820. }
  821. }
  822. this.setState({
  823. waterData: theArr,
  824. waterSum: waterSum.toFixed(4)
  825. });
  826. }.bind(this)
  827. }).always(
  828. function() {
  829. this.setState({
  830. loading: false
  831. });
  832. }.bind(this)
  833. );
  834. },
  835. waterCanl() {
  836. this.setState({
  837. cvisible: false
  838. });
  839. },
  840. exportKaip() {
  841. window.location.href =
  842. globalConfig.context +
  843. "/api/admin/receivables/exportInvoice?" +
  844. `orderNo=${this.state.selectedRowKeys}`;
  845. },
  846. exportAll() {
  847. window.location.href =
  848. globalConfig.context +
  849. "/api/admin/receivables/exportReceivables?" +
  850. `orderNo=${
  851. this.state.orderNoSearch ? this.state.orderNoSearch : ""
  852. }&buyerName=${
  853. this.state.nameSearch ? this.state.nameSearch : ""
  854. }&departmentId=${
  855. this.state.departmenttList ? this.state.departmenttList : ""
  856. }&contractNo=${
  857. this.state.contractNoSearch ? this.state.contractNoSearch : ""
  858. }&processStatus=${this.state.processStatusSearch}`;
  859. },
  860. exportWater() {
  861. window.location.href =
  862. globalConfig.context +
  863. "/api/admin/receivables/exportMyBill?" +
  864. `orderNo=${this.state.selectedRowKeys}`;
  865. },
  866. printAll() {
  867. this.setState({
  868. dvisible: true
  869. // loading: true
  870. });
  871. this.loadData(1, 9999);
  872. this.state.pagination.pageSize = 9999;
  873. this.setState({
  874. pagination: this.state.pagination
  875. });
  876. window.setTimeout(() => {
  877. document.querySelectorAll(
  878. ".ant-pagination.ant-table-pagination.mini"
  879. )[0].style.display = "none";
  880. // let tr = document.querySelectorAll(".patent-table tr");
  881. // for(let i = 0; i < tr.length; i++) {
  882. // tr[i].style.fontSize = "6px"
  883. // }
  884. // let td = document.querySelectorAll(".patent-table tr td");
  885. // for (let i = 0; i < td.length; i++) {
  886. // td[i].style.padding = "0 0 0 0";
  887. // }
  888. }, 100);
  889. },
  890. render() {
  891. const formItemLayout = {
  892. labelCol: { span: 8 },
  893. wrapperCol: { span: 14 }
  894. };
  895. const { RangePicker } = DatePicker;
  896. var departmentArr = this.state.departmentArr || [];
  897. const { loading, selectedRowKeys, visible } = this.state;
  898. const rowSelection = {
  899. selectedRowKeys,
  900. onChange: this.onSelectChange,
  901. hideDefaultSelections: true
  902. };
  903. return (
  904. <div className="user-content">
  905. <div className="content-title" style={{ marginBottom: 10 }}>
  906. <span style={{ fontWeight: 900, fontSize: 16 }}>收款结算</span>
  907. </div>
  908. <Tabs defaultActiveKey="2" onChange={this.callback} className="test">
  909. <TabPane tab="更改表格显示数据" key="1">
  910. <div style={{ marginLeft: 10 }}>
  911. <ChooseList
  912. columns={this.state.columns}
  913. changeFn={this.changeList}
  914. changeList={this.state.changeList}
  915. top={55}
  916. margin={11}
  917. />
  918. </div>
  919. </TabPane>
  920. <TabPane tab="搜索" key="2">
  921. <div className="user-search" style={{ marginLeft: 10 }}>
  922. <Input
  923. placeholder="订单编号"
  924. value={this.state.orderNoSearch}
  925. onChange={e => {
  926. this.setState({ orderNoSearch: e.target.value });
  927. }}
  928. />
  929. <Input
  930. placeholder="客户名称"
  931. value={this.state.nameSearch}
  932. onChange={e => {
  933. this.setState({ nameSearch: e.target.value });
  934. }}
  935. />
  936. <Select
  937. placeholder="订单部门"
  938. style={{ width: 150, marginRight: 10 }}
  939. value={this.state.departmenttList}
  940. onChange={e => {
  941. this.setState({ departmenttList: e });
  942. }}
  943. >
  944. {departmentArr.map(function(item) {
  945. return (
  946. <Select.Option key={item.id}>{item.name}</Select.Option>
  947. );
  948. })}
  949. </Select>
  950. <Input
  951. placeholder="合同编号"
  952. value={this.state.contractNoSearch}
  953. onChange={e => {
  954. this.setState({
  955. contractNoSearch: e.target.value
  956. });
  957. }}
  958. />
  959. <Select
  960. placeholder="流程状态"
  961. onChange={e => {
  962. this.setState({ processStatusSearch: e });
  963. }}
  964. style={{ width: 160, marginRight: 5 }}
  965. value={this.state.processStatusSearch}
  966. >
  967. <Option value="3">未分配</Option>
  968. <Option value="4">已分配</Option>
  969. </Select>
  970. <Select
  971. placeholder="结算状态"
  972. onChange={e => {
  973. this.setState({ liquidationStatus: e });
  974. }}
  975. style={{ width: 160, marginRight: 5 }}
  976. value={this.state.liquidationStatus}
  977. >
  978. <Option value="0">首付待付清</Option>
  979. <Option value="1">尾款待付清</Option>
  980. <Option value="2">已付清</Option>
  981. </Select>
  982. <span style={{}}>下单日期:</span>
  983. <RangePicker
  984. value={[
  985. this.state.releaseDate[0]
  986. ? moment(this.state.releaseDate[0])
  987. : null,
  988. this.state.releaseDate[1]
  989. ? moment(this.state.releaseDate[1])
  990. : null
  991. ]}
  992. onChange={(data, dataString) => {
  993. this.setState({ releaseDate: dataString });
  994. }}
  995. />
  996. <span style={{}}>最近收款:</span>
  997. <RangePicker
  998. value={[
  999. this.state.shouKuanDate[0]
  1000. ? moment(this.state.shouKuanDate[0])
  1001. : null,
  1002. this.state.shouKuanDate[1]
  1003. ? moment(this.state.shouKuanDate[1])
  1004. : null
  1005. ]}
  1006. onChange={(data, dataString) => {
  1007. this.setState({ shouKuanDate: dataString });
  1008. }}
  1009. />
  1010. <Button
  1011. type="primary"
  1012. onClick={this.search}
  1013. style={{ marginLeft: 10 }}
  1014. >
  1015. 搜索
  1016. </Button>
  1017. <Button onClick={this.reset}>重置</Button>
  1018. </div>
  1019. </TabPane>
  1020. {/* <TabPane tab="打印" key="3">
  1021. <Button
  1022. type="primary"
  1023. style={{ margin: "11px 0px 10px 10px" }}
  1024. onClick={this.printAll}
  1025. disabled={!this.state.dataSource.length}
  1026. >
  1027. 打印所有列表信息
  1028. </Button>
  1029. <Button
  1030. type="primary"
  1031. disabled={this.state.selectedRowKeys.length != 1}
  1032. style={{ margin: "11px 0px 10px 10px" }}
  1033. onClick={() => {
  1034. this.inRecordData();
  1035. this.setState({
  1036. bvisible: true
  1037. });
  1038. }}
  1039. >
  1040. 打印开票详情
  1041. </Button>
  1042. <Button
  1043. type="primary"
  1044. disabled={this.state.selectedRowKeys.length != 1}
  1045. style={{ margin: "11px 0px 10px 10px" }}
  1046. onClick={() => {
  1047. this.waterData();
  1048. this.setState({
  1049. cvisible: true
  1050. });
  1051. }}
  1052. >
  1053. 打印收款流水
  1054. </Button>
  1055. </TabPane>
  1056. <TabPane tab="导出Excel" key="4">
  1057. <Button
  1058. type="primary"
  1059. style={{ margin: "11px 0px 10px 10px" }}
  1060. onClick={this.exportAll}
  1061. >
  1062. 导出当前列表
  1063. </Button>
  1064. <Button
  1065. type="primary"
  1066. disabled={this.state.selectedRowKeys.length != 1}
  1067. style={{ margin: "11px 0px 10px 10px" }}
  1068. onClick={this.exportKaip}
  1069. >
  1070. 导出所选开票详情
  1071. </Button>
  1072. <Button
  1073. type="primary"
  1074. disabled={this.state.selectedRowKeys.length != 1}
  1075. style={{ margin: "11px 0px 10px 10px" }}
  1076. onClick={this.exportWater}
  1077. >
  1078. 导出所选收款详情流水
  1079. </Button>
  1080. </TabPane> */}
  1081. <TabPane tab="查看" key="5">
  1082. <Button
  1083. type="primary"
  1084. disabled={this.state.selectedRowKeys.length != 1}
  1085. style={{ margin: "11px 0px 10px 10px" }}
  1086. onClick={() => {
  1087. this.inRecordData();
  1088. this.setState({
  1089. bvisible: true
  1090. });
  1091. }}
  1092. >
  1093. 查看开票详情
  1094. </Button>
  1095. <Button
  1096. type="primary"
  1097. disabled={this.state.selectedRowKeys.length != 1}
  1098. style={{ margin: "11px 0px 10px 10px" }}
  1099. onClick={() => {
  1100. this.waterData();
  1101. this.setState({
  1102. cvisible: true
  1103. });
  1104. }}
  1105. >
  1106. 详情收款流水
  1107. </Button>
  1108. </TabPane>
  1109. {/* <TabPane tab="批量操作" key="6">
  1110. <Button
  1111. type="primary"
  1112. disabled={this.state.selectedRowKeys.length == 0}
  1113. style={{ margin: "0px 0px 10px 10px" }}
  1114. onClick={e => {
  1115. e.stopPropagation(),
  1116. this.evaluateY(this.state.selectedRowKeys, "财务专员");
  1117. }}
  1118. >
  1119. 转交
  1120. </Button>
  1121. </TabPane> */}
  1122. </Tabs>
  1123. <div className="patent-table">
  1124. <Spin spinning={this.state.loading}>
  1125. <Table
  1126. bordered
  1127. columns={
  1128. this.state.changeList == undefined
  1129. ? this.state.columns
  1130. : this.state.changeList
  1131. }
  1132. dataSource={this.state.dataSource}
  1133. rowSelection={rowSelection}
  1134. scroll={{ x: "max-content", y: 0 }}
  1135. pagination={this.state.pagination}
  1136. onRowDoubleClick={this.tableRowClick.bind(this)}
  1137. size="small"
  1138. />
  1139. </Spin>
  1140. <p
  1141. style={{ display: "inline-block", fontSize: "14px", color: "red" }}
  1142. >
  1143. {
  1144. <span style={{ marginRight: 10 }}>
  1145. {`收款金额总计(万元):${this.state.hui ? this.state.hui : "0"}`}
  1146. </span>
  1147. }
  1148. {
  1149. <span>
  1150. {`合同额总计(万元):${
  1151. this.state.totalHui ? this.state.totalHui : "0"
  1152. }`}
  1153. </span>
  1154. }
  1155. </p>
  1156. </div>
  1157. <Assign
  1158. title="任务"
  1159. selApi={"/api/admin/newOrder/updateFinance"}
  1160. data={this.state.assignDataY}
  1161. showDesc={this.state.assignVisibleY}
  1162. closeDesc={this.closeAssignY.bind(this)}
  1163. // fenpaiData={8}
  1164. specially={0}
  1165. roleName={this.state.nub}
  1166. requestMethod={"get"}
  1167. />
  1168. <OrderDesc
  1169. data={this.state.RowData}
  1170. showDesc={this.state.showDesc}
  1171. closeDesc={this.closeDesc.bind(this)}
  1172. />
  1173. <Receivable
  1174. title="收款记录"
  1175. api="/api/admin/financial/addReceiptsFlow"
  1176. data={this.state.assignDataX}
  1177. showDesc={this.state.assignVisibleX}
  1178. closeDesc={this.closeAssignX.bind(this)}
  1179. />
  1180. <Modal
  1181. visible={this.state.boHuiVisible}
  1182. width="400px"
  1183. title="驳回备注"
  1184. footer=""
  1185. onOk={this.boHuiOk}
  1186. onCancel={this.boHuiCancel}
  1187. >
  1188. <Form layout="horizontal" onSubmit={this.boHuiSubmit}>
  1189. <Spin spinning={this.state.loading}>
  1190. <FormItem
  1191. labelCol={{ span: 5 }}
  1192. wrapperCol={{ span: 16 }}
  1193. label={
  1194. <span>
  1195. <strong style={{ color: "#f00" }}>*</strong>驳回原因
  1196. </span>
  1197. }
  1198. >
  1199. <Input
  1200. type="textarea"
  1201. rows={4}
  1202. placeholder="请输入驳回原因"
  1203. value={this.state.content}
  1204. onChange={e => {
  1205. this.setState({ content: e.target.value });
  1206. }}
  1207. />
  1208. </FormItem>
  1209. <FormItem wrapperCol={{ span: 12, offset: 5 }}>
  1210. <Button
  1211. type="primary"
  1212. htmlType="submit"
  1213. style={{ marginRight: 20 }}
  1214. >
  1215. 驳回
  1216. </Button>
  1217. <Button
  1218. type="default"
  1219. onClick={() => {
  1220. this.boHuiCancel();
  1221. }}
  1222. >
  1223. 取消
  1224. </Button>
  1225. </FormItem>
  1226. </Spin>
  1227. </Form>
  1228. </Modal>
  1229. <Modal
  1230. visible={this.state.bvisible}
  1231. footer=""
  1232. title="开票历史记录"
  1233. className="admin-desc-content"
  1234. width="900px"
  1235. onCancel={this.inRecordCanl}
  1236. >
  1237. <Spin spinning={this.state.loading}>
  1238. <div
  1239. className="patent-table"
  1240. ref={e => {
  1241. this.refs.kaiPiao = e;
  1242. }}
  1243. >
  1244. <Table
  1245. columns={this.state.columnsDate}
  1246. dataSource={this.state.recordData}
  1247. pagination={false}
  1248. bordered
  1249. />
  1250. <div className="clearfix" style={{ marginTop: "20px" }}>
  1251. <FormItem
  1252. className="half-item"
  1253. {...formItemLayout}
  1254. label={<span style={{ fontSize: "14px" }}>开票总计</span>}
  1255. >
  1256. <span>{this.state.sum + "(万元)"}</span>
  1257. </FormItem>
  1258. </div>
  1259. <ReactToPrint
  1260. trigger={() => (
  1261. <Button
  1262. type="primary"
  1263. style={{
  1264. float: "right",
  1265. // marginTop: 10,
  1266. position: "absolute",
  1267. top: -54,
  1268. right: 30
  1269. }}
  1270. >
  1271. 打印
  1272. </Button>
  1273. )}
  1274. content={() => this.refs.kaiPiao}
  1275. />
  1276. </div>
  1277. </Spin>
  1278. </Modal>
  1279. <Modal
  1280. visible={this.state.cvisible}
  1281. footer=""
  1282. title="详细收款流水"
  1283. className="admin-desc-content"
  1284. width="1300px"
  1285. onCancel={this.waterCanl}
  1286. >
  1287. <Spin spinning={this.state.loading}>
  1288. <div
  1289. className="patent-table"
  1290. ref={e => {
  1291. this.refs.shouKuan = e;
  1292. }}
  1293. >
  1294. <Table
  1295. columns={this.state.waterlistDate}
  1296. dataSource={this.state.waterData}
  1297. pagination={false}
  1298. bordered
  1299. />
  1300. <div className="clearfix" style={{ marginTop: "20px" }}>
  1301. <FormItem
  1302. className="half-item"
  1303. {...formItemLayout}
  1304. label={<span style={{ fontSize: "14px" }}>总计金额</span>}
  1305. >
  1306. <span>{this.state.waterSum + "(万元)"}</span>
  1307. </FormItem>
  1308. </div>
  1309. <ReactToPrint
  1310. trigger={() => (
  1311. <Button
  1312. type="primary"
  1313. style={{
  1314. float: "right",
  1315. position: "absolute",
  1316. top: -54,
  1317. right: 30
  1318. }}
  1319. >
  1320. 打印
  1321. </Button>
  1322. )}
  1323. content={() => this.refs.shouKuan}
  1324. />
  1325. </div>
  1326. </Spin>
  1327. </Modal>
  1328. <Modal
  1329. visible={this.state.dvisible}
  1330. footer=""
  1331. title="所有列表信息"
  1332. className="admin-desc-content"
  1333. width="1300px"
  1334. onCancel={() => {
  1335. this.loadData();
  1336. this.setState({
  1337. dvisible: false
  1338. });
  1339. }}
  1340. >
  1341. <Spin spinning={this.state.loading}>
  1342. <div
  1343. className="patent-table"
  1344. style={{
  1345. // width: 900,
  1346. // position: "relative",
  1347. // left: "50%",
  1348. // transform: "translate(-50%)",
  1349. padding: "25px 0 30px 30px"
  1350. }}
  1351. ref={e => {
  1352. this.refs.all = e;
  1353. }}
  1354. >
  1355. <Table
  1356. columns={this.state.printColumns}
  1357. dataSource={this.state.dataSource}
  1358. pagination={this.state.pagination}
  1359. bordered
  1360. size="small"
  1361. />
  1362. </div>
  1363. </Spin>
  1364. <ReactToPrint
  1365. trigger={() => (
  1366. <Button
  1367. type="primary"
  1368. style={{
  1369. float: "right",
  1370. marginTop: 10,
  1371. position: "absolute",
  1372. top: 0,
  1373. right: 30
  1374. }}
  1375. >
  1376. 打印
  1377. </Button>
  1378. )}
  1379. content={() => this.refs.all}
  1380. />
  1381. </Modal>
  1382. </div>
  1383. );
  1384. }
  1385. });
  1386. export default ShouKuangAll;