changeDetailCwzy.js 54 KB

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