shouKuang.jsx 33 KB

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