huiKuan.jsx 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227
  1. import React from "react";
  2. import $ from "jquery/src/ajax";
  3. import moment from "moment";
  4. import "./public.less";
  5. import {
  6. Form,
  7. Button,
  8. Input,
  9. Select,
  10. Spin,
  11. Table,
  12. message,
  13. Modal,
  14. Upload,
  15. DatePicker,
  16. Icon,
  17. Tabs,
  18. Popconfirm,
  19. Tag, Tooltip
  20. } from "antd";
  21. import {
  22. getProvinceA,
  23. getInvoiceStatus,
  24. getprovince,
  25. getStatus,
  26. getPeople,
  27. splitUrl,
  28. moneyVerify
  29. } from "@/tools";
  30. import { ChooseList } from "../../../../component/manageCenter/order/orderNew/chooseList";
  31. import "./huiKuan.less"
  32. import LogPopup from "../../../common/logPopup";
  33. import Cascaders from "../../../common/cascaders";
  34. const { RangePicker } = DatePicker;
  35. const FormItem = Form.Item;
  36. const { TextArea } = Input;
  37. const { TabPane } = Tabs;
  38. const HuiKuan = React.createClass({
  39. loadData(pageNo, pageSize) {
  40. this.state.data = [];
  41. this.setState({
  42. loading: true
  43. });
  44. $.ajax({
  45. method: "get",
  46. dataType: "json",
  47. crossDomain: false,
  48. url: globalConfig.context + "/api/admin/receivables/listReceivables",
  49. data: {
  50. pageNo: pageNo || 1,
  51. pageSize: pageSize || this.state.pagination.pageSize,
  52. // 订单状态 判断是否重复
  53. status: this.state.statusSearch,
  54. // 订单编号
  55. orderNo: this.state.orderNoSearch,
  56. // 合同编号
  57. contractNo: this.state.nameSearch,
  58. // 付款方
  59. corporateName: this.state.payFrom,
  60. // 营销员名字
  61. adminName: this.state.adminName,
  62. // 客户名称
  63. nickname: this.state.nickname,
  64. // 订单所属部门id
  65. orderDeps: this.state.orderDeps,
  66. // 管理员部门id
  67. adminDeps: this.state.adminDeps
  68. },
  69. success: function (data) {
  70. let theArr = [];
  71. if (!data.data || !data.data.pagination.list) {
  72. if (data.error && data.error.length) {
  73. message.warning(data.error[0].message);
  74. }
  75. } else {
  76. for (let i = 0; i < data.data.pagination.list.length; i++) {
  77. let thisdata = data.data.pagination.list[i];
  78. theArr.push({
  79. key: thisdata.id,
  80. status: {
  81. first: thisdata.status,
  82. second: thisdata.inptStatus
  83. },
  84. orderNo: thisdata.orderNo,
  85. contractNo: thisdata.contractNo,
  86. corporateName: thisdata.corporateName,
  87. nickname: thisdata.nickname,
  88. totalAmount: thisdata.totalAmount,
  89. depName: thisdata.depName,
  90. amount: thisdata.amount,
  91. receivablesTimes: thisdata.receivablesTimes,
  92. createTimes: thisdata.createTimes,
  93. remarks: thisdata.remarks,
  94. financialPayNo: thisdata.financialPayNo,
  95. settlementAmount: thisdata.settlementAmount
  96. });
  97. }
  98. }
  99. this.state.pagination.current = data.data.pagination.pageNo;
  100. this.state.pagination.total = data.data.pagination.totalCount;
  101. if (
  102. data.data &&
  103. data.data.pagination.list &&
  104. !data.data.pagination.list.length
  105. ) {
  106. this.state.pagination.current = 0;
  107. this.state.pagination.total = 0;
  108. }
  109. this.setState({
  110. totalPage: data.data.pagination.totalPage,
  111. dataSource: theArr,
  112. pagination: this.state.pagination,
  113. totalHui: data.data.count ? data.data.count.totalAmount : 0,
  114. hui: data.data.count ? data.data.count.amount : 0
  115. });
  116. // console.log(this.state.dataSource);
  117. }.bind(this)
  118. }).always(
  119. function () {
  120. this.setState({
  121. loading: false
  122. });
  123. }.bind(this)
  124. );
  125. },
  126. departmentList() {
  127. this.setState({
  128. loading: true
  129. });
  130. $.ajax({
  131. method: "get",
  132. dataType: "json",
  133. crossDomain: false,
  134. url: globalConfig.context + "/api/admin/organization/selectSuperId",
  135. data: {},
  136. success: function (data) {
  137. let thedata = data.data;
  138. let theArr = [];
  139. if (!thedata) {
  140. if (data.error && data.error.length) {
  141. message.warning(data.error[0].message);
  142. }
  143. } else {
  144. thedata.map(function (item, index) {
  145. theArr.push({
  146. key: index,
  147. name: item.name,
  148. id: item.id
  149. });
  150. });
  151. }
  152. this.setState({
  153. departmentArr: theArr
  154. });
  155. }.bind(this)
  156. }).always(
  157. function () {
  158. this.setState({
  159. loading: false
  160. });
  161. }.bind(this)
  162. );
  163. },
  164. getInitialState() {
  165. return {
  166. mergeModal: false,
  167. visible: false,
  168. selectedRowKeys: [], // Check here to configure the default column
  169. loading: false,
  170. searchMore: true,
  171. assignVisible: false,
  172. releaseDate: [],
  173. totalPage: 0,
  174. boHuivisible: false,
  175. selectedRows: [],
  176. // 弹出层数据
  177. modalData: {},
  178. // userName: "",
  179. contractNo: "",
  180. reason: "",
  181. foo: 0,
  182. // 子组件改变的表格title数组
  183. changeList: undefined,
  184. pagination: {
  185. defaultCurrent: 1,
  186. defaultPageSize: 10,
  187. showQuickJumper: true,
  188. pageSize: 10,
  189. onChange: function (page) {
  190. this.loadData(page);
  191. }.bind(this),
  192. showTotal: function (total) {
  193. return "共" + total + "条数据";
  194. }
  195. },
  196. paginationModal: {
  197. pageSize: 100,
  198. showTotal: function (total) {
  199. return "共" + total + "条数据";
  200. }
  201. },
  202. columns: [
  203. {
  204. title: "合同编号",
  205. dataIndex: "contractNo",
  206. key: "contractNo",
  207. // fixed: "left"
  208. className: "title-table"
  209. },
  210. {
  211. title: "订单编号",
  212. dataIndex: "orderNo",
  213. key: "orderNo",
  214. className: "title-table"
  215. },
  216. {
  217. title: "流水编号",
  218. dataIndex: "financialPayNo",
  219. key: "financialPayNo",
  220. className: "title-table"
  221. },
  222. {
  223. title: "客户名称",
  224. dataIndex: "nickname",
  225. key: "nickname",
  226. className: "title-table",
  227. width: 150,
  228. render: (text) => {
  229. return (
  230. <Tooltip title={text}>
  231. <div style={{
  232. maxWidth: '150px',
  233. overflow: 'hidden',
  234. textOverflow: "ellipsis",
  235. whiteSpace: 'nowrap',
  236. }}>{text}</div>
  237. </Tooltip>
  238. )
  239. },
  240. },
  241. {
  242. title: "付款方",
  243. dataIndex: "corporateName",
  244. key: "corporateName",
  245. className: "title-table"
  246. },
  247. {
  248. title: "合同额(万元)",
  249. dataIndex: "totalAmount",
  250. key: "totalAmount",
  251. className: "title-table"
  252. },
  253. {
  254. title: "已收款(万元)",
  255. dataIndex: "settlementAmount",
  256. key: "settlementAmount",
  257. className: "title-table"
  258. },
  259. {
  260. title: "本次回款(万元)",
  261. dataIndex: "amount",
  262. key: "amount",
  263. className: "title-table"
  264. },
  265. {
  266. title: "回款时间",
  267. dataIndex: "receivablesTimes",
  268. key: "receivablesTimes",
  269. className: "title-table"
  270. },
  271. {
  272. title: "状态",
  273. dataIndex: "status",
  274. key: "status",
  275. className: "title-table",
  276. render: status => {
  277. let str = "";
  278. let color = "";
  279. let str2 = "";
  280. let color2 = "";
  281. if (status.first == 0) {
  282. color = "#87d068";
  283. str = "正常"
  284. if (status.second == 1) {
  285. str = "内容缺失"
  286. color = "#000";
  287. } else if (status.second == 2) {
  288. str = "订单异常"
  289. color = "#000";
  290. } else if (status.second == 3) {
  291. str = "名称不一致"
  292. color = "#000";
  293. }
  294. } else if (status.first == 1) {
  295. str = "重复";
  296. color = "#f50";
  297. if (status.second == 1) {
  298. str2 = "内容缺失";
  299. color2 = "#000";
  300. } else if (status.second == 2) {
  301. str2 = "订单异常";
  302. color2 = "#000";
  303. } else if (status.second == 3) {
  304. str2 = "名称不一致";
  305. color2 = "#000";
  306. }
  307. } else {
  308. color = "#000";
  309. if (status.first == 2) {
  310. str = "订单异常";
  311. } else if (status.first == 3) {
  312. str = "金额异常";
  313. } else if (status.first == 4) {
  314. str = "名称异常";
  315. } else if (status.first == 5) {
  316. str = "已收款";
  317. } else if (status.first == 6) {
  318. str = "变更锁定";
  319. }
  320. }
  321. return (
  322. <div>
  323. <Tag color={color}>{str}</Tag>
  324. <Tag color={color2} style={{ display: status.first == 1 && status.second != 0 ? "inline-blcok" : "none" }}>{str2}</Tag>
  325. </div>
  326. );
  327. }
  328. },
  329. {
  330. title: "批量导入时间",
  331. dataIndex: "createTimes",
  332. key: "createTimes",
  333. className: "title-table"
  334. },
  335. {
  336. title: "备注",
  337. dataIndex: "remarks",
  338. key: "remarks",
  339. className: "title-table"
  340. }
  341. ],
  342. columnsDate: [
  343. {
  344. title: "编号",
  345. dataIndex: "id",
  346. key: "id"
  347. },
  348. {
  349. title: "订单编号",
  350. dataIndex: "orderno",
  351. key: "orderno"
  352. },
  353. {
  354. title: "开票金额(万元)",
  355. dataIndex: "amount",
  356. key: "amount"
  357. },
  358. {
  359. title: "申请时间",
  360. dataIndex: "createTime",
  361. key: "createTime"
  362. },
  363. {
  364. title: "开票状态",
  365. dataIndex: "status",
  366. key: "status",
  367. render: (text, record) => {
  368. return <div>{getInvoiceStatus(text, record)} <LogPopup id={record.id} /></div>;
  369. },
  370. }
  371. ],
  372. dataSource: [],
  373. upLoadFlag: false,
  374. upLoad: {
  375. name: "file",
  376. action: globalConfig.context + "/api/admin/receivables/import",
  377. headers: {
  378. authorization: "authorization-text"
  379. },
  380. onChange: info => {
  381. if (info.file.status == "done") {
  382. if (info.file.response.data == 1) {
  383. message.success("导入成功!");
  384. this.loadData();
  385. } else {
  386. message.warning(info.file.response.error[0].message);
  387. }
  388. }
  389. }
  390. }
  391. };
  392. },
  393. search() {
  394. this.setState({
  395. selectedRowKeys: []
  396. })
  397. this.loadData();
  398. },
  399. componentWillMount() {
  400. this.loadData();
  401. this.departmentList();
  402. // $("#rcDialogTitle0").on("click", function() {
  403. // alert(123);
  404. // console.log(123);
  405. // });
  406. },
  407. reset() {
  408. this.state.nameSearch = "";
  409. this.state.releaseDate = [];
  410. this.state.orderNoSearch = "";
  411. this.state.adminName = "";
  412. this.state.departmenttList = [];
  413. this.state.nickname = "";
  414. this.state.payFrom = "";
  415. this.state.statusSearch = [];
  416. this.state.adminDeps = undefined;
  417. this.state.orderDeps = undefined;
  418. this.state.statusSearch = [];
  419. this.Cascaders1.empty();
  420. this.Cascaders2.empty();
  421. this.loadData();
  422. },
  423. changeList(arr) {
  424. const newArr = [];
  425. this.state.columns.forEach(item => {
  426. arr.forEach(val => {
  427. if (val === item.title) {
  428. newArr.push(item);
  429. }
  430. });
  431. });
  432. this.setState({
  433. changeList: newArr
  434. });
  435. },
  436. onSelectChange(selectedRowKeys) {
  437. // console.log("selectedRowKeys changed: ", selectedRowKeys);
  438. this.setState({ selectedRowKeys });
  439. },
  440. showModal() {
  441. this.setState({
  442. visible: true,
  443. choose: true
  444. });
  445. this.state.dataSource.forEach((item) => {
  446. if (item.key == this.state.selectedRowKeys[0]) {
  447. this.setState({
  448. modalData: JSON.parse(JSON.stringify(item))
  449. })
  450. // console.log(this.state.modalData);
  451. }
  452. })
  453. },
  454. tableRowClick(record) {
  455. this.setState({
  456. visible: true,
  457. choose: true
  458. });
  459. this.setState({
  460. modalData: JSON.parse(JSON.stringify(record))
  461. });
  462. },
  463. handleOk() {
  464. if (moneyVerify(this.state.modalData.amount)) return
  465. this.setState({ loading: true });
  466. if (!this.state.choose) {
  467. $.ajax({
  468. method: "POST",
  469. dataType: "json",
  470. crossDomain: false,
  471. url: globalConfig.context + "/api/admin/receivables/addReceivables",
  472. data: {
  473. orderNo: this.state.modalData.orderNo,
  474. amount: this.state.modalData.amount,
  475. receivablesTimes: this.state.modalData.receivablesTimes,
  476. // totalAmount: this.state.modalData.totalAmount,
  477. // contractNo: this.state.modalData.contractNo,
  478. // nickname: this.state.modalData.nickname,
  479. remarks: this.state.modalData.remarks,
  480. corporateName: this.state.modalData.corporateName,
  481. financialPayNo: this.state.modalData.financialPayNo
  482. },
  483. success: function (data) {
  484. if (data.error && data.error.length) {
  485. message.warning(data.error[0].message);
  486. } else {
  487. // console.log("成功", data);
  488. message.success("添加成功!")
  489. this.loadData();
  490. this.state.selectedRowKeys = [];
  491. this.setState({
  492. selectedRowKeys: this.state.selectedRowKeys
  493. });
  494. this.setState({ loading: false, visible: false });
  495. }
  496. }.bind(this)
  497. }).always(
  498. function () {
  499. this.setState({
  500. loading: false
  501. });
  502. }.bind(this)
  503. );
  504. } else {
  505. $.ajax({
  506. method: "POST",
  507. dataType: "json",
  508. crossDomain: false,
  509. url: globalConfig.context + "/api/admin/receivables/updateReceivables",
  510. data: {
  511. orderNo: this.state.modalData.orderNo,
  512. amount: this.state.modalData.amount,
  513. receivablesTimes: this.state.modalData.receivablesTimes,
  514. // totalAmount: this.state.modalData.totalAmount,
  515. // contractNo: this.state.modalData.contractNo,
  516. // nickname: this.state.modalData.nickname,
  517. corporateName: this.state.modalData.corporateName,
  518. financialPayNo: this.state.modalData.financialPayNo,
  519. remarks: this.state.modalData.remarks,
  520. id: this.state.modalData.key
  521. },
  522. success: function (data) {
  523. if (data.error && data.error.length) {
  524. message.warning(data.error[0].message);
  525. } else {
  526. // console.log("成功",data);
  527. message.success("修改成功!")
  528. this.loadData()
  529. this.state.selectedRowKeys = [];
  530. this.setState({
  531. selectedRowKeys: this.state.selectedRowKeys
  532. });
  533. this.setState({ loading: false, visible: false });
  534. }
  535. }.bind(this)
  536. }).always(
  537. function () {
  538. this.setState({
  539. loading: false
  540. });
  541. }.bind(this)
  542. );
  543. }
  544. // this.setState({ loading: false, visible: false });
  545. },
  546. handleCancel() {
  547. // this.loadData()
  548. this.setState({ visible: false });
  549. },
  550. callback(key) {
  551. // console.log(key);
  552. },
  553. delChecked() {
  554. // console.log("被删除列表",this.state.selectedRowKeys);
  555. let ids = this.state.selectedRowKeys.join(",")
  556. $.ajax({
  557. method: "POST",
  558. dataType: "json",
  559. crossDomain: false,
  560. url: globalConfig.context + "/api/admin/receivables/deleteReceivables",
  561. data: {
  562. ids,
  563. type: 0
  564. },
  565. success: function (data) {
  566. if (data.error && data.error.length) {
  567. message.warning(data.error[0].message);
  568. }
  569. message.success("删除成功!")
  570. }.bind(this)
  571. }).always(
  572. function () {
  573. this.loadData()
  574. this.state.selectedRowKeys = [];
  575. this.setState({
  576. selectedRowKeys: this.state.selectedRowKeys
  577. });
  578. }.bind(this)
  579. );
  580. // this.loadData()
  581. },
  582. delAllChecked() {
  583. // console.log("删除全部");
  584. $.ajax({
  585. method: "POST",
  586. dataType: "json",
  587. crossDomain: false,
  588. url: globalConfig.context + "/api/admin/receivables/deleteReceivables",
  589. data: {
  590. type: 1
  591. },
  592. success: function (data) {
  593. if (data.error && data.error.length) {
  594. message.warning(data.error[0].message);
  595. }
  596. message.success("删除全部成功!")
  597. }.bind(this)
  598. }).always(
  599. function () {
  600. this.loadData();
  601. this.state.selectedRowKeys = [];
  602. this.setState({
  603. selectedRowKeys: this.state.selectedRowKeys
  604. });
  605. }.bind(this)
  606. );
  607. // this.loadData()
  608. // console.log("aaa", $(".ant-modal-content"));
  609. },
  610. mergeAll() {
  611. // console.log("合并全部");
  612. this.setState({
  613. confirmLoading: true
  614. })
  615. $.ajax({
  616. method: "POST",
  617. dataType: "json",
  618. crossDomain: false,
  619. url: globalConfig.context + "/api/admin/receivables/batchImport",
  620. data: {},
  621. success: function (data) {
  622. if (data.error && data.error.length) {
  623. message.warning(data.error[0].message);
  624. } else {
  625. message.success("合并成功!请在收款列表中,查看已收款情况。");
  626. this.setState({
  627. mergeModal: false
  628. });
  629. }
  630. }.bind(this)
  631. }).always(
  632. function () {
  633. this.loadData();
  634. this.state.pagination.pageSize = 10
  635. this.state.selectedRowKeys = []
  636. this.setState({
  637. selectedRowKeys: this.state.selectedRowKeys,
  638. pagination: this.state.pagination,
  639. mergeModal: false,
  640. confirmLoading: false,
  641. })
  642. // window.location.reload();
  643. }.bind(this)
  644. );
  645. // message.success("合并成功!请在收款列表中,查看已收款情况。");
  646. },
  647. addModal() {
  648. this.state.modalData = {}
  649. this.setState({
  650. modalData: this.state.modalData,
  651. visible: true,
  652. choose: false
  653. })
  654. },
  655. download() {
  656. window.location.href =
  657. globalConfig.context +
  658. "/api/admin/receivables/downloadTemplate?" +
  659. "sign=receivbles_template";
  660. },
  661. // daoHui() {
  662. // window.location.href =
  663. // globalConfig.context +
  664. // "/api/admin/receivables/exportReceivables"
  665. // },
  666. render() {
  667. const formItemLayout = {
  668. labelCol: { span: 8 },
  669. wrapperCol: { span: 14 }
  670. };
  671. var departmentArr = this.state.departmentArr || [];
  672. const { loading, selectedRowKeys, visible } = this.state;
  673. const rowSelection = {
  674. selectedRowKeys,
  675. onChange: this.onSelectChange,
  676. hideDefaultSelections: true
  677. };
  678. var departmentArr = this.state.departmentArr || [];
  679. return (
  680. <div className="user-content" style={{ position: "relative" }}>
  681. <div className="content-title" style={{ marginBottom: 10 }}>
  682. <span style={{ fontWeight: 900, fontSize: 16 }}>批量回款</span>
  683. </div>
  684. <Tabs defaultActiveKey="1" onChange={this.callback} className="test">
  685. <TabPane tab="搜索" key="1">
  686. <div className="user-search" style={{ marginLeft: 10 }}>
  687. <Input
  688. placeholder="合同编号"
  689. value={this.state.nameSearch}
  690. onChange={e => {
  691. this.setState({ nameSearch: e.target.value });
  692. }}
  693. />
  694. <Input
  695. placeholder="订单编号"
  696. value={this.state.orderNoSearch}
  697. onChange={e => {
  698. this.setState({ orderNoSearch: e.target.value });
  699. }}
  700. />
  701. <Input
  702. placeholder="客户名称"
  703. value={this.state.nickname}
  704. onChange={e => {
  705. this.setState({ nickname: e.target.value });
  706. }}
  707. />
  708. <Select
  709. placeholder="状态"
  710. style={{ width: 150, marginRight: 10 }}
  711. value={this.state.statusSearch}
  712. onChange={e => {
  713. this.setState({ statusSearch: e });
  714. // console.log("状态", e);
  715. }}
  716. >
  717. <Select.Option key={0}>正常</Select.Option>
  718. <Select.Option key={1}>重复</Select.Option>
  719. <Select.Option key={2}>异常</Select.Option>
  720. </Select>
  721. <Input
  722. placeholder="订单负责人"
  723. value={this.state.adminName}
  724. onChange={e => {
  725. this.setState({ adminName: e.target.value });
  726. }}
  727. />
  728. <Cascaders
  729. ref={node => this.Cascaders1 = node}
  730. placeholder="订单所属部门"
  731. id="id"
  732. name="name"
  733. children="list"
  734. height={28}
  735. onSel={(e) => {
  736. this.setState({
  737. orderDeps: JSON.stringify(e),
  738. })
  739. }}
  740. />
  741. {/* <Select
  742. placeholder="订单所属部门"
  743. style={{ width: 150, marginRight: 10 }}
  744. value={this.state.orderBranch}
  745. onChange={e => {
  746. this.setState({ orderBranch: e });
  747. }}
  748. >
  749. {departmentArr.map(function (item) {
  750. return (
  751. <Select.Option key={item.id}>{item.name}</Select.Option>
  752. );
  753. })}
  754. </Select> */}
  755. <Cascaders
  756. ref={node => this.Cascaders2 = node}
  757. placeholder="负责人所属部门"
  758. id="id"
  759. name="name"
  760. children="list"
  761. height={28}
  762. onSel={(e) => {
  763. this.setState({
  764. adminDeps: JSON.stringify(e),
  765. })
  766. }}
  767. />
  768. {/* <Select
  769. placeholder="负责人所属部门"
  770. style={{ width: 150, marginRight: 10 }}
  771. value={this.state.principalList}
  772. onChange={e => {
  773. this.setState({ principalList: e });
  774. }}
  775. >
  776. {departmentArr.map(function (item) {
  777. return (
  778. <Select.Option key={item.id}>{item.name}</Select.Option>
  779. );
  780. })}
  781. </Select> */}
  782. <Input
  783. placeholder="付款方"
  784. value={this.state.payFrom}
  785. onChange={e => {
  786. this.setState({ payFrom: e.target.value });
  787. }}
  788. />
  789. <Button
  790. type="primary"
  791. onClick={this.search}
  792. style={{ marginLeft: 10 }}
  793. >
  794. 搜索
  795. </Button>
  796. <Button onClick={this.reset}>重置</Button>
  797. </div>
  798. </TabPane>
  799. <TabPane tab="更改表格显示数据" key="2">
  800. <div style={{ marginLeft: 10 }}>
  801. <ChooseList
  802. columns={this.state.columns}
  803. changeFn={this.changeList}
  804. changeList={this.state.changeList}
  805. top={55}
  806. margin={11}
  807. display={"inline-block"}
  808. style={{ marginBottom: 17 }}
  809. />
  810. </div>
  811. </TabPane>
  812. <TabPane tab="操作" key="3">
  813. <div
  814. class={123}
  815. style={{
  816. position: "relative",
  817. top: 10,
  818. left: 10,
  819. // zIndex: 99,
  820. // left: 400,
  821. // transform: "translateX(-50%)",
  822. display: "inline-block",
  823. width: 122,
  824. height: 28,
  825. overflow: "hidden"
  826. }}
  827. >
  828. <Upload {...this.state.upLoad}>
  829. <Button
  830. type="primary"
  831. disabled={this.state.dataSource.length != 0 || this.props.look}
  832. >
  833. <Icon type="upload" />
  834. 导入回款列表
  835. </Button>
  836. </Upload>
  837. </div>
  838. <Button
  839. type="primary"
  840. style={{ marginBottom: 11, marginLeft: 25 }}
  841. onClick={this.download}
  842. >
  843. 下载回款列表模板
  844. </Button>
  845. {/* <Button
  846. type="primary"
  847. style={{ marginBottom: 20, marginLeft: 15 }}
  848. onClick={this.daoHui}
  849. >
  850. 导出回款列表
  851. </Button> */}
  852. <Button
  853. type="primary"
  854. style={{ marginBottom: 11, marginLeft: 15 }}
  855. disabled={this.state.selectedRowKeys.length == 1 ? false : true}
  856. onClick={this.showModal}
  857. >
  858. 修改单条数据
  859. </Button>
  860. <Button
  861. type="primary"
  862. style={{ marginBottom: 11, marginLeft: 15 }}
  863. onClick={this.addModal}
  864. >
  865. 添加单条数据
  866. </Button>
  867. <Popconfirm
  868. placement="top"
  869. title={"您确定要删除选中项的回款信息吗?删除后,不可以恢复!"}
  870. onConfirm={this.delChecked}
  871. okText="确定"
  872. cancelText="取消"
  873. >
  874. <Button
  875. primary
  876. type="danger"
  877. style={{ marginBottom: 11, marginLeft: 15 }}
  878. disabled={this.state.selectedRowKeys.length > 0 ? false : true}
  879. >
  880. 删除选中项
  881. </Button>
  882. </Popconfirm>
  883. <Popconfirm
  884. placement="top"
  885. title={"您确定要删除全部的回款信息吗?删除后,不可以恢复!"}
  886. onConfirm={this.delAllChecked}
  887. okText="确定"
  888. cancelText="取消"
  889. >
  890. <Button
  891. type="danger"
  892. style={{ marginBottom: 11, marginLeft: 15 }}
  893. disabled={this.state.dataSource.length == 0}
  894. >
  895. 删除全部
  896. </Button>
  897. </Popconfirm>
  898. <Button
  899. type="danger"
  900. style={{ marginBottom: 11, marginLeft: 15 }}
  901. disabled={this.state.dataSource.length == 0 || this.props.look}
  902. onClick={e => {
  903. this.loadData(1, 100);
  904. this.setState({
  905. mergeModal: true
  906. });
  907. }}
  908. >
  909. 确认合并回款
  910. </Button>
  911. <Button
  912. type="danger"
  913. style={{ marginBottom: 11, marginLeft: 15 }}
  914. disabled={this.state.dataSource.length == 0}
  915. onClick={e => {
  916. this.setState({
  917. selectedRowKeys: []
  918. });
  919. }}
  920. >
  921. 重置选项
  922. </Button>
  923. </TabPane>
  924. </Tabs>
  925. <div className="patent-table" style={{ position: "relative" }}>
  926. <Spin spinning={this.state.loading}>
  927. <Table
  928. columns={
  929. this.state.changeList == undefined
  930. ? this.state.columns
  931. : this.state.changeList
  932. }
  933. scroll={{ x: "max-content" }}
  934. dataSource={this.state.dataSource}
  935. pagination={this.state.pagination}
  936. rowSelection={rowSelection}
  937. onRowDoubleClick={this.tableRowClick.bind(this)}
  938. bordered
  939. size="small"
  940. />
  941. </Spin>
  942. <p
  943. style={{ display: "inline-block", fontSize: "14px", color: "red" }}
  944. >
  945. {
  946. <span style={{ marginRight: 10 }}>
  947. {`回款金额总计(万元):${this.state.hui ? this.state.hui : "0"}`}
  948. </span>
  949. }
  950. {
  951. <span>
  952. {`合同额总计(万元):${this.state.totalHui ? this.state.totalHui : "0"
  953. }`}
  954. </span>
  955. }
  956. </p>
  957. </div>
  958. <Modal
  959. width={500}
  960. visible={visible}
  961. title="收款记录"
  962. onOk={this.handleOk}
  963. onCancel={this.handleCancel}
  964. footer={[
  965. <Button key="back" onClick={this.handleCancel}>
  966. 取消
  967. </Button>,
  968. <Button
  969. key="submit"
  970. type="primary"
  971. loading={loading}
  972. disabled={this.props.look}
  973. onClick={this.handleOk}
  974. >
  975. 保存
  976. </Button>
  977. ]}
  978. >
  979. <p
  980. style={{
  981. marginBottom: 10,
  982. display: this.state.choose ? "block" : "none"
  983. }}
  984. >
  985. 合同编号:
  986. <Input
  987. style={{
  988. width: "auto"
  989. }}
  990. disabled={this.state.choose}
  991. value={this.state.modalData.contractNo}
  992. onChange={e => {
  993. let val = e.target.value;
  994. this.state.modalData.contractNo = val;
  995. this.setState({ modalData: this.state.modalData });
  996. }}
  997. />
  998. </p>
  999. <p style={{ marginBottom: 10 }}>
  1000. 订单编号:
  1001. <Input
  1002. style={{ width: "auto" }}
  1003. value={this.state.modalData.orderNo}
  1004. onChange={e => {
  1005. let val = e.target.value;
  1006. this.state.modalData.orderNo = val;
  1007. this.setState({ modalData: this.state.modalData });
  1008. }}
  1009. />
  1010. </p>
  1011. <p style={{ marginBottom: 10 }}>
  1012. 流水编号:
  1013. <Input
  1014. style={{ width: "auto" }}
  1015. value={this.state.modalData.financialPayNo}
  1016. onChange={e => {
  1017. let val = e.target.value;
  1018. this.state.modalData.financialPayNo = val;
  1019. this.setState({ modalData: this.state.modalData });
  1020. }}
  1021. />
  1022. </p>
  1023. <p style={{ marginBottom: 10 }}>
  1024. 付款方:
  1025. <Input
  1026. style={{ width: "auto" }}
  1027. value={this.state.modalData.corporateName}
  1028. onChange={e => {
  1029. let val = e.target.value;
  1030. this.state.modalData.corporateName = val;
  1031. this.setState({ modalData: this.state.modalData });
  1032. }}
  1033. />
  1034. </p>
  1035. <p
  1036. style={{
  1037. marginBottom: 10,
  1038. display: this.state.choose ? "block" : "none"
  1039. }}
  1040. >
  1041. 客户名称:
  1042. <Input
  1043. style={{
  1044. width: "auto"
  1045. }}
  1046. disabled={this.state.choose}
  1047. value={this.state.modalData.nickname}
  1048. onChange={e => {
  1049. let val = e.target.value;
  1050. this.state.modalData.nickname = val;
  1051. this.setState({ modalData: this.state.modalData });
  1052. }}
  1053. />
  1054. </p>
  1055. <p
  1056. style={{
  1057. marginBottom: 10,
  1058. display: this.state.choose ? "block" : "none"
  1059. }}
  1060. >
  1061. 合同额(万元):
  1062. <Input
  1063. style={{
  1064. width: "auto",
  1065. display: this.state.choose ? "inline-block" : "none"
  1066. }}
  1067. disabled={this.state.choose}
  1068. value={this.state.modalData.totalAmount}
  1069. onChange={e => {
  1070. let val = e.target.value;
  1071. this.state.modalData.totalAmount = val;
  1072. this.setState({ modalData: this.state.modalData });
  1073. }}
  1074. />
  1075. </p>
  1076. <p style={{ marginBottom: 10 }}>
  1077. 本次回款(万元):
  1078. <Input
  1079. style={{ width: "auto" }}
  1080. value={this.state.modalData.amount}
  1081. onChange={e => {
  1082. let val = e.target.value;
  1083. this.state.modalData.amount = val;
  1084. this.setState({ modalData: this.state.modalData });
  1085. }}
  1086. />
  1087. </p>
  1088. <p style={{ marginBottom: 10 }}>
  1089. 回款时间:
  1090. <DatePicker
  1091. showTime
  1092. placeholder="选择回款时间"
  1093. value={
  1094. this.state.modalData.receivablesTimes
  1095. ? moment(this.state.modalData.receivablesTimes, "YYYY-MM-DD")
  1096. : ""
  1097. }
  1098. onChange={(v, e) => {
  1099. this.state.modalData.receivablesTimes = e;
  1100. console.log(e);
  1101. this.setState({ modalData: this.state.modalData });
  1102. }}
  1103. onOk={() => { }}
  1104. />
  1105. </p>
  1106. <p
  1107. style={{
  1108. marginBottom: 10,
  1109. display: this.state.choose ? "block" : "none"
  1110. }}
  1111. >
  1112. 批量导入时间:
  1113. <Input
  1114. style={{ width: "auto" }}
  1115. value={this.state.modalData.createTimes}
  1116. disabled
  1117. onChange={e => {
  1118. let val = e.target.value;
  1119. this.state.modalData.createTimes = val;
  1120. this.setState({ modalData: this.state.modalData });
  1121. }}
  1122. />
  1123. </p>
  1124. <p style={{ marginBottom: 10 }}>
  1125. <span style={{ display: "inline-block", marginBottom: 20 }}>
  1126. 备注:
  1127. </span>
  1128. <TextArea
  1129. style={{ width: "70%" }}
  1130. value={this.state.modalData.remarks}
  1131. onChange={e => {
  1132. this.state.modalData.remarks = e.target.value;
  1133. // console.log(e);
  1134. this.setState({ modalData: this.state.modalData });
  1135. }}
  1136. placeholder="请输入备注信息"
  1137. autosize={{ minRows: 3, maxRows: 5 }}
  1138. />
  1139. </p>
  1140. </Modal>
  1141. <Modal
  1142. title="确认合并列表"
  1143. visible={this.state.mergeModal}
  1144. width={1300}
  1145. onOk={this.mergeAll}
  1146. confirmLoading={this.state.confirmLoading}
  1147. onCancel={() => {
  1148. this.setState({
  1149. mergeModal: false
  1150. });
  1151. }}
  1152. >
  1153. <div className="patent-table" style={{ position: "relative" }}>
  1154. <Spin spinning={this.state.loading}>
  1155. <Table
  1156. columns={this.state.columns}
  1157. scroll={{ x: "max-content" }}
  1158. dataSource={this.state.dataSource}
  1159. bordered
  1160. size="small"
  1161. pagination={this.state.paginationModal}
  1162. />
  1163. </Spin>
  1164. <p
  1165. style={{
  1166. display: "inline-block",
  1167. fontSize: "14px",
  1168. color: "red"
  1169. }}
  1170. >
  1171. {
  1172. <span style={{ marginRight: 10 }}>
  1173. {`回款金额总计(万元):${this.state.hui ? this.state.hui : "0"
  1174. }`}
  1175. </span>
  1176. }
  1177. {
  1178. <span>
  1179. {`合同额总计(万元):${this.state.totalHui ? this.state.totalHui : "0"
  1180. }`}
  1181. </span>
  1182. }
  1183. </p>
  1184. </div>
  1185. </Modal>
  1186. </div>
  1187. );
  1188. }
  1189. });
  1190. export default HuiKuan;