changeDetailCwjl.js 57 KB

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