huiKuan.jsx 34 KB

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