changeDetailCwzy.js 54 KB

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