changeDetailCwzy.js 54 KB

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