shouKuang.jsx 39 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393
  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. 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=${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}`;
  851. },
  852. exportWater() {
  853. window.location.href =
  854. globalConfig.context +
  855. "/api/admin/receivables/exportMyBill?" +
  856. `orderNo=${this.state.selectedRowKeys}`;
  857. },
  858. printAll() {
  859. this.setState({
  860. dvisible: true,
  861. // loading: true
  862. });
  863. this.loadData(1,9999)
  864. this.state.pagination.pageSize = 9999
  865. this.setState({
  866. pagination: this.state.pagination
  867. });
  868. window.setTimeout(()=> {
  869. document.querySelectorAll(".ant-pagination.ant-table-pagination.mini")[0].style.display="none"
  870. // let tr = document.querySelectorAll(".patent-table tr");
  871. // for(let i = 0; i < tr.length; i++) {
  872. // tr[i].style.fontSize = "6px"
  873. // }
  874. // let td = document.querySelectorAll(".patent-table tr td");
  875. // for (let i = 0; i < td.length; i++) {
  876. // td[i].style.padding = "0 0 0 0";
  877. // }
  878. },100)
  879. },
  880. render() {
  881. const formItemLayout = {
  882. labelCol: { span: 8 },
  883. wrapperCol: { span: 14 }
  884. };
  885. const { RangePicker } = DatePicker;
  886. var departmentArr = this.state.departmentArr || [];
  887. const { loading, selectedRowKeys, visible } = this.state;
  888. const rowSelection = {
  889. selectedRowKeys,
  890. onChange: this.onSelectChange,
  891. hideDefaultSelections: true
  892. };
  893. return (
  894. <div className="user-content">
  895. <div className="content-title" style={{ marginBottom: 10 }}>
  896. <span style={{ fontWeight: 900, fontSize: 16 }}>收款结算</span>
  897. </div>
  898. <Tabs defaultActiveKey="2" onChange={this.callback} className="test">
  899. <TabPane tab="更改表格显示数据" key="1">
  900. <div style={{ marginLeft: 10 }}>
  901. <ChooseList
  902. columns={this.state.columns}
  903. changeFn={this.changeList}
  904. changeList={this.state.changeList}
  905. top={55}
  906. margin={11}
  907. />
  908. </div>
  909. </TabPane>
  910. <TabPane tab="搜索" key="2">
  911. <div className="user-search" style={{ marginLeft: 10 }}>
  912. <Input
  913. placeholder="订单编号"
  914. value={this.state.orderNoSearch}
  915. onChange={e => {
  916. this.setState({ orderNoSearch: e.target.value });
  917. }}
  918. />
  919. <Input
  920. placeholder="客户名称"
  921. value={this.state.nameSearch}
  922. onChange={e => {
  923. this.setState({ nameSearch: e.target.value });
  924. }}
  925. />
  926. <Select
  927. placeholder="订单部门"
  928. style={{ width: 150, marginRight: 10 }}
  929. value={this.state.departmenttList}
  930. onChange={e => {
  931. this.setState({ departmenttList: e });
  932. }}
  933. >
  934. {departmentArr.map(function(item) {
  935. return (
  936. <Select.Option key={item.id}>{item.name}</Select.Option>
  937. );
  938. })}
  939. </Select>
  940. <Input
  941. placeholder="合同编号"
  942. value={this.state.contractNoSearch}
  943. onChange={e => {
  944. this.setState({
  945. contractNoSearch: e.target.value
  946. });
  947. }}
  948. />
  949. <Select
  950. placeholder="流程状态"
  951. onChange={e => {
  952. this.setState({ processStatusSearch: e });
  953. }}
  954. style={{ width: 160, marginRight: 5 }}
  955. value={this.state.processStatusSearch}
  956. >
  957. <Option value="3">未分配</Option>
  958. <Option value="4">已分配</Option>
  959. </Select>
  960. <Select
  961. placeholder="结算状态"
  962. onChange={e => {
  963. this.setState({ liquidationStatus: e });
  964. }}
  965. style={{ width: 160, marginRight: 5 }}
  966. value={this.state.liquidationStatus}
  967. >
  968. <Option value="0">首付待付清</Option>
  969. <Option value="1">尾款待付清</Option>
  970. <Option value="2">已付清</Option>
  971. </Select>
  972. <span style={{}}>下单日期:</span>
  973. <RangePicker
  974. value={[
  975. this.state.releaseDate[0]
  976. ? moment(this.state.releaseDate[0])
  977. : null,
  978. this.state.releaseDate[1]
  979. ? moment(this.state.releaseDate[1])
  980. : null
  981. ]}
  982. onChange={(data, dataString) => {
  983. this.setState({ releaseDate: dataString });
  984. }}
  985. />
  986. <span style={{}}>最近收款:</span>
  987. <RangePicker
  988. value={[
  989. this.state.shouKuanDate[0]
  990. ? moment(this.state.shouKuanDate[0])
  991. : null,
  992. this.state.shouKuanDate[1]
  993. ? moment(this.state.shouKuanDate[1])
  994. : null
  995. ]}
  996. onChange={(data, dataString) => {
  997. this.setState({ shouKuanDate: dataString });
  998. }}
  999. />
  1000. <Button
  1001. type="primary"
  1002. onClick={this.search}
  1003. style={{ marginLeft: 10 }}
  1004. >
  1005. 搜索
  1006. </Button>
  1007. <Button onClick={this.reset}>重置</Button>
  1008. </div>
  1009. </TabPane>
  1010. <TabPane tab="打印" key="3">
  1011. <Button
  1012. type="primary"
  1013. style={{ margin: "11px 0px 10px 10px" }}
  1014. onClick={this.printAll}
  1015. disabled={!this.state.dataSource.length}
  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.inRecordData();
  1025. this.setState({
  1026. bvisible: true
  1027. });
  1028. }}
  1029. >
  1030. 打印开票详情
  1031. </Button>
  1032. <Button
  1033. type="primary"
  1034. disabled={this.state.selectedRowKeys.length != 1}
  1035. style={{ margin: "11px 0px 10px 10px" }}
  1036. onClick={() => {
  1037. this.waterData();
  1038. this.setState({
  1039. cvisible: true
  1040. });
  1041. }}
  1042. >
  1043. 打印收款流水
  1044. </Button>
  1045. </TabPane>
  1046. <TabPane tab="导出Excel" key="4">
  1047. <Button
  1048. type="primary"
  1049. style={{ margin: "11px 0px 10px 10px" }}
  1050. onClick={this.exportAll}
  1051. >
  1052. 导出当前列表
  1053. </Button>
  1054. <Button
  1055. type="primary"
  1056. disabled={this.state.selectedRowKeys.length != 1}
  1057. style={{ margin: "11px 0px 10px 10px" }}
  1058. onClick={this.exportKaip}
  1059. >
  1060. 导出所选开票详情
  1061. </Button>
  1062. <Button
  1063. type="primary"
  1064. disabled={this.state.selectedRowKeys.length != 1}
  1065. style={{ margin: "11px 0px 10px 10px" }}
  1066. onClick={this.exportWater}
  1067. >
  1068. 导出所选收款详情流水
  1069. </Button>
  1070. </TabPane>
  1071. <TabPane tab="查看" key="5">
  1072. <Button
  1073. type="primary"
  1074. disabled={this.state.selectedRowKeys.length != 1}
  1075. style={{ margin: "11px 0px 10px 10px" }}
  1076. onClick={() => {
  1077. this.inRecordData();
  1078. this.setState({
  1079. bvisible: true
  1080. });
  1081. }}
  1082. >
  1083. 查看开票详情
  1084. </Button>
  1085. <Button
  1086. type="primary"
  1087. disabled={this.state.selectedRowKeys.length != 1}
  1088. style={{ margin: "11px 0px 10px 10px" }}
  1089. onClick={() => {
  1090. this.waterData();
  1091. this.setState({
  1092. cvisible: true
  1093. });
  1094. }}
  1095. >
  1096. 详情收款流水
  1097. </Button>
  1098. </TabPane>
  1099. {/* <TabPane tab="批量操作" key="6">
  1100. <Button
  1101. type="primary"
  1102. disabled={this.state.selectedRowKeys.length == 0}
  1103. style={{ margin: "0px 0px 10px 10px" }}
  1104. onClick={e => {
  1105. e.stopPropagation(),
  1106. this.evaluateY(this.state.selectedRowKeys, "财务专员");
  1107. }}
  1108. >
  1109. 转交
  1110. </Button>
  1111. </TabPane> */}
  1112. </Tabs>
  1113. <div className="patent-table">
  1114. <Spin spinning={this.state.loading}>
  1115. <Table
  1116. bordered
  1117. columns={
  1118. this.state.changeList == undefined
  1119. ? this.state.columns
  1120. : this.state.changeList
  1121. }
  1122. dataSource={this.state.dataSource}
  1123. rowSelection={rowSelection}
  1124. scroll={{ x: "max-content", y: 0 }}
  1125. pagination={this.state.pagination}
  1126. onRowDoubleClick={this.tableRowClick.bind(this)}
  1127. size="small"
  1128. />
  1129. </Spin>
  1130. <p
  1131. style={{ display: "inline-block", fontSize: "14px", color: "red" }}
  1132. >
  1133. {
  1134. <span style={{ marginRight: 10 }}>
  1135. {`收款金额总计(万元):${this.state.hui ? this.state.hui : "0"}`}
  1136. </span>
  1137. }
  1138. {
  1139. <span>
  1140. {`合同额总计(万元):${
  1141. this.state.totalHui ? this.state.totalHui : "0"
  1142. }`}
  1143. </span>
  1144. }
  1145. </p>
  1146. </div>
  1147. <Assign
  1148. title="任务"
  1149. selApi={"/api/admin/newOrder/updateFinance"}
  1150. data={this.state.assignDataY}
  1151. showDesc={this.state.assignVisibleY}
  1152. closeDesc={this.closeAssignY.bind(this)}
  1153. // fenpaiData={8}
  1154. specially={0}
  1155. roleName={this.state.nub}
  1156. requestMethod={"get"}
  1157. />
  1158. <OrderDesc
  1159. data={this.state.RowData}
  1160. showDesc={this.state.showDesc}
  1161. closeDesc={this.closeDesc.bind(this)}
  1162. />
  1163. <Receivable
  1164. title="收款记录"
  1165. api="/api/admin/financial/addReceiptsFlow"
  1166. data={this.state.assignDataX}
  1167. showDesc={this.state.assignVisibleX}
  1168. closeDesc={this.closeAssignX.bind(this)}
  1169. />
  1170. <Modal
  1171. visible={this.state.boHuiVisible}
  1172. width="400px"
  1173. title="驳回备注"
  1174. footer=""
  1175. onOk={this.boHuiOk}
  1176. onCancel={this.boHuiCancel}
  1177. >
  1178. <Form layout="horizontal" onSubmit={this.boHuiSubmit}>
  1179. <Spin spinning={this.state.loading}>
  1180. <FormItem
  1181. labelCol={{ span: 5 }}
  1182. wrapperCol={{ span: 16 }}
  1183. label={
  1184. <span>
  1185. <strong style={{ color: "#f00" }}>*</strong>驳回原因
  1186. </span>
  1187. }
  1188. >
  1189. <Input
  1190. type="textarea"
  1191. rows={4}
  1192. placeholder="请输入驳回原因"
  1193. value={this.state.content}
  1194. onChange={e => {
  1195. this.setState({ content: e.target.value });
  1196. }}
  1197. />
  1198. </FormItem>
  1199. <FormItem wrapperCol={{ span: 12, offset: 5 }}>
  1200. <Button
  1201. type="primary"
  1202. htmlType="submit"
  1203. style={{ marginRight: 20 }}
  1204. >
  1205. 驳回
  1206. </Button>
  1207. <Button
  1208. type="default"
  1209. onClick={() => {
  1210. this.boHuiCancel();
  1211. }}
  1212. >
  1213. 取消
  1214. </Button>
  1215. </FormItem>
  1216. </Spin>
  1217. </Form>
  1218. </Modal>
  1219. <Modal
  1220. visible={this.state.bvisible}
  1221. footer=""
  1222. title="开票历史记录"
  1223. className="admin-desc-content"
  1224. width="900px"
  1225. onCancel={this.inRecordCanl}
  1226. >
  1227. <Spin spinning={this.state.loading}>
  1228. <div
  1229. className="patent-table"
  1230. ref={e => {
  1231. this.refs.kaiPiao = e;
  1232. }}
  1233. >
  1234. <Table
  1235. columns={this.state.columnsDate}
  1236. dataSource={this.state.recordData}
  1237. pagination={false}
  1238. bordered
  1239. />
  1240. <div className="clearfix" style={{ marginTop: "20px" }}>
  1241. <FormItem
  1242. className="half-item"
  1243. {...formItemLayout}
  1244. label={<span style={{ fontSize: "14px" }}>开票总计</span>}
  1245. >
  1246. <span>{this.state.sum + "(万元)"}</span>
  1247. </FormItem>
  1248. </div>
  1249. <ReactToPrint
  1250. trigger={() => (
  1251. <Button
  1252. type="primary"
  1253. style={{
  1254. float: "right",
  1255. // marginTop: 10,
  1256. position: "absolute",
  1257. top: -54,
  1258. right: 30
  1259. }}
  1260. >
  1261. 打印
  1262. </Button>
  1263. )}
  1264. content={() => this.refs.kaiPiao}
  1265. />
  1266. </div>
  1267. </Spin>
  1268. </Modal>
  1269. <Modal
  1270. visible={this.state.cvisible}
  1271. footer=""
  1272. title="详细收款流水"
  1273. className="admin-desc-content"
  1274. width="1300px"
  1275. onCancel={this.waterCanl}
  1276. >
  1277. <Spin spinning={this.state.loading}>
  1278. <div
  1279. className="patent-table"
  1280. ref={e => {
  1281. this.refs.shouKuan = e;
  1282. }}
  1283. >
  1284. <Table
  1285. columns={this.state.waterlistDate}
  1286. dataSource={this.state.waterData}
  1287. pagination={false}
  1288. bordered
  1289. />
  1290. <div className="clearfix" style={{ marginTop: "20px" }}>
  1291. <FormItem
  1292. className="half-item"
  1293. {...formItemLayout}
  1294. label={<span style={{ fontSize: "14px" }}>总计金额</span>}
  1295. >
  1296. <span>{this.state.waterSum + "(万元)"}</span>
  1297. </FormItem>
  1298. </div>
  1299. <ReactToPrint
  1300. trigger={() => (
  1301. <Button
  1302. type="primary"
  1303. style={{
  1304. float: "right",
  1305. position: "absolute",
  1306. top: -54,
  1307. right: 30
  1308. }}
  1309. >
  1310. 打印
  1311. </Button>
  1312. )}
  1313. content={() => this.refs.shouKuan}
  1314. />
  1315. </div>
  1316. </Spin>
  1317. </Modal>
  1318. <Modal
  1319. visible={this.state.dvisible}
  1320. footer=""
  1321. title="所有列表信息"
  1322. className="admin-desc-content"
  1323. width="1300px"
  1324. onCancel={() => {
  1325. this.loadData();
  1326. this.setState({
  1327. dvisible: false
  1328. });
  1329. }}
  1330. >
  1331. <Spin spinning={this.state.loading}>
  1332. <div
  1333. className="patent-table"
  1334. style={{
  1335. // width: 900,
  1336. // position: "relative",
  1337. // left: "50%",
  1338. // transform: "translate(-50%)",
  1339. padding: "25px 0 30px 30px"
  1340. }}
  1341. ref={e => {
  1342. this.refs.all = e;
  1343. }}
  1344. >
  1345. <Table
  1346. columns={this.state.printColumns}
  1347. dataSource={this.state.dataSource}
  1348. pagination={this.state.pagination}
  1349. bordered
  1350. size="small"
  1351. />
  1352. </div>
  1353. </Spin>
  1354. <ReactToPrint
  1355. trigger={() => (
  1356. <Button
  1357. type="primary"
  1358. style={{
  1359. float: "right",
  1360. marginTop: 10,
  1361. position: "absolute",
  1362. top: 0,
  1363. right: 30
  1364. }}
  1365. >
  1366. 打印
  1367. </Button>
  1368. )}
  1369. content={() => this.refs.all}
  1370. />
  1371. </Modal>
  1372. </div>
  1373. );
  1374. }
  1375. });
  1376. export default ShouKuang;