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