changeDetailCwzy.js 42 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492
  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. } from "antd";
  14. import AgreeButton from "./agreeButton.js";
  15. import Rizhi from "./rizhi.js";
  16. import moment from "moment";
  17. import { getProcessStatusNew, moneyVerify } from "@/tools.js";
  18. import { shenghePeo } from "@/tools.js";
  19. import $ from "jquery/src/ajax";
  20. import ReactToPrint from "react-to-print";
  21. import tongguo from "../../../../../../image/tongguo.png";
  22. const { RangePicker } = DatePicker;
  23. const formItemLayout = {
  24. labelCol: { span: 8 },
  25. wrapperCol: { span: 14 }
  26. };
  27. const changeType = [
  28. {
  29. value: "0",
  30. key: "退单退款"
  31. },
  32. {
  33. value: "1",
  34. key: "项目及金额变更"
  35. },
  36. {
  37. value: "2",
  38. key: "仅项目变更"
  39. },
  40. {
  41. value: "3",
  42. key: "仅金额变更"
  43. },
  44. {
  45. value: "4",
  46. key: "重报"
  47. },
  48. {
  49. value: "5",
  50. key: "赠送"
  51. }
  52. ];
  53. const getChangeType = function(e) {
  54. if (e || e == 0) {
  55. let str = e.toString();
  56. let theType = "";
  57. changeType.map(function(item) {
  58. if (item.value == str) {
  59. theType = item.key;
  60. }
  61. });
  62. return theType;
  63. }
  64. };
  65. class Itemlist extends Component {
  66. constructor(props) {
  67. super(props);
  68. }
  69. render() {
  70. let pageData = this.props.pageData;
  71. return (
  72. <div className="clearfix">
  73. <Form.Item
  74. label={pageData.labelA}
  75. {...pageData.formItemLayoutA}
  76. className="half-item"
  77. style={{ marginBottom: "-5px" }}
  78. >
  79. <p style={{ width: 731, wordWrap: "break-word" }}>{pageData.dataA}</p>
  80. </Form.Item>
  81. <Form.Item
  82. label={pageData.labelB}
  83. {...pageData.formItemLayoutB}
  84. className="half-item"
  85. style={{ marginBottom: "-5px" }}
  86. >
  87. <span>{pageData.dataB}</span>
  88. </Form.Item>
  89. </div>
  90. );
  91. }
  92. }
  93. class ItemInput extends Component {
  94. constructor(props) {
  95. super(props);
  96. this.state = {
  97. valueA: "",
  98. valueB: ""
  99. };
  100. }
  101. componentWillReceiveProps(nextProps) {
  102. if (!nextProps.reset) {
  103. this.reset();
  104. }
  105. }
  106. reset() {
  107. this.setState({
  108. valueA: "",
  109. valueB: ""
  110. });
  111. }
  112. render() {
  113. let pageData = this.props.pageData;
  114. return (
  115. <div className="clearfix">
  116. <Form.Item
  117. label={pageData.labelA}
  118. {...pageData.formItemLayoutA}
  119. className="half-item"
  120. >
  121. <Input
  122. value={this.state.valueA}
  123. placeholder={"请输入" + pageData.labelA}
  124. style={{ width: 160 }}
  125. onChange={e => {
  126. this.setState({ valueA: e.target.value });
  127. pageData.onChangeA(e.target.value);
  128. }}
  129. />
  130. </Form.Item>
  131. <Form.Item
  132. label={pageData.labelB}
  133. {...pageData.formItemLayoutB}
  134. className="half-item"
  135. >
  136. {pageData.mark ? (
  137. <Input
  138. value={this.state.valueB}
  139. placeholder={"请输入" + pageData.labelB}
  140. style={{ width: 160 }}
  141. onChange={e => {
  142. this.setState({ valueB: e.target.value });
  143. pageData.onChangeB(e.target.value);
  144. }}
  145. />
  146. ) : (
  147. ""
  148. )}
  149. </Form.Item>
  150. </div>
  151. );
  152. }
  153. }
  154. class ChangeDetail extends Component {
  155. constructor(props) {
  156. super(props);
  157. this.state = {
  158. rotateDeg: 0,
  159. previewVisible: false,
  160. buttonStatus: true,
  161. changeType: 2,
  162. dataSource: [],
  163. reason: "",
  164. // 累计回收退票
  165. refundInvoice: 0,
  166. // 退票数组
  167. contactList: [],
  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. ContactsLists: [
  180. {
  181. title: "金额(万)",
  182. dataIndex: "amount",
  183. key: "amount",
  184. render: (text, record) => {
  185. return (
  186. <div>
  187. 实际回收退票(万元)
  188. <Input
  189. value={record.amount}
  190. placeholder="请输入金额(必填项)"
  191. disabled={record.load}
  192. key={record.id}
  193. required="required"
  194. onChange={e => {
  195. record.amount = e.target.value;
  196. this.setState({ contactList: this.state.contactList });
  197. }}
  198. style={{ width: "120px" }}
  199. />
  200. </div>
  201. );
  202. }
  203. },
  204. {
  205. title: "时间",
  206. dataIndex: "createTimes",
  207. key: "createTimes",
  208. render: (text, record) => {
  209. return (
  210. <div>
  211. {/* <DatePicker
  212. showTime
  213. placeholder="请输入退票时间"
  214. onChange={v => {
  215. record.time = v._d;
  216. this.setState({ contactList: this.state.contactList });
  217. }}
  218. onOk={v => {
  219. record.time = v._d;
  220. this.setState({ contactList: this.state.contactList });
  221. console.log(this.state);
  222. }}
  223. /> */}
  224. {record.createTimes}
  225. </div>
  226. );
  227. }
  228. },
  229. {
  230. title: "操作",
  231. dataIndex: "dels",
  232. key: "dels",
  233. render: (text, record, index) => {
  234. return (
  235. <div
  236. style={{
  237. display:
  238. (this.props.data.processState == 7 ||
  239. this.props.data.processState == 8) &&
  240. this.props.data.status == 4
  241. ? "none"
  242. : "block"
  243. }}
  244. >
  245. <Popconfirm
  246. title="是否删除?"
  247. onConfirm={() => {
  248. this.confirmDelet(record);
  249. }}
  250. okText="删除"
  251. cancelText="不删除"
  252. >
  253. <Button
  254. style={{
  255. marginRight: "10px",
  256. color: "#ffffff",
  257. background: "#f00",
  258. border: "none"
  259. }}
  260. >
  261. 删除
  262. </Button>
  263. </Popconfirm>
  264. {record.load != true ? (
  265. <Button
  266. type="primary"
  267. onClick={() => {
  268. this.contactSave(record);
  269. }}
  270. >
  271. 保存
  272. </Button>
  273. ) : (
  274. ""
  275. )}
  276. </div>
  277. );
  278. }
  279. }
  280. ]
  281. };
  282. this.getOrgCodeUrl = this.getOrgCodeUrl.bind(this);
  283. this.changeButtonStatus = this.changeButtonStatus.bind(this);
  284. this.reset = this.reset.bind(this);
  285. this.addcontact = this.addcontact.bind(this);
  286. this.contactSave = this.contactSave.bind(this);
  287. this.confirmDelet = this.confirmDelet.bind(this);
  288. this.finish = this.finish.bind(this);
  289. this.reload = this.reLoad.bind(this);
  290. this.downImg = this.downImg.bind(this);
  291. this.upImg = this.upImg.bind(this);
  292. this.rotate = this.rotate.bind(this);
  293. }
  294. componentWillReceiveProps(nextProps) {
  295. this.setState({
  296. paymentTimes: nextProps.data.paymentTimes,
  297. paymentAmount: nextProps.data.paymentAmount,
  298. invoiceTimes: nextProps.data.invoiceTimes,
  299. invoiceAmount: nextProps.data.invoiceAmount,
  300. cwCost: nextProps.data.cwCost,
  301. refundableAmount: nextProps.data.refundableAmount,
  302. cwRemarks: nextProps.data.cwRemarks,
  303. contactList: nextProps.contactList,
  304. refundInvoice: nextProps.data.refundInvoice
  305. });
  306. if (!nextProps.reset) {
  307. this.reset();
  308. }
  309. }
  310. componentDidMount() {
  311. window.setTimeout(() => {
  312. const contactList = this.props.contactList;
  313. contactList.forEach(item => {
  314. item.load = true;
  315. });
  316. this.setState({
  317. contactList
  318. });
  319. }, 0);
  320. }
  321. // componentDidMount() {
  322. // console.log("--",this.props.dataSource[0].orderNo);
  323. // $.ajax({
  324. // method: "post",
  325. // dataType: "json",
  326. // crossDomain: false,
  327. // url:
  328. // globalConfig.context +
  329. // "/api/admin/orderChange/listOrderInvoiceAndBill",
  330. // data: {
  331. // orderNo: this.props.dataSource[0].orderNo,
  332. // },
  333. // success: function(data) {
  334. // console.log("看看",this.props);
  335. // }.bind(this)
  336. // });
  337. // }
  338. downImg() {
  339. let num = 0;
  340. for (let i = 0; i < this.props.pictureUrl.length; i++) {
  341. if (this.props.pictureUrl[i].url == this.state.previewImage) {
  342. num = i;
  343. }
  344. }
  345. if (num == this.props.pictureUrl.length - 1) {
  346. return message.warning("已经是最后一张了哦");
  347. }
  348. this.state.previewImage = this.props.pictureUrl[num + 1].url;
  349. this.setState({
  350. previewImage: this.state.previewImage,
  351. rotateDeg: 0
  352. });
  353. }
  354. upImg() {
  355. let num = 0;
  356. for (let i = 0; i < this.props.pictureUrl.length; i++) {
  357. if (this.props.pictureUrl[i].url == this.state.previewImage) {
  358. num = i;
  359. }
  360. }
  361. if (num == 0) {
  362. return message.warning("已经是第一张了哦");
  363. }
  364. this.state.previewImage = this.props.pictureUrl[num - 1].url;
  365. this.setState({
  366. previewImage: this.state.previewImage,
  367. rotateDeg: 0
  368. });
  369. }
  370. rotate() {
  371. let rotateDeg = this.state.rotateDeg + 90;
  372. this.setState({
  373. rotateDeg
  374. });
  375. }
  376. reset() {
  377. this.setState({
  378. paymentTimes: null,
  379. paymentAmount: "",
  380. invoiceTimes: null,
  381. invoiceAmount: "",
  382. cwCost: "",
  383. refundableAmount: "",
  384. cwRemarks: ""
  385. });
  386. }
  387. getOrgCodeUrl(e) {
  388. this.setState({
  389. orgCodeUrl: e
  390. });
  391. }
  392. // //查看催款节点
  393. // loaduserss(record) {
  394. // this.state.orderList = [];
  395. // this.setState({
  396. // orderNoss: record ? record.orderNo : this.props.datauser.orderNo
  397. // });
  398. // $.ajax({
  399. // method: "get",
  400. // dataType: "json",
  401. // crossDomain: false,
  402. // url: globalConfig.context + "/api/admin/newOrder/selectOrderDun",
  403. // data: {
  404. // orderNo: record ? record.orderNo : this.props.datauser.orderNo
  405. // },
  406. // success: function(data) {
  407. // let theArr = [];
  408. // let thisData = [];
  409. // if (!thisData) {
  410. // if (data.error && data.error.length) {
  411. // message.warning(data.error[0].message);
  412. // }
  413. // thisData = {};
  414. // } else {
  415. // for (let i = 0; i < data.data.length; i++) {
  416. // thisData = data.data[i];
  417. // theArr.push({
  418. // key: i,
  419. // dunSubject: thisData.dunSubject
  420. // ? thisData.dunSubject.toString()
  421. // : "", //催款科目
  422. // id: thisData.id, //节点Id
  423. // money: thisData.money, //催款金额
  424. // dunStatus: thisData.dunStatus, //催款状态
  425. // orderNo: record ? record.orderNo : this.props.datauser.orderNo
  426. // });
  427. // }
  428. // this.setState({
  429. // contactList: theArr
  430. // });
  431. // }
  432. // }.bind(this)
  433. // }).always(
  434. // function() {
  435. // this.setState({
  436. // loading: false
  437. // });
  438. // }.bind(this)
  439. // );
  440. // }
  441. timestampToTime(timestamp) {
  442. var date = new Date(timestamp); //时间戳为10位需*1000,时间戳为13位的话不需乘1000
  443. var Y = date.getFullYear() + "-";
  444. var M =
  445. (date.getMonth() + 1 < 10
  446. ? "0" + (date.getMonth() + 1)
  447. : date.getMonth() + 1) + "-";
  448. var D = date.getDate() + " ";
  449. var h = date.getHours() + ":";
  450. var m = date.getMinutes() + ":";
  451. var s = date.getSeconds();
  452. return Y + M + D + h + m + s;
  453. }
  454. reLoad() {
  455. $.ajax({
  456. method: "get",
  457. dataType: "json",
  458. crossDomain: false,
  459. url:
  460. globalConfig.context + "/api/admin/orderChange/listOrderRefundInvoice",
  461. data: {
  462. orderNo: this.props.data.orderNo
  463. },
  464. success: data => {
  465. if (!data) return;
  466. data.data.forEach(item => {
  467. item.load = true;
  468. });
  469. this.setState({
  470. contactList: data.data
  471. });
  472. }
  473. });
  474. }
  475. // 完成订单
  476. finish() {
  477. $.ajax({
  478. url: globalConfig.context + "/api/admin/orderChange/completeOrderChange",
  479. method: "get",
  480. data: {
  481. orderNo: this.props.data.orderNo,
  482. type: this.props.data.type,
  483. id: this.props.data.id
  484. },
  485. success: data => {
  486. if (data) {
  487. message.success("保存成功!");
  488. window.location.reload();
  489. }
  490. }
  491. });
  492. }
  493. 催款节点保存;
  494. contactSave(index) {
  495. if (this.state.contactList) {
  496. let Data = this.state.contactList;
  497. for (var a = 0; a < Data.length; a++) {
  498. if (Data[a].amount == "") {
  499. message.warning("退票金额不能为空");
  500. // this.refs.signFirstPayment.focus();
  501. return false;
  502. }
  503. }
  504. }
  505. // this.setState({
  506. // loading: true
  507. // });
  508. $.ajax({
  509. url:
  510. globalConfig.context + "/api/admin/orderChange/addOrderRefundInvoice",
  511. method: "post",
  512. data: {
  513. orderNo: this.props.data.orderNo,
  514. amount: index.amount
  515. }
  516. }).done(
  517. function(data) {
  518. if (!data.error.length) {
  519. message.success("保存成功!");
  520. let num = 0;
  521. this.state.contactList.forEach(item => {
  522. num += +item.amount;
  523. // if (item.key == index.key) {
  524. // item.load = true;
  525. // let time = this.timestampToTime(new Date().getTime());
  526. // item.createTimes = time;
  527. // }
  528. });
  529. this.setState({
  530. contactList: this.state.contactList,
  531. refundInvoice: num
  532. });
  533. this.reLoad();
  534. console.log("bug", this.state);
  535. } else {
  536. message.warning(data.error[0].message);
  537. }
  538. }.bind(this)
  539. );
  540. }
  541. //点击新增催款节点
  542. addcontact() {
  543. // let key = this.state.contactList.length
  544. // if(key == 0) {
  545. // key
  546. // }
  547. this.state.contactList.push({
  548. key: this.state.contactList.length,
  549. amount: "",
  550. createTime: undefined
  551. // orderNo: this.state.orderNoss,
  552. // dunTarget: this.state.kehuId
  553. });
  554. this.setState({
  555. contactList: this.state.contactList
  556. });
  557. }
  558. //删除收款节点
  559. confirmDelet(index) {
  560. // if (index.id) {
  561. // this.state.contactList.splice(index.key, 1);
  562. // this.setState({
  563. // contactList: this.state.contactList
  564. // });
  565. // this.contactSave();
  566. // } else {
  567. // this.state.contactList.splice(index.key, 1);
  568. // this.setState({
  569. // contactList: this.state.contactList
  570. // });
  571. // }
  572. // if(this.state.contactList.length == 1) {
  573. // this.state.contactList = []
  574. // this.setState({
  575. // contactList: this.state.contactList
  576. // });
  577. // return
  578. // }
  579. // let num = index.key
  580. // if (this.state.contactList[num + 1].key) {
  581. // this.state.contactList[num + 1].key = index.key;
  582. // }
  583. if (index.key) {
  584. let num = this.state.contactList.findIndex(item => item.key == index.key);
  585. this.state.contactList.splice(num, 1);
  586. let total = 0;
  587. this.state.contactList.forEach(item => {
  588. total += +item.amount;
  589. });
  590. this.setState({
  591. contactList: this.state.contactList,
  592. refundInvoice: total
  593. });
  594. return;
  595. }
  596. $.ajax({
  597. url:
  598. globalConfig.context +
  599. "/api/admin/orderChange/deleteOrderRefundInvoice",
  600. method: "post",
  601. data: {
  602. id: index.id
  603. }
  604. }).done(
  605. function(data) {
  606. if (!data.error.length) {
  607. message.success("保存成功!");
  608. let num = this.state.contactList.findIndex(
  609. item => item.id == index.id
  610. );
  611. this.state.contactList.splice(num, 1);
  612. let total = 0;
  613. this.state.contactList.forEach(item => {
  614. total += +item.amount;
  615. });
  616. this.setState({
  617. contactList: this.state.contactList,
  618. refundInvoice: total
  619. });
  620. } else {
  621. message.warning(data.error[0].message);
  622. }
  623. }.bind(this)
  624. );
  625. // console.log(this.state.contactList[num + 1].key);
  626. }
  627. // loadData() {
  628. // $.ajax({
  629. // method: "get",
  630. // dataType: "json",
  631. // async: false,
  632. // crossDomain: false,
  633. // url: globalConfig.context + "/api/admin/orderChange/orderChangeLogList",
  634. // data: {
  635. // changeId: this.props.data.id
  636. // },
  637. // success: function(data) {
  638. // if (data.error.length || data.data.list == "") {
  639. // if (data.error && data.error.length) {
  640. // message.warning(data.error[0].message);
  641. // }
  642. // } else {
  643. // this.setState({
  644. // dataSource: data.data
  645. // });
  646. // }
  647. // }.bind(this)
  648. // });
  649. // }
  650. //同意拒绝按钮的有无
  651. changeButtonStatus() {
  652. this.setState({
  653. buttonStatus: !this.state.buttonStatus
  654. });
  655. }
  656. onRef(ref) {
  657. this.fun = ref;
  658. }
  659. render() {
  660. const pageData = [
  661. {
  662. labelA: "客户名称",
  663. formItemLayoutA: formItemLayout,
  664. dataA: this.props.data.userName,
  665. labelB: "合同编号",
  666. formItemLayoutB: formItemLayout,
  667. dataB: this.props.data.contractNo
  668. },
  669. {
  670. labelA: "时间",
  671. formItemLayoutA: formItemLayout,
  672. dataA: this.props.data.createTimes,
  673. labelB: "发起人",
  674. formItemLayoutB: formItemLayout,
  675. dataB: this.props.data.applicant
  676. },
  677. {
  678. labelA: "当前进度",
  679. formItemLayoutA: formItemLayout,
  680. // 当前是咨询师以及咨询师经理时使用shenhePeo函数,其他流程正常显示
  681. dataA:
  682. this.props.data.processState == 2 || this.props.data.processState == 3
  683. ? shenghePeo(
  684. this.props.data.processState == 2
  685. ? this.props.data.consultantExamine
  686. : this.props.data.managerExamine,
  687. this.props.data.processState
  688. )
  689. : getProcessStatusNew(
  690. this.props.data.processState,
  691. this.props.data.status
  692. ),
  693. labelB: "变更类型",
  694. formItemLayoutB: formItemLayout,
  695. dataB: getChangeType(this.props.data.type)
  696. },
  697. {
  698. labelA: "合同额(万元)",
  699. formItemLayoutA: formItemLayout,
  700. dataA: this.props.data.totalAmount,
  701. labelB: "已收款(万元)",
  702. formItemLayoutB: formItemLayout,
  703. dataB: this.props.data.settlementAmount
  704. },
  705. {
  706. labelA: "欠款(万元)",
  707. formItemLayoutA: formItemLayout,
  708. dataA: this.props.data.arrears,
  709. labelB: "申请退款(万元)",
  710. formItemLayoutB: formItemLayout,
  711. dataB: this.props.data.changeAmount
  712. },
  713. {
  714. labelA: "变更原因",
  715. formItemLayoutA: formItemLayout,
  716. dataA: this.props.data.remarks
  717. }
  718. ];
  719. const planData = [
  720. {
  721. labelA: "项目进度",
  722. formItemLayoutA: formItemLayout,
  723. dataA: this.props.data.projectState,
  724. onChangeA: value => {
  725. this.setState({
  726. projectState: value
  727. });
  728. },
  729. labelB: "发生成本费用(万元)",
  730. formItemLayoutB: formItemLayout,
  731. dataB: this.props.data.zxsCost,
  732. onChangeB: value => {
  733. this.setState({
  734. zxsCost: value
  735. });
  736. }
  737. },
  738. {
  739. labelA: "备注",
  740. formItemLayoutA: formItemLayout,
  741. dataA: this.props.data.zxsRemarks,
  742. onChangeA: value => {
  743. this.setState({
  744. zxsRemarks: value
  745. });
  746. }
  747. }
  748. ];
  749. const financeData = [
  750. {
  751. labelA: "发生成本(万元)",
  752. formItemLayoutA: formItemLayout,
  753. dataA: this.props.data.cwCost ? this.props.data.cwCost : "0",
  754. onChangeA: value => {
  755. this.setState({
  756. cwCost: value
  757. });
  758. },
  759. labelB: "应退金额(万元)",
  760. formItemLayoutB: formItemLayout,
  761. dataB: this.props.data.refundableAmount
  762. ? this.props.data.refundableAmount
  763. : "0",
  764. onChangeB: value => {
  765. this.setState({
  766. refundableAmount: value
  767. });
  768. },
  769. mark: true
  770. }
  771. // {
  772. // labelA: "备注",
  773. // formItemLayoutA: formItemLayout,
  774. // dataA: this.props.data.cwRemarks,
  775. // onChangeA: value => {
  776. // this.setState({
  777. // reason: value
  778. // });
  779. // },
  780. // mark: false
  781. // }
  782. ];
  783. const buttonData = [
  784. {
  785. name: "同意",
  786. title: "理由",
  787. placeholder: "请输入理由",
  788. type: "primary",
  789. status: 2,
  790. onChange: value => {
  791. this.setState({
  792. remarks: value
  793. });
  794. }
  795. },
  796. {
  797. name: "拒绝",
  798. title: "理由",
  799. placeholder: "请输入理由",
  800. type: "danger",
  801. status: 3,
  802. onChange: value => {
  803. this.setState({
  804. remarks: value
  805. });
  806. }
  807. }
  808. ];
  809. const orgCodeUrl = this.props.pictureUrl;
  810. return (
  811. <div className="clearfix changeDetail">
  812. <div
  813. className="clearfix"
  814. ref={e => {
  815. this.refs = e;
  816. }}
  817. >
  818. <div
  819. style={{
  820. borderRadius: "50%",
  821. width: 300,
  822. height: 300,
  823. position: "absolute",
  824. top: 230,
  825. left: 525,
  826. transform: "rotate(-5deg)",
  827. zIndex: 1,
  828. display:
  829. (this.props.data.processState == 7 ||
  830. this.props.data.processState == 8) &&
  831. this.props.data.status == 4
  832. ? "block"
  833. : "none"
  834. }}
  835. >
  836. {/* <span
  837. style={{
  838. fontSize: 29,
  839. position: "absolute",
  840. left: "50%",
  841. top: "50%",
  842. transform: "translate(-50%,-50%)",
  843. color: "red"
  844. }}
  845. >
  846. 通过
  847. </span> */}
  848. <img src={tongguo} style={{ width: "100%" }} />
  849. </div>
  850. <h2 style={{ textAlign: "center", marginBottom: 10, marginTop: 20 }}>
  851. 合同变更记录
  852. </h2>
  853. {pageData.map((item, index) => {
  854. return <Itemlist key={index} pageData={item} />;
  855. })}
  856. <Form.Item
  857. label="变更凭证"
  858. labelCol={{ span: 4 }}
  859. wrapperCol={{ span: 18 }}
  860. >
  861. <Upload
  862. className="demandDetailShow-upload"
  863. listType="picture-card"
  864. fileList={orgCodeUrl}
  865. onPreview={file => {
  866. this.setState({
  867. previewImage: file.url || file.thumbUrl,
  868. previewVisible: true
  869. });
  870. }}
  871. />
  872. <Modal
  873. maskClosable={false}
  874. footer={null}
  875. visible={this.state.previewVisible}
  876. onCancel={() => {
  877. this.setState({ previewVisible: false, rotateDeg: 0 }, () => {
  878. this.reset();
  879. });
  880. }}
  881. >
  882. <img
  883. alt=""
  884. style={{
  885. width: "100%",
  886. transform: `rotate(${this.state.rotateDeg}deg)`
  887. }}
  888. src={this.state.previewImage || ""}
  889. />
  890. <Button
  891. onClick={this.rotate}
  892. style={{
  893. position: "relative",
  894. left: "50%",
  895. transform: "translateX(-50%)"
  896. }}
  897. >
  898. 旋转
  899. </Button>
  900. <Button
  901. onClick={this.upImg}
  902. style={{
  903. position: "absolute",
  904. left: -81,
  905. top: "50%",
  906. transform: "translateY(-50%)"
  907. }}
  908. >
  909. 上一张
  910. </Button>
  911. <Button
  912. onClick={this.downImg}
  913. style={{
  914. position: "absolute",
  915. right: -81,
  916. top: "50%",
  917. transform: "translateY(-50%)"
  918. }}
  919. >
  920. 下一张
  921. </Button>
  922. </Modal>
  923. <Rizhi changeId={this.props.data.id} />
  924. </Form.Item>
  925. <ul
  926. style={{
  927. width: "868px",
  928. overflow: "hidden",
  929. paddingLeft: "90px",
  930. position: "relative",
  931. bottom: "20px",
  932. fontSize: "12px",
  933. color: "rgba(0, 0, 0, 0.65)"
  934. }}
  935. >
  936. {/* <span>操作人:</span> */}
  937. {this.props.dataSource.map((item, index) => {
  938. if (item.status == 0) {
  939. item.status = "发起";
  940. } else if (item.status == 1) {
  941. item.status = "审核中";
  942. } else if (item.status == 2) {
  943. item.status = "通过";
  944. } else if (item.status == 3) {
  945. item.status = "驳回";
  946. } else if (item.status == 4) {
  947. item.status = "完成";
  948. }
  949. return (
  950. <li
  951. key={index}
  952. style={{
  953. width: "100%",
  954. height: "auto",
  955. wordBreak: "break-all",
  956. marginBottom: "10px"
  957. }}
  958. >
  959. {item.aname + ":" + "(" + item.status + ")" + item.remarks}
  960. </li>
  961. );
  962. })}
  963. </ul>
  964. <div className="clearfix">
  965. <h3 style={{ marginLeft: 20, fontWeight: 800, marginBottom: 10 }}>
  966. 收款情况
  967. </h3>
  968. <div style={{ marginLeft: "90px" }}>
  969. <ul style={{ fontSize: "12px", color: "rgba(0, 0, 0, 0.65)" }}>
  970. {(this.props.proceedsData.bill || []).map((item, index) => (
  971. <li key={index}>
  972. {item.payTime +
  973. " " +
  974. item.aName +
  975. " 收款:" +
  976. item.transactionAmount +
  977. "万元"}
  978. </li>
  979. ))}
  980. </ul>
  981. <div>收款总计:{this.props.proceedsTotal}万元</div>
  982. </div>
  983. <br />
  984. <div style={{ marginLeft: "90px" }}>
  985. <ul style={{ fontSize: "12px", color: "rgba(0, 0, 0, 0.65)" }}>
  986. {(this.props.proceedsData.invoice || []).map((item, index) => (
  987. <li key={index}>
  988. {item.createTime + " " + " 开票:" + item.amount + "万元"}
  989. </li>
  990. ))}
  991. </ul>
  992. <div>开票总计:{this.props.invoiceTotal}万元</div>
  993. </div>
  994. <p style={{ marginLeft: "90px", color: "red" }}>
  995. 系统预估 产生成本(万元):
  996. {this.props.data.estimateCost
  997. ? this.props.data.estimateCost
  998. : "0"}{" "}
  999. &nbsp;应退金额(万元):
  1000. {this.props.data.estimateRefundable
  1001. ? this.props.data.estimateRefundable
  1002. : "0"}
  1003. </p>
  1004. </div>
  1005. {/* {this.props.data.type === 0 ? (
  1006. <div>
  1007. <h3 style={{ marginLeft: 10, fontWeight: 800, marginBottom: 10 }}>
  1008. 当前项目进度(咨询师经理填写)
  1009. </h3>
  1010. {planData.map((item, index) => {
  1011. return <Itemlist key={index} pageData={item} />;
  1012. })}
  1013. </div>
  1014. ) : (
  1015. ""
  1016. )} */}
  1017. <div
  1018. style={{
  1019. display:
  1020. (this.props.data.processState == 8 ||
  1021. this.props.data.processState == 7) &&
  1022. (this.props.data.status == 2 || this.props.data.status == 4)
  1023. ? "block"
  1024. : "none"
  1025. }}
  1026. >
  1027. <h3 style={{ marginLeft: 20, fontWeight: 800, marginBottom: 10 }}>
  1028. 回收退票
  1029. </h3>
  1030. {/* {this.state.processStatus == 0 ? ( */}
  1031. <Button
  1032. type="primary"
  1033. onClick={this.addcontact}
  1034. style={{
  1035. float: "right",
  1036. marginRight: "50px",
  1037. marginBottom: "15px",
  1038. position: "relative",
  1039. zIndex: "999",
  1040. display:
  1041. (this.props.data.processState == 7 ||
  1042. this.props.data.processState == 8) &&
  1043. this.props.data.status == 4
  1044. ? "none"
  1045. : "block"
  1046. }}
  1047. >
  1048. 添加回收退票
  1049. </Button>
  1050. {/* ) : (
  1051. ""
  1052. )} */}
  1053. <Table
  1054. pagination={false}
  1055. bordered
  1056. columns={this.state.ContactsLists}
  1057. dataSource={this.state.contactList}
  1058. size="small"
  1059. />
  1060. </div>
  1061. {(this.props.data.processState > 5 &&
  1062. this.props.data.processState <= 8) ||
  1063. (this.props.data.processState === 9 &&
  1064. this.props.data.status === 4) ? (
  1065. <div>
  1066. <h3 style={{ marginLeft: 20, fontWeight: 800, marginBottom: 10 }}>
  1067. 当前财务状态(财务填写)
  1068. </h3>
  1069. {/* <div className="clearfix">
  1070. <Form.Item
  1071. className="half-item"
  1072. label="收款时间"
  1073. labelCol={{ span: 8 }}
  1074. wrapperCol={{ span: 14 }}
  1075. >
  1076. <span>{this.props.data.paymentTimes}</span>
  1077. </Form.Item>
  1078. <Form.Item
  1079. className="half-item"
  1080. label="收款金额(万元)"
  1081. labelCol={{ span: 8 }}
  1082. wrapperCol={{ span: 14 }}
  1083. >
  1084. <span>{this.props.data.paymentAmount}</span>
  1085. </Form.Item>
  1086. </div>
  1087. <div className="clearfix">
  1088. <Form.Item
  1089. className="half-item"
  1090. label="开票时间"
  1091. labelCol={{ span: 8 }}
  1092. wrapperCol={{ span: 14 }}
  1093. >
  1094. <span>{this.props.data.invoiceTimes}</span>
  1095. </Form.Item>
  1096. <Form.Item
  1097. className="half-item"
  1098. label="开票金额(万元)"
  1099. labelCol={{ span: 8 }}
  1100. wrapperCol={{ span: 14 }}
  1101. >
  1102. <span>{this.props.data.invoiceAmount}</span>
  1103. </Form.Item>
  1104. </div> */}
  1105. {financeData.map((item, index) => {
  1106. return <Itemlist key={index} pageData={item} />;
  1107. })}
  1108. </div>
  1109. ) : (
  1110. <div style={{ marginBottom: 10 }}>
  1111. <h3 style={{ marginLeft: 10, fontWeight: 800, marginBottom: 10 }}>
  1112. 当前财务状态(财务填写)
  1113. </h3>
  1114. <div className="clearfix">
  1115. {/* <Form.Item
  1116. className="half-item"
  1117. label="收款时间"
  1118. labelCol={{ span: 8 }}
  1119. wrapperCol={{ span: 14 }}
  1120. >
  1121. <DatePicker
  1122. style={{ width: 160 }}
  1123. value={
  1124. this.state.paymentTimes
  1125. ? moment(this.state.paymentTimes)
  1126. : null
  1127. }
  1128. onChange={(_data, dataString) => {
  1129. this.setState({
  1130. paymentTimes: dataString
  1131. });
  1132. }}
  1133. />
  1134. </Form.Item>
  1135. <Form.Item
  1136. className="half-item"
  1137. label="收款金额(万元)"
  1138. labelCol={{ span: 8 }}
  1139. wrapperCol={{ span: 14 }}
  1140. >
  1141. <Input
  1142. style={{ width: 160 }}
  1143. value={this.state.paymentAmount}
  1144. placeholder="请输入收款金额"
  1145. onChange={e => {
  1146. this.setState({
  1147. paymentAmount: e.target.value
  1148. });
  1149. }}
  1150. />
  1151. </Form.Item>
  1152. </div>
  1153. <div className="clearfix">
  1154. <Form.Item
  1155. className="half-item"
  1156. label="开票时间"
  1157. labelCol={{ span: 8 }}
  1158. wrapperCol={{ span: 14 }}
  1159. >
  1160. <DatePicker
  1161. style={{ width: 160 }}
  1162. value={
  1163. this.state.invoiceTimes
  1164. ? moment(this.state.invoiceTimes)
  1165. : null
  1166. }
  1167. onChange={(_data, dataString) => {
  1168. this.setState({
  1169. invoiceTimes: dataString
  1170. });
  1171. }}
  1172. />
  1173. </Form.Item>
  1174. <Form.Item
  1175. className="half-item"
  1176. label="开票金额(万元)"
  1177. labelCol={{ span: 8 }}
  1178. wrapperCol={{ span: 14 }}
  1179. >
  1180. <Input
  1181. style={{ width: 160 }}
  1182. value={this.state.invoiceAmount}
  1183. placeholder="请输入开票金额"
  1184. onChange={e => {
  1185. this.setState({
  1186. invoiceAmount: e.target.value
  1187. });
  1188. }}
  1189. />
  1190. </Form.Item> */}
  1191. <Form.Item
  1192. className="half-item"
  1193. label="发生成本(万元)"
  1194. labelCol={{ span: 8 }}
  1195. wrapperCol={{ span: 14 }}
  1196. >
  1197. <Input
  1198. style={{ width: 160 }}
  1199. value={this.state.cwCost}
  1200. placeholder="请输入发生成本"
  1201. onChange={e => {
  1202. this.setState({
  1203. cwCost: e.target.value
  1204. });
  1205. }}
  1206. />
  1207. </Form.Item>
  1208. <Form.Item
  1209. className="half-item"
  1210. label="应退金额(万元)"
  1211. labelCol={{ span: 8 }}
  1212. wrapperCol={{ span: 14 }}
  1213. >
  1214. <Input
  1215. style={{ width: 160 }}
  1216. value={this.state.refundableAmount}
  1217. placeholder="请输入应退金额"
  1218. onChange={e => {
  1219. this.setState({
  1220. refundableAmount: e.target.value
  1221. });
  1222. }}
  1223. />
  1224. </Form.Item>
  1225. </div>
  1226. <div
  1227. style={{
  1228. marginTop: "10px",
  1229. display:
  1230. this.props.data.processState == 5 &&
  1231. this.props.data.status == 2
  1232. ? "none"
  1233. : "block"
  1234. }}
  1235. >
  1236. <Form.Item
  1237. label="备注"
  1238. labelCol={{ span: 4 }}
  1239. wrapperCol={{ span: 14 }}
  1240. >
  1241. <Input.TextArea
  1242. rows={4}
  1243. value={this.state.reason}
  1244. placeholder="请输入补充资料/备注"
  1245. onChange={e => {
  1246. this.setState({
  1247. reason: e.target.value
  1248. });
  1249. }}
  1250. />
  1251. </Form.Item>
  1252. </div>
  1253. </div>
  1254. )}
  1255. <ul
  1256. style={{
  1257. margin: "10px 0 0 20px",
  1258. color: "red",
  1259. display:
  1260. (this.props.data.processState == 7 ||
  1261. this.props.data.processState == 8) &&
  1262. (this.props.data.status == 4 || this.props.data.status == 2)
  1263. ? "inline-block"
  1264. : "none"
  1265. }}
  1266. >
  1267. <li>
  1268. {"本次应收退票(万元):" +
  1269. (this.props.data.refundableAmount == null
  1270. ? 0
  1271. : this.props.data.refundableAmount)}
  1272. </li>
  1273. <li>
  1274. {"累计已回收退票(万元):" +
  1275. (this.state.refundInvoice == null
  1276. ? 0
  1277. : this.state.refundInvoice)}
  1278. </li>
  1279. </ul>
  1280. </div>
  1281. {!(
  1282. (this.props.data.processState > 5 &&
  1283. this.props.data.processState <= 8) ||
  1284. (this.props.data.processState === 9 && this.props.data.status === 4)
  1285. ) ? (
  1286. this.state.buttonStatus ? (
  1287. <div>
  1288. <div
  1289. className="clearfix"
  1290. style={{ display: "flex", justifyContent: "space-around" }}
  1291. >
  1292. {buttonData.map((item, index) => {
  1293. return (
  1294. <AgreeButton
  1295. data={item}
  1296. key={index}
  1297. backData={this.props.data}
  1298. processState={this.props.processState}
  1299. visible={this.changeButtonStatus}
  1300. ajaxData={this.state}
  1301. loadData={this.props.loadData}
  1302. rejectState={this.state.rejectState}
  1303. reason={this.state.reason}
  1304. onCancel={this.props.onCancel}
  1305. />
  1306. );
  1307. })}
  1308. </div>
  1309. <Select
  1310. defaultValue="0"
  1311. style={{
  1312. width: 120,
  1313. float: "left",
  1314. position: "relative",
  1315. bottom: "28px",
  1316. right: "-600px"
  1317. }}
  1318. onChange={val => {
  1319. this.setState({ rejectState: val });
  1320. // console.log(val, this.state.rejectState);
  1321. }}
  1322. >
  1323. <Option
  1324. value="0"
  1325. style={{
  1326. display: this.props.processState >= 1 ? "block" : "none"
  1327. }}
  1328. >
  1329. 营销员
  1330. </Option>
  1331. <Option
  1332. value="1"
  1333. style={{
  1334. display: this.props.processState >= 2 ? "block" : "none"
  1335. }}
  1336. >
  1337. 营销管理员
  1338. </Option>
  1339. <Option
  1340. value="2"
  1341. style={{
  1342. display: this.props.processState >= 3 ? "block" : "none"
  1343. }}
  1344. >
  1345. 咨询师
  1346. </Option>
  1347. <Option
  1348. value="3"
  1349. style={{
  1350. display: this.props.processState >= 4 ? "block" : "none"
  1351. }}
  1352. >
  1353. 咨询师经理
  1354. </Option>
  1355. <Option
  1356. value="4"
  1357. style={{
  1358. display: this.props.processState >= 5 ? "block" : "none"
  1359. }}
  1360. >
  1361. 咨询师总监
  1362. </Option>
  1363. <Option
  1364. value="5"
  1365. style={{
  1366. display: this.props.processState >= 6 ? "block" : "none"
  1367. }}
  1368. >
  1369. 财务专员(退单)
  1370. </Option>
  1371. <Option
  1372. value="6"
  1373. style={{
  1374. display: this.props.processState >= 7 ? "block" : "none"
  1375. }}
  1376. >
  1377. 财务总监
  1378. </Option>
  1379. <Option
  1380. value="7"
  1381. style={{
  1382. display: this.props.processState >= 8 ? "block" : "none"
  1383. }}
  1384. >
  1385. 总裁
  1386. </Option>
  1387. </Select>
  1388. </div>
  1389. ) : (
  1390. ""
  1391. )
  1392. ) : (
  1393. ""
  1394. )}
  1395. <Button
  1396. type="primary"
  1397. shape="round"
  1398. size="large"
  1399. style={{
  1400. position: "absolute",
  1401. left: "50%",
  1402. bottom: "0",
  1403. transform: "translateX(-50%)",
  1404. display:
  1405. (this.props.data.processState == 7 ||
  1406. this.props.data.processState == 8) &&
  1407. this.props.data.status == 2
  1408. ? "block"
  1409. : "none"
  1410. }}
  1411. onClick={this.finish}
  1412. >
  1413. 完成订单
  1414. </Button>
  1415. <ReactToPrint
  1416. trigger={() => (
  1417. <Button
  1418. type="primary"
  1419. style={{
  1420. float: "right",
  1421. marginTop: 10,
  1422. position: "absolute",
  1423. top: 0,
  1424. right: 30,
  1425. display:
  1426. (this.props.data.processState == 7 ||
  1427. this.props.data.processState == 8) &&
  1428. this.props.data.status == 4
  1429. ? "block"
  1430. : "block"
  1431. }}
  1432. >
  1433. 打印
  1434. </Button>
  1435. )}
  1436. content={() => this.refs}
  1437. />
  1438. </div>
  1439. );
  1440. }
  1441. }
  1442. export { ChangeDetail };