changeDetailCwzy.js 42 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480
  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. contactSave(index) {
  494. if (this.state.contactList) {
  495. let Data = this.state.contactList;
  496. for (var a = 0; a < Data.length; a++) {
  497. if (Data[a].amount == "") {
  498. message.warning("退票金额不能为空");
  499. // this.refs.signFirstPayment.focus();
  500. return false;
  501. }
  502. }
  503. }
  504. // this.setState({
  505. // loading: true
  506. // });
  507. $.ajax({
  508. url:
  509. globalConfig.context + "/api/admin/orderChange/addOrderRefundInvoice",
  510. method: "post",
  511. data: {
  512. orderNo: this.props.data.orderNo,
  513. amount: index.amount
  514. }
  515. }).done(
  516. function(data) {
  517. if (!data.error.length) {
  518. message.success("保存成功!");
  519. let num = 0;
  520. this.state.contactList.forEach(item => {
  521. num += +item.amount;
  522. // if (item.key == index.key) {
  523. // item.load = true;
  524. // let time = this.timestampToTime(new Date().getTime());
  525. // item.createTimes = time;
  526. // }
  527. });
  528. this.setState({
  529. contactList: this.state.contactList,
  530. refundInvoice: num
  531. });
  532. this.reLoad();
  533. console.log("bug", this.state);
  534. } else {
  535. message.warning(data.error[0].message);
  536. }
  537. }.bind(this)
  538. );
  539. }
  540. //点击新增催款节点
  541. addcontact() {
  542. // let key = this.state.contactList.length
  543. // if(key == 0) {
  544. // key
  545. // }
  546. this.state.contactList.push({
  547. key: this.state.contactList.length,
  548. amount: "",
  549. createTime: undefined
  550. // orderNo: this.state.orderNoss,
  551. // dunTarget: this.state.kehuId
  552. });
  553. this.setState({
  554. contactList: this.state.contactList
  555. });
  556. }
  557. //删除收款节点
  558. confirmDelet(index) {
  559. // if (index.id) {
  560. // this.state.contactList.splice(index.key, 1);
  561. // this.setState({
  562. // contactList: this.state.contactList
  563. // });
  564. // this.contactSave();
  565. // } else {
  566. // this.state.contactList.splice(index.key, 1);
  567. // this.setState({
  568. // contactList: this.state.contactList
  569. // });
  570. // }
  571. // if(this.state.contactList.length == 1) {
  572. // this.state.contactList = []
  573. // this.setState({
  574. // contactList: this.state.contactList
  575. // });
  576. // return
  577. // }
  578. // let num = index.key
  579. // if (this.state.contactList[num + 1].key) {
  580. // this.state.contactList[num + 1].key = index.key;
  581. // }
  582. if (index.key || !index.id) {
  583. let num = this.state.contactList.findIndex(item => item.key == index.key);
  584. this.state.contactList.splice(num, 1);
  585. let total = 0;
  586. this.state.contactList.forEach(item => {
  587. total += +item.amount;
  588. });
  589. this.setState({
  590. contactList: this.state.contactList,
  591. refundInvoice: total
  592. });
  593. }else {
  594. $.ajax({
  595. url:
  596. globalConfig.context +
  597. "/api/admin/orderChange/deleteOrderRefundInvoice",
  598. method: "post",
  599. data: {
  600. id: index.id
  601. }
  602. }).done(
  603. function(data) {
  604. if (!data.error.length) {
  605. message.success("删除成功!");
  606. this.reLoad();
  607. } else {
  608. message.warning(data.error[0].message);
  609. }
  610. }.bind(this)
  611. );
  612. }
  613. // console.log(this.state.contactList[num + 1].key);
  614. }
  615. // loadData() {
  616. // $.ajax({
  617. // method: "get",
  618. // dataType: "json",
  619. // async: false,
  620. // crossDomain: false,
  621. // url: globalConfig.context + "/api/admin/orderChange/orderChangeLogList",
  622. // data: {
  623. // changeId: this.props.data.id
  624. // },
  625. // success: function(data) {
  626. // if (data.error.length || data.data.list == "") {
  627. // if (data.error && data.error.length) {
  628. // message.warning(data.error[0].message);
  629. // }
  630. // } else {
  631. // this.setState({
  632. // dataSource: data.data
  633. // });
  634. // }
  635. // }.bind(this)
  636. // });
  637. // }
  638. //同意拒绝按钮的有无
  639. changeButtonStatus() {
  640. this.setState({
  641. buttonStatus: !this.state.buttonStatus
  642. });
  643. }
  644. onRef(ref) {
  645. this.fun = ref;
  646. }
  647. render() {
  648. const pageData = [
  649. {
  650. labelA: "客户名称",
  651. formItemLayoutA: formItemLayout,
  652. dataA: this.props.data.userName,
  653. labelB: "合同编号",
  654. formItemLayoutB: formItemLayout,
  655. dataB: this.props.data.contractNo
  656. },
  657. {
  658. labelA: "时间",
  659. formItemLayoutA: formItemLayout,
  660. dataA: this.props.data.createTimes,
  661. labelB: "发起人",
  662. formItemLayoutB: formItemLayout,
  663. dataB: this.props.data.applicant
  664. },
  665. {
  666. labelA: "当前进度",
  667. formItemLayoutA: formItemLayout,
  668. // 当前是咨询师以及咨询师经理时使用shenhePeo函数,其他流程正常显示
  669. dataA:
  670. this.props.data.processState == 2 || this.props.data.processState == 3
  671. ? shenghePeo(
  672. this.props.data.processState == 2
  673. ? this.props.data.consultantExamine
  674. : this.props.data.managerExamine,
  675. this.props.data.processState
  676. )
  677. : getProcessStatusNew(
  678. this.props.data.processState,
  679. this.props.data.status
  680. ),
  681. labelB: "变更类型",
  682. formItemLayoutB: formItemLayout,
  683. dataB: getChangeType(this.props.data.type)
  684. },
  685. {
  686. labelA: "合同额(万元)",
  687. formItemLayoutA: formItemLayout,
  688. dataA: this.props.data.totalAmount,
  689. labelB: "已收款(万元)",
  690. formItemLayoutB: formItemLayout,
  691. dataB: this.props.data.settlementAmount
  692. },
  693. {
  694. labelA: "欠款(万元)",
  695. formItemLayoutA: formItemLayout,
  696. dataA: this.props.data.arrears,
  697. labelB: "申请退款(万元)",
  698. formItemLayoutB: formItemLayout,
  699. dataB: this.props.data.changeAmount
  700. },
  701. {
  702. labelA: "变更原因",
  703. formItemLayoutA: formItemLayout,
  704. dataA: this.props.data.remarks
  705. }
  706. ];
  707. const planData = [
  708. {
  709. labelA: "项目进度",
  710. formItemLayoutA: formItemLayout,
  711. dataA: this.props.data.projectState,
  712. onChangeA: value => {
  713. this.setState({
  714. projectState: value
  715. });
  716. },
  717. labelB: "发生成本费用(万元)",
  718. formItemLayoutB: formItemLayout,
  719. dataB: this.props.data.zxsCost,
  720. onChangeB: value => {
  721. this.setState({
  722. zxsCost: value
  723. });
  724. }
  725. },
  726. {
  727. labelA: "备注",
  728. formItemLayoutA: formItemLayout,
  729. dataA: this.props.data.zxsRemarks,
  730. onChangeA: value => {
  731. this.setState({
  732. zxsRemarks: value
  733. });
  734. }
  735. }
  736. ];
  737. const financeData = [
  738. {
  739. labelA: "发生成本(万元)",
  740. formItemLayoutA: formItemLayout,
  741. dataA: this.props.data.cwCost ? this.props.data.cwCost : "0",
  742. onChangeA: value => {
  743. this.setState({
  744. cwCost: value
  745. });
  746. },
  747. labelB: "应退金额(万元)",
  748. formItemLayoutB: formItemLayout,
  749. dataB: this.props.data.refundableAmount
  750. ? this.props.data.refundableAmount
  751. : "0",
  752. onChangeB: value => {
  753. this.setState({
  754. refundableAmount: value
  755. });
  756. },
  757. mark: true
  758. }
  759. // {
  760. // labelA: "备注",
  761. // formItemLayoutA: formItemLayout,
  762. // dataA: this.props.data.cwRemarks,
  763. // onChangeA: value => {
  764. // this.setState({
  765. // reason: value
  766. // });
  767. // },
  768. // mark: false
  769. // }
  770. ];
  771. const buttonData = [
  772. {
  773. name: "同意",
  774. title: "理由",
  775. placeholder: "请输入理由",
  776. type: "primary",
  777. status: 2,
  778. onChange: value => {
  779. this.setState({
  780. remarks: value
  781. });
  782. }
  783. },
  784. {
  785. name: "拒绝",
  786. title: "理由",
  787. placeholder: "请输入理由",
  788. type: "danger",
  789. status: 3,
  790. onChange: value => {
  791. this.setState({
  792. remarks: value
  793. });
  794. }
  795. }
  796. ];
  797. const orgCodeUrl = this.props.pictureUrl;
  798. return (
  799. <div className="clearfix changeDetail">
  800. <div
  801. className="clearfix"
  802. ref={e => {
  803. this.refs = e;
  804. }}
  805. >
  806. <div
  807. style={{
  808. borderRadius: "50%",
  809. width: 300,
  810. height: 300,
  811. position: "absolute",
  812. top: 230,
  813. left: 525,
  814. transform: "rotate(-5deg)",
  815. zIndex: 1,
  816. display:
  817. (this.props.data.processState == 7 ||
  818. this.props.data.processState == 8) &&
  819. this.props.data.status == 4
  820. ? "block"
  821. : "none"
  822. }}
  823. >
  824. {/* <span
  825. style={{
  826. fontSize: 29,
  827. position: "absolute",
  828. left: "50%",
  829. top: "50%",
  830. transform: "translate(-50%,-50%)",
  831. color: "red"
  832. }}
  833. >
  834. 通过
  835. </span> */}
  836. <img src={tongguo} style={{ width: "100%" }} />
  837. </div>
  838. <h2 style={{ textAlign: "center", marginBottom: 10, marginTop: 20 }}>
  839. 合同变更记录
  840. </h2>
  841. {pageData.map((item, index) => {
  842. return <Itemlist key={index} pageData={item} />;
  843. })}
  844. <Form.Item
  845. label="变更凭证"
  846. labelCol={{ span: 4 }}
  847. wrapperCol={{ span: 18 }}
  848. >
  849. <Upload
  850. className="demandDetailShow-upload"
  851. listType="picture-card"
  852. fileList={orgCodeUrl}
  853. onPreview={file => {
  854. this.setState({
  855. previewImage: file.url || file.thumbUrl,
  856. previewVisible: true
  857. });
  858. }}
  859. />
  860. <Modal
  861. maskClosable={false}
  862. footer={null}
  863. visible={this.state.previewVisible}
  864. onCancel={() => {
  865. this.setState({ previewVisible: false, rotateDeg: 0 }, () => {
  866. this.reset();
  867. });
  868. }}
  869. >
  870. <img
  871. alt=""
  872. style={{
  873. width: "100%",
  874. transform: `rotate(${this.state.rotateDeg}deg)`
  875. }}
  876. src={this.state.previewImage || ""}
  877. />
  878. <Button
  879. onClick={this.rotate}
  880. style={{
  881. position: "relative",
  882. left: "50%",
  883. transform: "translateX(-50%)"
  884. }}
  885. >
  886. 旋转
  887. </Button>
  888. <Button
  889. onClick={this.upImg}
  890. style={{
  891. position: "absolute",
  892. left: -81,
  893. top: "50%",
  894. transform: "translateY(-50%)"
  895. }}
  896. >
  897. 上一张
  898. </Button>
  899. <Button
  900. onClick={this.downImg}
  901. style={{
  902. position: "absolute",
  903. right: -81,
  904. top: "50%",
  905. transform: "translateY(-50%)"
  906. }}
  907. >
  908. 下一张
  909. </Button>
  910. </Modal>
  911. <Rizhi changeId={this.props.data.id}/>
  912. </Form.Item>
  913. <ul
  914. style={{
  915. width: "868px",
  916. overflow: "hidden",
  917. paddingLeft: "90px",
  918. paddingTop: "10px",
  919. position: "relative",
  920. bottom: "20px",
  921. fontSize: "12px",
  922. color: "rgba(0, 0, 0, 0.65)"
  923. }}
  924. >
  925. {/* <span>操作人:</span> */}
  926. {this.props.dataSource.map((item, index) => {
  927. if (item.status == 0) {
  928. item.status = "发起";
  929. } else if (item.status == 1) {
  930. item.status = "审核中";
  931. } else if (item.status == 2) {
  932. item.status = "通过";
  933. } else if (item.status == 3) {
  934. item.status = "驳回";
  935. } else if (item.status == 4) {
  936. item.status = "完成";
  937. }
  938. return (
  939. <li
  940. key={index}
  941. style={{
  942. width: "100%",
  943. height: "auto",
  944. wordBreak: "break-all",
  945. marginBottom: "10px"
  946. }}
  947. >
  948. {item.aname + ":" + "(" + item.status + ")" + item.remarks}
  949. </li>
  950. );
  951. })}
  952. </ul>
  953. <div className="clearfix">
  954. <h3 style={{ marginLeft: 20, fontWeight: 800, marginBottom: 10 }}>
  955. 收款情况
  956. </h3>
  957. <div style={{ marginLeft: "90px" }}>
  958. <ul style={{ fontSize: "12px", color: "rgba(0, 0, 0, 0.65)" }}>
  959. {(this.props.proceedsData.bill || []).map((item, index) => (
  960. <li key={index}>
  961. {item.payTime +
  962. " " +
  963. item.aName +
  964. " 收款:" +
  965. item.transactionAmount +
  966. "万元"}
  967. </li>
  968. ))}
  969. </ul>
  970. <div>收款总计:{this.props.proceedsTotal}万元</div>
  971. </div>
  972. <br />
  973. <div style={{ marginLeft: "90px" }}>
  974. <ul style={{ fontSize: "12px", color: "rgba(0, 0, 0, 0.65)" }}>
  975. {(this.props.proceedsData.invoice || []).map((item, index) => (
  976. <li key={index}>
  977. {item.createTime + " " + " 开票:" + item.amount + "万元"}
  978. </li>
  979. ))}
  980. </ul>
  981. <div>开票总计:{this.props.invoiceTotal}万元</div>
  982. </div>
  983. <p style={{ marginLeft: "90px", color: "red" }}>
  984. 系统预估 产生成本(万元):
  985. {this.props.data.estimateCost
  986. ? this.props.data.estimateCost
  987. : "0"}{" "}
  988. &nbsp;应退金额(万元):
  989. {this.props.data.estimateRefundable
  990. ? this.props.data.estimateRefundable
  991. : "0"}
  992. </p>
  993. </div>
  994. {/* {this.props.data.type === 0 ? (
  995. <div>
  996. <h3 style={{ marginLeft: 10, fontWeight: 800, marginBottom: 10 }}>
  997. 当前项目进度(咨询师经理填写)
  998. </h3>
  999. {planData.map((item, index) => {
  1000. return <Itemlist key={index} pageData={item} />;
  1001. })}
  1002. </div>
  1003. ) : (
  1004. ""
  1005. )} */}
  1006. <div
  1007. style={{
  1008. display:
  1009. (this.props.data.processState == 8 ||
  1010. this.props.data.processState == 7) &&
  1011. (this.props.data.status == 2 || this.props.data.status == 4)
  1012. ? "block"
  1013. : "none"
  1014. }}
  1015. >
  1016. <h3 style={{ marginLeft: 20, fontWeight: 800, marginBottom: 10 }}>
  1017. 回收退票
  1018. </h3>
  1019. {/* {this.state.processStatus == 0 ? ( */}
  1020. <Button
  1021. type="primary"
  1022. onClick={this.addcontact}
  1023. style={{
  1024. float: "right",
  1025. marginRight: "50px",
  1026. marginBottom: "15px",
  1027. position: "relative",
  1028. zIndex: "999",
  1029. display:
  1030. (this.props.data.processState == 7 ||
  1031. this.props.data.processState == 8) &&
  1032. this.props.data.status == 4
  1033. ? "none"
  1034. : "block"
  1035. }}
  1036. >
  1037. 添加回收退票
  1038. </Button>
  1039. {/* ) : (
  1040. ""
  1041. )} */}
  1042. <Table
  1043. pagination={false}
  1044. bordered
  1045. columns={this.state.ContactsLists}
  1046. dataSource={this.state.contactList}
  1047. size="small"
  1048. />
  1049. </div>
  1050. {(this.props.data.processState > 5 &&
  1051. this.props.data.processState <= 8) ||
  1052. (this.props.data.processState === 9 &&
  1053. this.props.data.status === 4) ? (
  1054. <div>
  1055. <h3 style={{ marginLeft: 20, fontWeight: 800, marginBottom: 10 }}>
  1056. 当前财务状态(财务填写)
  1057. </h3>
  1058. {/* <div className="clearfix">
  1059. <Form.Item
  1060. className="half-item"
  1061. label="收款时间"
  1062. labelCol={{ span: 8 }}
  1063. wrapperCol={{ span: 14 }}
  1064. >
  1065. <span>{this.props.data.paymentTimes}</span>
  1066. </Form.Item>
  1067. <Form.Item
  1068. className="half-item"
  1069. label="收款金额(万元)"
  1070. labelCol={{ span: 8 }}
  1071. wrapperCol={{ span: 14 }}
  1072. >
  1073. <span>{this.props.data.paymentAmount}</span>
  1074. </Form.Item>
  1075. </div>
  1076. <div className="clearfix">
  1077. <Form.Item
  1078. className="half-item"
  1079. label="开票时间"
  1080. labelCol={{ span: 8 }}
  1081. wrapperCol={{ span: 14 }}
  1082. >
  1083. <span>{this.props.data.invoiceTimes}</span>
  1084. </Form.Item>
  1085. <Form.Item
  1086. className="half-item"
  1087. label="开票金额(万元)"
  1088. labelCol={{ span: 8 }}
  1089. wrapperCol={{ span: 14 }}
  1090. >
  1091. <span>{this.props.data.invoiceAmount}</span>
  1092. </Form.Item>
  1093. </div> */}
  1094. {financeData.map((item, index) => {
  1095. return <Itemlist key={index} pageData={item} />;
  1096. })}
  1097. </div>
  1098. ) : (
  1099. <div style={{ marginBottom: 10 }}>
  1100. <h3 style={{ marginLeft: 10, fontWeight: 800, marginBottom: 10 }}>
  1101. 当前财务状态(财务填写)
  1102. </h3>
  1103. <div className="clearfix">
  1104. {/* <Form.Item
  1105. className="half-item"
  1106. label="收款时间"
  1107. labelCol={{ span: 8 }}
  1108. wrapperCol={{ span: 14 }}
  1109. >
  1110. <DatePicker
  1111. style={{ width: 160 }}
  1112. value={
  1113. this.state.paymentTimes
  1114. ? moment(this.state.paymentTimes)
  1115. : null
  1116. }
  1117. onChange={(_data, dataString) => {
  1118. this.setState({
  1119. paymentTimes: dataString
  1120. });
  1121. }}
  1122. />
  1123. </Form.Item>
  1124. <Form.Item
  1125. className="half-item"
  1126. label="收款金额(万元)"
  1127. labelCol={{ span: 8 }}
  1128. wrapperCol={{ span: 14 }}
  1129. >
  1130. <Input
  1131. style={{ width: 160 }}
  1132. value={this.state.paymentAmount}
  1133. placeholder="请输入收款金额"
  1134. onChange={e => {
  1135. this.setState({
  1136. paymentAmount: e.target.value
  1137. });
  1138. }}
  1139. />
  1140. </Form.Item>
  1141. </div>
  1142. <div className="clearfix">
  1143. <Form.Item
  1144. className="half-item"
  1145. label="开票时间"
  1146. labelCol={{ span: 8 }}
  1147. wrapperCol={{ span: 14 }}
  1148. >
  1149. <DatePicker
  1150. style={{ width: 160 }}
  1151. value={
  1152. this.state.invoiceTimes
  1153. ? moment(this.state.invoiceTimes)
  1154. : null
  1155. }
  1156. onChange={(_data, dataString) => {
  1157. this.setState({
  1158. invoiceTimes: dataString
  1159. });
  1160. }}
  1161. />
  1162. </Form.Item>
  1163. <Form.Item
  1164. className="half-item"
  1165. label="开票金额(万元)"
  1166. labelCol={{ span: 8 }}
  1167. wrapperCol={{ span: 14 }}
  1168. >
  1169. <Input
  1170. style={{ width: 160 }}
  1171. value={this.state.invoiceAmount}
  1172. placeholder="请输入开票金额"
  1173. onChange={e => {
  1174. this.setState({
  1175. invoiceAmount: e.target.value
  1176. });
  1177. }}
  1178. />
  1179. </Form.Item> */}
  1180. <Form.Item
  1181. className="half-item"
  1182. label="发生成本(万元)"
  1183. labelCol={{ span: 8 }}
  1184. wrapperCol={{ span: 14 }}
  1185. >
  1186. <Input
  1187. style={{ width: 160 }}
  1188. value={this.state.cwCost}
  1189. placeholder="请输入发生成本"
  1190. onChange={e => {
  1191. this.setState({
  1192. cwCost: e.target.value
  1193. });
  1194. }}
  1195. />
  1196. </Form.Item>
  1197. <Form.Item
  1198. className="half-item"
  1199. label="应退金额(万元)"
  1200. labelCol={{ span: 8 }}
  1201. wrapperCol={{ span: 14 }}
  1202. >
  1203. <Input
  1204. style={{ width: 160 }}
  1205. value={this.state.refundableAmount}
  1206. placeholder="请输入应退金额"
  1207. onChange={e => {
  1208. this.setState({
  1209. refundableAmount: e.target.value
  1210. });
  1211. }}
  1212. />
  1213. </Form.Item>
  1214. </div>
  1215. <div
  1216. style={{
  1217. marginTop: "10px",
  1218. display:
  1219. this.props.data.processState == 5 &&
  1220. this.props.data.status == 2
  1221. ? "none"
  1222. : "block"
  1223. }}
  1224. >
  1225. <Form.Item
  1226. label="备注"
  1227. labelCol={{ span: 4 }}
  1228. wrapperCol={{ span: 14 }}
  1229. >
  1230. <Input.TextArea
  1231. rows={4}
  1232. value={this.state.reason}
  1233. placeholder="请输入补充资料/备注"
  1234. onChange={e => {
  1235. this.setState({
  1236. reason: e.target.value
  1237. });
  1238. }}
  1239. />
  1240. </Form.Item>
  1241. </div>
  1242. </div>
  1243. )}
  1244. <ul
  1245. style={{
  1246. margin: "10px 0 0 20px",
  1247. color: "red",
  1248. display:
  1249. (this.props.data.processState == 7 ||
  1250. this.props.data.processState == 8) &&
  1251. (this.props.data.status == 4 || this.props.data.status == 2)
  1252. ? "inline-block"
  1253. : "none"
  1254. }}
  1255. >
  1256. <li>
  1257. {"本次应收退票(万元):" +
  1258. (this.props.data.refundableAmount == null
  1259. ? 0
  1260. : this.props.data.refundableAmount)}
  1261. </li>
  1262. <li>
  1263. {"累计已回收退票(万元):" +
  1264. (this.state.refundInvoice == null
  1265. ? 0
  1266. : this.state.refundInvoice)}
  1267. </li>
  1268. </ul>
  1269. </div>
  1270. {!(
  1271. (this.props.data.processState > 5 &&
  1272. this.props.data.processState <= 8) ||
  1273. (this.props.data.processState === 9 && this.props.data.status === 4)
  1274. ) ? (
  1275. this.state.buttonStatus ? (
  1276. <div>
  1277. <div
  1278. className="clearfix"
  1279. style={{ display: "flex", justifyContent: "space-around" }}
  1280. >
  1281. {buttonData.map((item, index) => {
  1282. return (
  1283. <AgreeButton
  1284. data={item}
  1285. key={index}
  1286. backData={this.props.data}
  1287. processState={this.props.processState}
  1288. visible={this.changeButtonStatus}
  1289. ajaxData={this.state}
  1290. loadData={this.props.loadData}
  1291. rejectState={this.state.rejectState}
  1292. reason={this.state.reason}
  1293. onCancel={this.props.onCancel}
  1294. />
  1295. );
  1296. })}
  1297. </div>
  1298. <Select
  1299. defaultValue="0"
  1300. style={{
  1301. width: 120,
  1302. float: "left",
  1303. position: "relative",
  1304. bottom: "28px",
  1305. right: "-600px"
  1306. }}
  1307. onChange={val => {
  1308. this.setState({ rejectState: val });
  1309. // console.log(val, this.state.rejectState);
  1310. }}
  1311. >
  1312. <Option
  1313. value="0"
  1314. style={{
  1315. display: this.props.processState >= 1 ? "block" : "none"
  1316. }}
  1317. >
  1318. 营销员
  1319. </Option>
  1320. <Option
  1321. value="1"
  1322. style={{
  1323. display: this.props.processState >= 2 ? "block" : "none"
  1324. }}
  1325. >
  1326. 营销管理员
  1327. </Option>
  1328. <Option
  1329. value="2"
  1330. style={{
  1331. display: this.props.processState >= 3 ? "block" : "none"
  1332. }}
  1333. >
  1334. 咨询师
  1335. </Option>
  1336. <Option
  1337. value="3"
  1338. style={{
  1339. display: this.props.processState >= 4 ? "block" : "none"
  1340. }}
  1341. >
  1342. 咨询师经理
  1343. </Option>
  1344. <Option
  1345. value="4"
  1346. style={{
  1347. display: this.props.processState >= 5 ? "block" : "none"
  1348. }}
  1349. >
  1350. 咨询师总监
  1351. </Option>
  1352. <Option
  1353. value="5"
  1354. style={{
  1355. display: this.props.processState >= 6 ? "block" : "none"
  1356. }}
  1357. >
  1358. 财务专员(退单)
  1359. </Option>
  1360. <Option
  1361. value="6"
  1362. style={{
  1363. display: this.props.processState >= 7 ? "block" : "none"
  1364. }}
  1365. >
  1366. 财务总监
  1367. </Option>
  1368. <Option
  1369. value="7"
  1370. style={{
  1371. display: this.props.processState >= 8 ? "block" : "none"
  1372. }}
  1373. >
  1374. 总裁
  1375. </Option>
  1376. </Select>
  1377. </div>
  1378. ) : (
  1379. ""
  1380. )
  1381. ) : (
  1382. ""
  1383. )}
  1384. <Button
  1385. type="primary"
  1386. shape="round"
  1387. size="large"
  1388. style={{
  1389. position: "absolute",
  1390. left: "50%",
  1391. bottom: "0",
  1392. transform: "translateX(-50%)",
  1393. display:
  1394. (this.props.data.processState == 7 ||
  1395. this.props.data.processState == 8) &&
  1396. this.props.data.status == 2
  1397. ? "block"
  1398. : "none"
  1399. }}
  1400. onClick={this.finish}
  1401. >
  1402. 完成订单
  1403. </Button>
  1404. <ReactToPrint
  1405. trigger={() => (
  1406. <Button
  1407. type="primary"
  1408. style={{
  1409. float: "right",
  1410. marginTop: 10,
  1411. position: "absolute",
  1412. top: 0,
  1413. right: 30,
  1414. display:
  1415. (this.props.data.processState == 7 ||
  1416. this.props.data.processState == 8) &&
  1417. this.props.data.status == 4
  1418. ? "block"
  1419. : "block"
  1420. }}
  1421. >
  1422. 打印
  1423. </Button>
  1424. )}
  1425. content={() => this.refs}
  1426. />
  1427. </div>
  1428. );
  1429. }
  1430. }
  1431. export { ChangeDetail };