changeDetailCwjl.js 53 KB

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