huiKuan.jsx 32 KB

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