changeDetailCwzy.js 54 KB

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