chargeback.jsx 46 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403
  1. import React from 'react';
  2. import { Button, Input, Spin, Table, message,DatePicker, Upload, Form ,Modal,Col} from 'antd';
  3. import $ from 'jquery/src/ajax';
  4. import Picture from '@/manageCenter/publicComponent/picture';
  5. import moment from 'moment';
  6. import {
  7. getLiquidationStatus,
  8. getApprovedState,
  9. getProcessStatus,
  10. splitUrl,
  11. getjiedian,
  12. getNewOrderStatus,
  13. getRefundStatus,
  14. getCuikuan,
  15. ShowModal
  16. } from "@/tools.js";
  17. import './customer.less';
  18. import ShowModalDiv from "@/showModal.jsx";
  19. import OrderRiZi from "@/orderRiZi.jsx";
  20. const IntentionCustomer = Form.create()(
  21. React.createClass({
  22. loadData(pageNo) {
  23. this.setState({
  24. visitModul: false,
  25. loading: true,
  26. ispage: pageNo,
  27. modalVisible: false
  28. });
  29. $.ajax({
  30. method: "get",
  31. dataType: "json",
  32. crossDomain: false,
  33. url: globalConfig.context + "/api/admin/newOrder/orderRefundList",
  34. data: {
  35. pageNo: pageNo || 1,
  36. pageSize: this.state.pagination.pageSize,
  37. name: this.state.customerName, //名称
  38. orderNo: this.state.orderNo, //订单编号
  39. starTime: this.state.releaseDate[0], //开始时间
  40. endTime: this.state.releaseDate[1] //结束时间
  41. },
  42. success: function(data) {
  43. ShowModal(this);
  44. let theArr = [];
  45. if (data.error.length || data.data.list == "") {
  46. if (data.error && data.error.length) {
  47. message.warning(data.error[0].message);
  48. }
  49. } else {
  50. for (let i = 0; i < data.data.list.length; i++) {
  51. let thisdata = data.data.list[i];
  52. theArr.push({
  53. key: i,
  54. id: thisdata.id, //用户ID
  55. orderNo: thisdata.orderNo, //订单编号
  56. userName: thisdata.userName, //客户名称
  57. orderStatus: thisdata.orderStatus, //订单状态
  58. refundStatus: thisdata.refundStatus, //退单状态
  59. reason: thisdata.reason, //退单原因
  60. createDate: thisdata.createDate, //退单时间
  61. liquidationStatus: thisdata.liquidationStatus //结算状态
  62. });
  63. }
  64. this.state.pagination.total = data.data.totalCount;
  65. }
  66. if (data.data && data.data.list && !data.data.list.length) {
  67. this.state.pagination.total = 0;
  68. }
  69. this.setState({
  70. dataSource: theArr,
  71. pageNo: pageNo,
  72. pagination: this.state.pagination,
  73. selectedRowKeys: []
  74. });
  75. }.bind(this)
  76. }).always(
  77. function() {
  78. this.setState({
  79. loading: false
  80. });
  81. }.bind(this)
  82. );
  83. },
  84. getInitialState() {
  85. return {
  86. page: 1,
  87. releaseDate: [],
  88. selectedRowKeys: [],
  89. orgCodeUrl: [],
  90. customerArr: [],
  91. applicationUrl: [],
  92. contractUrl: [],
  93. pagination: {
  94. defaultCurrent: 1,
  95. defaultPageSize: 10,
  96. showQuickJumper: true,
  97. pageSize: 10,
  98. onChange: function(page) {
  99. this.loadData(page);
  100. }.bind(this),
  101. showTotal: function(total) {
  102. return "共" + total + "条数据";
  103. }
  104. },
  105. columns: [
  106. {
  107. title: "退单编号",
  108. dataIndex: "id",
  109. key: "id"
  110. },
  111. {
  112. title: "退单日期",
  113. dataIndex: "createDate",
  114. key: "createDate"
  115. },
  116. {
  117. title: "客户名称",
  118. dataIndex: "userName",
  119. key: "userName",
  120. render: text => {
  121. return text && text.length > 9 ? text.substr(0, 9) + "..." : text;
  122. }
  123. },
  124. {
  125. title: "订单编号",
  126. dataIndex: "orderNo",
  127. key: "orderNo"
  128. },
  129. {
  130. title: "订单状态",
  131. dataIndex: "orderStatus",
  132. key: "orderStatus",
  133. render: text => {
  134. return getNewOrderStatus(text);
  135. }
  136. },
  137. {
  138. title: "结算状态",
  139. dataIndex: "liquidationStatus",
  140. key: "liquidationStatus",
  141. render: text => {
  142. return getLiquidationStatus(text);
  143. }
  144. },
  145. {
  146. title: "退单状态",
  147. dataIndex: "refundStatus",
  148. key: "refundStatus",
  149. render: text => {
  150. return getRefundStatus(text);
  151. }
  152. },
  153. {
  154. title: "退单原因",
  155. dataIndex: "reason",
  156. key: "reason",
  157. render: text => {
  158. return text && text.length > 18
  159. ? text.substr(0, 18) + "..."
  160. : text;
  161. }
  162. },
  163. {
  164. title: "操作",
  165. dataIndex: "abc",
  166. key: "abc",
  167. render: (text, record) => {
  168. return (
  169. <div>
  170. <Button
  171. onClick={e => {
  172. e.stopPropagation(), this.visit(record);
  173. }}
  174. type="primary"
  175. >
  176. {this.state.refundStatus == 2
  177. ? "修改退单申请"
  178. : "查看退款申请"}
  179. </Button>
  180. </div>
  181. );
  182. }
  183. }
  184. ],
  185. data: [],
  186. dataSource: [],
  187. columnsX: [
  188. {
  189. title: "业务项目名称",
  190. dataIndex: "commodityName",
  191. key: "commodityName"
  192. },
  193. {
  194. title: "项目类别",
  195. dataIndex: "cname",
  196. key: "cname"
  197. },
  198. {
  199. title: "项目数量",
  200. dataIndex: "commodityQuantity",
  201. key: "commodityQuantity"
  202. },
  203. {
  204. title: "金额(万元)",
  205. dataIndex: "commodityPrice",
  206. key: "commodityPrice"
  207. },
  208. {
  209. title: "负责人",
  210. dataIndex: "contacts",
  211. key: "contacts"
  212. },
  213. {
  214. title: "负责人电话",
  215. dataIndex: "contactsMobile",
  216. key: "contactsMobile"
  217. },
  218. {
  219. title: "主要项目",
  220. dataIndex: "main",
  221. key: "main",
  222. render: text => {
  223. return text ? "是" : "否";
  224. }
  225. },
  226. {
  227. title: "项目说明",
  228. dataIndex: "taskComment",
  229. key: "taskComment",
  230. render: text => {
  231. return text && text.length > 8 ? text.substr(0, 8) + "…" : text;
  232. }
  233. }
  234. ],
  235. columnsrizhi: [
  236. {
  237. title: "流程",
  238. dataIndex: "processName",
  239. key: "processName"
  240. },
  241. {
  242. title: "操作人",
  243. dataIndex: "adminName",
  244. key: "adminName"
  245. },
  246. {
  247. title: "时间",
  248. dataIndex: "createDate",
  249. key: "createDate"
  250. }
  251. ],
  252. dataSourceX: [],
  253. ContactsListsNew: [
  254. {
  255. title: "项目名称",
  256. dataIndex: "commodityName",
  257. key: "commodityName",
  258. render: text => {
  259. return <span>{text}</span>;
  260. }
  261. },
  262. {
  263. title: "项目分类",
  264. dataIndex: "projectType",
  265. key: "projectType",
  266. render: text => {
  267. let arr = this.state.dataSourceX || [];
  268. let str = "";
  269. for (let i = 0; i < arr.length; i++) {
  270. if (this.state.dataSourceX[i].sort == text) {
  271. str = this.state.dataSourceX[i].cname;
  272. return <span>{str}</span>;
  273. }
  274. }
  275. }
  276. },
  277. {
  278. title: "催款科目",
  279. dataIndex: "dunTypeName",
  280. key: "dunTypeName",
  281. render: text => {
  282. return <span>{text}</span>;
  283. }
  284. },
  285. {
  286. title: "时间",
  287. dataIndex: "waitDay",
  288. key: "waitDay",
  289. render: (text, record) => {
  290. if (record.dunTypeName) {
  291. return <span>{text}</span>;
  292. }
  293. }
  294. },
  295. {
  296. title: "金额(万元)",
  297. dataIndex: "money",
  298. key: "money",
  299. render: (text, record) => {
  300. if (record.dunTypeName) {
  301. if (record.appropriationRatio && !record.money) {
  302. return <span>{record.appropriationRatio}(拨款比例)</span>;
  303. } else if (record.appropriationRatio && record.money) {
  304. return (
  305. <span>
  306. {text}(比例:{record.appropriationRatio})
  307. </span>
  308. );
  309. } else {
  310. return <span>{text}</span>;
  311. }
  312. }
  313. }
  314. },
  315. {
  316. title: "服务年限",
  317. dataIndex: "startDate",
  318. key: "startDate",
  319. render: (text, record) => {
  320. if (record.dunTypeName) {
  321. return <span>{text}</span>;
  322. }
  323. }
  324. },
  325. {
  326. title: "催款状态",
  327. dataIndex: "status",
  328. key: "status",
  329. render: text => {
  330. return <span>{text == 1 ? "已启动" : "未启动"}</span>;
  331. }
  332. }
  333. ],
  334. ContactsLists: [
  335. {
  336. title: "催款科目",
  337. dataIndex: "dunSubject",
  338. key: "dunSubject",
  339. render: text => {
  340. return getjiedian(text);
  341. }
  342. },
  343. {
  344. title: "金额(万元)",
  345. dataIndex: "money",
  346. key: "money"
  347. },
  348. {
  349. title: "催款状态",
  350. dataIndex: "dunStatus",
  351. key: "dunStatus",
  352. render: text => {
  353. return getCuikuan(text);
  354. }
  355. }
  356. ]
  357. };
  358. },
  359. //进入新增拜访记录
  360. visit(record) {
  361. this.setState({
  362. addnextVisible: true
  363. });
  364. this.tuidanxiangqing(record.id);
  365. },
  366. //退单详情
  367. tuidanxiangqing(id) {
  368. this.setState({
  369. loading: true
  370. });
  371. $.ajax({
  372. method: "get",
  373. dataType: "json",
  374. crossDomain: false,
  375. url: globalConfig.context + "/api/admin/newOrder/orderRefundDetail",
  376. data: {
  377. id: id
  378. }
  379. }).done(
  380. function(data) {
  381. if (data.error.length || data.data.list == "") {
  382. if (data.error && data.error.length) {
  383. message.warning(data.error[0].message);
  384. }
  385. } else {
  386. let thisdata = data.data;
  387. this.setState({
  388. id: thisdata.id,
  389. createDate: thisdata.createDate, //退单时间
  390. orderNo: thisdata.orderNo, //订单编号
  391. orderStatus: thisdata.orderStatus, //订单状态
  392. refundStatus: thisdata.refundStatus, //退单状态
  393. applicationUrl: thisdata.applicationUrl
  394. ? splitUrl(
  395. thisdata.applicationUrl,
  396. ",",
  397. globalConfig.avatarHost + "/upload"
  398. )
  399. : [], //申请表附件
  400. contractUrl: thisdata.contractUrl
  401. ? splitUrl(
  402. thisdata.contractUrl,
  403. ",",
  404. globalConfig.avatarHost + "/upload"
  405. )
  406. : [], //合同附件
  407. reason: thisdata.reason, //退单原因
  408. liquidationStatus: thisdata.liquidationStatus //结算状态
  409. });
  410. this.setState({
  411. loading: false
  412. });
  413. }
  414. }.bind(this)
  415. );
  416. },
  417. //点击确认退单
  418. tuidanOk() {
  419. let contractUrls = [];
  420. let applicationUrls = [];
  421. if (this.state.contractUrl.length) {
  422. let picArr = [];
  423. this.state.contractUrl.map(function(item) {
  424. if (
  425. item.response &&
  426. item.response.data &&
  427. item.response.data.length
  428. ) {
  429. picArr.push(item.response.data);
  430. }
  431. });
  432. contractUrls = picArr.join(",");
  433. }
  434. if (this.state.applicationUrl.length) {
  435. let picArr = [];
  436. this.state.applicationUrl.map(function(item) {
  437. if (
  438. item.response &&
  439. item.response.data &&
  440. item.response.data.length
  441. ) {
  442. picArr.push(item.response.data);
  443. }
  444. });
  445. applicationUrls = picArr.join(",");
  446. }
  447. $.ajax({
  448. method: "POST",
  449. dataType: "json",
  450. crossDomain: false,
  451. url: globalConfig.context + "/api/admin/newOrder/updateOrderRefund",
  452. data: {
  453. id: this.state.id, //订单编号
  454. contractUrl: contractUrls.length ? contractUrls : "", //终止合同
  455. applicationUrl: applicationUrls.length ? applicationUrls : "", //退单申请表
  456. reason: this.state.reason //退单原因
  457. }
  458. }).done(
  459. function(data) {
  460. this.setState({
  461. loading: false
  462. });
  463. if (!data.error.length) {
  464. message.success("退单成功!");
  465. this.nextCancel();
  466. this.handleCancel();
  467. } else {
  468. message.warning(data.error[0].message);
  469. }
  470. }.bind(this)
  471. );
  472. },
  473. //页面加载函数
  474. componentWillMount() {
  475. this.loadData();
  476. },
  477. //整行点击
  478. tableRowClick(record) {
  479. this.setState({
  480. visible: true
  481. });
  482. this.xiangqing(record.orderNo);
  483. this.xiangmu(record.orderNo);
  484. this.jiedian(record.orderNo);
  485. this.jiedianNew(record.orderNo);
  486. },
  487. rizhi() {
  488. console.log(this.state.orderNo);
  489. this.setState({
  490. loading: true
  491. });
  492. $.ajax({
  493. method: "get",
  494. dataType: "json",
  495. crossDomain: false,
  496. url: "/api/admin/newOrder/selectOrderLog",
  497. data: {
  498. orderNo: this.state.orderNo
  499. },
  500. success: function(data) {
  501. let theArr = [];
  502. let thisData = data.data;
  503. if (!thisData.length) {
  504. if (data.error && data.error.length) {
  505. message.warning(data.error[0].message);
  506. }
  507. thisData = {};
  508. } else {
  509. for (let i = 0; i < data.data.length; i++) {
  510. let thisdata = data.data[i];
  511. theArr.push({
  512. processName: thisdata.processName,
  513. adminName: thisdata.adminName,
  514. createDate: thisdata.createDate
  515. });
  516. }
  517. }
  518. this.setState({
  519. dataSourcerizhi: theArr
  520. });
  521. }.bind(this)
  522. }).always(
  523. function() {
  524. this.setState({
  525. loading: false
  526. });
  527. }.bind(this)
  528. );
  529. },
  530. //查看订单日志
  531. getOrderLog() {
  532. this.setState({
  533. rizhivisible: true
  534. });
  535. this.rizhi();
  536. },
  537. closeOrderLog() {
  538. this.setState({
  539. rizhivisible: false
  540. });
  541. },
  542. //详情关闭
  543. nextCancel() {
  544. this.setState({
  545. addnextVisible: false
  546. });
  547. this.resets();
  548. },
  549. //订单详情
  550. xiangqing(orderNos) {
  551. $.ajax({
  552. method: "get",
  553. dataType: "json",
  554. crossDomain: false,
  555. url: globalConfig.context + "/api/admin/newOrder/getOrderNewDetail",
  556. data: {
  557. orderNo: orderNos
  558. },
  559. success: function(data) {
  560. if (data.error.length || data.data.list == "") {
  561. if (data.error && data.error.length) {
  562. message.warning(data.error[0].message);
  563. }
  564. } else {
  565. let thisdata = data.data;
  566. this.setState({
  567. id: thisdata.id,
  568. kehuId: thisdata.buyerId,
  569. orderNo: thisdata.orderNo, //订单编号
  570. contractNo: thisdata.contractNo, //合同编号
  571. userName: thisdata.userName, //客户名称
  572. signDate: thisdata.signDate, //签单时间
  573. processStatus: thisdata.processStatus, //流程状态
  574. liquidationStatus: thisdata.liquidationStatus, //结算状态
  575. contacts: thisdata.contacts, //企业联系人
  576. contactMobile: thisdata.contactMobile, //联系人电话
  577. legalPerson: thisdata.legalPerson, //法人
  578. legalPersonTel: thisdata.legalPersonTel, //法人电话
  579. firstAmount: thisdata.firstAmount, //签单金额
  580. totalAmount: thisdata.totalAmount, //首付金额
  581. settlementAmount: thisdata.settlementAmount, //已收款项
  582. orderRemarks: thisdata.orderRemarks, //订单留言
  583. orgCodeUrl: thisdata.contractPictureUrl
  584. ? splitUrl(
  585. thisdata.contractPictureUrl,
  586. ",",
  587. globalConfig.avatarHost + "/upload"
  588. )
  589. : [], //图片地址
  590. salesmanName: thisdata.salesmanName, //营销员名称
  591. salesmanMobile: thisdata.salesmanMobile, //营销员电话
  592. oldSalesmanName: thisdata.oldSalesmanName, //营销员名称
  593. oldSalesmanMobile: thisdata.oldSalesmanMobile, //营销员电话
  594. financeName: thisdata.financeName, //财务名称
  595. financeMobile: thisdata.financeMobile, //财务电话
  596. nowFinance: thisdata.nowFinance, //财务名称
  597. nowFinanceMobile: thisdata.nowFinanceMobile, //财务电话
  598. approval: thisdata.approval.toString() //特批状态
  599. //approval:thisdata.approval==0?thisdata.approval.toString():thisdata.approval,//特批状态
  600. });
  601. }
  602. }.bind(this)
  603. }).always(
  604. function() {
  605. this.setState({
  606. loading: false
  607. });
  608. }.bind(this)
  609. );
  610. },
  611. //项目列表
  612. xiangmu(orderNos) {
  613. $.ajax({
  614. method: "get",
  615. dataType: "json",
  616. crossDomain: false,
  617. url: globalConfig.context + "/api/admin/newOrder/getOrderTask",
  618. data: {
  619. orderNo: orderNos
  620. },
  621. success: function(data) {
  622. let theArr = [];
  623. if (data.error.length || data.data.list == "") {
  624. if (data.error && data.error.length) {
  625. message.warning(data.error[0].message);
  626. }
  627. } else {
  628. for (let i = 0; i < data.data.length; i++) {
  629. let thisdata = data.data[i];
  630. theArr.push({
  631. key: i,
  632. id: thisdata.id,
  633. orderNo: thisdata.orderNo, //订单编号
  634. commodityId: thisdata.commodityId, //项目ID
  635. commodityName: thisdata.commodityName, //项目名称
  636. cname: thisdata.cname, //项目类别
  637. commodityPrice: thisdata.commodityPrice, //项目价格
  638. commodityQuantity: thisdata.commodityQuantity, //项目数量
  639. main: thisdata.main, //是否为主要任务
  640. taskComment: thisdata.taskComment, //任务说明
  641. contacts: thisdata.contacts, //联系人
  642. contactsMobile: thisdata.contactsMobile, //联系人电话
  643. sort: thisdata.cSort
  644. });
  645. }
  646. }
  647. this.setState({
  648. dataSourceX: theArr,
  649. paginations: false
  650. });
  651. }.bind(this)
  652. }).always(
  653. function() {
  654. this.setState({
  655. loading: false
  656. });
  657. }.bind(this)
  658. );
  659. },
  660. //节点列表
  661. jiedian(orderNos) {
  662. $.ajax({
  663. method: "get",
  664. dataType: "json",
  665. crossDomain: false,
  666. url: globalConfig.context + "/api/admin/newOrder/selectOrderDun",
  667. data: {
  668. orderNo: orderNos
  669. },
  670. success: function(data) {
  671. let theArr = [];
  672. let thisData = [];
  673. if (data.error.length || data.data.list == "") {
  674. if (data.error && data.error.length) {
  675. message.warning(data.error[0].message);
  676. }
  677. } else {
  678. for (let i = 0; i < data.data.length; i++) {
  679. thisData = data.data[i];
  680. theArr.push({
  681. key: i,
  682. dunSubject: thisData.dunSubject
  683. ? thisData.dunSubject.toString()
  684. : "", //催款科目
  685. id: thisData.id, //节点Id
  686. money: thisData.money, //催款金额
  687. dunStatus: thisData.dunStatus, //催款状态
  688. orderNo: thisData.orderNo
  689. });
  690. }
  691. this.setState({
  692. contactList: theArr
  693. });
  694. }
  695. }.bind(this)
  696. }).always(
  697. function() {
  698. this.setState({
  699. loading: false
  700. });
  701. }.bind(this)
  702. );
  703. },
  704. //查看催款节点
  705. jiedianNew(orderNos) {
  706. $.ajax({
  707. method: "get",
  708. dataType: "json",
  709. crossDomain: false,
  710. url:
  711. globalConfig.context + "/api/admin/newOrderDun/selectListNewOrderDun",
  712. data: {
  713. orderNo: orderNos
  714. },
  715. success: function(data) {
  716. if (data.error && data.error.length) {
  717. message.warning(data.error[0].message);
  718. } else {
  719. let theArr = [];
  720. let thisData = [];
  721. let arr = data.data || [];
  722. let totalCui = 0;
  723. for (let i = 0; i < arr.length; i++) {
  724. thisData = arr[i];
  725. totalCui += +thisData.money;
  726. theArr.push({
  727. key: i,
  728. dunSubject: thisData.dunSubject
  729. ? thisData.dunSubject.toString()
  730. : "", //催款科目
  731. id: thisData.id, //节点Id
  732. money: thisData.money, //催款金额
  733. // orderNo: record ? record.orderNo : this.props.datauser.orderNo,
  734. commodityName: thisData.commodityName,
  735. projectType: thisData.projectType,
  736. dunTypeName: thisData.dunTypeName,
  737. status: thisData.status,
  738. waitDay: thisData.waitDay,
  739. effectiveCount: thisData.effectiveCount,
  740. startDate: thisData.startDate,
  741. dunType: thisData.dunType,
  742. appropriationRatio: thisData.appropriationRatio
  743. });
  744. }
  745. if (!totalCui) {
  746. totalCui = 0;
  747. }
  748. totalCui = (Math.round(totalCui * 10000) / 10000).toFixed(4);
  749. this.setState({
  750. contactListNew: theArr,
  751. totalCui
  752. });
  753. }
  754. }.bind(this)
  755. }).always(
  756. function() {
  757. this.setState({
  758. loading: false
  759. });
  760. }.bind(this)
  761. );
  762. },
  763. resets() {
  764. this.state.orderNo = "";
  765. this.state.customerName = "";
  766. this.state.releaseDate[0] = undefined;
  767. this.state.releaseDate[1] = undefined;
  768. },
  769. reset() {
  770. this.state.orderNo = "";
  771. this.state.customerName = "";
  772. this.state.releaseDate[0] = undefined;
  773. this.state.releaseDate[1] = undefined;
  774. this.loadData();
  775. },
  776. //搜索
  777. search() {
  778. this.setState({
  779. //signBillVisible:false
  780. });
  781. this.loadData();
  782. },
  783. getOrgCodeUrl(e) {
  784. this.setState({ orgCodeUrl: e });
  785. },
  786. //关闭详情
  787. visitCancel() {
  788. this.setState({
  789. visible: false
  790. });
  791. this.resets();
  792. },
  793. visitOk() {
  794. this.setState({
  795. visible: false
  796. });
  797. this.resets();
  798. },
  799. render() {
  800. const formItemLayout = {
  801. labelCol: { span: 8 },
  802. wrapperCol: { span: 14 }
  803. };
  804. const FormItem = Form.Item;
  805. const { RangePicker } = DatePicker;
  806. const cuiDataList = this.state.contactList || [];
  807. const rowSelection = {
  808. selectedRowKeys: this.state.selectedRowKeys,
  809. onChange: (selectedRowKeys, selectedRows) => {
  810. this.setState({
  811. modalVisible: false,
  812. selectedRows: selectedRows.slice(-1),
  813. selectedRowKeys: selectedRowKeys.slice(-1)
  814. });
  815. },
  816. onSelect: recordt => {
  817. this.setState({
  818. modalVisible: false,
  819. recordt: recordt.id
  820. });
  821. }
  822. };
  823. return (
  824. <div className="user-content">
  825. <ShowModalDiv ShowModal={this.state.showModal} />
  826. <div className="content-title">
  827. <span>退单管理</span>
  828. </div>
  829. <div className="user-search">
  830. <Input
  831. placeholder="客户名称"
  832. style={{ width: "150px", marginBottom: "10px" }}
  833. value={this.state.customerName}
  834. onChange={e => {
  835. this.setState({ customerName: e.target.value });
  836. }}
  837. />
  838. <Input
  839. placeholder="订单编号"
  840. style={{ width: "150px" }}
  841. value={this.state.orderNo}
  842. onChange={e => {
  843. this.setState({ orderNo: e.target.value });
  844. }}
  845. />
  846. <span style={{ marginRight: "10px" }}>下单时间 :</span>
  847. <RangePicker
  848. value={[
  849. this.state.releaseDate[0]
  850. ? moment(this.state.releaseDate[0])
  851. : null,
  852. this.state.releaseDate[1]
  853. ? moment(this.state.releaseDate[1])
  854. : null
  855. ]}
  856. onChange={(data, dataString) => {
  857. this.setState({ releaseDate: dataString });
  858. }}
  859. />
  860. <Button
  861. type="primary"
  862. onClick={this.search}
  863. style={{ marginLeft: "10px" }}
  864. >
  865. 搜索
  866. </Button>
  867. <Button onClick={this.reset}>重置</Button>
  868. <div className="patent-table">
  869. <Spin spinning={this.state.loading}>
  870. <Table
  871. columns={this.state.columns}
  872. dataSource={this.state.dataSource}
  873. rowSelection={rowSelection}
  874. pagination={this.state.pagination}
  875. onRowClick={this.tableRowClick}
  876. bordered
  877. size="small"
  878. />
  879. </Spin>
  880. </div>
  881. <Modal
  882. className="customeDetails"
  883. footer=""
  884. title="订单详情"
  885. width="900px"
  886. visible={this.state.visible}
  887. onOk={this.visitOk}
  888. onCancel={this.visitCancel}
  889. >
  890. <Form
  891. layout="horizontal"
  892. onSubmit={this.handleSubmit}
  893. id="demand-form"
  894. style={{ paddingBottom: "40px" }}
  895. >
  896. <Spin spinning={this.state.loading}>
  897. <div className="clearfix">
  898. <FormItem
  899. className="half-item"
  900. {...formItemLayout}
  901. label="订单编号"
  902. >
  903. <span>{this.state.orderNo}</span>
  904. </FormItem>
  905. <FormItem
  906. className="half-item"
  907. {...formItemLayout}
  908. label="合同编号"
  909. >
  910. <span>{this.state.contractNo}</span>
  911. </FormItem>
  912. <FormItem
  913. className="half-item"
  914. {...formItemLayout}
  915. label="客户名称"
  916. >
  917. <span>{this.state.userName}</span>
  918. </FormItem>
  919. <FormItem
  920. className="half-item"
  921. {...formItemLayout}
  922. label="合同签订时间"
  923. >
  924. <span>{this.state.signDate}</span>
  925. </FormItem>
  926. <FormItem
  927. className="half-item"
  928. {...formItemLayout}
  929. label="流程状态"
  930. >
  931. <span>{getProcessStatus(this.state.processStatus)}</span>
  932. </FormItem>
  933. <FormItem
  934. className="half-item"
  935. {...formItemLayout}
  936. label="结算状态"
  937. >
  938. <span>
  939. {getLiquidationStatus(this.state.liquidationStatus)}
  940. </span>
  941. </FormItem>
  942. <FormItem
  943. className="half-item"
  944. {...formItemLayout}
  945. label="企业联系人"
  946. >
  947. <span>{this.state.contacts}</span>
  948. </FormItem>
  949. <FormItem
  950. className="half-item"
  951. {...formItemLayout}
  952. label="联系人电话"
  953. >
  954. <span>{this.state.contactMobile}</span>
  955. </FormItem>
  956. <FormItem
  957. className="half-item"
  958. {...formItemLayout}
  959. label="企业法人"
  960. >
  961. <span>{this.state.legalPerson}</span>
  962. </FormItem>
  963. <FormItem
  964. className="half-item"
  965. {...formItemLayout}
  966. label="法人电话"
  967. >
  968. <span>{this.state.legalPersonTel}</span>
  969. </FormItem>
  970. <FormItem
  971. className="half-item"
  972. {...formItemLayout}
  973. label="签单金额(万元)"
  974. >
  975. <span>{this.state.firstAmount}</span>
  976. </FormItem>
  977. <FormItem
  978. className="half-item"
  979. {...formItemLayout}
  980. label="首付金额(万元)"
  981. >
  982. <span>{this.state.totalAmount}</span>
  983. </FormItem>
  984. <FormItem
  985. className="half-item"
  986. {...formItemLayout}
  987. label="特批立项"
  988. >
  989. <span>{getApprovedState(this.state.approval)}</span>
  990. </FormItem>
  991. <FormItem
  992. className="half-item"
  993. {...formItemLayout}
  994. label="已收款项(万元)"
  995. >
  996. <span>{this.state.settlementAmount}</span>
  997. </FormItem>
  998. <div className="clearfix">
  999. <FormItem
  1000. labelCol={{ span: 4 }}
  1001. wrapperCol={{ span: 16 }}
  1002. label="订单留言"
  1003. >
  1004. <span>{this.state.orderRemarks}</span>
  1005. </FormItem>
  1006. </div>
  1007. <div className="clearfix">
  1008. <FormItem
  1009. labelCol={{ span: 4 }}
  1010. wrapperCol={{ span: 18 }}
  1011. label="合同扫描件"
  1012. >
  1013. <Upload
  1014. className="demandDetailShow-upload"
  1015. listType="picture-card"
  1016. fileList={this.state.orgCodeUrl}
  1017. onPreview={file => {
  1018. this.setState({
  1019. previewImage: file.url || file.thumbUrl,
  1020. previewVisible: true
  1021. });
  1022. }}
  1023. ></Upload>
  1024. <Modal
  1025. maskClosable={false}
  1026. footer={null}
  1027. visible={this.state.previewVisible}
  1028. onCancel={() => {
  1029. this.setState({ previewVisible: false });
  1030. }}
  1031. >
  1032. <img
  1033. alt=""
  1034. style={{ width: "100%" }}
  1035. src={this.state.previewImage || ""}
  1036. />
  1037. </Modal>
  1038. <Button
  1039. style={{
  1040. float: "right",
  1041. marginRight: "140px",
  1042. marginTop: "20px"
  1043. }}
  1044. onClick={this.getOrderLog}
  1045. >
  1046. 查看订单 日志
  1047. </Button>
  1048. </FormItem>
  1049. </div>
  1050. <div className="clearfix">
  1051. <FormItem
  1052. className="half-item"
  1053. {...formItemLayout}
  1054. label="订单负责人"
  1055. >
  1056. <span>{this.state.salesmanName}</span>
  1057. </FormItem>
  1058. <FormItem
  1059. className="half-item"
  1060. {...formItemLayout}
  1061. label="订单负责人电话"
  1062. >
  1063. <span>{this.state.salesmanMobile}</span>
  1064. </FormItem>
  1065. </div>
  1066. <div className="clearfix">
  1067. <FormItem
  1068. className="half-item"
  1069. {...formItemLayout}
  1070. label="当前财务负责人"
  1071. >
  1072. <span>{this.state.nowFinance}</span>
  1073. </FormItem>
  1074. <FormItem
  1075. className="half-item"
  1076. {...formItemLayout}
  1077. label="当前财务负责人电话"
  1078. >
  1079. <span>{this.state.nowFinanceMobile}</span>
  1080. </FormItem>
  1081. </div>
  1082. <div className="clearfix">
  1083. <FormItem
  1084. className="half-item"
  1085. {...formItemLayout}
  1086. style={{ opacity: ".5" }}
  1087. label="原订单负责人"
  1088. >
  1089. <span>{this.state.oldSalesmanName}</span>
  1090. </FormItem>
  1091. <FormItem
  1092. className="half-item"
  1093. {...formItemLayout}
  1094. style={{ opacity: ".5" }}
  1095. label="原订单负责人电话"
  1096. >
  1097. <span>{this.state.oldSalesmanMobile}</span>
  1098. </FormItem>
  1099. </div>
  1100. <div className="clearfix">
  1101. <FormItem
  1102. className="half-item"
  1103. style={{ opacity: ".5" }}
  1104. {...formItemLayout}
  1105. label="实际财务操作人"
  1106. >
  1107. <span>{this.state.financeName}</span>
  1108. </FormItem>
  1109. <FormItem
  1110. className="half-item"
  1111. {...formItemLayout}
  1112. style={{ opacity: ".5" }}
  1113. label="实际财务操作人电话"
  1114. >
  1115. <span>{this.state.financeMobile}</span>
  1116. </FormItem>
  1117. </div>
  1118. <div>
  1119. <span style={{ marginLeft: "50px", fontSize: "20px" }}>
  1120. 项目业务
  1121. </span>
  1122. </div>
  1123. <div className="patent-table">
  1124. <Spin spinning={this.state.loading}>
  1125. <Table
  1126. columns={this.state.columnsX}
  1127. dataSource={this.state.dataSourceX}
  1128. pagination={this.state.paginations}
  1129. bordered
  1130. size="small"
  1131. />
  1132. </Spin>
  1133. </div>
  1134. <div>
  1135. <span style={{ marginLeft: "50px", fontSize: "20px" }}>
  1136. 催款节点
  1137. </span>
  1138. <span
  1139. style={{
  1140. display: cuiDataList.length ? "none" : "inline-block",
  1141. marginLeft: 10,
  1142. color: "red"
  1143. }}
  1144. >
  1145. 金额总计(万元): {this.state.totalCui}
  1146. </span>
  1147. </div>
  1148. <div className="clearfix">
  1149. <Spin spinning={this.state.loading}>
  1150. <Form layout="horizontal" id="demand-form">
  1151. <Table
  1152. pagination={false}
  1153. bordered
  1154. size="small"
  1155. // columns={this.state.ContactsLists}
  1156. // dataSource={this.state.contactList}
  1157. columns={
  1158. cuiDataList.length
  1159. ? this.state.ContactsLists
  1160. : this.state.ContactsListsNew
  1161. }
  1162. dataSource={
  1163. cuiDataList.length
  1164. ? this.state.contactList
  1165. : this.state.contactListNew
  1166. }
  1167. />
  1168. <Col
  1169. span={24}
  1170. offset={9}
  1171. style={{ marginTop: "15px" }}
  1172. ></Col>
  1173. </Form>
  1174. </Spin>
  1175. </div>
  1176. </div>
  1177. </Spin>
  1178. </Form>
  1179. </Modal>
  1180. <Modal
  1181. maskClosable={false}
  1182. visible={this.state.addnextVisible}
  1183. onOk={this.nextCancel}
  1184. onCancel={this.nextCancel}
  1185. width="800px"
  1186. title={this.state.refundStatus == 2 ? "修改退单申请" : "退单详情"}
  1187. footer=""
  1188. className="admin-desc-content"
  1189. >
  1190. <Form layout="horizontal" id="demand-form">
  1191. <Spin spinning={this.state.loading}>
  1192. <div className="clearfix">
  1193. <FormItem
  1194. className="half-item"
  1195. {...formItemLayout}
  1196. label="退单编号"
  1197. >
  1198. <span>{this.state.id}</span>
  1199. </FormItem>
  1200. <FormItem
  1201. className="half-item"
  1202. {...formItemLayout}
  1203. label="退单日期"
  1204. >
  1205. <span>{this.state.createDate}</span>
  1206. </FormItem>
  1207. <FormItem
  1208. className="half-item"
  1209. {...formItemLayout}
  1210. label="订单编号"
  1211. >
  1212. <span>{this.state.orderNo}</span>
  1213. </FormItem>
  1214. <FormItem
  1215. className="half-item"
  1216. {...formItemLayout}
  1217. label="订单状态"
  1218. >
  1219. <span>{getNewOrderStatus(this.state.orderStatus)}</span>
  1220. </FormItem>
  1221. <FormItem
  1222. className="half-item"
  1223. {...formItemLayout}
  1224. label="退单状态"
  1225. >
  1226. <span>{getRefundStatus(this.state.refundStatus)}</span>
  1227. </FormItem>
  1228. <FormItem
  1229. className="half-item"
  1230. {...formItemLayout}
  1231. label="退款状态"
  1232. >
  1233. <span>
  1234. {getLiquidationStatus(this.state.liquidationStatus)}
  1235. </span>
  1236. </FormItem>
  1237. <div className="clearfix">
  1238. {this.state.refundStatus == 2 ? (
  1239. <FormItem
  1240. labelCol={{ span: 4 }}
  1241. wrapperCol={{ span: 16 }}
  1242. label="终止合同"
  1243. >
  1244. <Picture
  1245. fileList={e => {
  1246. this.setState({ contractUrl: e });
  1247. }}
  1248. pictureUrl={this.state.contractUrl}
  1249. visible={this.props.visible}
  1250. data={{
  1251. sign: "order_refund_file",
  1252. url: "/api/admin/newOrder/uploadRefundOrderFile",
  1253. number: 8
  1254. }}
  1255. />
  1256. </FormItem>
  1257. ) : (
  1258. <FormItem
  1259. labelCol={{ span: 4 }}
  1260. wrapperCol={{ span: 18 }}
  1261. label="合同扫描件"
  1262. >
  1263. <Upload
  1264. className="demandDetailShow-upload"
  1265. listType="picture-card"
  1266. fileList={this.state.orgCodeUrl}
  1267. onPreview={file => {
  1268. this.setState({
  1269. previewImage: file.url || file.thumbUrl,
  1270. previewVisible: true
  1271. });
  1272. }}
  1273. ></Upload>
  1274. <Modal
  1275. maskClosable={false}
  1276. footer={null}
  1277. visible={this.state.previewVisible}
  1278. onCancel={() => {
  1279. this.setState({ previewVisible: false });
  1280. }}
  1281. >
  1282. <img
  1283. alt=""
  1284. style={{ width: "100%" }}
  1285. src={this.state.previewImage || ""}
  1286. />
  1287. </Modal>
  1288. </FormItem>
  1289. )}
  1290. </div>
  1291. <div className="clearfix">
  1292. <FormItem
  1293. labelCol={{ span: 4 }}
  1294. wrapperCol={{ span: 16 }}
  1295. label="退单申请表"
  1296. >
  1297. <Upload
  1298. className="demandDetailShow-upload"
  1299. listType="picture-card"
  1300. fileList={this.state.orgCodeUrl}
  1301. onPreview={file => {
  1302. this.setState({
  1303. previewImage: file.url || file.thumbUrl,
  1304. previewVisible: true
  1305. });
  1306. }}
  1307. ></Upload>
  1308. </FormItem>
  1309. </div>
  1310. <div className="clearfix">
  1311. <FormItem
  1312. labelCol={{ span: 4 }}
  1313. wrapperCol={{ span: 16 }}
  1314. label="退单理由"
  1315. >
  1316. {this.state.refundStatus == 2 ? (
  1317. <Input
  1318. type="textarea"
  1319. placeholder="请输入退单理由"
  1320. rows={4}
  1321. value={this.state.reason}
  1322. onChange={e => {
  1323. this.setState({ reason: e.target.value });
  1324. }}
  1325. />
  1326. ) : (
  1327. <span>{this.state.reason}</span>
  1328. )}
  1329. </FormItem>
  1330. </div>
  1331. {this.state.refundStatus == 2 ? (
  1332. <FormItem
  1333. wrapperCol={{ span: 12, offset: 4 }}
  1334. className="half-middle"
  1335. >
  1336. <Button
  1337. className="submitSave"
  1338. type="primary"
  1339. onClick={this.tuidanOk}
  1340. >
  1341. 重新退单
  1342. </Button>
  1343. <Button
  1344. className="submitSave"
  1345. type="ghost"
  1346. onClick={this.nextCancel}
  1347. >
  1348. 取消
  1349. </Button>
  1350. </FormItem>
  1351. ) : (
  1352. ""
  1353. )}
  1354. </div>
  1355. </Spin>
  1356. </Form>
  1357. </Modal>
  1358. {/* <Modal
  1359. visible={this.state.rizhivisible}
  1360. className="admin-desc-content"
  1361. width="800px"
  1362. maskClosable={false}
  1363. title="订单日志"
  1364. footer={null}
  1365. onCancel={this.closeOrderLog}
  1366. >
  1367. <div className="patent-table">
  1368. <Spin spinning={this.state.loading}>
  1369. <Table
  1370. columns={this.state.columnsrizhi}
  1371. dataSource={this.state.dataSourcerizhi}
  1372. pagination={false}
  1373. />
  1374. </Spin>
  1375. </div>
  1376. </Modal> */}
  1377. <OrderRiZi
  1378. dataSourcerizhi={this.state.dataSourcerizhi}
  1379. closeOrderLog={this.closeOrderLog}
  1380. visible={this.state.rizhivisible}
  1381. loading={this.state.loading}
  1382. />
  1383. </div>
  1384. </div>
  1385. );
  1386. }
  1387. })
  1388. );
  1389. export default IntentionCustomer;