changeDetailCwjl.js 57 KB

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