changeDetailCwzy.js 59 KB

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