shouKuang.jsx 39 KB

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