changeDetailCwzy.js 43 KB

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