shouKuang.jsx 34 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250
  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: "orderNo",
  427. key: "orderNo"
  428. },
  429. {
  430. title: "平台流水号",
  431. dataIndex: "billNo",
  432. key: "billNo"
  433. // fixed: "left"
  434. },
  435. {
  436. title: "金额(万元)",
  437. dataIndex: "transactionAmount",
  438. key: "transactionAmount"
  439. },
  440. {
  441. title: "收款方",
  442. dataIndex: "payeeName",
  443. key: "payeeName"
  444. },
  445. {
  446. title: "付款方",
  447. dataIndex: "payerName",
  448. key: "payerName"
  449. },
  450. {
  451. title: "流水科目",
  452. dataIndex: "transactionSubject",
  453. key: "transactionSubject",
  454. render: text => {
  455. return getTransactionProject(text);
  456. }
  457. },
  458. {
  459. title: "收款类型",
  460. dataIndex: "type",
  461. key: "type"
  462. },
  463. {
  464. title: "财务流水时间",
  465. dataIndex: "financialPayTimes",
  466. key: "financialPayTimes"
  467. },
  468. {
  469. title: "财务流水号",
  470. dataIndex: "financialPayNo",
  471. key: "financialPayNo"
  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. disabled={!this.state.dataSource.length}
  920. >
  921. 打印所有列表信息
  922. </Button>
  923. </TabPane>
  924. <TabPane tab="导出Excel" key="4">
  925. <Button
  926. type="primary"
  927. style={{ margin: "0px 0px 10px 10px" }}
  928. onClick={this.exportAll}
  929. >
  930. 导出当前列表
  931. </Button>
  932. <Button
  933. type="primary"
  934. disabled={!this.state.selectedRowKeys.length}
  935. style={{ margin: "0px 0px 10px 10px" }}
  936. onClick={this.exportKaip}
  937. >
  938. 导出所选开票详情
  939. </Button>
  940. <Button
  941. type="primary"
  942. disabled={!this.state.selectedRowKeys.length}
  943. style={{ margin: "0px 0px 10px 10px" }}
  944. onClick={this.exportWater}
  945. >
  946. 导出所选收款详情流水
  947. </Button>
  948. </TabPane>
  949. <TabPane tab="查看" key="5">
  950. <Button
  951. type="primary"
  952. disabled={this.state.selectedRowKeys.length != 1}
  953. style={{ margin: "0px 0px 10px 10px" }}
  954. onClick={() => {
  955. this.inRecordData();
  956. this.setState({
  957. bvisible: true
  958. });
  959. }}
  960. >
  961. 查看开票详情
  962. </Button>
  963. <Button
  964. type="primary"
  965. disabled={this.state.selectedRowKeys.length != 1}
  966. style={{ margin: "0px 0px 10px 10px" }}
  967. onClick={() => {
  968. this.waterData();
  969. this.setState({
  970. cvisible: true
  971. });
  972. }}
  973. >
  974. 详情收款流水
  975. </Button>
  976. </TabPane>
  977. </Tabs>
  978. <div className="patent-table">
  979. <Spin spinning={this.state.loading}>
  980. <Table
  981. bordered
  982. columns={
  983. this.state.changeList == undefined
  984. ? this.state.columns
  985. : this.state.changeList
  986. }
  987. dataSource={this.state.dataSource}
  988. rowSelection={rowSelection}
  989. scroll={{ x: true, y: 0 }}
  990. pagination={this.state.pagination}
  991. onRowClick={this.tableRowClick.bind(this)}
  992. />
  993. </Spin>
  994. <p
  995. style={{ display: "inline-block", fontSize: "14px", color: "red" }}
  996. >
  997. {`收款金额总计(万元):${this.state.hui ? this.state.hui : "0"}` +
  998. " " +
  999. " " +
  1000. `合同额总计(万元):${
  1001. this.state.totalHui ? this.state.totalHui : "0"
  1002. }`}
  1003. </p>
  1004. </div>
  1005. <Assign
  1006. title="任务"
  1007. selApi={"/api/admin/newOrder/updateFinance"}
  1008. data={this.state.assignDataY}
  1009. showDesc={this.state.assignVisibleY}
  1010. closeDesc={this.closeAssignY.bind(this)}
  1011. // fenpaiData={8}
  1012. specially={0}
  1013. roleName={this.state.nub}
  1014. requestMethod={"get"}
  1015. />
  1016. <OrderDesc
  1017. data={this.state.RowData}
  1018. showDesc={this.state.showDesc}
  1019. closeDesc={this.closeDesc.bind(this)}
  1020. />
  1021. <Receivable
  1022. title="收款记录"
  1023. api="/api/admin/financial/addReceiptsFlow"
  1024. data={this.state.assignDataX}
  1025. showDesc={this.state.assignVisibleX}
  1026. closeDesc={this.closeAssignX.bind(this)}
  1027. />
  1028. <Modal
  1029. visible={this.state.boHuiVisible}
  1030. width="400px"
  1031. title="驳回备注"
  1032. footer=""
  1033. onOk={this.boHuiOk}
  1034. onCancel={this.boHuiCancel}
  1035. >
  1036. <Form layout="horizontal" onSubmit={this.boHuiSubmit}>
  1037. <Spin spinning={this.state.loading}>
  1038. <FormItem
  1039. labelCol={{ span: 5 }}
  1040. wrapperCol={{ span: 16 }}
  1041. label={
  1042. <span>
  1043. <strong style={{ color: "#f00" }}>*</strong>驳回原因
  1044. </span>
  1045. }
  1046. >
  1047. <Input
  1048. type="textarea"
  1049. rows={4}
  1050. placeholder="请输入驳回原因"
  1051. value={this.state.content}
  1052. onChange={e => {
  1053. this.setState({ content: e.target.value });
  1054. }}
  1055. />
  1056. </FormItem>
  1057. <FormItem wrapperCol={{ span: 12, offset: 5 }}>
  1058. <Button
  1059. type="primary"
  1060. htmlType="submit"
  1061. style={{ marginRight: 20 }}
  1062. >
  1063. 驳回
  1064. </Button>
  1065. <Button
  1066. type="default"
  1067. onClick={() => {
  1068. this.boHuiCancel();
  1069. }}
  1070. >
  1071. 取消
  1072. </Button>
  1073. </FormItem>
  1074. </Spin>
  1075. </Form>
  1076. </Modal>
  1077. <Modal
  1078. visible={this.state.bvisible}
  1079. footer=""
  1080. title="开票历史记录"
  1081. className="admin-desc-content"
  1082. width="900px"
  1083. onCancel={this.inRecordCanl}
  1084. >
  1085. <Spin spinning={this.state.loading}>
  1086. <div
  1087. className="patent-table"
  1088. ref={e => {
  1089. this.refs.kaiPiao = e;
  1090. }}
  1091. >
  1092. <Table
  1093. columns={this.state.columnsDate}
  1094. dataSource={this.state.recordData}
  1095. pagination={false}
  1096. bordered
  1097. />
  1098. <div className="clearfix" style={{ marginTop: "20px" }}>
  1099. <FormItem
  1100. className="half-item"
  1101. {...formItemLayout}
  1102. label={<span style={{ fontSize: "14px" }}>开票总计</span>}
  1103. >
  1104. <span>{this.state.sum + "(万元)"}</span>
  1105. </FormItem>
  1106. </div>
  1107. <ReactToPrint
  1108. trigger={() => (
  1109. <Button
  1110. type="primary"
  1111. style={{
  1112. float: "right",
  1113. // marginTop: 10,
  1114. position: "absolute",
  1115. top: -54,
  1116. right: 30
  1117. }}
  1118. >
  1119. 打印
  1120. </Button>
  1121. )}
  1122. content={() => this.refs.kaiPiao}
  1123. />
  1124. </div>
  1125. </Spin>
  1126. </Modal>
  1127. <Modal
  1128. visible={this.state.cvisible}
  1129. footer=""
  1130. title="详细收款流水"
  1131. className="admin-desc-content"
  1132. width="1300px"
  1133. onCancel={this.waterCanl}
  1134. >
  1135. <Spin spinning={this.state.loading}>
  1136. <div
  1137. className="patent-table"
  1138. ref={e => {
  1139. this.refs.shouKuan = e;
  1140. }}
  1141. >
  1142. <Table
  1143. columns={this.state.waterlistDate}
  1144. dataSource={this.state.waterData}
  1145. pagination={false}
  1146. bordered
  1147. />
  1148. <div className="clearfix" style={{ marginTop: "20px" }}>
  1149. <FormItem
  1150. className="half-item"
  1151. {...formItemLayout}
  1152. label={<span style={{ fontSize: "14px" }}>总计金额</span>}
  1153. >
  1154. <span>{this.state.waterSum + "(万元)"}</span>
  1155. </FormItem>
  1156. </div>
  1157. <ReactToPrint
  1158. trigger={() => (
  1159. <Button
  1160. type="primary"
  1161. style={{
  1162. float: "right",
  1163. position: "absolute",
  1164. top: -54,
  1165. right: 30
  1166. }}
  1167. >
  1168. 打印
  1169. </Button>
  1170. )}
  1171. content={() => this.refs.shouKuan}
  1172. />
  1173. </div>
  1174. </Spin>
  1175. </Modal>
  1176. <Modal
  1177. visible={this.state.dvisible}
  1178. footer=""
  1179. title="所有列表信息"
  1180. className="admin-desc-content"
  1181. width="1300px"
  1182. onCancel={() => {
  1183. this.loadData();
  1184. this.setState({
  1185. dvisible: false
  1186. });
  1187. }}
  1188. >
  1189. <Spin spinning={this.state.loading}>
  1190. <div
  1191. className="patent-table"
  1192. style={{
  1193. // width: 900,
  1194. // position: "relative",
  1195. // left: "50%",
  1196. // transform: "translate(-50%)",
  1197. padding: "25px 0 30px 30px"
  1198. }}
  1199. ref={e => {
  1200. this.refs.all = e;
  1201. }}
  1202. >
  1203. <Table
  1204. columns={this.state.printColumns}
  1205. dataSource={this.state.dataSource}
  1206. pagination={this.state.pagination}
  1207. bordered
  1208. size="small"
  1209. />
  1210. </div>
  1211. </Spin>
  1212. <ReactToPrint
  1213. trigger={() => (
  1214. <Button
  1215. type="primary"
  1216. style={{
  1217. float: "right",
  1218. marginTop: 10,
  1219. position: "absolute",
  1220. top: 0,
  1221. right: 30
  1222. }}
  1223. >
  1224. 打印
  1225. </Button>
  1226. )}
  1227. content={() => this.refs.all}
  1228. />
  1229. </Modal>
  1230. </div>
  1231. );
  1232. }
  1233. });
  1234. export default ShouKuang;