changeDetailCwzy.js 40 KB

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