changeDetailCwzy.js 57 KB

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