chargeback.jsx 48 KB

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