huiKuan.jsx 37 KB

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