huiKuan.jsx 35 KB

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