changeDetailCwjl.js 57 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945
  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 == 8 ||
  272. this.props.data.processState == 9) &&
  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 == 3 || this.props.data.processState == 4
  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: changeColor(this.props.data.firstAmount),
  910. },
  911. {
  912. labelA: "变更原因",
  913. formItemLayoutA: formItemLayout,
  914. dataA: this.props.data.remarks
  915. }
  916. ];
  917. const planData = [
  918. {
  919. labelA: "项目进度",
  920. formItemLayoutA: formItemLayout,
  921. dataA: this.props.data.projectState,
  922. onChangeA: value => {
  923. this.setState({
  924. projectState: value
  925. });
  926. },
  927. labelB: "发生成本费用(万元)",
  928. formItemLayoutB: formItemLayout,
  929. dataB: this.props.data.zxsCost,
  930. onChangeB: value => {
  931. this.setState({
  932. zxsCost: value
  933. });
  934. }
  935. },
  936. {
  937. labelA: "备注",
  938. formItemLayoutA: formItemLayout,
  939. dataA: this.props.data.zxsRemarks,
  940. onChangeA: value => {
  941. this.setState({
  942. zxsRemarks: value
  943. });
  944. }
  945. }
  946. ];
  947. const financeData = [
  948. {
  949. labelA: "发生成本(万元)",
  950. formItemLayoutA: formItemLayout,
  951. dataA: this.props.data.cwCost ? this.props.data.cwCost : "0",
  952. onChangeA: value => {
  953. this.setState({
  954. cwCost: value
  955. });
  956. },
  957. labelB: "应退金额(万元)",
  958. formItemLayoutB: formItemLayout,
  959. dataB: this.props.data.refundableAmount
  960. ? this.props.data.refundableAmount
  961. : "0",
  962. onChangeB: value => {
  963. this.setState({
  964. refundableAmount: value
  965. });
  966. },
  967. mark: true
  968. }
  969. // {
  970. // labelA: "备注",
  971. // formItemLayoutA: formItemLayout,
  972. // dataA: this.props.data.cwRemarks,
  973. // onChangeA: value => {
  974. // this.setState({
  975. // reason: value
  976. // });
  977. // },
  978. // mark: false
  979. // }
  980. ];
  981. const buttonData = [
  982. {
  983. name: "同意",
  984. title: "理由",
  985. placeholder: "请输入理由",
  986. type: "primary",
  987. status: 2,
  988. onChange: value => {
  989. this.setState({
  990. remarks: value
  991. });
  992. }
  993. },
  994. {
  995. name: "拒绝",
  996. title: "理由",
  997. placeholder: "请输入理由",
  998. type: "danger",
  999. status: 3,
  1000. onChange: value => {
  1001. this.setState({
  1002. remarks: value
  1003. });
  1004. }
  1005. }
  1006. ];
  1007. const orgCodeUrl = this.props.pictureUrl;
  1008. const attachment = this.props.attachment
  1009. return (
  1010. <div className="clearfix changeDetail">
  1011. <div
  1012. className="clearfix"
  1013. ref={(e) => {
  1014. this.refs = e;
  1015. }}
  1016. >
  1017. <div
  1018. style={{
  1019. borderRadius: "50%",
  1020. width: 300,
  1021. height: 300,
  1022. position: "absolute",
  1023. top: 230,
  1024. left: 525,
  1025. transform: "rotate(-5deg)",
  1026. zIndex: 1,
  1027. display:
  1028. this.props.data.status == 4
  1029. ? "block"
  1030. : "none",
  1031. }}
  1032. >
  1033. <img src={tongguo} style={{ width: "100%" }} />
  1034. </div>
  1035. <div
  1036. style={{
  1037. borderRadius: "50%",
  1038. width: 300,
  1039. height: 300,
  1040. position: "absolute",
  1041. top: 284,
  1042. left: 586,
  1043. transform: "rotate(-5deg)",
  1044. zIndex: 1,
  1045. display: this.props.data.status == 5 ? "block" : "none",
  1046. }}
  1047. >
  1048. <img src={quxiao} style={{ width: "63%" }} />
  1049. </div>
  1050. <h2 style={{ textAlign: "center", marginBottom: 10, marginTop: 20 }}>
  1051. 合同变更记录
  1052. </h2>
  1053. {pageData.map((item, index) => {
  1054. return <Itemlist key={index} pageData={item} />;
  1055. })}
  1056. <Form.Item
  1057. label="变更凭证"
  1058. labelCol={{ span: 4 }}
  1059. wrapperCol={{ span: 18 }}
  1060. >
  1061. <div style={{ paddingTop: '10px', paddingBottom: '10px' }}>
  1062. <ImgList domId={this.props.domId ? this.props.domId : 'changeDetailCwjlqq'} fileList={orgCodeUrl} ItemWidth={'96px'} />
  1063. </div>
  1064. <Modal
  1065. maskClosable={false}
  1066. footer={null}
  1067. width={"50%"}
  1068. visible={this.state.previewVisible}
  1069. onCancel={() => {
  1070. this.setState({ previewVisible: false, rotateDeg: 0 }, () => {
  1071. this.reset();
  1072. });
  1073. }}
  1074. >
  1075. <img
  1076. alt=""
  1077. style={{
  1078. width: "100%",
  1079. transform: `rotate(${this.state.rotateDeg}deg)`,
  1080. }}
  1081. src={this.state.previewImage || ""}
  1082. />
  1083. <Button
  1084. onClick={this.rotate}
  1085. style={{
  1086. position: "relative",
  1087. left: "50%",
  1088. transform: "translateX(-50%)",
  1089. }}
  1090. >
  1091. 旋转
  1092. </Button>
  1093. <Button
  1094. onClick={this.upImg}
  1095. style={{
  1096. position: "absolute",
  1097. left: -81,
  1098. top: "50%",
  1099. transform: "translateY(-50%)",
  1100. }}
  1101. >
  1102. 上一张
  1103. </Button>
  1104. <Button
  1105. onClick={this.downImg}
  1106. style={{
  1107. position: "absolute",
  1108. right: -81,
  1109. top: "50%",
  1110. transform: "translateY(-50%)",
  1111. }}
  1112. >
  1113. 下一张
  1114. </Button>
  1115. </Modal>
  1116. <Rizhi changeId={this.props.id} />
  1117. </Form.Item>
  1118. {
  1119. this.props.contractPictureUrl && this.props.contractPictureUrl.length != 0 &&
  1120. <div className="clearfix">
  1121. <Form.Item
  1122. labelCol={{ span: 4 }}
  1123. wrapperCol={{ span: 18 }}
  1124. label="最新合同"
  1125. >
  1126. <div style={{ paddingTop: 10 }}>
  1127. <ImgList
  1128. domId={"zxht"}
  1129. fileList={
  1130. this.props.contractPictureUrl
  1131. }
  1132. ItemWidth={"96px"}
  1133. />
  1134. </div>
  1135. </Form.Item>
  1136. </div>
  1137. }
  1138. <ul
  1139. style={{
  1140. width: "868px",
  1141. overflow: "hidden",
  1142. paddingLeft: "90px",
  1143. paddingTop: "10px",
  1144. position: "relative",
  1145. bottom: "20px",
  1146. fontSize: "12px",
  1147. color: "rgba(0, 0, 0, 0.65)",
  1148. }}
  1149. >
  1150. {/* <span>操作人:</span> */}
  1151. {this.props.dataSource.map((item, index) => {
  1152. if (item.status == 0) {
  1153. item.status = "发起";
  1154. } else if (item.status == 1) {
  1155. item.status = "审核中";
  1156. } else if (item.status == 2) {
  1157. item.status = "通过";
  1158. } else if (item.status == 3) {
  1159. item.status = "驳回";
  1160. } else if (item.status == 4) {
  1161. item.status = "完成";
  1162. } else if (item.status == 5) {
  1163. item.status = "撤销";
  1164. }
  1165. return (
  1166. <li
  1167. key={index}
  1168. style={{
  1169. width: "100%",
  1170. height: "auto",
  1171. wordBreak: "break-all",
  1172. marginBottom: "10px",
  1173. }}
  1174. >
  1175. {item.aname + ":" + "【" + item.status + "】" + item.remarks + "(" + item.createTimes + ")"}
  1176. </li>
  1177. );
  1178. })}
  1179. </ul>
  1180. <ProAndCuiList id={this.props.id} />
  1181. {/* 收款情况 */}
  1182. <div className="clearfix">
  1183. <h3 style={{ marginLeft: 20, fontWeight: 800, marginBottom: 10 }}>
  1184. 收款情况
  1185. </h3>
  1186. <div style={{ marginLeft: "90px" }}>
  1187. <ul style={{ fontSize: "12px", color: "rgba(0, 0, 0, 0.65)" }}>
  1188. {(this.props.proceedsData.bill || []).map((item, index) => (
  1189. <li key={index}>
  1190. {item.payTime +
  1191. " " +
  1192. item.aName +
  1193. " 收款:" +
  1194. item.transactionAmount +
  1195. "万元"}
  1196. </li>
  1197. ))}
  1198. </ul>
  1199. <div>收款总计:{this.props.proceedsTotal}万元</div>
  1200. </div>
  1201. <br />
  1202. <div style={{ marginLeft: "90px" }}>
  1203. <ul style={{ fontSize: "12px", color: "rgba(0, 0, 0, 0.65)" }}>
  1204. {(this.props.proceedsData.invoice || []).map((item, index) => (
  1205. <li key={index}>
  1206. {item.createTime + " " + " 开票:" + item.amount + "万元"}
  1207. </li>
  1208. ))}
  1209. </ul>
  1210. <div>开票总计:{this.props.invoiceTotal}万元</div>
  1211. </div>
  1212. <p style={{ marginLeft: "90px", color: "red" }}>
  1213. 系统预估 产生成本(万元):
  1214. {this.props.data.estimateCost
  1215. ? this.props.data.estimateCost
  1216. : "0"}{" "}
  1217. &nbsp;应退金额(万元):
  1218. {this.props.data.estimateRefundable
  1219. ? this.props.data.estimateRefundable
  1220. : "0"}
  1221. </p>
  1222. </div>
  1223. {/* {this.props.data.type === 0 ? (
  1224. <div>
  1225. <h3 style={{ marginLeft: 10, fontWeight: 800, marginBottom: 10 }}>
  1226. 当前项目进度(咨询师经理填写)
  1227. </h3>
  1228. {planData.map((item, index) => {
  1229. return <Itemlist key={index} pageData={item} />;
  1230. })}
  1231. </div>
  1232. ) : (
  1233. ""
  1234. )} */}
  1235. {/* 当前财务状态 */}
  1236. {(this.props.data.processState > 6 &&
  1237. this.props.data.processState <= 8) ||
  1238. (this.props.data.processState === 9 &&
  1239. this.props.data.status === 4) ||
  1240. (1 == 1) ? (
  1241. <div>
  1242. <h3 style={{ marginLeft: 20, fontWeight: 800, marginBottom: 10 }}>
  1243. 当前财务状态(财务填写)
  1244. </h3>
  1245. {/* <div className="clearfix">
  1246. <Form.Item
  1247. className="half-item"
  1248. label="收款时间"
  1249. labelCol={{ span: 8 }}
  1250. wrapperCol={{ span: 14 }}
  1251. >
  1252. <span>{this.props.data.paymentTimes}</span>
  1253. </Form.Item>
  1254. <Form.Item
  1255. className="half-item"
  1256. label="收款金额(万元)"
  1257. labelCol={{ span: 8 }}
  1258. wrapperCol={{ span: 14 }}
  1259. >
  1260. <span>{this.props.data.paymentAmount}</span>
  1261. </Form.Item>
  1262. </div>
  1263. <div className="clearfix">
  1264. <Form.Item
  1265. className="half-item"
  1266. label="开票时间"
  1267. labelCol={{ span: 8 }}
  1268. wrapperCol={{ span: 14 }}
  1269. >
  1270. <span>{this.props.data.invoiceTimes}</span>
  1271. </Form.Item>
  1272. <Form.Item
  1273. className="half-item"
  1274. label="开票金额(万元)"
  1275. labelCol={{ span: 8 }}
  1276. wrapperCol={{ span: 14 }}
  1277. >
  1278. <span>{this.props.data.invoiceAmount}</span>
  1279. </Form.Item>
  1280. </div> */}
  1281. {financeData.map((item, index) => {
  1282. return <Itemlist key={index} pageData={item} />;
  1283. })}
  1284. </div>
  1285. ) : (
  1286. <div style={{ marginBottom: 10 }}>
  1287. <h3 style={{ marginLeft: 10, fontWeight: 800, marginBottom: 10 }}>
  1288. 当前财务状态(财务填写)
  1289. </h3>
  1290. <div className="clearfix">
  1291. {/* <Form.Item
  1292. className="half-item"
  1293. label="收款时间"
  1294. labelCol={{ span: 8 }}
  1295. wrapperCol={{ span: 14 }}
  1296. >
  1297. <DatePicker
  1298. style={{ width: 160 }}
  1299. value={
  1300. this.state.paymentTimes
  1301. ? moment(this.state.paymentTimes)
  1302. : null
  1303. }
  1304. onChange={(_data, dataString) => {
  1305. this.setState({
  1306. paymentTimes: dataString
  1307. });
  1308. }}
  1309. />
  1310. </Form.Item>
  1311. <Form.Item
  1312. className="half-item"
  1313. label="收款金额(万元)"
  1314. labelCol={{ span: 8 }}
  1315. wrapperCol={{ span: 14 }}
  1316. >
  1317. <Input
  1318. style={{ width: 160 }}
  1319. value={this.state.paymentAmount}
  1320. placeholder="请输入收款金额"
  1321. onChange={e => {
  1322. this.setState({
  1323. paymentAmount: e.target.value
  1324. });
  1325. }}
  1326. />
  1327. </Form.Item>
  1328. </div>
  1329. <div className="clearfix">
  1330. <Form.Item
  1331. className="half-item"
  1332. label="开票时间"
  1333. labelCol={{ span: 8 }}
  1334. wrapperCol={{ span: 14 }}
  1335. >
  1336. <DatePicker
  1337. style={{ width: 160 }}
  1338. value={
  1339. this.state.invoiceTimes
  1340. ? moment(this.state.invoiceTimes)
  1341. : null
  1342. }
  1343. onChange={(_data, dataString) => {
  1344. this.setState({
  1345. invoiceTimes: dataString
  1346. });
  1347. }}
  1348. />
  1349. </Form.Item>
  1350. <Form.Item
  1351. className="half-item"
  1352. label="开票金额(万元)"
  1353. labelCol={{ span: 8 }}
  1354. wrapperCol={{ span: 14 }}
  1355. >
  1356. <Input
  1357. style={{ width: 160 }}
  1358. value={this.state.invoiceAmount}
  1359. placeholder="请输入开票金额"
  1360. onChange={e => {
  1361. this.setState({
  1362. invoiceAmount: e.target.value
  1363. });
  1364. }}
  1365. />
  1366. </Form.Item> */}
  1367. <Form.Item
  1368. className="half-item"
  1369. label="发生成本(万元)"
  1370. labelCol={{ span: 8 }}
  1371. wrapperCol={{ span: 14 }}
  1372. >
  1373. <Input
  1374. style={{ width: 160 }}
  1375. value={this.state.cwCost}
  1376. placeholder="请输入发生成本"
  1377. onChange={(e) => {
  1378. this.setState({
  1379. cwCost: e.target.value,
  1380. });
  1381. }}
  1382. />
  1383. </Form.Item>
  1384. <Form.Item
  1385. className="half-item"
  1386. label="应退金额(万元)"
  1387. labelCol={{ span: 8 }}
  1388. wrapperCol={{ span: 14 }}
  1389. >
  1390. <Input
  1391. style={{ width: 160 }}
  1392. value={this.state.refundableAmount}
  1393. placeholder="请输入应退金额"
  1394. onChange={(e) => {
  1395. this.setState({
  1396. refundableAmount: e.target.value,
  1397. });
  1398. }}
  1399. />
  1400. </Form.Item>
  1401. </div>
  1402. {/* <div
  1403. style={{
  1404. marginTop: "10px",
  1405. display:
  1406. this.props.data.processState == 5 &&
  1407. this.props.data.status == 2
  1408. ? "none"
  1409. : "block"
  1410. }}
  1411. >
  1412. <Form.Item
  1413. label="备注"
  1414. labelCol={{ span: 4 }}
  1415. wrapperCol={{ span: 14 }}
  1416. >
  1417. <Input.TextArea
  1418. rows={4}
  1419. value={this.state.reason}
  1420. placeholder="请输入补充资料/备注"
  1421. onChange={e => {
  1422. this.setState({
  1423. reason: e.target.value
  1424. });
  1425. }}
  1426. />
  1427. </Form.Item>
  1428. </div> */}
  1429. </div>
  1430. )}
  1431. {/* 回收退票3 */}
  1432. <div
  1433. style={{
  1434. display:
  1435. (this.props.data.processState == 9 ||
  1436. this.props.data.processState == 8) &&
  1437. (this.props.data.status == 2 || this.props.data.status == 4 || this.props.data.status == 3 || this.props.data.status == 6)
  1438. ? "block"
  1439. : "none",
  1440. marginTop: '10px'
  1441. }}
  1442. >
  1443. <h3 style={{ marginLeft: 20, fontWeight: 800, marginBottom: 10 }}>
  1444. 回收退票
  1445. </h3>
  1446. <Table
  1447. size="middle"
  1448. pagination={false}
  1449. bordered
  1450. columns={this.state.ContactsLists}
  1451. dataSource={this.state.contactList}
  1452. />
  1453. </div>
  1454. <ul
  1455. style={{
  1456. margin: "10px 0 0 20px",
  1457. color: "red",
  1458. display:
  1459. (this.props.data.processState == 8 ||
  1460. this.props.data.processState == 9) &&
  1461. (this.props.data.status == 4 || this.props.data.status == 2 || this.props.data.status == 3 || this.props.data.status == 6)
  1462. ? "inline-block"
  1463. : "none",
  1464. }}
  1465. >
  1466. <li>
  1467. {"本次应收退票(万元):" +
  1468. (this.props.data.refundableAmount == null
  1469. ? 0
  1470. : this.props.data.refundableAmount)}
  1471. </li>
  1472. <li>
  1473. {"累计已回收退票(万元):" +
  1474. (this.state.refundInvoice == null
  1475. ? 0
  1476. : this.state.refundInvoice)}
  1477. </li>
  1478. </ul>
  1479. {/* 完成审核,上传附件 */}
  1480. <div style={{
  1481. position: "relative",
  1482. display:
  1483. (this.props.data.processState == 8 ||
  1484. this.props.data.processState == 9) &&
  1485. this.props.data.status == 2 || this.props.data.status == 4 || this.props.data.status == 3 || this.props.data.status == 6
  1486. ? "block"
  1487. : "none",
  1488. marginTop: 10,
  1489. }}
  1490. >
  1491. <hr
  1492. style={{
  1493. marginTop: 12,
  1494. marginBottom: 10,
  1495. backgroundColor: "black",
  1496. height: 1,
  1497. border: "none",
  1498. }}
  1499. />
  1500. <h3
  1501. style={{
  1502. marginLeft: 20,
  1503. fontWeight: 800,
  1504. marginBottom: 10,
  1505. display: "inline-block",
  1506. }}
  1507. >
  1508. 完成审核,上传附件{" "}
  1509. <span
  1510. style={{ fontSize: 12, fontWeight: "normal", color: "red" }}
  1511. >
  1512. (注:由营销员上传变更后附件,全变更流程完成。)
  1513. </span>
  1514. </h3>
  1515. <div>
  1516. <Form.Item
  1517. label="变更附件"
  1518. labelCol={{ span: 4 }}
  1519. wrapperCol={{ span: 18 }}
  1520. >
  1521. <div style={{ paddingTop: '10px', paddingBottom: '10px' }}>
  1522. {attachment.length > 0 ? <ImgList domId={this.props.domId + 2 ? this.props.domId + 2 : 'changeDetailCwjlqq1'} fileList={attachment} ItemWidth={'96px'} /> : '无附件'}
  1523. </div>
  1524. <Modal
  1525. maskClosable={false}
  1526. footer={null}
  1527. width={"50%"}
  1528. visible={this.state.previewVisible}
  1529. onCancel={() => {
  1530. this.setState({ previewVisible: false, rotateDeg: 0 }, () => {
  1531. // this.reset();
  1532. });
  1533. }}
  1534. >
  1535. <img
  1536. alt=""
  1537. style={{
  1538. width: "100%",
  1539. transform: `rotate(${this.state.rotateDeg}deg)`,
  1540. }}
  1541. src={this.state.previewImage || ""}
  1542. />
  1543. <Button
  1544. onClick={this.rotate}
  1545. style={{
  1546. position: "relative",
  1547. left: "50%",
  1548. transform: "translateX(-50%)",
  1549. }}
  1550. >
  1551. 旋转
  1552. </Button>
  1553. <Button
  1554. onClick={this.upImg}
  1555. style={{
  1556. position: "absolute",
  1557. left: -81,
  1558. top: "50%",
  1559. transform: "translateY(-50%)",
  1560. }}
  1561. >
  1562. 上一张
  1563. </Button>
  1564. <Button
  1565. onClick={this.downImg}
  1566. style={{
  1567. position: "absolute",
  1568. right: -81,
  1569. top: "50%",
  1570. transform: "translateY(-50%)",
  1571. }}
  1572. >
  1573. 下一张
  1574. </Button>
  1575. </Modal>
  1576. {/* <Rizhi changeId={this.props.id} /> */}
  1577. </Form.Item>
  1578. </div>
  1579. </div>
  1580. {/* <div
  1581. style={{
  1582. position: "relative",
  1583. display:
  1584. (this.props.data.processState == 7 ||
  1585. this.props.data.processState == 8) &&
  1586. this.props.data.status == 4 && !this.props.data.refundStatus
  1587. ? "block"
  1588. : "none",
  1589. marginTop: 10
  1590. }}
  1591. >
  1592. <hr style={{ marginTop: 12, marginBottom: 10, backgroundColor: "black", height: 1, border: "none" }} />
  1593. <h3 style={{ marginLeft: 20, fontWeight: 800, marginBottom: 10, display: "inline-block" }}>
  1594. 执行退款 <span style={{ fontSize: 12, fontWeight: "normal", color: "red" }}>(注:执行退款,系统将从已收款金额中直接减款)</span>
  1595. </h3>
  1596. <Button onClick={this.addRefund} style={{ float: "right" }}>添加执行退款</Button>
  1597. <Table
  1598. pagination={false}
  1599. bordered
  1600. columns={this.state.refundColumn}
  1601. dataSource={this.state.refundDataSource}
  1602. scroll={{ x: "max-content", y: 0 }}
  1603. size="small"
  1604. />
  1605. <div className="clearfix">
  1606. <h3 style={{ marginLeft: 20, fontWeight: 800, marginBottom: 10 }}>
  1607. 上传退款凭证
  1608. </h3>
  1609. <div style={{ marginLeft: 20 }}>
  1610. <PicturesWall
  1611. fileList={this.getVoucherUrl}
  1612. pictureUrl={this.state.voucherUrl}
  1613. url="/api/admin/orderChange/uploadRefund"
  1614. sign="order_change_file"
  1615. />
  1616. </div>
  1617. </div>
  1618. <Button type="primary" onClick={this.refundExecute} style={{ position: "relative", left: "50%", transform: "translateX(-50%)" }}>确定执行退款</Button>
  1619. </div> */}
  1620. <div
  1621. style={{
  1622. display:
  1623. (this.props.data.processState == 8 ||
  1624. this.props.data.processState == 9) &&
  1625. this.props.data.status == 4 &&
  1626. this.props.data.refundStatus
  1627. ? "block"
  1628. : "none",
  1629. }}
  1630. >
  1631. <Refund
  1632. data={this.props.data}
  1633. id={this.props.id}
  1634. dataSource={this.state.refundDataSource}
  1635. />
  1636. </div>
  1637. </div>
  1638. {/* {!(
  1639. (this.props.data.processState > 5 &&
  1640. this.props.data.processState <= 8) ||
  1641. (this.props.data.processState === 9 && this.props.data.status === 4)
  1642. ) ? (
  1643. this.state.buttonStatus ? (
  1644. <div>
  1645. <div
  1646. className="clearfix"
  1647. style={{ display: "flex", justifyContent: "space-around" }}
  1648. >
  1649. {buttonData.map((item, index) => {
  1650. return (
  1651. <AgreeButton
  1652. data={item}
  1653. key={index}
  1654. backData={this.props.data}
  1655. processState={this.props.processState}
  1656. visible={this.changeButtonStatus}
  1657. ajaxData={this.state}
  1658. loadData={this.props.loadData}
  1659. rejectState={this.state.rejectState}
  1660. reason={this.state.reason}
  1661. onCancel={this.props.onCancel}
  1662. />
  1663. );
  1664. })}
  1665. </div>
  1666. <Select
  1667. defaultValue="0"
  1668. style={{
  1669. width: 120,
  1670. float: "left",
  1671. position: "relative",
  1672. bottom: "28px",
  1673. right: "-600px"
  1674. }}
  1675. onChange={val => {
  1676. this.setState({ rejectState: val });
  1677. // console.log(val, this.state.rejectState);
  1678. }}
  1679. >
  1680. <Option
  1681. value="0"
  1682. style={{
  1683. display: this.props.processState >= 1 ? "block" : "none"
  1684. }}
  1685. >
  1686. 营销员
  1687. </Option>
  1688. <Option
  1689. value="1"
  1690. style={{
  1691. display: this.props.processState >= 2 ? "block" : "none"
  1692. }}
  1693. >
  1694. 营销管理员
  1695. </Option>
  1696. <Option
  1697. value="2"
  1698. style={{
  1699. display: this.props.processState >= 3 ? "block" : "none"
  1700. }}
  1701. >
  1702. 咨询师
  1703. </Option>
  1704. <Option
  1705. value="3"
  1706. style={{
  1707. display: this.props.processState >= 4 ? "block" : "none"
  1708. }}
  1709. >
  1710. 咨询师经理
  1711. </Option>
  1712. <Option
  1713. value="4"
  1714. style={{
  1715. display: this.props.processState >= 5 ? "block" : "none"
  1716. }}
  1717. >
  1718. 咨询师总监
  1719. </Option>
  1720. <Option
  1721. value="5"
  1722. style={{
  1723. display: this.props.processState >= 6 ? "block" : "none"
  1724. }}
  1725. >
  1726. 财务专员(退单)
  1727. </Option>
  1728. <Option
  1729. value="6"
  1730. style={{
  1731. display: this.props.processState >= 7 ? "block" : "none"
  1732. }}
  1733. >
  1734. 财务总监
  1735. </Option>
  1736. <Option
  1737. value="7"
  1738. style={{
  1739. display: this.props.processState >= 8 ? "block" : "none"
  1740. }}
  1741. >
  1742. 总裁
  1743. </Option>
  1744. </Select>
  1745. </div>
  1746. ) : (
  1747. ""
  1748. )
  1749. ) : (
  1750. ""
  1751. )} */}
  1752. {/* <Button
  1753. type="primary"
  1754. shape="round"
  1755. size="large"
  1756. style={{
  1757. position: "absolute",
  1758. left: "50%",
  1759. bottom: "0",
  1760. transform: "translateX(-50%)",
  1761. display:
  1762. (this.props.data.processState == 7 ||
  1763. this.props.data.processState == 8) &&
  1764. this.props.data.status == 2
  1765. ? "block"
  1766. : "none"
  1767. }}
  1768. onClick={this.finish}
  1769. >
  1770. 完成订单
  1771. </Button> */}
  1772. <ReactToPrint
  1773. trigger={() => (
  1774. <Button
  1775. type="primary"
  1776. style={{
  1777. float: "right",
  1778. marginTop: 10,
  1779. position: "absolute",
  1780. top: 0,
  1781. right: 30,
  1782. display:
  1783. (this.props.data.processState == 8 ||
  1784. this.props.data.processState == 9) &&
  1785. this.props.data.status == 4
  1786. ? "block"
  1787. : "block",
  1788. }}
  1789. >
  1790. 打印
  1791. </Button>
  1792. )}
  1793. content={() => this.refs}
  1794. />
  1795. <Modal
  1796. maskClosable={false}
  1797. visible={this.state.addRefundVisible}
  1798. onOk={this.refundCancel}
  1799. onCancel={this.refundCancel}
  1800. width="700px"
  1801. title="添加执行退款"
  1802. footer=""
  1803. className="admin-desc-content"
  1804. >
  1805. <Form
  1806. layout="horizontal"
  1807. onSubmit={this.nextSubmit}
  1808. // id="demand-form"
  1809. >
  1810. <Spin spinning={this.state.loading}>
  1811. <div className="clearfix">
  1812. <FormItem
  1813. className="half-item"
  1814. {...formItemLayoutRefund}
  1815. label="退款金额"
  1816. >
  1817. <Input
  1818. style={{ width: "155px" }}
  1819. placeholder="请输入退款金额"
  1820. value={this.state.refundMoney}
  1821. onChange={(e) => {
  1822. this.setState({
  1823. refundMoney: e.target.value,
  1824. });
  1825. }}
  1826. />
  1827. </FormItem>
  1828. <FormItem
  1829. className="half-item"
  1830. {...formItemLayoutRefund}
  1831. label="退款时间"
  1832. >
  1833. <DatePicker
  1834. value={
  1835. this.state.refundDate
  1836. ? moment(this.state.refundDate)
  1837. : null
  1838. }
  1839. onChange={(date, dateString) => {
  1840. this.setState({
  1841. refundDate: dateString,
  1842. });
  1843. }}
  1844. />
  1845. </FormItem>
  1846. <FormItem
  1847. style={{ height: "auto" }}
  1848. labelCol={{ span: 3 }}
  1849. wrapperCol={{ span: 19 }}
  1850. label="备注"
  1851. >
  1852. <TextArea
  1853. rows={4}
  1854. placeholder="请输入备注信息"
  1855. style={{ width: "95%" }}
  1856. value={this.state.refundRemarks}
  1857. onChange={(e) => {
  1858. this.setState({
  1859. refundRemarks: e.target.value,
  1860. });
  1861. }}
  1862. />
  1863. </FormItem>
  1864. <FormItem
  1865. wrapperCol={{ span: 12, offset: 6 }}
  1866. className="half-middle"
  1867. style={{ marginTop: 10 }}
  1868. >
  1869. <Button
  1870. className="submitSave"
  1871. type="primary"
  1872. onClick={this.sumitRefund}
  1873. >
  1874. 保存
  1875. </Button>
  1876. <Button
  1877. className="submitSave"
  1878. type="ghost"
  1879. style={{ marginLeft: 10 }}
  1880. onClick={this.refundCancel}
  1881. >
  1882. 取消
  1883. </Button>
  1884. </FormItem>
  1885. </div>
  1886. </Spin>
  1887. </Form>
  1888. </Modal>
  1889. </div>
  1890. );
  1891. }
  1892. }
  1893. export { ChangeDetail };