shouKuang.jsx 39 KB

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