changeDetailCwzy.js 59 KB

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