changeDetailCwjl.js 53 KB

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