shouKuanAll.jsx 39 KB

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