chargeback.jsx 47 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404
  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. remarks: thisdata.remarks
  516. });
  517. }
  518. }
  519. this.setState({
  520. dataSourcerizhi: theArr
  521. });
  522. }.bind(this)
  523. }).always(
  524. function() {
  525. this.setState({
  526. loading: false
  527. });
  528. }.bind(this)
  529. );
  530. },
  531. //查看订单日志
  532. getOrderLog() {
  533. this.setState({
  534. rizhivisible: true
  535. });
  536. this.rizhi();
  537. },
  538. closeOrderLog() {
  539. this.setState({
  540. rizhivisible: false
  541. });
  542. },
  543. //详情关闭
  544. nextCancel() {
  545. this.setState({
  546. addnextVisible: false
  547. });
  548. this.resets();
  549. },
  550. //订单详情
  551. xiangqing(orderNos) {
  552. $.ajax({
  553. method: "get",
  554. dataType: "json",
  555. crossDomain: false,
  556. url: globalConfig.context + "/api/admin/newOrder/getOrderNewDetail",
  557. data: {
  558. orderNo: orderNos
  559. },
  560. success: function(data) {
  561. if (data.error.length || data.data.list == "") {
  562. if (data.error && data.error.length) {
  563. message.warning(data.error[0].message);
  564. }
  565. } else {
  566. let thisdata = data.data;
  567. this.setState({
  568. id: thisdata.id,
  569. kehuId: thisdata.buyerId,
  570. orderNo: thisdata.orderNo, //订单编号
  571. contractNo: thisdata.contractNo, //合同编号
  572. userName: thisdata.userName, //客户名称
  573. signDate: thisdata.signDate, //签单时间
  574. processStatus: thisdata.processStatus, //流程状态
  575. liquidationStatus: thisdata.liquidationStatus, //结算状态
  576. contacts: thisdata.contacts, //企业联系人
  577. contactMobile: thisdata.contactMobile, //联系人电话
  578. legalPerson: thisdata.legalPerson, //法人
  579. legalPersonTel: thisdata.legalPersonTel, //法人电话
  580. firstAmount: thisdata.firstAmount, //签单金额
  581. totalAmount: thisdata.totalAmount, //首付金额
  582. settlementAmount: thisdata.settlementAmount, //已收款项
  583. orderRemarks: thisdata.orderRemarks, //订单留言
  584. orgCodeUrl: thisdata.contractPictureUrl
  585. ? splitUrl(
  586. thisdata.contractPictureUrl,
  587. ",",
  588. globalConfig.avatarHost + "/upload"
  589. )
  590. : [], //图片地址
  591. salesmanName: thisdata.salesmanName, //营销员名称
  592. salesmanMobile: thisdata.salesmanMobile, //营销员电话
  593. oldSalesmanName: thisdata.oldSalesmanName, //营销员名称
  594. oldSalesmanMobile: thisdata.oldSalesmanMobile, //营销员电话
  595. financeName: thisdata.financeName, //财务名称
  596. financeMobile: thisdata.financeMobile, //财务电话
  597. nowFinance: thisdata.nowFinance, //财务名称
  598. nowFinanceMobile: thisdata.nowFinanceMobile, //财务电话
  599. approval: thisdata.approval.toString() //特批状态
  600. //approval:thisdata.approval==0?thisdata.approval.toString():thisdata.approval,//特批状态
  601. });
  602. }
  603. }.bind(this)
  604. }).always(
  605. function() {
  606. this.setState({
  607. loading: false
  608. });
  609. }.bind(this)
  610. );
  611. },
  612. //项目列表
  613. xiangmu(orderNos) {
  614. $.ajax({
  615. method: "get",
  616. dataType: "json",
  617. crossDomain: false,
  618. url: globalConfig.context + "/api/admin/newOrder/getOrderTask",
  619. data: {
  620. orderNo: orderNos
  621. },
  622. success: function(data) {
  623. let theArr = [];
  624. if (data.error.length || data.data.list == "") {
  625. if (data.error && data.error.length) {
  626. message.warning(data.error[0].message);
  627. }
  628. } else {
  629. for (let i = 0; i < data.data.length; i++) {
  630. let thisdata = data.data[i];
  631. theArr.push({
  632. key: i,
  633. id: thisdata.id,
  634. orderNo: thisdata.orderNo, //订单编号
  635. commodityId: thisdata.commodityId, //项目ID
  636. commodityName: thisdata.commodityName, //项目名称
  637. cname: thisdata.cname, //项目类别
  638. commodityPrice: thisdata.commodityPrice, //项目价格
  639. commodityQuantity: thisdata.commodityQuantity, //项目数量
  640. main: thisdata.main, //是否为主要任务
  641. taskComment: thisdata.taskComment, //任务说明
  642. contacts: thisdata.contacts, //联系人
  643. contactsMobile: thisdata.contactsMobile, //联系人电话
  644. sort: thisdata.cSort
  645. });
  646. }
  647. }
  648. this.setState({
  649. dataSourceX: theArr,
  650. paginations: false
  651. });
  652. }.bind(this)
  653. }).always(
  654. function() {
  655. this.setState({
  656. loading: false
  657. });
  658. }.bind(this)
  659. );
  660. },
  661. //节点列表
  662. jiedian(orderNos) {
  663. $.ajax({
  664. method: "get",
  665. dataType: "json",
  666. crossDomain: false,
  667. url: globalConfig.context + "/api/admin/newOrder/selectOrderDun",
  668. data: {
  669. orderNo: orderNos
  670. },
  671. success: function(data) {
  672. let theArr = [];
  673. let thisData = [];
  674. if (data.error.length || data.data.list == "") {
  675. if (data.error && data.error.length) {
  676. message.warning(data.error[0].message);
  677. }
  678. } else {
  679. for (let i = 0; i < data.data.length; i++) {
  680. thisData = data.data[i];
  681. theArr.push({
  682. key: i,
  683. dunSubject: thisData.dunSubject
  684. ? thisData.dunSubject.toString()
  685. : "", //催款科目
  686. id: thisData.id, //节点Id
  687. money: thisData.money, //催款金额
  688. dunStatus: thisData.dunStatus, //催款状态
  689. orderNo: thisData.orderNo
  690. });
  691. }
  692. this.setState({
  693. contactList: theArr
  694. });
  695. }
  696. }.bind(this)
  697. }).always(
  698. function() {
  699. this.setState({
  700. loading: false
  701. });
  702. }.bind(this)
  703. );
  704. },
  705. //查看催款节点
  706. jiedianNew(orderNos) {
  707. $.ajax({
  708. method: "get",
  709. dataType: "json",
  710. crossDomain: false,
  711. url:
  712. globalConfig.context + "/api/admin/newOrderDun/selectListNewOrderDun",
  713. data: {
  714. orderNo: orderNos
  715. },
  716. success: function(data) {
  717. if (data.error && data.error.length) {
  718. message.warning(data.error[0].message);
  719. } else {
  720. let theArr = [];
  721. let thisData = [];
  722. let arr = data.data || [];
  723. let totalCui = 0;
  724. for (let i = 0; i < arr.length; i++) {
  725. thisData = arr[i];
  726. totalCui += +thisData.money;
  727. theArr.push({
  728. key: i,
  729. dunSubject: thisData.dunSubject
  730. ? thisData.dunSubject.toString()
  731. : "", //催款科目
  732. id: thisData.id, //节点Id
  733. money: thisData.money, //催款金额
  734. // orderNo: record ? record.orderNo : this.props.datauser.orderNo,
  735. commodityName: thisData.commodityName,
  736. projectType: thisData.projectType,
  737. dunTypeName: thisData.dunTypeName,
  738. status: thisData.status,
  739. waitDay: thisData.waitDay,
  740. effectiveCount: thisData.effectiveCount,
  741. startDate: thisData.startDate,
  742. dunType: thisData.dunType,
  743. appropriationRatio: thisData.appropriationRatio
  744. });
  745. }
  746. if (!totalCui) {
  747. totalCui = 0;
  748. }
  749. totalCui = (Math.round(totalCui * 10000) / 10000).toFixed(4);
  750. this.setState({
  751. contactListNew: theArr,
  752. totalCui
  753. });
  754. }
  755. }.bind(this)
  756. }).always(
  757. function() {
  758. this.setState({
  759. loading: false
  760. });
  761. }.bind(this)
  762. );
  763. },
  764. resets() {
  765. this.state.orderNo = "";
  766. this.state.customerName = "";
  767. this.state.releaseDate[0] = undefined;
  768. this.state.releaseDate[1] = undefined;
  769. },
  770. reset() {
  771. this.state.orderNo = "";
  772. this.state.customerName = "";
  773. this.state.releaseDate[0] = undefined;
  774. this.state.releaseDate[1] = undefined;
  775. this.loadData();
  776. },
  777. //搜索
  778. search() {
  779. this.setState({
  780. //signBillVisible:false
  781. });
  782. this.loadData();
  783. },
  784. getOrgCodeUrl(e) {
  785. this.setState({ orgCodeUrl: e });
  786. },
  787. //关闭详情
  788. visitCancel() {
  789. this.setState({
  790. visible: false
  791. });
  792. this.resets();
  793. },
  794. visitOk() {
  795. this.setState({
  796. visible: false
  797. });
  798. this.resets();
  799. },
  800. render() {
  801. const formItemLayout = {
  802. labelCol: { span: 8 },
  803. wrapperCol: { span: 14 }
  804. };
  805. const FormItem = Form.Item;
  806. const { RangePicker } = DatePicker;
  807. const cuiDataList = this.state.contactList || [];
  808. const rowSelection = {
  809. selectedRowKeys: this.state.selectedRowKeys,
  810. onChange: (selectedRowKeys, selectedRows) => {
  811. this.setState({
  812. modalVisible: false,
  813. selectedRows: selectedRows.slice(-1),
  814. selectedRowKeys: selectedRowKeys.slice(-1)
  815. });
  816. },
  817. onSelect: recordt => {
  818. this.setState({
  819. modalVisible: false,
  820. recordt: recordt.id
  821. });
  822. }
  823. };
  824. return (
  825. <div className="user-content">
  826. <ShowModalDiv ShowModal={this.state.showModal} />
  827. <div className="content-title">
  828. <span>退单管理</span>
  829. </div>
  830. <div className="user-search">
  831. <Input
  832. placeholder="客户名称"
  833. style={{ width: "150px", marginBottom: "10px" }}
  834. value={this.state.customerName}
  835. onChange={e => {
  836. this.setState({ customerName: e.target.value });
  837. }}
  838. />
  839. <Input
  840. placeholder="订单编号"
  841. style={{ width: "150px" }}
  842. value={this.state.orderNo}
  843. onChange={e => {
  844. this.setState({ orderNo: e.target.value });
  845. }}
  846. />
  847. <span style={{ marginRight: "10px" }}>下单时间 :</span>
  848. <RangePicker
  849. value={[
  850. this.state.releaseDate[0]
  851. ? moment(this.state.releaseDate[0])
  852. : null,
  853. this.state.releaseDate[1]
  854. ? moment(this.state.releaseDate[1])
  855. : null
  856. ]}
  857. onChange={(data, dataString) => {
  858. this.setState({ releaseDate: dataString });
  859. }}
  860. />
  861. <Button
  862. type="primary"
  863. onClick={this.search}
  864. style={{ marginLeft: "10px" }}
  865. >
  866. 搜索
  867. </Button>
  868. <Button onClick={this.reset}>重置</Button>
  869. <div className="patent-table">
  870. <Spin spinning={this.state.loading}>
  871. <Table
  872. columns={this.state.columns}
  873. dataSource={this.state.dataSource}
  874. rowSelection={rowSelection}
  875. pagination={this.state.pagination}
  876. onRowClick={this.tableRowClick}
  877. bordered
  878. size="small"
  879. />
  880. </Spin>
  881. </div>
  882. <Modal
  883. className="customeDetails"
  884. footer=""
  885. title="订单详情"
  886. width="900px"
  887. visible={this.state.visible}
  888. onOk={this.visitOk}
  889. onCancel={this.visitCancel}
  890. >
  891. <Form
  892. layout="horizontal"
  893. onSubmit={this.handleSubmit}
  894. id="demand-form"
  895. style={{ paddingBottom: "40px" }}
  896. >
  897. <Spin spinning={this.state.loading}>
  898. <div className="clearfix">
  899. <FormItem
  900. className="half-item"
  901. {...formItemLayout}
  902. label="订单编号"
  903. >
  904. <span>{this.state.orderNo}</span>
  905. </FormItem>
  906. <FormItem
  907. className="half-item"
  908. {...formItemLayout}
  909. label="合同编号"
  910. >
  911. <span>{this.state.contractNo}</span>
  912. </FormItem>
  913. <FormItem
  914. className="half-item"
  915. {...formItemLayout}
  916. label="客户名称"
  917. >
  918. <span>{this.state.userName}</span>
  919. </FormItem>
  920. <FormItem
  921. className="half-item"
  922. {...formItemLayout}
  923. label="合同签订时间"
  924. >
  925. <span>{this.state.signDate}</span>
  926. </FormItem>
  927. <FormItem
  928. className="half-item"
  929. {...formItemLayout}
  930. label="流程状态"
  931. >
  932. <span>{getProcessStatus(this.state.processStatus)}</span>
  933. </FormItem>
  934. <FormItem
  935. className="half-item"
  936. {...formItemLayout}
  937. label="结算状态"
  938. >
  939. <span>
  940. {getLiquidationStatus(this.state.liquidationStatus)}
  941. </span>
  942. </FormItem>
  943. <FormItem
  944. className="half-item"
  945. {...formItemLayout}
  946. label="企业联系人"
  947. >
  948. <span>{this.state.contacts}</span>
  949. </FormItem>
  950. <FormItem
  951. className="half-item"
  952. {...formItemLayout}
  953. label="联系人电话"
  954. >
  955. <span>{this.state.contactMobile}</span>
  956. </FormItem>
  957. <FormItem
  958. className="half-item"
  959. {...formItemLayout}
  960. label="企业法人"
  961. >
  962. <span>{this.state.legalPerson}</span>
  963. </FormItem>
  964. <FormItem
  965. className="half-item"
  966. {...formItemLayout}
  967. label="法人电话"
  968. >
  969. <span>{this.state.legalPersonTel}</span>
  970. </FormItem>
  971. <FormItem
  972. className="half-item"
  973. {...formItemLayout}
  974. label="签单金额(万元)"
  975. >
  976. <span>{this.state.firstAmount}</span>
  977. </FormItem>
  978. <FormItem
  979. className="half-item"
  980. {...formItemLayout}
  981. label="首付金额(万元)"
  982. >
  983. <span>{this.state.totalAmount}</span>
  984. </FormItem>
  985. <FormItem
  986. className="half-item"
  987. {...formItemLayout}
  988. label="特批立项"
  989. >
  990. <span>{getApprovedState(this.state.approval)}</span>
  991. </FormItem>
  992. <FormItem
  993. className="half-item"
  994. {...formItemLayout}
  995. label="已收款项(万元)"
  996. >
  997. <span>{this.state.settlementAmount}</span>
  998. </FormItem>
  999. <div className="clearfix">
  1000. <FormItem
  1001. labelCol={{ span: 4 }}
  1002. wrapperCol={{ span: 16 }}
  1003. label="订单留言"
  1004. >
  1005. <span>{this.state.orderRemarks}</span>
  1006. </FormItem>
  1007. </div>
  1008. <div className="clearfix">
  1009. <FormItem
  1010. labelCol={{ span: 4 }}
  1011. wrapperCol={{ span: 18 }}
  1012. label="合同扫描件"
  1013. >
  1014. <Upload
  1015. className="demandDetailShow-upload"
  1016. listType="picture-card"
  1017. fileList={this.state.orgCodeUrl}
  1018. onPreview={file => {
  1019. this.setState({
  1020. previewImage: file.url || file.thumbUrl,
  1021. previewVisible: true
  1022. });
  1023. }}
  1024. ></Upload>
  1025. <Modal
  1026. maskClosable={false}
  1027. footer={null}
  1028. visible={this.state.previewVisible}
  1029. onCancel={() => {
  1030. this.setState({ previewVisible: false });
  1031. }}
  1032. >
  1033. <img
  1034. alt=""
  1035. style={{ width: "100%" }}
  1036. src={this.state.previewImage || ""}
  1037. />
  1038. </Modal>
  1039. <Button
  1040. style={{
  1041. float: "right",
  1042. marginRight: "140px",
  1043. marginTop: "20px"
  1044. }}
  1045. onClick={this.getOrderLog}
  1046. >
  1047. 查看订单 日志
  1048. </Button>
  1049. </FormItem>
  1050. </div>
  1051. <div className="clearfix">
  1052. <FormItem
  1053. className="half-item"
  1054. {...formItemLayout}
  1055. label="订单负责人"
  1056. >
  1057. <span>{this.state.salesmanName}</span>
  1058. </FormItem>
  1059. <FormItem
  1060. className="half-item"
  1061. {...formItemLayout}
  1062. label="订单负责人电话"
  1063. >
  1064. <span>{this.state.salesmanMobile}</span>
  1065. </FormItem>
  1066. </div>
  1067. <div className="clearfix">
  1068. <FormItem
  1069. className="half-item"
  1070. {...formItemLayout}
  1071. label="当前财务负责人"
  1072. >
  1073. <span>{this.state.nowFinance}</span>
  1074. </FormItem>
  1075. <FormItem
  1076. className="half-item"
  1077. {...formItemLayout}
  1078. label="当前财务负责人电话"
  1079. >
  1080. <span>{this.state.nowFinanceMobile}</span>
  1081. </FormItem>
  1082. </div>
  1083. <div className="clearfix">
  1084. <FormItem
  1085. className="half-item"
  1086. {...formItemLayout}
  1087. style={{ opacity: ".5" }}
  1088. label="原订单负责人"
  1089. >
  1090. <span>{this.state.oldSalesmanName}</span>
  1091. </FormItem>
  1092. <FormItem
  1093. className="half-item"
  1094. {...formItemLayout}
  1095. style={{ opacity: ".5" }}
  1096. label="原订单负责人电话"
  1097. >
  1098. <span>{this.state.oldSalesmanMobile}</span>
  1099. </FormItem>
  1100. </div>
  1101. <div className="clearfix">
  1102. <FormItem
  1103. className="half-item"
  1104. style={{ opacity: ".5" }}
  1105. {...formItemLayout}
  1106. label="实际财务操作人"
  1107. >
  1108. <span>{this.state.financeName}</span>
  1109. </FormItem>
  1110. <FormItem
  1111. className="half-item"
  1112. {...formItemLayout}
  1113. style={{ opacity: ".5" }}
  1114. label="实际财务操作人电话"
  1115. >
  1116. <span>{this.state.financeMobile}</span>
  1117. </FormItem>
  1118. </div>
  1119. <div>
  1120. <span style={{ marginLeft: "50px", fontSize: "20px" }}>
  1121. 项目业务
  1122. </span>
  1123. </div>
  1124. <div className="patent-table">
  1125. <Spin spinning={this.state.loading}>
  1126. <Table
  1127. columns={this.state.columnsX}
  1128. dataSource={this.state.dataSourceX}
  1129. pagination={this.state.paginations}
  1130. bordered
  1131. size="small"
  1132. />
  1133. </Spin>
  1134. </div>
  1135. <div>
  1136. <span style={{ marginLeft: "50px", fontSize: "20px" }}>
  1137. 催款节点
  1138. </span>
  1139. <span
  1140. style={{
  1141. display: cuiDataList.length ? "none" : "inline-block",
  1142. marginLeft: 10,
  1143. color: "red"
  1144. }}
  1145. >
  1146. 金额总计(万元): {this.state.totalCui}
  1147. </span>
  1148. </div>
  1149. <div className="clearfix">
  1150. <Spin spinning={this.state.loading}>
  1151. <Form layout="horizontal" id="demand-form">
  1152. <Table
  1153. pagination={false}
  1154. bordered
  1155. size="small"
  1156. // columns={this.state.ContactsLists}
  1157. // dataSource={this.state.contactList}
  1158. columns={
  1159. cuiDataList.length
  1160. ? this.state.ContactsLists
  1161. : this.state.ContactsListsNew
  1162. }
  1163. dataSource={
  1164. cuiDataList.length
  1165. ? this.state.contactList
  1166. : this.state.contactListNew
  1167. }
  1168. />
  1169. <Col
  1170. span={24}
  1171. offset={9}
  1172. style={{ marginTop: "15px" }}
  1173. ></Col>
  1174. </Form>
  1175. </Spin>
  1176. </div>
  1177. </div>
  1178. </Spin>
  1179. </Form>
  1180. </Modal>
  1181. <Modal
  1182. maskClosable={false}
  1183. visible={this.state.addnextVisible}
  1184. onOk={this.nextCancel}
  1185. onCancel={this.nextCancel}
  1186. width="800px"
  1187. title={this.state.refundStatus == 2 ? "修改退单申请" : "退单详情"}
  1188. footer=""
  1189. className="admin-desc-content"
  1190. >
  1191. <Form layout="horizontal" id="demand-form">
  1192. <Spin spinning={this.state.loading}>
  1193. <div className="clearfix">
  1194. <FormItem
  1195. className="half-item"
  1196. {...formItemLayout}
  1197. label="退单编号"
  1198. >
  1199. <span>{this.state.id}</span>
  1200. </FormItem>
  1201. <FormItem
  1202. className="half-item"
  1203. {...formItemLayout}
  1204. label="退单日期"
  1205. >
  1206. <span>{this.state.createDate}</span>
  1207. </FormItem>
  1208. <FormItem
  1209. className="half-item"
  1210. {...formItemLayout}
  1211. label="订单编号"
  1212. >
  1213. <span>{this.state.orderNo}</span>
  1214. </FormItem>
  1215. <FormItem
  1216. className="half-item"
  1217. {...formItemLayout}
  1218. label="订单状态"
  1219. >
  1220. <span>{getNewOrderStatus(this.state.orderStatus)}</span>
  1221. </FormItem>
  1222. <FormItem
  1223. className="half-item"
  1224. {...formItemLayout}
  1225. label="退单状态"
  1226. >
  1227. <span>{getRefundStatus(this.state.refundStatus)}</span>
  1228. </FormItem>
  1229. <FormItem
  1230. className="half-item"
  1231. {...formItemLayout}
  1232. label="退款状态"
  1233. >
  1234. <span>
  1235. {getLiquidationStatus(this.state.liquidationStatus)}
  1236. </span>
  1237. </FormItem>
  1238. <div className="clearfix">
  1239. {this.state.refundStatus == 2 ? (
  1240. <FormItem
  1241. labelCol={{ span: 4 }}
  1242. wrapperCol={{ span: 16 }}
  1243. label="终止合同"
  1244. >
  1245. <Picture
  1246. fileList={e => {
  1247. this.setState({ contractUrl: e });
  1248. }}
  1249. pictureUrl={this.state.contractUrl}
  1250. visible={this.props.visible}
  1251. data={{
  1252. sign: "order_refund_file",
  1253. url: "/api/admin/newOrder/uploadRefundOrderFile",
  1254. number: 8
  1255. }}
  1256. />
  1257. </FormItem>
  1258. ) : (
  1259. <FormItem
  1260. labelCol={{ span: 4 }}
  1261. wrapperCol={{ span: 18 }}
  1262. label="合同扫描件"
  1263. >
  1264. <Upload
  1265. className="demandDetailShow-upload"
  1266. listType="picture-card"
  1267. fileList={this.state.orgCodeUrl}
  1268. onPreview={file => {
  1269. this.setState({
  1270. previewImage: file.url || file.thumbUrl,
  1271. previewVisible: true
  1272. });
  1273. }}
  1274. ></Upload>
  1275. <Modal
  1276. maskClosable={false}
  1277. footer={null}
  1278. visible={this.state.previewVisible}
  1279. onCancel={() => {
  1280. this.setState({ previewVisible: false });
  1281. }}
  1282. >
  1283. <img
  1284. alt=""
  1285. style={{ width: "100%" }}
  1286. src={this.state.previewImage || ""}
  1287. />
  1288. </Modal>
  1289. </FormItem>
  1290. )}
  1291. </div>
  1292. <div className="clearfix">
  1293. <FormItem
  1294. labelCol={{ span: 4 }}
  1295. wrapperCol={{ span: 16 }}
  1296. label="退单申请表"
  1297. >
  1298. <Upload
  1299. className="demandDetailShow-upload"
  1300. listType="picture-card"
  1301. fileList={this.state.orgCodeUrl}
  1302. onPreview={file => {
  1303. this.setState({
  1304. previewImage: file.url || file.thumbUrl,
  1305. previewVisible: true
  1306. });
  1307. }}
  1308. ></Upload>
  1309. </FormItem>
  1310. </div>
  1311. <div className="clearfix">
  1312. <FormItem
  1313. labelCol={{ span: 4 }}
  1314. wrapperCol={{ span: 16 }}
  1315. label="退单理由"
  1316. >
  1317. {this.state.refundStatus == 2 ? (
  1318. <Input
  1319. type="textarea"
  1320. placeholder="请输入退单理由"
  1321. rows={4}
  1322. value={this.state.reason}
  1323. onChange={e => {
  1324. this.setState({ reason: e.target.value });
  1325. }}
  1326. />
  1327. ) : (
  1328. <span>{this.state.reason}</span>
  1329. )}
  1330. </FormItem>
  1331. </div>
  1332. {this.state.refundStatus == 2 ? (
  1333. <FormItem
  1334. wrapperCol={{ span: 12, offset: 4 }}
  1335. className="half-middle"
  1336. >
  1337. <Button
  1338. className="submitSave"
  1339. type="primary"
  1340. onClick={this.tuidanOk}
  1341. >
  1342. 重新退单
  1343. </Button>
  1344. <Button
  1345. className="submitSave"
  1346. type="ghost"
  1347. onClick={this.nextCancel}
  1348. >
  1349. 取消
  1350. </Button>
  1351. </FormItem>
  1352. ) : (
  1353. ""
  1354. )}
  1355. </div>
  1356. </Spin>
  1357. </Form>
  1358. </Modal>
  1359. {/* <Modal
  1360. visible={this.state.rizhivisible}
  1361. className="admin-desc-content"
  1362. width="800px"
  1363. maskClosable={false}
  1364. title="订单日志"
  1365. footer={null}
  1366. onCancel={this.closeOrderLog}
  1367. >
  1368. <div className="patent-table">
  1369. <Spin spinning={this.state.loading}>
  1370. <Table
  1371. columns={this.state.columnsrizhi}
  1372. dataSource={this.state.dataSourcerizhi}
  1373. pagination={false}
  1374. />
  1375. </Spin>
  1376. </div>
  1377. </Modal> */}
  1378. <OrderRiZi
  1379. dataSourcerizhi={this.state.dataSourcerizhi}
  1380. closeOrderLog={this.closeOrderLog}
  1381. visible={this.state.rizhivisible}
  1382. loading={this.state.loading}
  1383. />
  1384. </div>
  1385. </div>
  1386. );
  1387. }
  1388. })
  1389. );
  1390. export default IntentionCustomer;