changeDetailCwzy.js 54 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869
  1. import React, { Component } from "react";
  2. import {
  3. Form,
  4. Upload,
  5. Modal,
  6. Input,
  7. DatePicker,
  8. Button,
  9. message,
  10. Select,
  11. Table,
  12. Popconfirm,
  13. Spin
  14. } from "antd";
  15. import AgreeButton from "./agreeButton.js";
  16. import Rizhi from "./rizhi.js";
  17. import PicturesWall from "./picturesWall";
  18. import moment from "moment";
  19. import { getProcessStatusNew, moneyVerify } from "@/tools.js";
  20. import { shenghePeo, changeColor } from "@/tools.js";
  21. import $ from "jquery/src/ajax";
  22. import ReactToPrint from "react-to-print";
  23. import tongguo from "../../../../../../image/tongguo.png";
  24. import ProAndCuiList from "./proAndCuiList.jsx";
  25. import Refund from "./refund.js"
  26. import "./xButton.less"
  27. const { RangePicker } = DatePicker;
  28. const { TextArea } = Input;
  29. const FormItem = Form.Item;
  30. const formItemLayout = {
  31. labelCol: { span: 8 },
  32. wrapperCol: { span: 14 }
  33. };
  34. const formItemLayoutRefund = {
  35. labelCol: { span: 5 },
  36. wrapperCol: { span: 11 }
  37. };
  38. const changeType = [
  39. {
  40. value: "0",
  41. key: "退单退款"
  42. },
  43. {
  44. value: "1",
  45. key: "项目及金额变更"
  46. },
  47. {
  48. value: "2",
  49. key: "仅项目变更"
  50. },
  51. {
  52. value: "3",
  53. key: "仅金额变更"
  54. },
  55. {
  56. value: "4",
  57. key: "重报"
  58. },
  59. {
  60. value: "5",
  61. key: "赠送"
  62. }
  63. ];
  64. const getChangeType = function (e) {
  65. if (e || e == 0) {
  66. let str = e.toString();
  67. let theType = "";
  68. changeType.map(function (item) {
  69. if (item.value == str) {
  70. theType = item.key;
  71. }
  72. });
  73. return theType;
  74. }
  75. };
  76. class Itemlist extends Component {
  77. constructor(props) {
  78. super(props);
  79. }
  80. render() {
  81. let pageData = this.props.pageData;
  82. return (
  83. <div className="clearfix">
  84. <Form.Item
  85. label={pageData.labelA}
  86. {...pageData.formItemLayoutA}
  87. className="half-item"
  88. style={{ marginBottom: "-5px" }}
  89. >
  90. <p style={{ width: 731, wordWrap: "break-word" }}>{pageData.dataA}</p>
  91. </Form.Item>
  92. <Form.Item
  93. label={pageData.labelB}
  94. {...pageData.formItemLayoutB}
  95. className="half-item"
  96. style={{ marginBottom: "-5px" }}
  97. >
  98. <span>{pageData.dataB}</span>
  99. </Form.Item>
  100. </div>
  101. );
  102. }
  103. }
  104. class ItemInput extends Component {
  105. constructor(props) {
  106. super(props);
  107. this.state = {
  108. valueA: "",
  109. valueB: ""
  110. };
  111. }
  112. componentWillReceiveProps(nextProps) {
  113. if (!nextProps.reset) {
  114. this.reset();
  115. }
  116. }
  117. reset() {
  118. this.setState({
  119. valueA: "",
  120. valueB: ""
  121. });
  122. }
  123. render() {
  124. let pageData = this.props.pageData;
  125. return (
  126. <div className="clearfix">
  127. <Form.Item
  128. label={pageData.labelA}
  129. {...pageData.formItemLayoutA}
  130. className="half-item"
  131. >
  132. <Input
  133. value={this.state.valueA}
  134. placeholder={"请输入" + pageData.labelA}
  135. style={{ width: 160 }}
  136. onChange={e => {
  137. this.setState({ valueA: e.target.value });
  138. pageData.onChangeA(e.target.value);
  139. }}
  140. />
  141. </Form.Item>
  142. <Form.Item
  143. label={pageData.labelB}
  144. {...pageData.formItemLayoutB}
  145. className="half-item"
  146. >
  147. {pageData.mark ? (
  148. <Input
  149. value={this.state.valueB}
  150. placeholder={"请输入" + pageData.labelB}
  151. style={{ width: 160 }}
  152. onChange={e => {
  153. this.setState({ valueB: e.target.value });
  154. pageData.onChangeB(e.target.value);
  155. }}
  156. />
  157. ) : (
  158. ""
  159. )}
  160. </Form.Item>
  161. </div>
  162. );
  163. }
  164. }
  165. class ChangeDetail extends Component {
  166. constructor(props) {
  167. super(props);
  168. this.state = {
  169. rotateDeg: 0,
  170. previewVisible: false,
  171. buttonStatus: true,
  172. changeType: 2,
  173. dataSource: [],
  174. voucherUrl: [],
  175. loading: false,
  176. reason: "",
  177. // 累计回收退票
  178. refundInvoice: 0,
  179. // 退票数组
  180. contactList: [],
  181. // 退款数据
  182. refundDataSource: [],
  183. rejectState: 0,
  184. // 收款信息
  185. proceedsData: [],
  186. proceedsTotal: this.props.proceedsTotal,
  187. // 开票信息
  188. invoiceData: [],
  189. invoiceTotal: this.props.invoiceTotal,
  190. cost: 10,
  191. refund: 8,
  192. // 测试添加退票
  193. contactList: this.props.contactList,
  194. // 退款
  195. refundColumn: [
  196. {
  197. title: "退款金额(万元)",
  198. dataIndex: "refundAmount",
  199. key: "refundAmount",
  200. },
  201. {
  202. title: "退款时间",
  203. dataIndex: "refundDate",
  204. key: "refundDate"
  205. },
  206. {
  207. title: "备注",
  208. dataIndex: "remarks",
  209. key: "remarks"
  210. },
  211. {
  212. title: "操作",
  213. dataIndex: "delete",
  214. key: "delete",
  215. render: (text, record) => {
  216. return (
  217. <Popconfirm
  218. title="是否删除?"
  219. onConfirm={() => {
  220. this.deleteRefund(record)
  221. }}
  222. okText="删除"
  223. cancelText="不删除"
  224. >
  225. <Button
  226. style={{ display: !this.props.refundStatus ? "block" : "none" }}
  227. type="danger">
  228. 删除
  229. </Button>
  230. </Popconfirm>
  231. )
  232. }
  233. }
  234. ],
  235. ContactsLists: [
  236. {
  237. title: "金额(万元)",
  238. dataIndex: "amount",
  239. key: "amount",
  240. render: (text, record) => {
  241. return (
  242. <div>
  243. 实际回收退票(万元)
  244. <Input
  245. value={record.amount}
  246. placeholder="请输入金额(必填项)"
  247. disabled={record.load}
  248. key={record.id}
  249. required="required"
  250. onChange={e => {
  251. record.amount = e.target.value;
  252. this.setState({ contactList: this.state.contactList });
  253. }}
  254. style={{ width: "120px" }}
  255. />
  256. </div>
  257. );
  258. }
  259. },
  260. {
  261. title: "时间",
  262. dataIndex: "createTimes",
  263. key: "createTimes",
  264. render: (text, record) => {
  265. return (
  266. <div>
  267. {/* <DatePicker
  268. showTime
  269. placeholder="请输入退票时间"
  270. onChange={v => {
  271. record.time = v._d;
  272. this.setState({ contactList: this.state.contactList });
  273. }}
  274. onOk={v => {
  275. record.time = v._d;
  276. this.setState({ contactList: this.state.contactList });
  277. console.log(this.state);
  278. }}
  279. /> */}
  280. {record.createTimes}
  281. </div>
  282. );
  283. }
  284. },
  285. {
  286. title: "操作",
  287. dataIndex: "dels",
  288. key: "dels",
  289. render: (text, record, index) => {
  290. return (
  291. <div
  292. style={{
  293. display:
  294. (this.props.data.processState == 7 ||
  295. this.props.data.processState == 8) &&
  296. this.props.data.status == 4
  297. ? "none"
  298. : "block"
  299. }}
  300. >
  301. <Popconfirm
  302. title="是否删除?"
  303. onConfirm={() => {
  304. this.confirmDelet(record);
  305. }}
  306. okText="删除"
  307. cancelText="不删除"
  308. >
  309. <Button
  310. style={{
  311. marginRight: "10px",
  312. color: "#ffffff",
  313. background: "#f00",
  314. border: "none",
  315. }}
  316. >
  317. 删除
  318. </Button>
  319. </Popconfirm>
  320. {record.load != true ? (
  321. <Button
  322. type="primary"
  323. onClick={() => {
  324. this.contactSave(record);
  325. }}
  326. >
  327. 保存
  328. </Button>
  329. ) : (
  330. ""
  331. )}
  332. </div>
  333. );
  334. }
  335. }
  336. ]
  337. };
  338. this.getOrgCodeUrl = this.getOrgCodeUrl.bind(this);
  339. this.changeButtonStatus = this.changeButtonStatus.bind(this);
  340. this.reset = this.reset.bind(this);
  341. this.addcontact = this.addcontact.bind(this);
  342. this.contactSave = this.contactSave.bind(this);
  343. this.confirmDelet = this.confirmDelet.bind(this);
  344. this.finish = this.finish.bind(this);
  345. this.reload = this.reLoad.bind(this);
  346. this.downImg = this.downImg.bind(this);
  347. this.upImg = this.upImg.bind(this);
  348. this.rotate = this.rotate.bind(this);
  349. this.moneyOld = this.moneyOld.bind(this);
  350. this.addRefund = this.addRefund.bind(this);
  351. this.refundCancel = this.refundCancel.bind(this);
  352. this.sumitRefund = this.sumitRefund.bind(this);
  353. this.getVoucherUrl = this.getVoucherUrl.bind(this);
  354. this.refundGetList = this.refundGetList.bind(this);
  355. this.deleteRefund = this.deleteRefund.bind(this);
  356. this.refundExecute = this.refundExecute.bind(this);
  357. }
  358. componentWillReceiveProps(nextProps) {
  359. this.setState({
  360. paymentTimes: nextProps.data.paymentTimes,
  361. paymentAmount: nextProps.data.paymentAmount,
  362. invoiceTimes: nextProps.data.invoiceTimes,
  363. invoiceAmount: nextProps.data.invoiceAmount,
  364. cwCost: nextProps.data.cwCost,
  365. refundableAmount: nextProps.data.refundableAmount,
  366. cwRemarks: nextProps.data.cwRemarks,
  367. contactList: nextProps.contactList,
  368. refundInvoice: nextProps.data.refundInvoice
  369. });
  370. if (!nextProps.reset) {
  371. this.reset();
  372. }
  373. }
  374. refundExecute() {
  375. this.setState({
  376. loading: true
  377. });
  378. $.ajax({
  379. method: "post",
  380. dataType: "json",
  381. crossDomain: false,
  382. url: globalConfig.context + "/api/admin/orderChange/pushRefund",
  383. data: {
  384. id: this.props.id,
  385. refundUrl: this.state.refundUrl
  386. },
  387. success: function (data) {
  388. let theArr = [];
  389. if (data.error && data.error.length) {
  390. message.warning(data.error[0].message);
  391. } else {
  392. message.success("提交退款成功!")
  393. this.refundGetList()
  394. this.props.onCancel()
  395. }
  396. }.bind(this)
  397. }).always(
  398. function () {
  399. this.setState({
  400. loading: false
  401. });
  402. }.bind(this)
  403. );
  404. }
  405. deleteRefund(record) {
  406. this.setState({
  407. loading: true
  408. });
  409. $.ajax({
  410. method: "post",
  411. dataType: "json",
  412. crossDomain: false,
  413. url: globalConfig.context + "/api/admin/orderChange/deleteRefund",
  414. data: {
  415. id: record.id
  416. },
  417. success: function (data) {
  418. let theArr = [];
  419. if (data.error && data.error.length) {
  420. message.warning(data.error[0].message);
  421. } else {
  422. message.success("删除成功!")
  423. this.refundGetList()
  424. }
  425. }.bind(this)
  426. }).always(
  427. function () {
  428. this.setState({
  429. loading: false
  430. });
  431. }.bind(this)
  432. );
  433. }
  434. sumitRefund() {
  435. if (this.state.refundMoney == "" || this.state.refundMoney == undefined) {
  436. message.warning("请填写正确退款金额")
  437. return
  438. } else if (this.state.refundRemarks == "" || this.state.refundRemarks == undefined) {
  439. message.warning("请填写备注")
  440. return
  441. } else if (this.state.refundDate == "" || this.state.refundDate == undefined) {
  442. message.warning("请选择退款时间")
  443. return
  444. }
  445. this.setState({
  446. loading: true
  447. });
  448. $.ajax({
  449. method: "post",
  450. dataType: "json",
  451. crossDomain: false,
  452. url: globalConfig.context + "/api/admin/orderChange/addRefund",
  453. data: {
  454. refundAmount: this.state.refundMoney,
  455. refundDate: this.state.refundDate,
  456. remarks: this.state.refundRemarks,
  457. orderNo: this.props.data.orderNo,
  458. cid: this.props.id,
  459. },
  460. success: function (data) {
  461. let theArr = [];
  462. if (data.error && data.error.length) {
  463. message.warning(data.error[0].message);
  464. } else {
  465. message.success("添加成功!")
  466. this.refundGetList()
  467. this.setState({
  468. addRefundVisible: false
  469. })
  470. }
  471. }.bind(this)
  472. }).always(
  473. function () {
  474. this.setState({
  475. loading: false
  476. });
  477. }.bind(this)
  478. );
  479. }
  480. refundGetList() {
  481. this.setState({
  482. loading: true
  483. });
  484. $.ajax({
  485. method: "get",
  486. dataType: "json",
  487. crossDomain: false,
  488. url: globalConfig.context + "/api/admin/orderChange/listRefund",
  489. data: {
  490. id: this.props.id
  491. },
  492. success: function (data) {
  493. let theArr = [];
  494. if (data.error && data.error.length) {
  495. message.warning(data.error[0].message);
  496. } else {
  497. this.setState({
  498. refundDataSource: data.data
  499. })
  500. }
  501. }.bind(this)
  502. }).always(
  503. function () {
  504. this.setState({
  505. loading: false
  506. });
  507. }.bind(this)
  508. );
  509. }
  510. moneyOld(str, money) {
  511. if (money) {
  512. return (
  513. <span style={{ color: "red", fontWeight: 900, fontSize: 16 }}>
  514. {str}(原合同金额{money}万元)
  515. </span>
  516. );
  517. } else {
  518. return (
  519. <span style={{ color: "red", fontWeight: 900, fontSize: 16 }}>
  520. {str}
  521. </span>
  522. );
  523. }
  524. }
  525. componentDidMount() {
  526. window.setTimeout(() => {
  527. const contactList = this.props.contactList;
  528. contactList.forEach(item => {
  529. item.load = true;
  530. });
  531. this.setState({
  532. contactList
  533. });
  534. }, 0);
  535. this.refundGetList()
  536. }
  537. addRefund() {
  538. this.setState({
  539. addRefundVisible: true,
  540. refundMoney: undefined,
  541. refundDate: undefined,
  542. refundRemarks: undefined,
  543. })
  544. }
  545. refundCancel() {
  546. this.setState({
  547. addRefundVisible: false,
  548. refundMoney: undefined,
  549. refundDate: undefined,
  550. refundRemarks: undefined,
  551. })
  552. }
  553. getVoucherUrl(e) {
  554. this.setState({
  555. voucherUrl: e
  556. });
  557. let url = ""
  558. e.forEach((item, index) => {
  559. if (item.response && item.response.data) {
  560. if (index < e.length - 1) {
  561. url += item.response.data + ","
  562. } else {
  563. url += item.response.data
  564. }
  565. }
  566. })
  567. this.setState({
  568. refundUrl: url
  569. })
  570. }
  571. downImg() {
  572. let num = 0;
  573. for (let i = 0; i < this.props.pictureUrl.length; i++) {
  574. if (this.props.pictureUrl[i].url == this.state.previewImage) {
  575. num = i;
  576. }
  577. }
  578. if (num == this.props.pictureUrl.length - 1) {
  579. return message.warning("已经是最后一张了哦");
  580. }
  581. this.state.previewImage = this.props.pictureUrl[num + 1].url;
  582. this.setState({
  583. previewImage: this.state.previewImage,
  584. rotateDeg: 0
  585. });
  586. }
  587. upImg() {
  588. let num = 0;
  589. for (let i = 0; i < this.props.pictureUrl.length; i++) {
  590. if (this.props.pictureUrl[i].url == this.state.previewImage) {
  591. num = i;
  592. }
  593. }
  594. if (num == 0) {
  595. return message.warning("已经是第一张了哦");
  596. }
  597. this.state.previewImage = this.props.pictureUrl[num - 1].url;
  598. this.setState({
  599. previewImage: this.state.previewImage,
  600. rotateDeg: 0
  601. });
  602. }
  603. rotate() {
  604. let rotateDeg = this.state.rotateDeg + 90;
  605. this.setState({
  606. rotateDeg
  607. });
  608. }
  609. reset() {
  610. this.setState({
  611. paymentTimes: null,
  612. paymentAmount: "",
  613. invoiceTimes: null,
  614. invoiceAmount: "",
  615. cwCost: "",
  616. refundableAmount: "",
  617. cwRemarks: ""
  618. });
  619. }
  620. getOrgCodeUrl(e) {
  621. this.setState({
  622. orgCodeUrl: e
  623. });
  624. }
  625. // //查看催款节点
  626. // loaduserss(record) {
  627. // this.state.orderList = [];
  628. // this.setState({
  629. // orderNoss: record ? record.orderNo : this.props.datauser.orderNo
  630. // });
  631. // $.ajax({
  632. // method: "get",
  633. // dataType: "json",
  634. // crossDomain: false,
  635. // url: globalConfig.context + "/api/admin/newOrder/selectOrderDun",
  636. // data: {
  637. // orderNo: record ? record.orderNo : this.props.datauser.orderNo
  638. // },
  639. // success: function(data) {
  640. // let theArr = [];
  641. // let thisData = [];
  642. // if (!thisData) {
  643. // if (data.error && data.error.length) {
  644. // message.warning(data.error[0].message);
  645. // }
  646. // thisData = {};
  647. // } else {
  648. // for (let i = 0; i < data.data.length; i++) {
  649. // thisData = data.data[i];
  650. // theArr.push({
  651. // key: i,
  652. // dunSubject: thisData.dunSubject
  653. // ? thisData.dunSubject.toString()
  654. // : "", //催款科目
  655. // id: thisData.id, //节点Id
  656. // money: thisData.money, //催款金额
  657. // dunStatus: thisData.dunStatus, //催款状态
  658. // orderNo: record ? record.orderNo : this.props.datauser.orderNo
  659. // });
  660. // }
  661. // this.setState({
  662. // contactList: theArr
  663. // });
  664. // }
  665. // }.bind(this)
  666. // }).always(
  667. // function() {
  668. // this.setState({
  669. // loading: false
  670. // });
  671. // }.bind(this)
  672. // );
  673. // }
  674. timestampToTime(timestamp) {
  675. var date = new Date(timestamp); //时间戳为10位需*1000,时间戳为13位的话不需乘1000
  676. var Y = date.getFullYear() + "-";
  677. var M =
  678. (date.getMonth() + 1 < 10
  679. ? "0" + (date.getMonth() + 1)
  680. : date.getMonth() + 1) + "-";
  681. var D = date.getDate() + " ";
  682. var h = date.getHours() + ":";
  683. var m = date.getMinutes() + ":";
  684. var s = date.getSeconds();
  685. return Y + M + D + h + m + s;
  686. }
  687. reLoad() {
  688. $.ajax({
  689. method: "get",
  690. dataType: "json",
  691. crossDomain: false,
  692. url:
  693. globalConfig.context + "/api/admin/orderChange/listOrderRefundInvoice",
  694. data: {
  695. orderNo: this.props.data.orderNo
  696. },
  697. success: data => {
  698. if (!data) return;
  699. data.data.forEach(item => {
  700. item.load = true;
  701. });
  702. this.setState({
  703. contactList: data.data
  704. });
  705. }
  706. });
  707. }
  708. // 完成订单
  709. finish() {
  710. $.ajax({
  711. url: globalConfig.context + "/api/admin/orderChange/completeOrderChange",
  712. method: "get",
  713. data: {
  714. orderNo: this.props.data.orderNo,
  715. type: this.props.data.type,
  716. id: this.props.data.id
  717. },
  718. success: data => {
  719. if (data.data && data.data.length) {
  720. message.success("保存成功!");
  721. // window.location.reload();
  722. this.props.onCancel()
  723. } else if (data.error && data.error.length) {
  724. message.warning(data.error[0].message)
  725. }
  726. }
  727. });
  728. }
  729. contactSave(index) {
  730. if (this.state.contactList) {
  731. let Data = this.state.contactList;
  732. for (var a = 0; a < Data.length; a++) {
  733. if (Data[a].amount == "") {
  734. message.warning("退票金额不能为空");
  735. // this.refs.signFirstPayment.focus();
  736. return false;
  737. }
  738. }
  739. }
  740. // this.setState({
  741. // loading: true
  742. // });
  743. $.ajax({
  744. url:
  745. globalConfig.context + "/api/admin/orderChange/addOrderRefundInvoice",
  746. method: "post",
  747. data: {
  748. orderNo: this.props.data.orderNo,
  749. amount: index.amount
  750. }
  751. }).done(
  752. function (data) {
  753. if (!data.error.length) {
  754. message.success("保存成功!");
  755. let num = 0;
  756. this.state.contactList.forEach(item => {
  757. num += +item.amount;
  758. // if (item.key == index.key) {
  759. // item.load = true;
  760. // let time = this.timestampToTime(new Date().getTime());
  761. // item.createTimes = time;
  762. // }
  763. });
  764. this.setState({
  765. contactList: this.state.contactList,
  766. refundInvoice: num
  767. });
  768. this.reLoad();
  769. console.log("bug", this.state);
  770. } else {
  771. message.warning(data.error[0].message);
  772. }
  773. }.bind(this)
  774. );
  775. }
  776. //点击新增催款节点
  777. addcontact() {
  778. // let key = this.state.contactList.length
  779. // if(key == 0) {
  780. // key
  781. // }
  782. this.state.contactList.push({
  783. key: this.state.contactList.length,
  784. amount: "",
  785. createTime: undefined
  786. // orderNo: this.state.orderNoss,
  787. // dunTarget: this.state.kehuId
  788. });
  789. this.setState({
  790. contactList: this.state.contactList
  791. });
  792. }
  793. //删除收款节点
  794. confirmDelet(index) {
  795. // if (index.id) {
  796. // this.state.contactList.splice(index.key, 1);
  797. // this.setState({
  798. // contactList: this.state.contactList
  799. // });
  800. // this.contactSave();
  801. // } else {
  802. // this.state.contactList.splice(index.key, 1);
  803. // this.setState({
  804. // contactList: this.state.contactList
  805. // });
  806. // }
  807. // if(this.state.contactList.length == 1) {
  808. // this.state.contactList = []
  809. // this.setState({
  810. // contactList: this.state.contactList
  811. // });
  812. // return
  813. // }
  814. // let num = index.key
  815. // if (this.state.contactList[num + 1].key) {
  816. // this.state.contactList[num + 1].key = index.key;
  817. // }
  818. if (index.key || !index.id) {
  819. let num = this.state.contactList.findIndex(item => item.key == index.key);
  820. this.state.contactList.splice(num, 1);
  821. let total = 0;
  822. this.state.contactList.forEach(item => {
  823. total += +item.amount;
  824. });
  825. this.setState({
  826. contactList: this.state.contactList,
  827. refundInvoice: total
  828. });
  829. } else {
  830. $.ajax({
  831. url:
  832. globalConfig.context +
  833. "/api/admin/orderChange/deleteOrderRefundInvoice",
  834. method: "post",
  835. data: {
  836. id: index.id
  837. }
  838. }).done(
  839. function (data) {
  840. if (!data.error.length) {
  841. message.success("删除成功!");
  842. this.reLoad();
  843. } else {
  844. message.warning(data.error[0].message);
  845. }
  846. }.bind(this)
  847. );
  848. }
  849. // console.log(this.state.contactList[num + 1].key);
  850. }
  851. // loadData() {
  852. // $.ajax({
  853. // method: "get",
  854. // dataType: "json",
  855. // async: false,
  856. // crossDomain: false,
  857. // url: globalConfig.context + "/api/admin/orderChange/orderChangeLogList",
  858. // data: {
  859. // changeId: this.props.data.id
  860. // },
  861. // success: function(data) {
  862. // if (data.error.length || data.data.list == "") {
  863. // if (data.error && data.error.length) {
  864. // message.warning(data.error[0].message);
  865. // }
  866. // } else {
  867. // this.setState({
  868. // dataSource: data.data
  869. // });
  870. // }
  871. // }.bind(this)
  872. // });
  873. // }
  874. //同意拒绝按钮的有无
  875. changeButtonStatus() {
  876. this.setState({
  877. buttonStatus: !this.state.buttonStatus
  878. });
  879. }
  880. onRef(ref) {
  881. this.fun = ref;
  882. }
  883. render() {
  884. const pageData = [
  885. {
  886. labelA: "客户名称",
  887. formItemLayoutA: formItemLayout,
  888. dataA: this.props.data.userName,
  889. labelB: "合同编号",
  890. formItemLayoutB: formItemLayout,
  891. dataB: this.props.data.contractNo
  892. },
  893. {
  894. labelA: "时间",
  895. formItemLayoutA: formItemLayout,
  896. dataA: this.props.data.createTimes,
  897. labelB: "发起人",
  898. formItemLayoutB: formItemLayout,
  899. dataB: this.props.data.applicant
  900. },
  901. {
  902. labelA: "当前进度",
  903. formItemLayoutA: formItemLayout,
  904. // 当前是咨询师以及咨询师经理时使用shenhePeo函数,其他流程正常显示
  905. dataA:
  906. this.props.data.processState == 2 || this.props.data.processState == 3
  907. ? shenghePeo(
  908. this.props.data.processState == 2
  909. ? this.props.data.consultantExamine
  910. : this.props.data.managerExamine,
  911. this.props.data.processState
  912. )
  913. : getProcessStatusNew(
  914. this.props.data.processState,
  915. this.props.data.status
  916. ),
  917. labelB: "变更类型",
  918. formItemLayoutB: formItemLayout,
  919. dataB: getChangeType(this.props.data.type)
  920. },
  921. {
  922. labelA: "合同额(万元)",
  923. formItemLayoutA: formItemLayout,
  924. dataA: this.moneyOld(this.props.data.totalAmount, this.props.money),
  925. labelB: "已收款(万元)",
  926. formItemLayoutB: formItemLayout,
  927. dataB: changeColor(this.props.data.settlementAmount)
  928. },
  929. {
  930. labelA: "欠款(万元)",
  931. formItemLayoutA: formItemLayout,
  932. dataA: changeColor(this.props.data.arrears),
  933. labelB: "申请退款(万元)",
  934. formItemLayoutB: formItemLayout,
  935. dataB: changeColor(this.props.data.changeAmount)
  936. },
  937. {
  938. labelA: "变更原因",
  939. formItemLayoutA: formItemLayout,
  940. dataA: this.props.data.remarks
  941. }
  942. ];
  943. const planData = [
  944. {
  945. labelA: "项目进度",
  946. formItemLayoutA: formItemLayout,
  947. dataA: this.props.data.projectState,
  948. onChangeA: value => {
  949. this.setState({
  950. projectState: value
  951. });
  952. },
  953. labelB: "发生成本费用(万元)",
  954. formItemLayoutB: formItemLayout,
  955. dataB: this.props.data.zxsCost,
  956. onChangeB: value => {
  957. this.setState({
  958. zxsCost: value
  959. });
  960. }
  961. },
  962. {
  963. labelA: "备注",
  964. formItemLayoutA: formItemLayout,
  965. dataA: this.props.data.zxsRemarks,
  966. onChangeA: value => {
  967. this.setState({
  968. zxsRemarks: value
  969. });
  970. }
  971. }
  972. ];
  973. const financeData = [
  974. {
  975. labelA: "发生成本(万元)",
  976. formItemLayoutA: formItemLayout,
  977. dataA: this.props.data.cwCost ? this.props.data.cwCost : "0",
  978. onChangeA: value => {
  979. this.setState({
  980. cwCost: value
  981. });
  982. },
  983. labelB: "应退金额(万元)",
  984. formItemLayoutB: formItemLayout,
  985. dataB: this.props.data.refundableAmount
  986. ? this.props.data.refundableAmount
  987. : "0",
  988. onChangeB: value => {
  989. this.setState({
  990. refundableAmount: value
  991. });
  992. },
  993. mark: true
  994. }
  995. // {
  996. // labelA: "备注",
  997. // formItemLayoutA: formItemLayout,
  998. // dataA: this.props.data.cwRemarks,
  999. // onChangeA: value => {
  1000. // this.setState({
  1001. // reason: value
  1002. // });
  1003. // },
  1004. // mark: false
  1005. // }
  1006. ];
  1007. const buttonData = [
  1008. {
  1009. name: "同意",
  1010. title: "理由",
  1011. placeholder: "请输入理由",
  1012. type: "primary",
  1013. status: 2,
  1014. onChange: value => {
  1015. this.setState({
  1016. remarks: value
  1017. });
  1018. }
  1019. },
  1020. {
  1021. name: "拒绝",
  1022. title: "理由",
  1023. placeholder: "请输入理由",
  1024. type: "danger",
  1025. status: 3,
  1026. onChange: value => {
  1027. this.setState({
  1028. remarks: value
  1029. });
  1030. }
  1031. }
  1032. ];
  1033. const orgCodeUrl = this.props.pictureUrl;
  1034. return (
  1035. <div className="clearfix changeDetail">
  1036. <div
  1037. className="clearfix"
  1038. ref={e => {
  1039. this.refs = e;
  1040. }}
  1041. >
  1042. <div
  1043. style={{
  1044. borderRadius: "50%",
  1045. width: 300,
  1046. height: 300,
  1047. position: "absolute",
  1048. top: 230,
  1049. left: 525,
  1050. transform: "rotate(-5deg)",
  1051. zIndex: 1,
  1052. display:
  1053. (this.props.data.processState == 7 ||
  1054. this.props.data.processState == 8) &&
  1055. this.props.data.status == 4
  1056. ? "block"
  1057. : "none"
  1058. }}
  1059. >
  1060. {/* <span
  1061. style={{
  1062. fontSize: 29,
  1063. position: "absolute",
  1064. left: "50%",
  1065. top: "50%",
  1066. transform: "translate(-50%,-50%)",
  1067. color: "red"
  1068. }}
  1069. >
  1070. 通过
  1071. </span> */}
  1072. <img src={tongguo} style={{ width: "100%" }} />
  1073. </div>
  1074. <h2 style={{ textAlign: "center", marginBottom: 10, marginTop: 20 }}>
  1075. 合同变更记录
  1076. </h2>
  1077. {pageData.map((item, index) => {
  1078. return <Itemlist key={index} pageData={item} />;
  1079. })}
  1080. <Form.Item
  1081. label="变更凭证"
  1082. labelCol={{ span: 4 }}
  1083. wrapperCol={{ span: 18 }}
  1084. >
  1085. <Upload
  1086. className="demandDetailShow-upload"
  1087. listType="picture-card"
  1088. fileList={orgCodeUrl}
  1089. onPreview={file => {
  1090. this.setState({
  1091. previewImage: file.url || file.thumbUrl,
  1092. previewVisible: true
  1093. });
  1094. }}
  1095. />
  1096. <Modal
  1097. maskClosable={false}
  1098. footer={null}
  1099. visible={this.state.previewVisible}
  1100. onCancel={() => {
  1101. this.setState({ previewVisible: false, rotateDeg: 0 }, () => {
  1102. this.reset();
  1103. });
  1104. }}
  1105. >
  1106. <img
  1107. alt=""
  1108. style={{
  1109. width: "100%",
  1110. transform: `rotate(${this.state.rotateDeg}deg)`
  1111. }}
  1112. src={this.state.previewImage || ""}
  1113. />
  1114. <Button
  1115. onClick={this.rotate}
  1116. style={{
  1117. position: "relative",
  1118. left: "50%",
  1119. transform: "translateX(-50%)"
  1120. }}
  1121. >
  1122. 旋转
  1123. </Button>
  1124. <Button
  1125. onClick={this.upImg}
  1126. style={{
  1127. position: "absolute",
  1128. left: -81,
  1129. top: "50%",
  1130. transform: "translateY(-50%)"
  1131. }}
  1132. >
  1133. 上一张
  1134. </Button>
  1135. <Button
  1136. onClick={this.downImg}
  1137. style={{
  1138. position: "absolute",
  1139. right: -81,
  1140. top: "50%",
  1141. transform: "translateY(-50%)"
  1142. }}
  1143. >
  1144. 下一张
  1145. </Button>
  1146. </Modal>
  1147. <Rizhi changeId={this.props.id} />
  1148. </Form.Item>
  1149. <ul
  1150. style={{
  1151. width: "868px",
  1152. overflow: "hidden",
  1153. paddingLeft: "90px",
  1154. paddingTop: "10px",
  1155. position: "relative",
  1156. bottom: "20px",
  1157. fontSize: "12px",
  1158. color: "rgba(0, 0, 0, 0.65)"
  1159. }}
  1160. >
  1161. {/* <span>操作人:</span> */}
  1162. {this.props.dataSource.map((item, index) => {
  1163. if (item.status == 0) {
  1164. item.status = "发起";
  1165. } else if (item.status == 1) {
  1166. item.status = "审核中";
  1167. } else if (item.status == 2) {
  1168. item.status = "通过";
  1169. } else if (item.status == 3) {
  1170. item.status = "驳回";
  1171. } else if (item.status == 4) {
  1172. item.status = "完成";
  1173. }
  1174. return (
  1175. <li
  1176. key={index}
  1177. style={{
  1178. width: "100%",
  1179. height: "auto",
  1180. wordBreak: "break-all",
  1181. marginBottom: "10px"
  1182. }}
  1183. >
  1184. {item.aname + ":" + "(" + item.status + ")" + item.remarks}
  1185. </li>
  1186. );
  1187. })}
  1188. </ul>
  1189. <ProAndCuiList id={this.props.id} />
  1190. <div className="clearfix">
  1191. <h3 style={{ marginLeft: 20, fontWeight: 800, marginBottom: 10 }}>
  1192. 收款情况
  1193. </h3>
  1194. <div style={{ marginLeft: "90px" }}>
  1195. <ul style={{ fontSize: "12px", color: "rgba(0, 0, 0, 0.65)" }}>
  1196. {(this.props.proceedsData.bill || []).map((item, index) => (
  1197. <li key={index}>
  1198. {item.payTime +
  1199. " " +
  1200. item.aName +
  1201. " 收款:" +
  1202. item.transactionAmount +
  1203. "万元"}
  1204. </li>
  1205. ))}
  1206. </ul>
  1207. <div>收款总计:{this.props.proceedsTotal}万元</div>
  1208. </div>
  1209. <br />
  1210. <div style={{ marginLeft: "90px" }}>
  1211. <ul style={{ fontSize: "12px", color: "rgba(0, 0, 0, 0.65)" }}>
  1212. {(this.props.proceedsData.invoice || []).map((item, index) => (
  1213. <li key={index}>
  1214. {item.createTime + " " + " 开票:" + item.amount + "万元"}
  1215. </li>
  1216. ))}
  1217. </ul>
  1218. <div>开票总计:{this.props.invoiceTotal}万元</div>
  1219. </div>
  1220. <p style={{ marginLeft: "90px", color: "red" }}>
  1221. 系统预估 产生成本(万元):
  1222. {this.props.data.estimateCost
  1223. ? this.props.data.estimateCost
  1224. : "0"}{" "}
  1225. &nbsp;应退金额(万元):
  1226. {this.props.data.estimateRefundable
  1227. ? this.props.data.estimateRefundable
  1228. : "0"}
  1229. </p>
  1230. </div>
  1231. {/* {this.props.data.type === 0 ? (
  1232. <div>
  1233. <h3 style={{ marginLeft: 10, fontWeight: 800, marginBottom: 10 }}>
  1234. 当前项目进度(咨询师经理填写)
  1235. </h3>
  1236. {planData.map((item, index) => {
  1237. return <Itemlist key={index} pageData={item} />;
  1238. })}
  1239. </div>
  1240. ) : (
  1241. ""
  1242. )} */}
  1243. <div
  1244. style={{
  1245. display:
  1246. (this.props.data.processState == 8 ||
  1247. this.props.data.processState == 7) &&
  1248. (this.props.data.status == 2 || this.props.data.status == 4)
  1249. ? "block"
  1250. : "none"
  1251. }}
  1252. >
  1253. <h3 style={{ marginLeft: 20, fontWeight: 800, marginBottom: 10 }}>
  1254. 回收退票
  1255. </h3>
  1256. {/* {this.state.processStatus == 0 ? ( */}
  1257. <Button
  1258. type="primary"
  1259. onClick={this.addcontact}
  1260. style={{
  1261. float: "right",
  1262. marginRight: "50px",
  1263. marginBottom: "15px",
  1264. position: "relative",
  1265. zIndex: "999",
  1266. display:
  1267. (this.props.data.processState == 7 ||
  1268. this.props.data.processState == 8) &&
  1269. this.props.data.status == 4
  1270. ? "none"
  1271. : "block"
  1272. }}
  1273. >
  1274. 添加回收退票
  1275. </Button>
  1276. {/* ) : (
  1277. ""
  1278. )} */}
  1279. <Table
  1280. pagination={false}
  1281. bordered
  1282. columns={this.state.ContactsLists}
  1283. dataSource={this.state.contactList}
  1284. size="small"
  1285. />
  1286. </div>
  1287. {(this.props.data.processState > 5 &&
  1288. this.props.data.processState <= 8) ||
  1289. (this.props.data.processState === 9 &&
  1290. this.props.data.status === 4) ? (
  1291. <div>
  1292. <h3 style={{ marginLeft: 20, fontWeight: 800, marginBottom: 10 }}>
  1293. 当前财务状态(财务填写)
  1294. </h3>
  1295. {/* <div className="clearfix">
  1296. <Form.Item
  1297. className="half-item"
  1298. label="收款时间"
  1299. labelCol={{ span: 8 }}
  1300. wrapperCol={{ span: 14 }}
  1301. >
  1302. <span>{this.props.data.paymentTimes}</span>
  1303. </Form.Item>
  1304. <Form.Item
  1305. className="half-item"
  1306. label="收款金额(万元)"
  1307. labelCol={{ span: 8 }}
  1308. wrapperCol={{ span: 14 }}
  1309. >
  1310. <span>{this.props.data.paymentAmount}</span>
  1311. </Form.Item>
  1312. </div>
  1313. <div className="clearfix">
  1314. <Form.Item
  1315. className="half-item"
  1316. label="开票时间"
  1317. labelCol={{ span: 8 }}
  1318. wrapperCol={{ span: 14 }}
  1319. >
  1320. <span>{this.props.data.invoiceTimes}</span>
  1321. </Form.Item>
  1322. <Form.Item
  1323. className="half-item"
  1324. label="开票金额(万元)"
  1325. labelCol={{ span: 8 }}
  1326. wrapperCol={{ span: 14 }}
  1327. >
  1328. <span>{this.props.data.invoiceAmount}</span>
  1329. </Form.Item>
  1330. </div> */}
  1331. {financeData.map((item, index) => {
  1332. return <Itemlist key={index} pageData={item} />;
  1333. })}
  1334. </div>
  1335. ) : (
  1336. <div style={{ marginBottom: 10 }}>
  1337. <h3 style={{ marginLeft: 10, fontWeight: 800, marginBottom: 10 }}>
  1338. 当前财务状态(财务填写)
  1339. </h3>
  1340. <div className="clearfix">
  1341. {/* <Form.Item
  1342. className="half-item"
  1343. label="收款时间"
  1344. labelCol={{ span: 8 }}
  1345. wrapperCol={{ span: 14 }}
  1346. >
  1347. <DatePicker
  1348. style={{ width: 160 }}
  1349. value={
  1350. this.state.paymentTimes
  1351. ? moment(this.state.paymentTimes)
  1352. : null
  1353. }
  1354. onChange={(_data, dataString) => {
  1355. this.setState({
  1356. paymentTimes: dataString
  1357. });
  1358. }}
  1359. />
  1360. </Form.Item>
  1361. <Form.Item
  1362. className="half-item"
  1363. label="收款金额(万元)"
  1364. labelCol={{ span: 8 }}
  1365. wrapperCol={{ span: 14 }}
  1366. >
  1367. <Input
  1368. style={{ width: 160 }}
  1369. value={this.state.paymentAmount}
  1370. placeholder="请输入收款金额"
  1371. onChange={e => {
  1372. this.setState({
  1373. paymentAmount: e.target.value
  1374. });
  1375. }}
  1376. />
  1377. </Form.Item>
  1378. </div>
  1379. <div className="clearfix">
  1380. <Form.Item
  1381. className="half-item"
  1382. label="开票时间"
  1383. labelCol={{ span: 8 }}
  1384. wrapperCol={{ span: 14 }}
  1385. >
  1386. <DatePicker
  1387. style={{ width: 160 }}
  1388. value={
  1389. this.state.invoiceTimes
  1390. ? moment(this.state.invoiceTimes)
  1391. : null
  1392. }
  1393. onChange={(_data, dataString) => {
  1394. this.setState({
  1395. invoiceTimes: dataString
  1396. });
  1397. }}
  1398. />
  1399. </Form.Item>
  1400. <Form.Item
  1401. className="half-item"
  1402. label="开票金额(万元)"
  1403. labelCol={{ span: 8 }}
  1404. wrapperCol={{ span: 14 }}
  1405. >
  1406. <Input
  1407. style={{ width: 160 }}
  1408. value={this.state.invoiceAmount}
  1409. placeholder="请输入开票金额"
  1410. onChange={e => {
  1411. this.setState({
  1412. invoiceAmount: e.target.value
  1413. });
  1414. }}
  1415. />
  1416. </Form.Item> */}
  1417. <Form.Item
  1418. className="half-item"
  1419. label="发生成本(万元)"
  1420. labelCol={{ span: 8 }}
  1421. wrapperCol={{ span: 14 }}
  1422. >
  1423. <Input
  1424. style={{ width: 160 }}
  1425. value={this.state.cwCost}
  1426. placeholder="请输入发生成本"
  1427. onChange={e => {
  1428. this.setState({
  1429. cwCost: e.target.value
  1430. });
  1431. }}
  1432. />
  1433. </Form.Item>
  1434. <Form.Item
  1435. className="half-item"
  1436. label="应退金额(万元)"
  1437. labelCol={{ span: 8 }}
  1438. wrapperCol={{ span: 14 }}
  1439. >
  1440. <Input
  1441. style={{ width: 160 }}
  1442. value={this.state.refundableAmount}
  1443. placeholder="请输入应退金额"
  1444. onChange={e => {
  1445. this.setState({
  1446. refundableAmount: e.target.value
  1447. });
  1448. }}
  1449. />
  1450. </Form.Item>
  1451. </div>
  1452. <div
  1453. style={{
  1454. marginTop: "10px",
  1455. display:
  1456. this.props.data.processState == 5 &&
  1457. this.props.data.status == 2
  1458. ? "none"
  1459. : "block"
  1460. }}
  1461. >
  1462. <Form.Item
  1463. label="备注"
  1464. labelCol={{ span: 4 }}
  1465. wrapperCol={{ span: 14 }}
  1466. >
  1467. <Input.TextArea
  1468. rows={4}
  1469. value={this.state.reason}
  1470. placeholder="请输入补充资料/备注"
  1471. onChange={e => {
  1472. this.setState({
  1473. reason: e.target.value
  1474. });
  1475. }}
  1476. />
  1477. </Form.Item>
  1478. </div>
  1479. </div>
  1480. )}
  1481. <ul
  1482. style={{
  1483. margin: "10px 0 0 20px",
  1484. color: "red",
  1485. display:
  1486. (this.props.data.processState == 7 ||
  1487. this.props.data.processState == 8) &&
  1488. (this.props.data.status == 4 || this.props.data.status == 2)
  1489. ? "inline-block"
  1490. : "none"
  1491. }}
  1492. >
  1493. <li>
  1494. {"本次应收退票(万元):" +
  1495. (this.props.data.refundableAmount == null
  1496. ? 0
  1497. : this.props.data.refundableAmount)}
  1498. </li>
  1499. <li>
  1500. {"累计已回收退票(万元):" +
  1501. (this.state.refundInvoice == null
  1502. ? 0
  1503. : this.state.refundInvoice)}
  1504. </li>
  1505. </ul>
  1506. <div
  1507. style={{
  1508. position: "relative",
  1509. display:
  1510. (this.props.data.processState == 7 ||
  1511. this.props.data.processState == 8) &&
  1512. this.props.data.status == 4 && !this.props.data.refundStatus
  1513. ? "block"
  1514. : "none",
  1515. marginTop: 10
  1516. }}
  1517. >
  1518. <hr style={{ marginTop: 12, marginBottom: 10, backgroundColor: "black", height: 1, border: "none" }} />
  1519. <h3 style={{ marginLeft: 20, fontWeight: 800, marginBottom: 10, display: "inline-block" }}>
  1520. 执行退款 <span style={{ fontSize: 12, fontWeight: "normal", color: "red" }}>(注:执行退款,系统将从已收款金额中直接减款)</span>
  1521. </h3>
  1522. <Button onClick={this.addRefund} style={{ float: "right" }}>添加执行退款</Button>
  1523. <Table
  1524. pagination={false}
  1525. bordered
  1526. columns={this.state.refundColumn}
  1527. dataSource={this.state.refundDataSource}
  1528. scroll={{ x: "max-content", y: 0 }}
  1529. size="small"
  1530. />
  1531. <div className="clearfix">
  1532. <h3 style={{ marginLeft: 20, fontWeight: 800, marginBottom: 10 }}>
  1533. 上传退款凭证
  1534. </h3>
  1535. <div style={{ marginLeft: 20 }}>
  1536. <PicturesWall
  1537. fileList={this.getVoucherUrl}
  1538. pictureUrl={this.state.voucherUrl}
  1539. url="/api/admin/orderChange/uploadRefund"
  1540. sign="order_change_file"
  1541. />
  1542. </div>
  1543. </div>
  1544. <Button type="primary" onClick={this.refundExecute} style={{ position: "relative", left: "50%", transform: "translateX(-50%)" }}>确定执行退款</Button>
  1545. </div>
  1546. <div
  1547. style={{
  1548. display:
  1549. (this.props.data.processState == 7 ||
  1550. this.props.data.processState == 8) &&
  1551. this.props.data.status == 4 && this.props.data.refundStatus
  1552. ? "block"
  1553. : "none"
  1554. }}>
  1555. <Refund data={this.props.data} id={this.props.id} dataSource={this.state.refundDataSource} />
  1556. </div>
  1557. </div>
  1558. {!(
  1559. (this.props.data.processState > 5 &&
  1560. this.props.data.processState <= 8) ||
  1561. (this.props.data.processState === 9 && this.props.data.status === 4)
  1562. ) ? (
  1563. this.state.buttonStatus ? (
  1564. <div>
  1565. <div
  1566. className="clearfix"
  1567. style={{ display: "flex", justifyContent: "space-around" }}
  1568. >
  1569. {buttonData.map((item, index) => {
  1570. return (
  1571. <AgreeButton
  1572. data={item}
  1573. key={index}
  1574. backData={this.props.data}
  1575. processState={this.props.processState}
  1576. visible={this.changeButtonStatus}
  1577. ajaxData={this.state}
  1578. loadData={this.props.loadData}
  1579. rejectState={this.state.rejectState}
  1580. reason={this.state.reason}
  1581. onCancel={this.props.onCancel}
  1582. />
  1583. );
  1584. })}
  1585. </div>
  1586. <Select
  1587. defaultValue="0"
  1588. style={{
  1589. width: 120,
  1590. float: "left",
  1591. position: "relative",
  1592. bottom: "28px",
  1593. right: "-600px"
  1594. }}
  1595. onChange={val => {
  1596. this.setState({ rejectState: val });
  1597. // console.log(val, this.state.rejectState);
  1598. }}
  1599. >
  1600. <Option
  1601. value="0"
  1602. style={{
  1603. display: this.props.processState >= 1 ? "block" : "none"
  1604. }}
  1605. >
  1606. 营销员
  1607. </Option>
  1608. <Option
  1609. value="1"
  1610. style={{
  1611. display: this.props.processState >= 2 ? "block" : "none"
  1612. }}
  1613. >
  1614. 营销管理员
  1615. </Option>
  1616. <Option
  1617. value="2"
  1618. style={{
  1619. display: this.props.processState >= 3 ? "block" : "none"
  1620. }}
  1621. >
  1622. 咨询师
  1623. </Option>
  1624. <Option
  1625. value="3"
  1626. style={{
  1627. display: this.props.processState >= 4 ? "block" : "none"
  1628. }}
  1629. >
  1630. 咨询师经理
  1631. </Option>
  1632. <Option
  1633. value="4"
  1634. style={{
  1635. display: this.props.processState >= 5 ? "block" : "none"
  1636. }}
  1637. >
  1638. 咨询师总监
  1639. </Option>
  1640. <Option
  1641. value="5"
  1642. style={{
  1643. display: this.props.processState >= 6 ? "block" : "none"
  1644. }}
  1645. >
  1646. 财务专员(退单)
  1647. </Option>
  1648. <Option
  1649. value="6"
  1650. style={{
  1651. display: this.props.processState >= 7 ? "block" : "none"
  1652. }}
  1653. >
  1654. 财务总监
  1655. </Option>
  1656. <Option
  1657. value="7"
  1658. style={{
  1659. display: this.props.processState >= 8 ? "block" : "none"
  1660. }}
  1661. >
  1662. 总裁
  1663. </Option>
  1664. </Select>
  1665. </div>
  1666. ) : (
  1667. ""
  1668. )
  1669. ) : (
  1670. ""
  1671. )}
  1672. <Button
  1673. type="primary"
  1674. shape="round"
  1675. size="large"
  1676. style={{
  1677. position: "absolute",
  1678. left: "50%",
  1679. bottom: "0",
  1680. transform: "translateX(-50%)",
  1681. display:
  1682. (this.props.data.processState == 7 ||
  1683. this.props.data.processState == 8) &&
  1684. this.props.data.status == 2
  1685. ? "block"
  1686. : "none"
  1687. }}
  1688. onClick={this.finish}
  1689. >
  1690. 完成订单
  1691. </Button>
  1692. <ReactToPrint
  1693. trigger={() => (
  1694. <Button
  1695. type="primary"
  1696. style={{
  1697. float: "right",
  1698. marginTop: 10,
  1699. position: "absolute",
  1700. top: 0,
  1701. right: 30,
  1702. display:
  1703. (this.props.data.processState == 7 ||
  1704. this.props.data.processState == 8) &&
  1705. this.props.data.status == 4
  1706. ? "block"
  1707. : "block"
  1708. }}
  1709. >
  1710. 打印
  1711. </Button>
  1712. )}
  1713. content={() => this.refs}
  1714. />
  1715. <Modal
  1716. maskClosable={false}
  1717. visible={this.state.addRefundVisible}
  1718. onOk={this.refundCancel}
  1719. onCancel={this.refundCancel}
  1720. width="700px"
  1721. title="添加执行退款"
  1722. footer=""
  1723. className="admin-desc-content"
  1724. >
  1725. <Form
  1726. layout="horizontal"
  1727. onSubmit={this.nextSubmit}
  1728. // id="demand-form"
  1729. >
  1730. <Spin spinning={this.state.loading}>
  1731. <div className="clearfix">
  1732. <FormItem
  1733. className="half-item"
  1734. {...formItemLayoutRefund}
  1735. label="退款金额"
  1736. >
  1737. <Input
  1738. style={{ width: "155px" }}
  1739. placeholder="请输入退款金额"
  1740. value={this.state.refundMoney}
  1741. onChange={e => {
  1742. this.setState({
  1743. refundMoney: e.target.value
  1744. })
  1745. }} />
  1746. </FormItem>
  1747. <FormItem
  1748. className="half-item"
  1749. {...formItemLayoutRefund}
  1750. label="退款时间"
  1751. >
  1752. <DatePicker
  1753. value={
  1754. this.state.refundDate
  1755. ? moment(this.state.refundDate)
  1756. : null
  1757. }
  1758. onChange={(date, dateString) => {
  1759. console.log(date, dateString)
  1760. this.setState({
  1761. refundDate: dateString
  1762. })
  1763. }} />
  1764. </FormItem>
  1765. <FormItem
  1766. style={{ height: "auto" }}
  1767. labelCol={{ span: 3 }}
  1768. wrapperCol={{ span: 19 }}
  1769. label="备注"
  1770. >
  1771. <TextArea
  1772. rows={4}
  1773. placeholder="请输入备注信息"
  1774. style={{ width: "95%" }}
  1775. value={this.state.refundRemarks}
  1776. onChange={e => {
  1777. this.setState({
  1778. refundRemarks: e.target.value
  1779. })
  1780. }}
  1781. />
  1782. </FormItem>
  1783. <FormItem
  1784. wrapperCol={{ span: 12, offset: 6 }}
  1785. className="half-middle"
  1786. style={{ marginTop: 10 }}
  1787. >
  1788. <Button
  1789. className="submitSave"
  1790. type="primary"
  1791. onClick={this.sumitRefund}
  1792. >
  1793. 保存
  1794. </Button>
  1795. <Button
  1796. className="submitSave"
  1797. type="ghost"
  1798. style={{ marginLeft: 10 }}
  1799. onClick={this.refundCancel}
  1800. >
  1801. 取消
  1802. </Button>
  1803. </FormItem>
  1804. </div>
  1805. </Spin>
  1806. </Form>
  1807. </Modal>
  1808. </div>
  1809. );
  1810. }
  1811. }
  1812. export { ChangeDetail };