shouKuang.jsx 36 KB

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