changeDetailCwzy.js 42 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493
  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. paddingTop: "10px",
  931. position: "relative",
  932. bottom: "20px",
  933. fontSize: "12px",
  934. color: "rgba(0, 0, 0, 0.65)"
  935. }}
  936. >
  937. {/* <span>操作人:</span> */}
  938. {this.props.dataSource.map((item, index) => {
  939. if (item.status == 0) {
  940. item.status = "发起";
  941. } else if (item.status == 1) {
  942. item.status = "审核中";
  943. } else if (item.status == 2) {
  944. item.status = "通过";
  945. } else if (item.status == 3) {
  946. item.status = "驳回";
  947. } else if (item.status == 4) {
  948. item.status = "完成";
  949. }
  950. return (
  951. <li
  952. key={index}
  953. style={{
  954. width: "100%",
  955. height: "auto",
  956. wordBreak: "break-all",
  957. marginBottom: "10px"
  958. }}
  959. >
  960. {item.aname + ":" + "(" + item.status + ")" + item.remarks}
  961. </li>
  962. );
  963. })}
  964. </ul>
  965. <div className="clearfix">
  966. <h3 style={{ marginLeft: 20, fontWeight: 800, marginBottom: 10 }}>
  967. 收款情况
  968. </h3>
  969. <div style={{ marginLeft: "90px" }}>
  970. <ul style={{ fontSize: "12px", color: "rgba(0, 0, 0, 0.65)" }}>
  971. {(this.props.proceedsData.bill || []).map((item, index) => (
  972. <li key={index}>
  973. {item.payTime +
  974. " " +
  975. item.aName +
  976. " 收款:" +
  977. item.transactionAmount +
  978. "万元"}
  979. </li>
  980. ))}
  981. </ul>
  982. <div>收款总计:{this.props.proceedsTotal}万元</div>
  983. </div>
  984. <br />
  985. <div style={{ marginLeft: "90px" }}>
  986. <ul style={{ fontSize: "12px", color: "rgba(0, 0, 0, 0.65)" }}>
  987. {(this.props.proceedsData.invoice || []).map((item, index) => (
  988. <li key={index}>
  989. {item.createTime + " " + " 开票:" + item.amount + "万元"}
  990. </li>
  991. ))}
  992. </ul>
  993. <div>开票总计:{this.props.invoiceTotal}万元</div>
  994. </div>
  995. <p style={{ marginLeft: "90px", color: "red" }}>
  996. 系统预估 产生成本(万元):
  997. {this.props.data.estimateCost
  998. ? this.props.data.estimateCost
  999. : "0"}{" "}
  1000. &nbsp;应退金额(万元):
  1001. {this.props.data.estimateRefundable
  1002. ? this.props.data.estimateRefundable
  1003. : "0"}
  1004. </p>
  1005. </div>
  1006. {/* {this.props.data.type === 0 ? (
  1007. <div>
  1008. <h3 style={{ marginLeft: 10, fontWeight: 800, marginBottom: 10 }}>
  1009. 当前项目进度(咨询师经理填写)
  1010. </h3>
  1011. {planData.map((item, index) => {
  1012. return <Itemlist key={index} pageData={item} />;
  1013. })}
  1014. </div>
  1015. ) : (
  1016. ""
  1017. )} */}
  1018. <div
  1019. style={{
  1020. display:
  1021. (this.props.data.processState == 8 ||
  1022. this.props.data.processState == 7) &&
  1023. (this.props.data.status == 2 || this.props.data.status == 4)
  1024. ? "block"
  1025. : "none"
  1026. }}
  1027. >
  1028. <h3 style={{ marginLeft: 20, fontWeight: 800, marginBottom: 10 }}>
  1029. 回收退票
  1030. </h3>
  1031. {/* {this.state.processStatus == 0 ? ( */}
  1032. <Button
  1033. type="primary"
  1034. onClick={this.addcontact}
  1035. style={{
  1036. float: "right",
  1037. marginRight: "50px",
  1038. marginBottom: "15px",
  1039. position: "relative",
  1040. zIndex: "999",
  1041. display:
  1042. (this.props.data.processState == 7 ||
  1043. this.props.data.processState == 8) &&
  1044. this.props.data.status == 4
  1045. ? "none"
  1046. : "block"
  1047. }}
  1048. >
  1049. 添加回收退票
  1050. </Button>
  1051. {/* ) : (
  1052. ""
  1053. )} */}
  1054. <Table
  1055. pagination={false}
  1056. bordered
  1057. columns={this.state.ContactsLists}
  1058. dataSource={this.state.contactList}
  1059. size="small"
  1060. />
  1061. </div>
  1062. {(this.props.data.processState > 5 &&
  1063. this.props.data.processState <= 8) ||
  1064. (this.props.data.processState === 9 &&
  1065. this.props.data.status === 4) ? (
  1066. <div>
  1067. <h3 style={{ marginLeft: 20, fontWeight: 800, marginBottom: 10 }}>
  1068. 当前财务状态(财务填写)
  1069. </h3>
  1070. {/* <div className="clearfix">
  1071. <Form.Item
  1072. className="half-item"
  1073. label="收款时间"
  1074. labelCol={{ span: 8 }}
  1075. wrapperCol={{ span: 14 }}
  1076. >
  1077. <span>{this.props.data.paymentTimes}</span>
  1078. </Form.Item>
  1079. <Form.Item
  1080. className="half-item"
  1081. label="收款金额(万元)"
  1082. labelCol={{ span: 8 }}
  1083. wrapperCol={{ span: 14 }}
  1084. >
  1085. <span>{this.props.data.paymentAmount}</span>
  1086. </Form.Item>
  1087. </div>
  1088. <div className="clearfix">
  1089. <Form.Item
  1090. className="half-item"
  1091. label="开票时间"
  1092. labelCol={{ span: 8 }}
  1093. wrapperCol={{ span: 14 }}
  1094. >
  1095. <span>{this.props.data.invoiceTimes}</span>
  1096. </Form.Item>
  1097. <Form.Item
  1098. className="half-item"
  1099. label="开票金额(万元)"
  1100. labelCol={{ span: 8 }}
  1101. wrapperCol={{ span: 14 }}
  1102. >
  1103. <span>{this.props.data.invoiceAmount}</span>
  1104. </Form.Item>
  1105. </div> */}
  1106. {financeData.map((item, index) => {
  1107. return <Itemlist key={index} pageData={item} />;
  1108. })}
  1109. </div>
  1110. ) : (
  1111. <div style={{ marginBottom: 10 }}>
  1112. <h3 style={{ marginLeft: 10, fontWeight: 800, marginBottom: 10 }}>
  1113. 当前财务状态(财务填写)
  1114. </h3>
  1115. <div className="clearfix">
  1116. {/* <Form.Item
  1117. className="half-item"
  1118. label="收款时间"
  1119. labelCol={{ span: 8 }}
  1120. wrapperCol={{ span: 14 }}
  1121. >
  1122. <DatePicker
  1123. style={{ width: 160 }}
  1124. value={
  1125. this.state.paymentTimes
  1126. ? moment(this.state.paymentTimes)
  1127. : null
  1128. }
  1129. onChange={(_data, dataString) => {
  1130. this.setState({
  1131. paymentTimes: dataString
  1132. });
  1133. }}
  1134. />
  1135. </Form.Item>
  1136. <Form.Item
  1137. className="half-item"
  1138. label="收款金额(万元)"
  1139. labelCol={{ span: 8 }}
  1140. wrapperCol={{ span: 14 }}
  1141. >
  1142. <Input
  1143. style={{ width: 160 }}
  1144. value={this.state.paymentAmount}
  1145. placeholder="请输入收款金额"
  1146. onChange={e => {
  1147. this.setState({
  1148. paymentAmount: e.target.value
  1149. });
  1150. }}
  1151. />
  1152. </Form.Item>
  1153. </div>
  1154. <div className="clearfix">
  1155. <Form.Item
  1156. className="half-item"
  1157. label="开票时间"
  1158. labelCol={{ span: 8 }}
  1159. wrapperCol={{ span: 14 }}
  1160. >
  1161. <DatePicker
  1162. style={{ width: 160 }}
  1163. value={
  1164. this.state.invoiceTimes
  1165. ? moment(this.state.invoiceTimes)
  1166. : null
  1167. }
  1168. onChange={(_data, dataString) => {
  1169. this.setState({
  1170. invoiceTimes: dataString
  1171. });
  1172. }}
  1173. />
  1174. </Form.Item>
  1175. <Form.Item
  1176. className="half-item"
  1177. label="开票金额(万元)"
  1178. labelCol={{ span: 8 }}
  1179. wrapperCol={{ span: 14 }}
  1180. >
  1181. <Input
  1182. style={{ width: 160 }}
  1183. value={this.state.invoiceAmount}
  1184. placeholder="请输入开票金额"
  1185. onChange={e => {
  1186. this.setState({
  1187. invoiceAmount: e.target.value
  1188. });
  1189. }}
  1190. />
  1191. </Form.Item> */}
  1192. <Form.Item
  1193. className="half-item"
  1194. label="发生成本(万元)"
  1195. labelCol={{ span: 8 }}
  1196. wrapperCol={{ span: 14 }}
  1197. >
  1198. <Input
  1199. style={{ width: 160 }}
  1200. value={this.state.cwCost}
  1201. placeholder="请输入发生成本"
  1202. onChange={e => {
  1203. this.setState({
  1204. cwCost: e.target.value
  1205. });
  1206. }}
  1207. />
  1208. </Form.Item>
  1209. <Form.Item
  1210. className="half-item"
  1211. label="应退金额(万元)"
  1212. labelCol={{ span: 8 }}
  1213. wrapperCol={{ span: 14 }}
  1214. >
  1215. <Input
  1216. style={{ width: 160 }}
  1217. value={this.state.refundableAmount}
  1218. placeholder="请输入应退金额"
  1219. onChange={e => {
  1220. this.setState({
  1221. refundableAmount: e.target.value
  1222. });
  1223. }}
  1224. />
  1225. </Form.Item>
  1226. </div>
  1227. <div
  1228. style={{
  1229. marginTop: "10px",
  1230. display:
  1231. this.props.data.processState == 5 &&
  1232. this.props.data.status == 2
  1233. ? "none"
  1234. : "block"
  1235. }}
  1236. >
  1237. <Form.Item
  1238. label="备注"
  1239. labelCol={{ span: 4 }}
  1240. wrapperCol={{ span: 14 }}
  1241. >
  1242. <Input.TextArea
  1243. rows={4}
  1244. value={this.state.reason}
  1245. placeholder="请输入补充资料/备注"
  1246. onChange={e => {
  1247. this.setState({
  1248. reason: e.target.value
  1249. });
  1250. }}
  1251. />
  1252. </Form.Item>
  1253. </div>
  1254. </div>
  1255. )}
  1256. <ul
  1257. style={{
  1258. margin: "10px 0 0 20px",
  1259. color: "red",
  1260. display:
  1261. (this.props.data.processState == 7 ||
  1262. this.props.data.processState == 8) &&
  1263. (this.props.data.status == 4 || this.props.data.status == 2)
  1264. ? "inline-block"
  1265. : "none"
  1266. }}
  1267. >
  1268. <li>
  1269. {"本次应收退票(万元):" +
  1270. (this.props.data.refundableAmount == null
  1271. ? 0
  1272. : this.props.data.refundableAmount)}
  1273. </li>
  1274. <li>
  1275. {"累计已回收退票(万元):" +
  1276. (this.state.refundInvoice == null
  1277. ? 0
  1278. : this.state.refundInvoice)}
  1279. </li>
  1280. </ul>
  1281. </div>
  1282. {!(
  1283. (this.props.data.processState > 5 &&
  1284. this.props.data.processState <= 8) ||
  1285. (this.props.data.processState === 9 && this.props.data.status === 4)
  1286. ) ? (
  1287. this.state.buttonStatus ? (
  1288. <div>
  1289. <div
  1290. className="clearfix"
  1291. style={{ display: "flex", justifyContent: "space-around" }}
  1292. >
  1293. {buttonData.map((item, index) => {
  1294. return (
  1295. <AgreeButton
  1296. data={item}
  1297. key={index}
  1298. backData={this.props.data}
  1299. processState={this.props.processState}
  1300. visible={this.changeButtonStatus}
  1301. ajaxData={this.state}
  1302. loadData={this.props.loadData}
  1303. rejectState={this.state.rejectState}
  1304. reason={this.state.reason}
  1305. onCancel={this.props.onCancel}
  1306. />
  1307. );
  1308. })}
  1309. </div>
  1310. <Select
  1311. defaultValue="0"
  1312. style={{
  1313. width: 120,
  1314. float: "left",
  1315. position: "relative",
  1316. bottom: "28px",
  1317. right: "-600px"
  1318. }}
  1319. onChange={val => {
  1320. this.setState({ rejectState: val });
  1321. // console.log(val, this.state.rejectState);
  1322. }}
  1323. >
  1324. <Option
  1325. value="0"
  1326. style={{
  1327. display: this.props.processState >= 1 ? "block" : "none"
  1328. }}
  1329. >
  1330. 营销员
  1331. </Option>
  1332. <Option
  1333. value="1"
  1334. style={{
  1335. display: this.props.processState >= 2 ? "block" : "none"
  1336. }}
  1337. >
  1338. 营销管理员
  1339. </Option>
  1340. <Option
  1341. value="2"
  1342. style={{
  1343. display: this.props.processState >= 3 ? "block" : "none"
  1344. }}
  1345. >
  1346. 咨询师
  1347. </Option>
  1348. <Option
  1349. value="3"
  1350. style={{
  1351. display: this.props.processState >= 4 ? "block" : "none"
  1352. }}
  1353. >
  1354. 咨询师经理
  1355. </Option>
  1356. <Option
  1357. value="4"
  1358. style={{
  1359. display: this.props.processState >= 5 ? "block" : "none"
  1360. }}
  1361. >
  1362. 咨询师总监
  1363. </Option>
  1364. <Option
  1365. value="5"
  1366. style={{
  1367. display: this.props.processState >= 6 ? "block" : "none"
  1368. }}
  1369. >
  1370. 财务专员(退单)
  1371. </Option>
  1372. <Option
  1373. value="6"
  1374. style={{
  1375. display: this.props.processState >= 7 ? "block" : "none"
  1376. }}
  1377. >
  1378. 财务总监
  1379. </Option>
  1380. <Option
  1381. value="7"
  1382. style={{
  1383. display: this.props.processState >= 8 ? "block" : "none"
  1384. }}
  1385. >
  1386. 总裁
  1387. </Option>
  1388. </Select>
  1389. </div>
  1390. ) : (
  1391. ""
  1392. )
  1393. ) : (
  1394. ""
  1395. )}
  1396. <Button
  1397. type="primary"
  1398. shape="round"
  1399. size="large"
  1400. style={{
  1401. position: "absolute",
  1402. left: "50%",
  1403. bottom: "0",
  1404. transform: "translateX(-50%)",
  1405. display:
  1406. (this.props.data.processState == 7 ||
  1407. this.props.data.processState == 8) &&
  1408. this.props.data.status == 2
  1409. ? "block"
  1410. : "none"
  1411. }}
  1412. onClick={this.finish}
  1413. >
  1414. 完成订单
  1415. </Button>
  1416. <ReactToPrint
  1417. trigger={() => (
  1418. <Button
  1419. type="primary"
  1420. style={{
  1421. float: "right",
  1422. marginTop: 10,
  1423. position: "absolute",
  1424. top: 0,
  1425. right: 30,
  1426. display:
  1427. (this.props.data.processState == 7 ||
  1428. this.props.data.processState == 8) &&
  1429. this.props.data.status == 4
  1430. ? "block"
  1431. : "block"
  1432. }}
  1433. >
  1434. 打印
  1435. </Button>
  1436. )}
  1437. content={() => this.refs}
  1438. />
  1439. </div>
  1440. );
  1441. }
  1442. }
  1443. export { ChangeDetail };