chargeback.jsx 47 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413
  1. import React from 'react';
  2. import { Button, Input, Spin, Table, message,DatePicker, Upload, Form ,Modal,Col,Tabs} 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. const {TabPane} = Tabs
  825. return (
  826. <div className="user-content">
  827. <ShowModalDiv ShowModal={this.state.showModal} />
  828. <div className="content-title">
  829. <span>退单管理</span>
  830. </div>
  831. <div className="user-search">
  832. <Tabs
  833. defaultActiveKey="1"
  834. onChange={this.callback}
  835. className="test">
  836. <TabPane tab="搜索" key="1">
  837. <Input
  838. placeholder="客户名称"
  839. style={{ width: "150px", marginBottom: "10px",marginTop: 10,marginRight: 10,marginLeft:10 }}
  840. value={this.state.customerName}
  841. onChange={e => {
  842. this.setState({ customerName: e.target.value });
  843. }}
  844. />
  845. <Input
  846. placeholder="订单编号"
  847. style={{ width: "150px" ,marginRight: 10}}
  848. value={this.state.orderNo}
  849. onChange={e => {
  850. this.setState({ orderNo: e.target.value });
  851. }}
  852. />
  853. <span style={{ marginRight: "10px" }}>下单时间 :</span>
  854. <RangePicker
  855. value={[
  856. this.state.releaseDate[0]
  857. ? moment(this.state.releaseDate[0])
  858. : null,
  859. this.state.releaseDate[1]
  860. ? moment(this.state.releaseDate[1])
  861. : null
  862. ]}
  863. onChange={(data, dataString) => {
  864. this.setState({ releaseDate: dataString });
  865. }}
  866. />
  867. <Button
  868. type="primary"
  869. onClick={this.search}
  870. style={{ marginLeft: "10px",marginRight: 10 }}
  871. >
  872. 搜索
  873. </Button>
  874. <Button onClick={this.reset}>重置</Button>
  875. </TabPane>
  876. </Tabs>
  877. <div className="patent-table">
  878. <Spin spinning={this.state.loading}>
  879. <Table
  880. columns={this.state.columns}
  881. dataSource={this.state.dataSource}
  882. rowSelection={rowSelection}
  883. pagination={this.state.pagination}
  884. onRowClick={this.tableRowClick}
  885. bordered
  886. size="small"
  887. />
  888. </Spin>
  889. </div>
  890. <Modal
  891. className="customeDetails"
  892. footer=""
  893. title="订单详情"
  894. width="900px"
  895. visible={this.state.visible}
  896. onOk={this.visitOk}
  897. onCancel={this.visitCancel}
  898. >
  899. <Form
  900. layout="horizontal"
  901. onSubmit={this.handleSubmit}
  902. id="demand-form"
  903. style={{ paddingBottom: "40px" }}
  904. >
  905. <Spin spinning={this.state.loading}>
  906. <div className="clearfix">
  907. <FormItem
  908. className="half-item"
  909. {...formItemLayout}
  910. label="订单编号"
  911. >
  912. <span>{this.state.orderNo}</span>
  913. </FormItem>
  914. <FormItem
  915. className="half-item"
  916. {...formItemLayout}
  917. label="合同编号"
  918. >
  919. <span>{this.state.contractNo}</span>
  920. </FormItem>
  921. <FormItem
  922. className="half-item"
  923. {...formItemLayout}
  924. label="客户名称"
  925. >
  926. <span>{this.state.userName}</span>
  927. </FormItem>
  928. <FormItem
  929. className="half-item"
  930. {...formItemLayout}
  931. label="合同签订时间"
  932. >
  933. <span>{this.state.signDate}</span>
  934. </FormItem>
  935. <FormItem
  936. className="half-item"
  937. {...formItemLayout}
  938. label="流程状态"
  939. >
  940. <span>{getProcessStatus(this.state.processStatus)}</span>
  941. </FormItem>
  942. <FormItem
  943. className="half-item"
  944. {...formItemLayout}
  945. label="结算状态"
  946. >
  947. <span>
  948. {getLiquidationStatus(this.state.liquidationStatus)}
  949. </span>
  950. </FormItem>
  951. <FormItem
  952. className="half-item"
  953. {...formItemLayout}
  954. label="企业联系人"
  955. >
  956. <span>{this.state.contacts}</span>
  957. </FormItem>
  958. <FormItem
  959. className="half-item"
  960. {...formItemLayout}
  961. label="联系人电话"
  962. >
  963. <span>{this.state.contactMobile}</span>
  964. </FormItem>
  965. <FormItem
  966. className="half-item"
  967. {...formItemLayout}
  968. label="企业法人"
  969. >
  970. <span>{this.state.legalPerson}</span>
  971. </FormItem>
  972. <FormItem
  973. className="half-item"
  974. {...formItemLayout}
  975. label="法人电话"
  976. >
  977. <span>{this.state.legalPersonTel}</span>
  978. </FormItem>
  979. <FormItem
  980. className="half-item"
  981. {...formItemLayout}
  982. label="签单金额(万元)"
  983. >
  984. <span>{this.state.firstAmount}</span>
  985. </FormItem>
  986. <FormItem
  987. className="half-item"
  988. {...formItemLayout}
  989. label="首付金额(万元)"
  990. >
  991. <span>{this.state.totalAmount}</span>
  992. </FormItem>
  993. <FormItem
  994. className="half-item"
  995. {...formItemLayout}
  996. label="特批立项"
  997. >
  998. <span>{getApprovedState(this.state.approval)}</span>
  999. </FormItem>
  1000. <FormItem
  1001. className="half-item"
  1002. {...formItemLayout}
  1003. label="已收款项(万元)"
  1004. >
  1005. <span>{this.state.settlementAmount}</span>
  1006. </FormItem>
  1007. <div className="clearfix">
  1008. <FormItem
  1009. labelCol={{ span: 4 }}
  1010. wrapperCol={{ span: 16 }}
  1011. label="订单留言"
  1012. >
  1013. <span>{this.state.orderRemarks}</span>
  1014. </FormItem>
  1015. </div>
  1016. <div className="clearfix">
  1017. <FormItem
  1018. labelCol={{ span: 4 }}
  1019. wrapperCol={{ span: 18 }}
  1020. label="合同扫描件"
  1021. >
  1022. <Upload
  1023. className="demandDetailShow-upload"
  1024. listType="picture-card"
  1025. fileList={this.state.orgCodeUrl}
  1026. onPreview={file => {
  1027. this.setState({
  1028. previewImage: file.url || file.thumbUrl,
  1029. previewVisible: true
  1030. });
  1031. }}
  1032. ></Upload>
  1033. <Modal
  1034. maskClosable={false}
  1035. footer={null}
  1036. visible={this.state.previewVisible}
  1037. onCancel={() => {
  1038. this.setState({ previewVisible: false });
  1039. }}
  1040. >
  1041. <img
  1042. alt=""
  1043. style={{ width: "100%" }}
  1044. src={this.state.previewImage || ""}
  1045. />
  1046. </Modal>
  1047. <Button
  1048. style={{
  1049. float: "right",
  1050. marginRight: "140px",
  1051. marginTop: "20px"
  1052. }}
  1053. onClick={this.getOrderLog}
  1054. >
  1055. 查看订单 日志
  1056. </Button>
  1057. </FormItem>
  1058. </div>
  1059. <div className="clearfix">
  1060. <FormItem
  1061. className="half-item"
  1062. {...formItemLayout}
  1063. label="订单负责人"
  1064. >
  1065. <span>{this.state.salesmanName}</span>
  1066. </FormItem>
  1067. <FormItem
  1068. className="half-item"
  1069. {...formItemLayout}
  1070. label="订单负责人电话"
  1071. >
  1072. <span>{this.state.salesmanMobile}</span>
  1073. </FormItem>
  1074. </div>
  1075. <div className="clearfix">
  1076. <FormItem
  1077. className="half-item"
  1078. {...formItemLayout}
  1079. label="当前财务负责人"
  1080. >
  1081. <span>{this.state.nowFinance}</span>
  1082. </FormItem>
  1083. <FormItem
  1084. className="half-item"
  1085. {...formItemLayout}
  1086. label="当前财务负责人电话"
  1087. >
  1088. <span>{this.state.nowFinanceMobile}</span>
  1089. </FormItem>
  1090. </div>
  1091. <div className="clearfix">
  1092. <FormItem
  1093. className="half-item"
  1094. {...formItemLayout}
  1095. style={{ opacity: ".5" }}
  1096. label="原订单负责人"
  1097. >
  1098. <span>{this.state.oldSalesmanName}</span>
  1099. </FormItem>
  1100. <FormItem
  1101. className="half-item"
  1102. {...formItemLayout}
  1103. style={{ opacity: ".5" }}
  1104. label="原订单负责人电话"
  1105. >
  1106. <span>{this.state.oldSalesmanMobile}</span>
  1107. </FormItem>
  1108. </div>
  1109. <div className="clearfix">
  1110. <FormItem
  1111. className="half-item"
  1112. style={{ opacity: ".5" }}
  1113. {...formItemLayout}
  1114. label="实际财务操作人"
  1115. >
  1116. <span>{this.state.financeName}</span>
  1117. </FormItem>
  1118. <FormItem
  1119. className="half-item"
  1120. {...formItemLayout}
  1121. style={{ opacity: ".5" }}
  1122. label="实际财务操作人电话"
  1123. >
  1124. <span>{this.state.financeMobile}</span>
  1125. </FormItem>
  1126. </div>
  1127. <div>
  1128. <span style={{ marginLeft: "50px", fontSize: "20px" }}>
  1129. 项目业务
  1130. </span>
  1131. </div>
  1132. <div className="patent-table">
  1133. <Spin spinning={this.state.loading}>
  1134. <Table
  1135. columns={this.state.columnsX}
  1136. dataSource={this.state.dataSourceX}
  1137. pagination={this.state.paginations}
  1138. bordered
  1139. size="small"
  1140. />
  1141. </Spin>
  1142. </div>
  1143. <div>
  1144. <span style={{ marginLeft: "50px", fontSize: "20px" }}>
  1145. 催款节点
  1146. </span>
  1147. <span
  1148. style={{
  1149. display: cuiDataList.length ? "none" : "inline-block",
  1150. marginLeft: 10,
  1151. color: "red"
  1152. }}
  1153. >
  1154. 金额总计(万元): {this.state.totalCui}
  1155. </span>
  1156. </div>
  1157. <div className="clearfix">
  1158. <Spin spinning={this.state.loading}>
  1159. <Form layout="horizontal" id="demand-form">
  1160. <Table
  1161. pagination={false}
  1162. bordered
  1163. size="small"
  1164. // columns={this.state.ContactsLists}
  1165. // dataSource={this.state.contactList}
  1166. columns={
  1167. cuiDataList.length
  1168. ? this.state.ContactsLists
  1169. : this.state.ContactsListsNew
  1170. }
  1171. dataSource={
  1172. cuiDataList.length
  1173. ? this.state.contactList
  1174. : this.state.contactListNew
  1175. }
  1176. />
  1177. <Col
  1178. span={24}
  1179. offset={9}
  1180. style={{ marginTop: "15px" }}
  1181. ></Col>
  1182. </Form>
  1183. </Spin>
  1184. </div>
  1185. </div>
  1186. </Spin>
  1187. </Form>
  1188. </Modal>
  1189. <Modal
  1190. maskClosable={false}
  1191. visible={this.state.addnextVisible}
  1192. onOk={this.nextCancel}
  1193. onCancel={this.nextCancel}
  1194. width="800px"
  1195. title={this.state.refundStatus == 2 ? "修改退单申请" : "退单详情"}
  1196. footer=""
  1197. className="admin-desc-content"
  1198. >
  1199. <Form layout="horizontal" id="demand-form">
  1200. <Spin spinning={this.state.loading}>
  1201. <div className="clearfix">
  1202. <FormItem
  1203. className="half-item"
  1204. {...formItemLayout}
  1205. label="退单编号"
  1206. >
  1207. <span>{this.state.id}</span>
  1208. </FormItem>
  1209. <FormItem
  1210. className="half-item"
  1211. {...formItemLayout}
  1212. label="退单日期"
  1213. >
  1214. <span>{this.state.createDate}</span>
  1215. </FormItem>
  1216. <FormItem
  1217. className="half-item"
  1218. {...formItemLayout}
  1219. label="订单编号"
  1220. >
  1221. <span>{this.state.orderNo}</span>
  1222. </FormItem>
  1223. <FormItem
  1224. className="half-item"
  1225. {...formItemLayout}
  1226. label="订单状态"
  1227. >
  1228. <span>{getNewOrderStatus(this.state.orderStatus)}</span>
  1229. </FormItem>
  1230. <FormItem
  1231. className="half-item"
  1232. {...formItemLayout}
  1233. label="退单状态"
  1234. >
  1235. <span>{getRefundStatus(this.state.refundStatus)}</span>
  1236. </FormItem>
  1237. <FormItem
  1238. className="half-item"
  1239. {...formItemLayout}
  1240. label="退款状态"
  1241. >
  1242. <span>
  1243. {getLiquidationStatus(this.state.liquidationStatus)}
  1244. </span>
  1245. </FormItem>
  1246. <div className="clearfix">
  1247. {this.state.refundStatus == 2 ? (
  1248. <FormItem
  1249. labelCol={{ span: 4 }}
  1250. wrapperCol={{ span: 16 }}
  1251. label="终止合同"
  1252. >
  1253. <Picture
  1254. fileList={e => {
  1255. this.setState({ contractUrl: e });
  1256. }}
  1257. pictureUrl={this.state.contractUrl}
  1258. visible={this.props.visible}
  1259. data={{
  1260. sign: "order_refund_file",
  1261. url: "/api/admin/newOrder/uploadRefundOrderFile",
  1262. number: 8
  1263. }}
  1264. />
  1265. </FormItem>
  1266. ) : (
  1267. <FormItem
  1268. labelCol={{ span: 4 }}
  1269. wrapperCol={{ span: 18 }}
  1270. label="合同扫描件"
  1271. >
  1272. <Upload
  1273. className="demandDetailShow-upload"
  1274. listType="picture-card"
  1275. fileList={this.state.orgCodeUrl}
  1276. onPreview={file => {
  1277. this.setState({
  1278. previewImage: file.url || file.thumbUrl,
  1279. previewVisible: true
  1280. });
  1281. }}
  1282. ></Upload>
  1283. <Modal
  1284. maskClosable={false}
  1285. footer={null}
  1286. visible={this.state.previewVisible}
  1287. onCancel={() => {
  1288. this.setState({ previewVisible: false });
  1289. }}
  1290. >
  1291. <img
  1292. alt=""
  1293. style={{ width: "100%" }}
  1294. src={this.state.previewImage || ""}
  1295. />
  1296. </Modal>
  1297. </FormItem>
  1298. )}
  1299. </div>
  1300. <div className="clearfix">
  1301. <FormItem
  1302. labelCol={{ span: 4 }}
  1303. wrapperCol={{ span: 16 }}
  1304. label="退单申请表"
  1305. >
  1306. <Upload
  1307. className="demandDetailShow-upload"
  1308. listType="picture-card"
  1309. fileList={this.state.orgCodeUrl}
  1310. onPreview={file => {
  1311. this.setState({
  1312. previewImage: file.url || file.thumbUrl,
  1313. previewVisible: true
  1314. });
  1315. }}
  1316. ></Upload>
  1317. </FormItem>
  1318. </div>
  1319. <div className="clearfix">
  1320. <FormItem
  1321. labelCol={{ span: 4 }}
  1322. wrapperCol={{ span: 16 }}
  1323. label="退单理由"
  1324. >
  1325. {this.state.refundStatus == 2 ? (
  1326. <Input
  1327. type="textarea"
  1328. placeholder="请输入退单理由"
  1329. rows={4}
  1330. value={this.state.reason}
  1331. onChange={e => {
  1332. this.setState({ reason: e.target.value });
  1333. }}
  1334. />
  1335. ) : (
  1336. <span>{this.state.reason}</span>
  1337. )}
  1338. </FormItem>
  1339. </div>
  1340. {this.state.refundStatus == 2 ? (
  1341. <FormItem
  1342. wrapperCol={{ span: 12, offset: 4 }}
  1343. className="half-middle"
  1344. >
  1345. <Button
  1346. className="submitSave"
  1347. type="primary"
  1348. onClick={this.tuidanOk}
  1349. >
  1350. 重新退单
  1351. </Button>
  1352. <Button
  1353. className="submitSave"
  1354. type="ghost"
  1355. onClick={this.nextCancel}
  1356. >
  1357. 取消
  1358. </Button>
  1359. </FormItem>
  1360. ) : (
  1361. ""
  1362. )}
  1363. </div>
  1364. </Spin>
  1365. </Form>
  1366. </Modal>
  1367. {/* <Modal
  1368. visible={this.state.rizhivisible}
  1369. className="admin-desc-content"
  1370. width="800px"
  1371. maskClosable={false}
  1372. title="订单日志"
  1373. footer={null}
  1374. onCancel={this.closeOrderLog}
  1375. >
  1376. <div className="patent-table">
  1377. <Spin spinning={this.state.loading}>
  1378. <Table
  1379. columns={this.state.columnsrizhi}
  1380. dataSource={this.state.dataSourcerizhi}
  1381. pagination={false}
  1382. />
  1383. </Spin>
  1384. </div>
  1385. </Modal> */}
  1386. <OrderRiZi
  1387. dataSourcerizhi={this.state.dataSourcerizhi}
  1388. closeOrderLog={this.closeOrderLog}
  1389. visible={this.state.rizhivisible}
  1390. loading={this.state.loading}
  1391. />
  1392. </div>
  1393. </div>
  1394. );
  1395. }
  1396. })
  1397. );
  1398. export default IntentionCustomer;