changeDetailCwzy.js 60 KB

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